DiSEqCDevSwitch Class Reference

Switch class, including tone, legacy and DiSEqC switches. More...

#include <diseqc.h>

Inheritance diagram for DiSEqCDevSwitch:
DiSEqCDevDevice

List of all members.

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 DiSEqCDevDeviceGetSelectedChild (const DiSEqCDevSettings &) const
 Retrieves the selected child for this configuration, if any.
virtual DiSEqCDevDeviceGetChild (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]

Detailed Description

Switch class, including tone, legacy and DiSEqC switches.

Definition at line 207 of file diseqc.h.


Member Enumeration Documentation

Enumerator:
kTypeTone 
kTypeDiSEqCCommitted 
kTypeDiSEqCUncommitted 
kTypeLegacySW21 
kTypeLegacySW42 
kTypeLegacySW64 
kTypeVoltage 
kTypeMiniDiSEqC 

Definition at line 220 of file diseqc.h.


Constructor & Destructor Documentation

DiSEqCDevSwitch::DiSEqCDevSwitch ( DiSEqCDevTree tree,
uint  devid 
)

Definition at line 996 of file diseqc.cpp.

DiSEqCDevSwitch::~DiSEqCDevSwitch (  ) 

Definition at line 1009 of file diseqc.cpp.


Member Function Documentation

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.

Parameters:
settings Configuration chain to apply.
tuning Tuning parameters.
Returns:
True if execution completed successfully.

Implements DiSEqCDevDevice.

Definition at line 1019 of file diseqc.cpp.

bool DiSEqCDevSwitch::Load ( void   )  [virtual]

Loads this device from the database.

Returns:
True if successful.

Implements DiSEqCDevDevice.

Definition at line 1153 of file diseqc.cpp.

bool DiSEqCDevSwitch::Store ( void   )  const [virtual]

Stores this device to the database.

Returns:
True if successful.

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.

Parameters:
ordinal Child number (starting at 0).
device New child device. (may be NULL)
Returns:
true if object was added to tree.

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.

Returns:
Number of children

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.

Parameters:
settings Configuration chain in effect.
Returns:
true if a command would be sent if Execute() were called.

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.

Parameters:
settings Configuration chain in effect.
tuning Tuning parameters.
Returns:
Voltage required.

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.

Parameters:
settings Configuration chain in effect.
Returns:
Child node object, or NULL if none.

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.

Parameters:
ordinal Child number (starting at 0).
Returns:
Pointer to device object, or NULL if no child.

Reimplemented from DiSEqCDevDevice.

Definition at line 1115 of file diseqc.cpp.

static QString DiSEqCDevSwitch::SwitchTypeToString ( dvbdev_switch_t  type  )  [inline, static]

Definition at line 253 of file diseqc.h.

Referenced by Store().

static dvbdev_switch_t DiSEqCDevSwitch::SwitchTypeFromString ( const QString &  type  )  [inline, static]

Definition at line 255 of file diseqc.h.

Referenced by Load().

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().


Member Data Documentation

Definition at line 274 of file diseqc.h.

Referenced by Execute(), ExecuteDiseqc(), ExecuteLegacy(), GetType(), Load(), SetType(), ShouldSwitch(), and Store().

Definition at line 275 of file diseqc.h.

Referenced by ExecuteDiseqc(), GetAddress(), Load(), SetAddress(), and Store().

Definition at line 277 of file diseqc.h.

Referenced by Execute(), Reset(), and ShouldSwitch().

Definition at line 278 of file diseqc.h.

Referenced by ExecuteDiseqc(), Reset(), and ShouldSwitch().

Definition at line 279 of file diseqc.h.

Referenced by ExecuteDiseqc(), Reset(), and ShouldSwitch().

Initial value:
{
    { "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().


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends
Generated on Mon May 28 06:42:00 2012 for MythTV by  doxygen 1.6.3