ChannelBase Class Reference

Abstract class providing a generic interface to tuning hardware. More...

#include <channelbase.h>

Inheritance diagram for ChannelBase:
DTVChannel DummyChannel ASIChannel CetonChannel DVBChannel FirewireChannel HDHRChannel IPTVChannel V4LChannel

List of all members.

Public Member Functions

 ChannelBase (TVRec *parent)
virtual ~ChannelBase (void)
virtual bool Init (QString &inputname, QString &startchannel, bool setchan)
virtual bool IsTunable (const QString &input, const QString &channum) const
virtual bool Open (void)=0
 Opens the channel changing hardware for use.
virtual void Close (void)=0
 Closes the channel changing hardware to use.
virtual bool IsOpen (void) const =0
 Reports whether channel is already open.
virtual bool SetChannelByString (const QString &chan)=0
virtual void SetFormat (const QString &)
virtual int SetFreqTable (const QString &)
virtual void SetFd (int fd)
 Sets file descriptor.
virtual int GetFd (void) const
 Returns file descriptor, -1 if it does not exist.
virtual bool Tune (const QString &freqid, int finetune)
virtual bool IsExternalChannelChangeSupported (void)
virtual uint GetNextChannel (uint chanid, int direction) const
virtual uint GetNextChannel (const QString &channum, int direction) const
virtual int GetInputByName (const QString &input) const
 Returns number of named input, returns -1 if not found.
virtual QString GetInputByNum (int capchannel) const
 Returns name of numbered input, returns null if not found.
virtual QString GetCurrentName (void) const
virtual int GetChanID (void) const
virtual int GetCurrentInputNum (void) const
virtual QString GetCurrentInput (void) const
virtual int GetNextInputNum (void) const
virtual QString GetNextInput (void) const
virtual QString GetNextInputStartChan (void)
virtual uint GetCurrentSourceID (void) const
virtual uint GetSourceID (int inputID) const
virtual uint GetInputCardID (int inputNum) const
virtual DBChanList GetChannels (int inputNum) const
virtual DBChanList GetChannels (const QString &inputname) const
virtual vector< InputInfoGetFreeInputs (const vector< uint > &excluded_cards) const
 Returns the recorders available inputs.
virtual QStringList GetConnectedInputs (void) const
 Returns names of connected inputs.
bool IsCommercialFree (void) const
 Returns true iff commercial detection is not required.
virtual QString GetDevice (void) const
 Returns String representing device, useful for debugging.
virtual void Renumber (uint srcid, const QString &oldChanNum, const QString &newChanNum)
 Changes a channum if we have it cached anywhere.
virtual bool SwitchToInput (const QString &input)
virtual bool SwitchToInput (const QString &input, const QString &chan)
virtual bool InitializeInputs (void)
 Fills in input map from DB.
virtual bool Retune (void)
virtual void StoreInputChannels (void)
 Saves current channel as the default channel for the current input.
virtual bool InitPictureAttributes (void)
virtual int GetPictureAttribute (PictureAttribute) const
virtual int ChangePictureAttribute (PictureAdjustType, PictureAttribute, bool up)
bool CheckChannel (const QString &channum, QString &inputName) const
void SetCardID (uint _cardid)
virtual int GetCardID (void) const
 Returns card id.

Static Public Member Functions

static ChannelBaseCreateChannel (TVRec *tv_rec, const GeneralDBOptions &genOpt, const DVBDBOptions &dvbOpt, const FireWireDBOptions &fwOpt, const QString &startchannel, bool enter_power_save_mode, QString &rbFileExt)

Protected Member Functions

virtual bool SwitchToInput (int inputNum, bool setstarting)
 Switches to another input on hardware, and sets the channel is setstarting is true.
virtual bool IsInputAvailable (int inputNum, uint &mplexid_restriction) const
int GetStartInput (uint cardid)
 Gets the default input for the cardid.
void ClearInputMap (void)
bool KillScript (void)
void HandleScript (const QString &freqid)
virtual void HandleScriptEnd (bool ok)
uint GetScriptStatus (bool holding_lock=false)
bool ChangeExternalChannel (const QString &changer, const QString &newchan)
bool ChangeInternalChannel (const QString &newchan, uint cardinputid)

Static Protected Member Functions

static void StoreInputChannels (const InputMap &)
 Sets starting channel for the each input in the input map.

Protected Attributes

TVRecm_pParent
QString m_curchannelname
int m_currentInputID
bool m_commfree
uint m_cardid
InputMap m_inputs
DBChanList m_allchannels
 channels across all inputs
QMutex m_system_lock
MythSystemm_system
uint m_system_status
 These get mapped from the GENERIC_EXIT_* to these values for use with the signalmonitor code.

Friends

class SignalMonitor

Detailed Description

Abstract class providing a generic interface to tuning hardware.

This class abstracts channel implementations for analog TV, ATSC, DVB, etc. Also implements many generic functions needed by most derived classes. It is responsible for tuning, i.e. switching channels.

Definition at line 31 of file channelbase.h.


Constructor & Destructor Documentation

ChannelBase::ChannelBase ( TVRec parent  ) 

Definition at line 49 of file channelbase.cpp.

ChannelBase::~ChannelBase ( void   )  [virtual]

Definition at line 56 of file channelbase.cpp.


Member Function Documentation

bool ChannelBase::Init ( QString &  inputname,
QString &  startchannel,
bool  setchan 
) [virtual]

Reimplemented in DVBChannel, and V4LChannel.

Definition at line 65 of file channelbase.cpp.

Referenced by CreateChannel(), and TVRec::TuningGetChanNum().

bool ChannelBase::IsTunable ( const QString &  input,
const QString &  channum 
) const [virtual]

Reimplemented in DummyChannel.

Definition at line 177 of file channelbase.cpp.

Referenced by Init().

virtual bool ChannelBase::Open ( void   )  [pure virtual]
virtual void ChannelBase::Close ( void   )  [pure virtual]
virtual bool ChannelBase::IsOpen ( void   )  const [pure virtual]
virtual bool ChannelBase::SetChannelByString ( const QString &  chan  )  [pure virtual]
virtual void ChannelBase::SetFormat ( const QString &   )  [inline, virtual]

Reimplemented in V4LChannel.

Definition at line 52 of file channelbase.h.

Referenced by DTVChannel::SetChannelByString().

virtual int ChannelBase::SetFreqTable ( const QString &   )  [inline, virtual]

Reimplemented in V4LChannel.

Definition at line 53 of file channelbase.h.

Referenced by DTVChannel::SetChannelByString().

virtual void ChannelBase::SetFd ( int  fd  )  [inline, virtual]

Sets file descriptor.

Reimplemented in V4LChannel.

Definition at line 55 of file channelbase.h.

Referenced by TVRec::TeardownRecorder(), TVRec::TuningNewRecorder(), and TVRec::TuningRestartRecorder().

virtual int ChannelBase::GetFd ( void   )  const [inline, virtual]

Returns file descriptor, -1 if it does not exist.

Reimplemented in DVBChannel, and V4LChannel.

Definition at line 57 of file channelbase.h.

Referenced by AnalogSignalMonitor::AnalogSignalMonitor(), and AnalogSignalMonitor::UpdateValues().

virtual bool ChannelBase::Tune ( const QString &  freqid,
int  finetune 
) [inline, virtual]

Reimplemented in ASIChannel, CetonChannel, DTVChannel, FirewireChannel, HDHRChannel, and V4LChannel.

Definition at line 58 of file channelbase.h.

virtual bool ChannelBase::IsExternalChannelChangeSupported ( void   )  [inline, virtual]

Reimplemented in FirewireChannel, and V4LChannel.

Definition at line 59 of file channelbase.h.

Referenced by InitializeInputs(), SignalMonitor::SignalMonitor(), and SignalMonitor::UpdateValues().

uint ChannelBase::GetNextChannel ( uint  chanid,
int  direction 
) const [virtual]
uint ChannelBase::GetNextChannel ( const QString &  channum,
int  direction 
) const [virtual]

Definition at line 258 of file channelbase.cpp.

int ChannelBase::GetInputByName ( const QString &  input  )  const [virtual]
QString ChannelBase::GetInputByNum ( int  capchannel  )  const [virtual]

Returns name of numbered input, returns null if not found.

Definition at line 324 of file channelbase.cpp.

virtual QString ChannelBase::GetCurrentName ( void   )  const [inline, virtual]
int ChannelBase::GetChanID ( void   )  const [virtual]
virtual int ChannelBase::GetCurrentInputNum ( void   )  const [inline, virtual]
virtual QString ChannelBase::GetCurrentInput ( void   )  const [inline, virtual]
int ChannelBase::GetNextInputNum ( void   )  const [virtual]
virtual QString ChannelBase::GetNextInput ( void   )  const [inline, virtual]

Definition at line 74 of file channelbase.h.

Referenced by TVRec::SetInput().

virtual QString ChannelBase::GetNextInputStartChan ( void   )  [inline, virtual]

Definition at line 76 of file channelbase.h.

Referenced by TVRec::SetInput().

virtual uint ChannelBase::GetCurrentSourceID ( void   )  const [inline, virtual]
virtual uint ChannelBase::GetSourceID ( int  inputID  )  const [inline, virtual]

Definition at line 80 of file channelbase.h.

Referenced by TVRec::GetProgramRingBufferForLiveTV().

uint ChannelBase::GetInputCardID ( int  inputNum  )  const [virtual]

Definition at line 602 of file channelbase.cpp.

Referenced by TVRec::TuningCheckForHWChange().

DBChanList ChannelBase::GetChannels ( int  inputNum  )  const [virtual]

Definition at line 610 of file channelbase.cpp.

Referenced by GetChannels(), Init(), and InitializeInputs().

DBChanList ChannelBase::GetChannels ( const QString &  inputname  )  const [virtual]

Definition at line 622 of file channelbase.cpp.

vector< InputInfo > ChannelBase::GetFreeInputs ( const vector< uint > &  excluded_cards  )  const [virtual]

Returns the recorders available inputs.

This filters out the connected inputs that belong to an input group which is busy. Recorders in the excluded cardids will not be considered busy for the sake of determining free inputs.

Definition at line 548 of file channelbase.cpp.

Referenced by TVRec::GetFreeInputs().

QStringList ChannelBase::GetConnectedInputs ( void   )  const [virtual]

Returns names of connected inputs.

Definition at line 309 of file channelbase.cpp.

Referenced by GetFreeInputs(), Init(), and TVRec::IsBusy().

bool ChannelBase::IsCommercialFree ( void   )  const [inline]

Returns true iff commercial detection is not required.

Definition at line 91 of file channelbase.h.

virtual QString ChannelBase::GetDevice ( void   )  const [inline, virtual]

Returns String representing device, useful for debugging.

Reimplemented in ASIChannel, CetonChannel, DummyChannel, DVBChannel, FirewireChannel, HDHRChannel, and V4LChannel.

Definition at line 93 of file channelbase.h.

Referenced by GetCardID(), and ChannelScanSM::loc().

void ChannelBase::Renumber ( uint  srcid,
const QString &  oldChanNum,
const QString &  newChanNum 
) [virtual]

Changes a channum if we have it cached anywhere.

Definition at line 997 of file channelbase.cpp.

Referenced by TVRec::SetChannelInfo().

bool ChannelBase::SwitchToInput ( const QString &  input  )  [virtual]
bool ChannelBase::SwitchToInput ( const QString &  input,
const QString &  chan 
) [virtual]

Reimplemented in DVBChannel.

Definition at line 360 of file channelbase.cpp.

bool ChannelBase::InitializeInputs ( void   )  [virtual]
virtual bool ChannelBase::Retune ( void   )  [inline, virtual]

Reimplemented in DVBChannel, FirewireChannel, and V4LChannel.

Definition at line 106 of file channelbase.h.

Referenced by NuppelVideoRecorder::DoV4L2().

virtual void ChannelBase::StoreInputChannels ( void   )  [inline, virtual]

Saves current channel as the default channel for the current input.

Definition at line 109 of file channelbase.h.

Referenced by TVRec::HandleTuning(), Renumber(), and StoreInputChannels().

virtual bool ChannelBase::InitPictureAttributes ( void   )  [inline, virtual]

Reimplemented in V4LChannel.

Definition at line 113 of file channelbase.h.

Referenced by DTVChannel::SetChannelByString(), and TVRec::TuningNewRecorder().

virtual int ChannelBase::GetPictureAttribute ( PictureAttribute   )  const [inline, virtual]

Reimplemented in V4LChannel.

Definition at line 114 of file channelbase.h.

Referenced by TVRec::GetPictureAttribute().

virtual int ChannelBase::ChangePictureAttribute ( PictureAdjustType  ,
PictureAttribute  ,
bool  up 
) [inline, virtual]

Reimplemented in V4LChannel.

Definition at line 115 of file channelbase.h.

Referenced by TVRec::ChangePictureAttribute().

bool ChannelBase::CheckChannel ( const QString &  channum,
QString &  inputName 
) const
void ChannelBase::SetCardID ( uint  _cardid  )  [inline]

Definition at line 121 of file channelbase.h.

Referenced by ChannelScanner::PreScanCommon().

int ChannelBase::GetCardID ( void   )  const [virtual]
ChannelBase * ChannelBase::CreateChannel ( TVRec tv_rec,
const GeneralDBOptions genOpt,
const DVBDBOptions dvbOpt,
const FireWireDBOptions fwOpt,
const QString &  startchannel,
bool  enter_power_save_mode,
QString &  rbFileExt 
) [static]

Definition at line 1145 of file channelbase.cpp.

bool ChannelBase::SwitchToInput ( int  inputNum,
bool  setstarting 
) [protected, virtual]

Switches to another input on hardware, and sets the channel is setstarting is true.

Reimplemented in DVBChannel, and V4LChannel.

Definition at line 383 of file channelbase.cpp.

bool ChannelBase::IsInputAvailable ( int  inputNum,
uint mplexid_restriction 
) const [protected, virtual]
int ChannelBase::GetStartInput ( uint  cardid  )  [protected]

Gets the default input for the cardid.

Parameters:
cardid ChannelBase::GetCardID()

Definition at line 1048 of file channelbase.cpp.

Referenced by CreateChannel(), and InitializeInputs().

void ChannelBase::ClearInputMap ( void   )  [protected]

Definition at line 1137 of file channelbase.cpp.

Referenced by InitializeInputs(), and ~ChannelBase().

void ChannelBase::StoreInputChannels ( const InputMap inputs  )  [static, protected]

Sets starting channel for the each input in the input map.

Parameters:
input Map from cardinputid to input params.

Definition at line 1023 of file channelbase.cpp.

bool ChannelBase::KillScript ( void   )  [protected]
Note:
m_system_lock must be held when this is called

Definition at line 635 of file channelbase.cpp.

Referenced by HandleScript(), and ~ChannelBase().

void ChannelBase::HandleScript ( const QString &  freqid  )  [protected]
Note:
m_system_lock must NOT be held when this is called

Definition at line 648 of file channelbase.cpp.

Referenced by IPTVChannel::SetChannelByString(), and DTVChannel::SetChannelByString().

void ChannelBase::HandleScriptEnd ( bool  ok  )  [protected, virtual]
Note:
m_system_lock must be held when this is called

Reimplemented in DTVChannel.

Definition at line 844 of file channelbase.cpp.

Referenced by GetScriptStatus(), and HandleScript().

uint ChannelBase::GetScriptStatus ( bool  holding_lock = false  )  [protected]

Definition at line 796 of file channelbase.cpp.

Referenced by HandleScript(), and SignalMonitor::UpdateValues().

bool ChannelBase::ChangeExternalChannel ( const QString &  changer,
const QString &  freqid 
) [protected]
Note:
m_system_lock must be held when this is called

Definition at line 777 of file channelbase.cpp.

Referenced by HandleScript().

bool ChannelBase::ChangeInternalChannel ( const QString &  newchan,
uint  cardinputid 
) [protected]

Definition at line 731 of file channelbase.cpp.

Referenced by HandleScript().


Friends And Related Function Documentation

friend class SignalMonitor [friend]

Definition at line 33 of file channelbase.h.


Member Data Documentation

QString ChannelBase::m_curchannelname [protected]

Definition at line 160 of file channelbase.h.

Referenced by IsCommercialFree(), and DTVChannel::SetChannelByString().

Definition at line 161 of file channelbase.h.

Referenced by GetCardID(), and SetCardID().

channels across all inputs

Definition at line 163 of file channelbase.h.

Referenced by GetNextChannel(), and InitializeInputs().

QMutex ChannelBase::m_system_lock [protected]

Definition at line 165 of file channelbase.h.

Referenced by GetScriptStatus(), HandleScript(), and ~ChannelBase().

These get mapped from the GENERIC_EXIT_* to these values for use with the signalmonitor code.

0 == unknown, 1 == pending, 2 == failed, 3 == success

Definition at line 170 of file channelbase.h.

Referenced by GetScriptStatus(), and HandleScript().


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends
Generated on Fri Feb 10 06:41:50 2012 for MythTV by  doxygen 1.6.3