00001
00002
00003
00004
00005
00006
00007 #ifndef _DISEQCSETTINGS_H_
00008 #define _DISEQCSETTINGS_H_
00009
00010 #include "diseqc.h"
00011 #include "settings.h"
00012
00013 typedef QMap<uint, Setting*> devid_to_setting_t;
00014
00015 class SwitchTypeSetting;
00016 class SwitchPortsSetting;
00017 class SwitchAddressSetting;
00018
00019 bool convert_diseqc_db(void);
00020
00021 class SwitchConfig : public QObject, public ConfigurationWizard
00022 {
00023 Q_OBJECT
00024
00025 public:
00026 SwitchConfig(DiSEqCDevSwitch &switch_dev);
00027
00028 public slots:
00029 void update(void);
00030
00031 private:
00032 SwitchTypeSetting *m_type;
00033 SwitchPortsSetting *m_ports;
00034 SwitchAddressSetting *m_address;
00035 };
00036
00037 class RotorPosMap : public ListBoxSetting, public Storage
00038 {
00039 Q_OBJECT
00040
00041 public:
00042 RotorPosMap(DiSEqCDevRotor &rotor);
00043
00044 virtual void Load(void);
00045 virtual void Save(void);
00046 virtual void Save(QString ) {}
00047
00048 public slots:
00049 void edit(void);
00050 void del(void);
00051
00052 protected:
00053 void PopulateList(void);
00054
00055 private:
00056 DiSEqCDevRotor &m_rotor;
00057 uint_to_dbl_t m_posmap;
00058 };
00059
00060 class RotorConfig : public QObject, public ConfigurationWizard
00061 {
00062 Q_OBJECT
00063
00064 public:
00065 RotorConfig(DiSEqCDevRotor &rotor);
00066
00067 public slots:
00068 void SetType(const QString &type);
00069 void RunRotorPositionsDialog(void);
00070
00071 private:
00072 DiSEqCDevRotor &m_rotor;
00073 TransButtonSetting *m_pos;
00074 };
00075
00076 class LNBTypeSetting;
00077 class LNBLOFSwitchSetting;
00078 class LNBLOFLowSetting;
00079 class LNBLOFHighSetting;
00080 class LNBPolarityInvertedSetting;
00081
00082 class LNBConfig : public QObject, public ConfigurationWizard
00083 {
00084 Q_OBJECT
00085
00086 public:
00087 LNBConfig(DiSEqCDevLNB &lnb);
00088
00089 public slots:
00090 void SetPreset(const QString &value);
00091 void UpdateType(void);
00092
00093 private:
00094 LNBTypeSetting *m_type;
00095 LNBLOFSwitchSetting *m_lof_switch;
00096 LNBLOFLowSetting *m_lof_lo;
00097 LNBLOFHighSetting *m_lof_hi;
00098 LNBPolarityInvertedSetting *m_pol_inv;
00099 };
00100
00101 class DeviceTree : public ListBoxSetting, public Storage
00102 {
00103 Q_OBJECT
00104
00105 public:
00106 DeviceTree(DiSEqCDevTree &tree);
00107
00108 virtual void Load(void);
00109 virtual void Save(void);
00110 virtual void Save(QString ) { }
00111
00112 protected:
00113 bool EditNodeDialog(uint nodeid);
00114 void CreateRootNodeDialog(void);
00115 void CreateNewNodeDialog(uint parentid, uint child_num);
00116
00117 bool RunTypeDialog(DiSEqCDevDevice::dvbdev_t &type);
00118 void PopulateTree(void);
00119 void PopulateTree(DiSEqCDevDevice *node,
00120 DiSEqCDevDevice *parent = NULL,
00121 uint childnum = 0,
00122 uint depth = 0);
00123
00124 public slots:
00125 void edit(void);
00126 void del(void);
00127
00128 private:
00129 DiSEqCDevTree &m_tree;
00130 };
00131
00132 class DTVDeviceTreeWizard : public ConfigurationDialog
00133 {
00134 public:
00135 DTVDeviceTreeWizard(DiSEqCDevTree &tree);
00136
00137 virtual DialogCode exec(void);
00138 };
00139
00140 class DTVDeviceConfigGroup : public VerticalConfigurationGroup
00141 {
00142 public:
00143 DTVDeviceConfigGroup(DiSEqCDevSettings &settings, uint cardid,
00144 bool switches_enabled);
00145 ~DTVDeviceConfigGroup(void);
00146
00147 protected:
00148 void AddNodes(ConfigurationGroup *group, const QString &trigger,
00149 DiSEqCDevDevice *node);
00150
00151 void AddChild(ConfigurationGroup *group, const QString &trigger,
00152 Setting *setting);
00153
00154 private:
00155 DiSEqCDevTree m_tree;
00156 DiSEqCDevSettings &m_settings;
00157 devid_to_setting_t m_devs;
00158 bool m_switches_enabled;
00159 };
00160
00161 #endif // _DISEQCSETTINGS_H_
00162