MythTV
master
|
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 } |
![]() | |
enum | dvbdev_t { kTypeSwitch = 0, kTypeRotor = 1, kTypeSCR = 2, kTypeLNB = 3 } |
Public Member Functions | |
DiSEqCDevSwitch (DiSEqCDevTree &tree, uint devid) | |
~DiSEqCDevSwitch () | |
void | Reset (void) override |
Resets to the last known settings for this device. More... | |
bool | Execute (const DiSEqCDevSettings &, const DTVMultiplex &) override |
Applies DiSEqC settings to this node and any children. More... | |
bool | Load (void) override |
Loads this device from the database. More... | |
bool | Store (void) const override |
Stores this device to the database. More... | |
void | SetType (dvbdev_switch_t type) |
void | SetAddress (uint address) |
void | SetNumPorts (uint num_ports) |
bool | SetChild (uint, DiSEqCDevDevice *) override |
Changes the nth child of this node. More... | |
dvbdev_switch_t | GetType (void) const |
uint | GetAddress (void) const |
uint | GetNumPorts (void) const |
bool | ShouldSwitch (const DiSEqCDevSettings &settings, const DTVMultiplex &tuning) const |
uint | GetChildCount (void) const override |
Retrieves the proper number of children for this node. More... | |
bool | IsCommandNeeded (const DiSEqCDevSettings &, const DTVMultiplex &) const override |
Determines if this device or any child will be sending a command for the given configuration chain. More... | |
uint | GetVoltage (const DiSEqCDevSettings &, const DTVMultiplex &) const override |
Retrives the desired voltage for this config. More... | |
DiSEqCDevDevice * | GetSelectedChild (const DiSEqCDevSettings &) const override |
Retrieves the selected child for this configuration, if any. More... | |
DiSEqCDevDevice * | GetChild (uint) override |
Retrieves the nth child of this node. More... | |
![]() | |
DiSEqCDevDevice (DiSEqCDevTree &tree, uint devid) | |
virtual | ~DiSEqCDevDevice () |
void | SetDeviceType (dvbdev_t type) |
void | SetParent (DiSEqCDevDevice *parent) |
void | SetOrdinal (uint ordinal) |
void | SetDescription (const QString &desc) |
void | SetRepeatCount (uint repeat) |
dvbdev_t | GetDeviceType (void) const |
uint | GetDeviceID (void) const |
bool | IsRealDeviceID (void) const |
DiSEqCDevDevice * | GetParent (void) const |
uint | GetOrdinal (void) const |
QString | GetDescription (void) const |
uint | GetRepeatCount (void) const |
DiSEqCDevDevice * | FindDevice (uint dev_id) |
Returns a device by ID. More... | |
Static Public Member Functions | |
static QString | SwitchTypeToString (dvbdev_switch_t type) |
static dvbdev_switch_t | SwitchTypeFromString (const QString &type) |
![]() | |
static QString | DevTypeToString (dvbdev_t type) |
static dvbdev_t | DevTypeFromString (const QString &type) |
static DiSEqCDevDevice * | CreateById (DiSEqCDevTree &tree, uint devid) |
static DiSEqCDevDevice * | CreateByType (DiSEqCDevTree &tree, dvbdev_t type, uint dev_id=0) |
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 |
![]() | |
void | SetDeviceID (uint devid) const |
Private Attributes | |
dvbdev_switch_t | m_type {kTypeTone} |
uint | m_address {0x10} |
uint | m_numPorts {2} |
uint | m_lastPos {(uint)-1} |
uint | m_lastHighBand {(uint)-1} |
uint | m_lastHorizontal {(uint)-1} |
dvbdev_vec_t | m_children |
Static Private Attributes | |
static const TypeTable | kSwitchTypeTable [9] |
Additional Inherited Members | |
![]() | |
static QString | TableToString (uint type, const TypeTable *table) |
static uint | TableFromString (const QString &type, const TypeTable *table) |
![]() | |
uint | m_devid |
dvbdev_t | m_devType {kTypeLNB} |
QString | m_desc |
DiSEqCDevTree & | m_tree |
DiSEqCDevDevice * | m_parent {nullptr} |
uint | m_ordinal {0} |
uint | m_repeat {1} |
DiSEqCDevSwitch::DiSEqCDevSwitch | ( | DiSEqCDevTree & | tree, |
uint | devid | ||
) |
Definition at line 1072 of file diseqc.cpp.
DiSEqCDevSwitch::~DiSEqCDevSwitch | ( | ) |
Definition at line 1083 of file diseqc.cpp.
|
overridevirtual |
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 1150 of file diseqc.cpp.
Referenced by DiSEqCDevSwitch().
|
overridevirtual |
Applies DiSEqC settings to this node and any children.
settings | Configuration chain to apply. |
tuning | Tuning parameters. |
Implements DiSEqCDevDevice.
Definition at line 1093 of file diseqc.cpp.
|
overridevirtual |
Loads this device from the database.
Implements DiSEqCDevDevice.
Definition at line 1227 of file diseqc.cpp.
|
overridevirtual |
Stores this device to the database.
Implements DiSEqCDevDevice.
Definition at line 1292 of file diseqc.cpp.
|
inline |
Definition at line 239 of file diseqc.h.
Referenced by SwitchTypeSetting::Save().
|
inline |
Definition at line 240 of file diseqc.h.
Referenced by SwitchAddressSetting::Save().
void DiSEqCDevSwitch::SetNumPorts | ( | uint | num_ports | ) |
Definition at line 1357 of file diseqc.cpp.
Referenced by SwitchPortsSetting::Save().
|
overridevirtual |
Changes the nth child of this node.
ordinal | Child number (starting at 0). |
device | New child device. (may be nullptr) |
Reimplemented from DiSEqCDevDevice.
Definition at line 1197 of file diseqc.cpp.
Referenced by Load().
|
inline |
Definition at line 245 of file diseqc.h.
Referenced by SwitchTypeSetting::Load().
|
inline |
Definition at line 246 of file diseqc.h.
Referenced by SwitchAddressSetting::Load().
|
inline |
Definition at line 247 of file diseqc.h.
Referenced by SwitchPortsSetting::Load().
bool DiSEqCDevSwitch::ShouldSwitch | ( | const DiSEqCDevSettings & | settings, |
const DTVMultiplex & | tuning | ||
) | const |
Definition at line 1588 of file diseqc.cpp.
Referenced by Execute(), and IsCommandNeeded().
|
overridevirtual |
Retrieves the proper number of children for this node.
Reimplemented from DiSEqCDevDevice.
Definition at line 1184 of file diseqc.cpp.
|
overridevirtual |
Determines if this device or any child will be sending a command for the given configuration chain.
settings | Configuration chain in effect. |
tuning | Tuning parameters. |
Reimplemented from DiSEqCDevDevice.
Definition at line 1163 of file diseqc.cpp.
Referenced by Execute().
|
overridevirtual |
Retrives the desired voltage for this config.
settings | Configuration chain in effect. |
tuning | Tuning parameters. |
Implements DiSEqCDevDevice.
Definition at line 1215 of file diseqc.cpp.
|
overridevirtual |
Retrieves the selected child for this configuration, if any.
settings | Configuration chain in effect. |
Reimplemented from DiSEqCDevDevice.
Definition at line 1174 of file diseqc.cpp.
Referenced by GetVoltage().
|
overridevirtual |
Retrieves the nth child of this node.
ordinal | Child number (starting at 0). |
Reimplemented from DiSEqCDevDevice.
Definition at line 1189 of file diseqc.cpp.
|
inlinestatic |
|
inlinestatic |
|
protected |
Definition at line 1380 of file diseqc.cpp.
Referenced by Execute().
|
protected |
Definition at line 1531 of file diseqc.cpp.
Referenced by Execute().
|
protected |
Definition at line 1547 of file diseqc.cpp.
Referenced by Execute().
|
protected |
Definition at line 1569 of file diseqc.cpp.
Referenced by Execute().
|
protected |
Definition at line 1631 of file diseqc.cpp.
Referenced by Execute().
|
protected |
Definition at line 1677 of file diseqc.cpp.
Referenced by Execute(), GetSelectedChild(), IsCommandNeeded(), and ShouldSwitch().
|
private |
Definition at line 282 of file diseqc.h.
Referenced by Execute(), ExecuteDiseqc(), ExecuteLegacy(), Load(), ShouldSwitch(), and Store().
|
private |
Definition at line 283 of file diseqc.h.
Referenced by ExecuteDiseqc(), Load(), and Store().
|
private |
Definition at line 284 of file diseqc.h.
Referenced by DiSEqCDevSwitch(), ExecuteDiseqc(), GetChildCount(), GetPosition(), Load(), SetNumPorts(), and Store().
Definition at line 285 of file diseqc.h.
Referenced by Execute(), Reset(), and ShouldSwitch().
Definition at line 286 of file diseqc.h.
Referenced by ExecuteDiseqc(), Reset(), and ShouldSwitch().
Definition at line 287 of file diseqc.h.
Referenced by ExecuteDiseqc(), Reset(), and ShouldSwitch().
|
private |
Definition at line 288 of file diseqc.h.
Referenced by DiSEqCDevSwitch(), Execute(), GetChild(), GetPosition(), GetSelectedChild(), IsCommandNeeded(), Load(), Reset(), SetChild(), SetNumPorts(), Store(), and ~DiSEqCDevSwitch().
|
staticprivate |