Switch class, including tone, legacy and DiSEqC switches. More...
#include <diseqc.h>
Public Types | |
| enum | dvbdev_switch_t { kTypeTone = 0, kTypeDiSEqCCommitted = 1, kTypeDiSEqCUncommitted = 2, kTypeLegacySW21 = 3, kTypeLegacySW42 = 4, kTypeLegacySW64 = 5, kTypeVoltage = 6, kTypeMiniDiSEqC = 7 } |
Public Member Functions | |
| DiSEqCDevSwitch (DiSEqCDevTree &tree, uint devid) | |
| ~DiSEqCDevSwitch () | |
| virtual void | Reset (void) |
| Resets to the last known settings for this device. | |
| virtual bool | Execute (const DiSEqCDevSettings &, const DTVMultiplex &) |
| Applies DiSEqC settings to this node and any children. | |
| virtual bool | Load (void) |
| Loads this device from the database. | |
| virtual bool | Store (void) const |
| Stores this device to the database. | |
| void | SetType (dvbdev_switch_t type) |
| void | SetAddress (uint address) |
| void | SetNumPorts (uint num_ports) |
| virtual bool | SetChild (uint, DiSEqCDevDevice *) |
| Changes the nth child of this node. | |
| dvbdev_switch_t | GetType (void) const |
| uint | GetAddress (void) const |
| uint | GetNumPorts (void) const |
| bool | ShouldSwitch (const DiSEqCDevSettings &settings, const DTVMultiplex &tuning) const |
| virtual uint | GetChildCount (void) const |
| Retrieves the proper number of children for this node. | |
| virtual bool | IsCommandNeeded (const DiSEqCDevSettings &, const DTVMultiplex &) const |
| Determines if this device or any child will be sending a command for the given configuration chain. | |
| virtual uint | GetVoltage (const DiSEqCDevSettings &, const DTVMultiplex &) const |
| Retrives the desired voltage for this config. | |
| virtual DiSEqCDevDevice * | GetSelectedChild (const DiSEqCDevSettings &) const |
| Retrieves the selected child for this configuration, if any. | |
| virtual DiSEqCDevDevice * | GetChild (uint) |
| Retrieves the nth child of this node. | |
Static Public Member Functions | |
| static QString | SwitchTypeToString (dvbdev_switch_t type) |
| static dvbdev_switch_t | SwitchTypeFromString (const QString &type) |
Protected Member Functions | |
| bool | ExecuteLegacy (const DiSEqCDevSettings &, const DTVMultiplex &, uint pos) |
| bool | ExecuteTone (const DiSEqCDevSettings &, const DTVMultiplex &, uint pos) |
| bool | ExecuteVoltage (const DiSEqCDevSettings &, const DTVMultiplex &, uint pos) |
| bool | ExecuteMiniDiSEqC (const DiSEqCDevSettings &, const DTVMultiplex &, uint pos) |
| bool | ExecuteDiseqc (const DiSEqCDevSettings &, const DTVMultiplex &, uint pos) |
| int | GetPosition (const DiSEqCDevSettings &) const |
Private Attributes | |
| dvbdev_switch_t | m_type |
| uint | m_address |
| uint | m_num_ports |
| uint | m_last_pos |
| uint | m_last_high_band |
| uint | m_last_horizontal |
| dvbdev_vec_t | m_children |
Static Private Attributes | |
| static const TypeTable | SwitchTypeTable [9] |
Switch class, including tone, legacy and DiSEqC switches.
Definition at line 207 of file diseqc.h.
| DiSEqCDevSwitch::DiSEqCDevSwitch | ( | DiSEqCDevTree & | tree, | |
| uint | devid | |||
| ) |
Definition at line 996 of file diseqc.cpp.
| DiSEqCDevSwitch::~DiSEqCDevSwitch | ( | ) |
Definition at line 1009 of file diseqc.cpp.
| void DiSEqCDevSwitch::Reset | ( | void | ) | [virtual] |
Resets to the last known settings for this device.
Device will not actually have commands issued until next Execute() method.
Reimplemented from DiSEqCDevDevice.
Definition at line 1076 of file diseqc.cpp.
Referenced by DiSEqCDevSwitch().
| bool DiSEqCDevSwitch::Execute | ( | const DiSEqCDevSettings & | , | |
| const DTVMultiplex & | ||||
| ) | [virtual] |
Applies DiSEqC settings to this node and any children.
| settings | Configuration chain to apply. | |
| tuning | Tuning parameters. |
Implements DiSEqCDevDevice.
Definition at line 1019 of file diseqc.cpp.
| bool DiSEqCDevSwitch::Load | ( | void | ) | [virtual] |
Loads this device from the database.
Implements DiSEqCDevDevice.
Definition at line 1153 of file diseqc.cpp.
| bool DiSEqCDevSwitch::Store | ( | void | ) | const [virtual] |
Stores this device to the database.
Implements DiSEqCDevDevice.
Definition at line 1218 of file diseqc.cpp.
| void DiSEqCDevSwitch::SetType | ( | dvbdev_switch_t | type | ) | [inline] |
Definition at line 231 of file diseqc.h.
Referenced by convert_diseqc_db(), and SwitchTypeSetting::Save().
| void DiSEqCDevSwitch::SetAddress | ( | uint | address | ) | [inline] |
Definition at line 232 of file diseqc.h.
Referenced by convert_diseqc_db(), and SwitchAddressSetting::Save().
| void DiSEqCDevSwitch::SetNumPorts | ( | uint | num_ports | ) |
Definition at line 1283 of file diseqc.cpp.
Referenced by convert_diseqc_db(), and SwitchPortsSetting::Save().
| bool DiSEqCDevSwitch::SetChild | ( | uint | , | |
| DiSEqCDevDevice * | ||||
| ) | [virtual] |
Changes the nth child of this node.
| ordinal | Child number (starting at 0). | |
| device | New child device. (may be NULL) |
Reimplemented from DiSEqCDevDevice.
Definition at line 1123 of file diseqc.cpp.
Referenced by Load().
| dvbdev_switch_t DiSEqCDevSwitch::GetType | ( | void | ) | const [inline] |
Definition at line 237 of file diseqc.h.
Referenced by SwitchTypeSetting::Load().
| uint DiSEqCDevSwitch::GetAddress | ( | void | ) | const [inline] |
Definition at line 238 of file diseqc.h.
Referenced by SwitchAddressSetting::Load().
| uint DiSEqCDevSwitch::GetNumPorts | ( | void | ) | const [inline] |
Definition at line 239 of file diseqc.h.
Referenced by SwitchPortsSetting::Load().
| bool DiSEqCDevSwitch::ShouldSwitch | ( | const DiSEqCDevSettings & | settings, | |
| const DTVMultiplex & | tuning | |||
| ) | const |
Definition at line 1514 of file diseqc.cpp.
Referenced by Execute(), and IsCommandNeeded().
| uint DiSEqCDevSwitch::GetChildCount | ( | void | ) | const [virtual] |
Retrieves the proper number of children for this node.
Reimplemented from DiSEqCDevDevice.
Definition at line 1110 of file diseqc.cpp.
| bool DiSEqCDevSwitch::IsCommandNeeded | ( | const DiSEqCDevSettings & | settings, | |
| const DTVMultiplex & | tuning | |||
| ) | const [virtual] |
Determines if this device or any child will be sending a command for the given configuration chain.
| settings | Configuration chain in effect. |
Reimplemented from DiSEqCDevDevice.
Definition at line 1089 of file diseqc.cpp.
Referenced by Execute().
| uint DiSEqCDevSwitch::GetVoltage | ( | const DiSEqCDevSettings & | , | |
| const DTVMultiplex & | ||||
| ) | const [virtual] |
Retrives the desired voltage for this config.
| settings | Configuration chain in effect. | |
| tuning | Tuning parameters. |
Implements DiSEqCDevDevice.
Definition at line 1141 of file diseqc.cpp.
| DiSEqCDevDevice * DiSEqCDevSwitch::GetSelectedChild | ( | const DiSEqCDevSettings & | ) | const [virtual] |
Retrieves the selected child for this configuration, if any.
| settings | Configuration chain in effect. |
Reimplemented from DiSEqCDevDevice.
Definition at line 1100 of file diseqc.cpp.
Referenced by GetVoltage().
| DiSEqCDevDevice * DiSEqCDevSwitch::GetChild | ( | uint | ) | [virtual] |
Retrieves the nth child of this node.
| ordinal | Child number (starting at 0). |
Reimplemented from DiSEqCDevDevice.
Definition at line 1115 of file diseqc.cpp.
| static QString DiSEqCDevSwitch::SwitchTypeToString | ( | dvbdev_switch_t | type | ) | [inline, static] |
| static dvbdev_switch_t DiSEqCDevSwitch::SwitchTypeFromString | ( | const QString & | type | ) | [inline, static] |
| bool DiSEqCDevSwitch::ExecuteLegacy | ( | const DiSEqCDevSettings & | settings, | |
| const DTVMultiplex & | tuning, | |||
| uint | pos | |||
| ) | [protected] |
Definition at line 1306 of file diseqc.cpp.
Referenced by Execute().
| bool DiSEqCDevSwitch::ExecuteTone | ( | const DiSEqCDevSettings & | , | |
| const DTVMultiplex & | , | |||
| uint | pos | |||
| ) | [protected] |
Definition at line 1457 of file diseqc.cpp.
Referenced by Execute().
| bool DiSEqCDevSwitch::ExecuteVoltage | ( | const DiSEqCDevSettings & | settings, | |
| const DTVMultiplex & | tuning, | |||
| uint | pos | |||
| ) | [protected] |
Definition at line 1473 of file diseqc.cpp.
Referenced by Execute().
| bool DiSEqCDevSwitch::ExecuteMiniDiSEqC | ( | const DiSEqCDevSettings & | settings, | |
| const DTVMultiplex & | tuning, | |||
| uint | pos | |||
| ) | [protected] |
Definition at line 1495 of file diseqc.cpp.
Referenced by Execute().
| bool DiSEqCDevSwitch::ExecuteDiseqc | ( | const DiSEqCDevSettings & | settings, | |
| const DTVMultiplex & | tuning, | |||
| uint | pos | |||
| ) | [protected] |
Definition at line 1557 of file diseqc.cpp.
Referenced by Execute().
| int DiSEqCDevSwitch::GetPosition | ( | const DiSEqCDevSettings & | settings | ) | const [protected] |
Definition at line 1603 of file diseqc.cpp.
Referenced by Execute(), GetSelectedChild(), IsCommandNeeded(), and ShouldSwitch().
dvbdev_switch_t DiSEqCDevSwitch::m_type [private] |
Definition at line 274 of file diseqc.h.
Referenced by Execute(), ExecuteDiseqc(), ExecuteLegacy(), GetType(), Load(), SetType(), ShouldSwitch(), and Store().
uint DiSEqCDevSwitch::m_address [private] |
Definition at line 275 of file diseqc.h.
Referenced by ExecuteDiseqc(), GetAddress(), Load(), SetAddress(), and Store().
uint DiSEqCDevSwitch::m_num_ports [private] |
Definition at line 276 of file diseqc.h.
Referenced by DiSEqCDevSwitch(), ExecuteDiseqc(), GetChildCount(), GetNumPorts(), GetPosition(), Load(), SetNumPorts(), and Store().
uint DiSEqCDevSwitch::m_last_pos [private] |
Definition at line 277 of file diseqc.h.
Referenced by Execute(), Reset(), and ShouldSwitch().
uint DiSEqCDevSwitch::m_last_high_band [private] |
Definition at line 278 of file diseqc.h.
Referenced by ExecuteDiseqc(), Reset(), and ShouldSwitch().
uint DiSEqCDevSwitch::m_last_horizontal [private] |
Definition at line 279 of file diseqc.h.
Referenced by ExecuteDiseqc(), Reset(), and ShouldSwitch().
dvbdev_vec_t DiSEqCDevSwitch::m_children [private] |
Definition at line 280 of file diseqc.h.
Referenced by DiSEqCDevSwitch(), Execute(), GetChild(), GetPosition(), GetSelectedChild(), IsCommandNeeded(), Load(), Reset(), SetChild(), SetNumPorts(), Store(), and ~DiSEqCDevSwitch().
const DiSEqCDevDevice::TypeTable DiSEqCDevSwitch::SwitchTypeTable [static, private] |
{
{ "legacy_sw21", kTypeLegacySW21 },
{ "legacy_sw42", kTypeLegacySW42 },
{ "legacy_sw64", kTypeLegacySW64 },
{ "tone", kTypeTone },
{ "diseqc", kTypeDiSEqCCommitted },
{ "diseqc_uncom", kTypeDiSEqCUncommitted },
{ "voltage", kTypeVoltage },
{ "mini_diseqc", kTypeMiniDiSEqC },
{ QString::null, kTypeTone },
}
Definition at line 282 of file diseqc.h.
Referenced by SwitchTypeFromString(), and SwitchTypeToString().
1.6.3