MythTV  master
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
ChannelBase Class Referenceabstract

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

#include <channelbase.h>

Inheritance diagram for ChannelBase:
Inheritance graph
[legend]
Collaboration diagram for ChannelBase:
Collaboration graph
[legend]

Public Member Functions

 ChannelBase (TVRec *parent)
 
virtual ~ChannelBase (void)
 
virtual bool Init (QString &startchannel, bool setchan)
 
virtual bool IsTunable (const QString &channum) const
 
virtual bool Open (void)=0
 Opens the channel changing hardware for use. More...
 
virtual void Close (void)=0
 Closes the channel changing hardware to use. More...
 
virtual bool IsOpen (void) const =0
 Reports whether channel is already open. More...
 
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. More...
 
virtual int GetFd (void) const
 Returns file descriptor, -1 if it does not exist. More...
 
virtual bool Tune (const QString &, int)
 
virtual bool IsExternalChannelChangeInUse (void)
 
virtual uint GetNextChannel (uint chanid, ChannelChangeDirection direction) const
 
virtual uint GetNextChannel (const QString &channum, ChannelChangeDirection direction) const
 
virtual QString GetChannelName (void) const
 
virtual int GetChanID (void) const
 
virtual int GetInputID (void) const
 
virtual QString GetInputName (void) const
 
virtual uint GetSourceID (void) const
 
bool IsCommercialFree (void) const
 Returns true iff commercial detection is not required. More...
 
virtual QString GetDevice (void) const
 Returns String representing device, useful for debugging. More...
 
virtual void Renumber (uint sourceid, const QString &oldChanNum, const QString &newChanNum)
 Changes a channum if we have it cached anywhere. More...
 
virtual bool InitializeInput (void)
 Fills in input map from DB. More...
 
virtual bool Retune (void)
 
virtual void StoreInputChannels (void)
 Saves current channel as the default channel for the current input. More...
 
virtual bool InitPictureAttributes (void)
 
virtual int GetPictureAttribute (PictureAttribute) const
 
virtual int ChangePictureAttribute (PictureAdjustType, PictureAttribute, bool)
 
bool CheckChannel (const QString &channum) const
 
void SetInputID (uint _inputid)
 
int GetMajorID (void)
 

Static Public Member Functions

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

Protected Member Functions

virtual bool IsInputAvailable (uint &mplexid_restriction, uint &chanid_restriction) const
 Switches to another input on hardware, and sets the channel is setstarting is true. More...
 
virtual bool IsExternalChannelChangeSupported (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 &freqid)
 
bool ChangeInternalChannel (const QString &freqid, uint cardinputid) const
 

Protected Attributes

TVRecm_pParent {nullptr}
 
QString m_curChannelName
 
bool m_commFree {false}
 
uint m_inputId {0}
 
uint m_sourceId {0}
 
QString m_name
 
QString m_startChanNum
 
QString m_externalChanger
 
QString m_tuneToChannel
 
ChannelInfoList m_channels
 channels across all inputs More...
 
QMutex m_systemLock
 
MythSystemLegacym_system {nullptr}
 
uint m_systemStatus {0}
 These get mapped from the GENERIC_EXIT_* to these values for use with the signalmonitor code. More...
 

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::ChannelBase ( TVRec parent)
explicit

Definition at line 51 of file channelbase.cpp.

◆ ~ChannelBase()

ChannelBase::~ChannelBase ( void  )
virtual

Definition at line 59 of file channelbase.cpp.

Member Function Documentation

◆ Init()

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

Reimplemented in DVBChannel, and V4LChannel.

Definition at line 66 of file channelbase.cpp.

Referenced by CreateChannel(), V4LChannel::Init(), DVBChannel::Init(), and TVRec::TuningGetChanNum().

◆ IsTunable()

bool ChannelBase::IsTunable ( const QString &  channum) const
virtual

Reimplemented in DummyChannel.

Definition at line 131 of file channelbase.cpp.

Referenced by Init().

◆ Open()

virtual bool ChannelBase::Open ( void  )
pure virtual

◆ Close()

virtual void ChannelBase::Close ( void  )
pure virtual

◆ IsOpen()

virtual bool ChannelBase::IsOpen ( void  ) const
pure virtual

◆ SetChannelByString()

virtual bool ChannelBase::SetChannelByString ( const QString &  chan)
pure virtual

Implemented in CetonChannel, HDHRChannel, DTVChannel, and DummyChannel.

Referenced by Init(), and TVRec::TuningFrequency().

◆ SetFormat()

virtual void ChannelBase::SetFormat ( const QString &  )
inlinevirtual

Reimplemented in V4LChannel, and DTVChannel.

Definition at line 52 of file channelbase.h.

◆ SetFreqTable()

virtual int ChannelBase::SetFreqTable ( const QString &  )
inlinevirtual

Reimplemented in V4LChannel.

Definition at line 53 of file channelbase.h.

Referenced by DTVChannel::SetChannelByString().

◆ SetFd()

virtual void ChannelBase::SetFd ( int  fd)
inlinevirtual

Sets file descriptor.

Reimplemented in V4LChannel.

Definition at line 55 of file channelbase.h.

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

◆ GetFd()

virtual int ChannelBase::GetFd ( void  ) const
inlinevirtual

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

Reimplemented in V4LChannel, and DVBChannel.

Definition at line 57 of file channelbase.h.

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

◆ Tune()

virtual bool ChannelBase::Tune ( const QString &  ,
int   
)
inlinevirtual

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

Definition at line 58 of file channelbase.h.

◆ IsExternalChannelChangeInUse()

bool ChannelBase::IsExternalChannelChangeInUse ( void  )
virtual

◆ GetNextChannel() [1/2]

uint ChannelBase::GetNextChannel ( uint  chanid,
ChannelChangeDirection  direction 
) const
virtual

Definition at line 201 of file channelbase.cpp.

Referenced by GetNextChannel(), TVRec::GetNextProgram(), and TVRec::TuningGetChanNum().

◆ GetNextChannel() [2/2]

uint ChannelBase::GetNextChannel ( const QString &  channum,
ChannelChangeDirection  direction 
) const
virtual

Definition at line 220 of file channelbase.cpp.

◆ GetChannelName()

virtual QString ChannelBase::GetChannelName ( void  ) const
inlinevirtual

◆ GetChanID()

int ChannelBase::GetChanID ( void  ) const
virtual

◆ GetInputID()

virtual int ChannelBase::GetInputID ( void  ) const
inlinevirtual

◆ GetInputName()

virtual QString ChannelBase::GetInputName ( void  ) const
inlinevirtual

◆ GetSourceID()

virtual uint ChannelBase::GetSourceID ( void  ) const
inlinevirtual

◆ IsCommercialFree()

bool ChannelBase::IsCommercialFree ( void  ) const
inline

Returns true iff commercial detection is not required.

Definition at line 76 of file channelbase.h.

◆ GetDevice()

virtual QString ChannelBase::GetDevice ( void  ) const
inlinevirtual

◆ Renumber()

void ChannelBase::Renumber ( uint  sourceid,
const QString &  oldChanNum,
const QString &  newChanNum 
)
virtual

Changes a channum if we have it cached anywhere.

Definition at line 627 of file channelbase.cpp.

Referenced by TVRec::SetChannelInfo(), and TVRec::TuningFrequency().

◆ InitializeInput()

bool ChannelBase::InitializeInput ( void  )
virtual

◆ Retune()

virtual bool ChannelBase::Retune ( void  )
inlinevirtual

Reimplemented in DVBChannel, V4LChannel, and FirewireChannel.

Definition at line 87 of file channelbase.h.

Referenced by NuppelVideoRecorder::DoV4L2().

◆ StoreInputChannels()

void ChannelBase::StoreInputChannels ( void  )
virtual

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

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

Definition at line 647 of file channelbase.cpp.

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

◆ InitPictureAttributes()

virtual bool ChannelBase::InitPictureAttributes ( void  )
inlinevirtual

Reimplemented in V4LChannel.

Definition at line 93 of file channelbase.h.

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

◆ GetPictureAttribute()

virtual int ChannelBase::GetPictureAttribute ( PictureAttribute  ) const
inlinevirtual

Reimplemented in V4LChannel.

Definition at line 94 of file channelbase.h.

Referenced by TVRec::GetPictureAttribute().

◆ ChangePictureAttribute()

virtual int ChannelBase::ChangePictureAttribute ( PictureAdjustType  ,
PictureAttribute  ,
bool   
)
inlinevirtual

Reimplemented in V4LChannel.

Definition at line 95 of file channelbase.h.

Referenced by TVRec::ChangePictureAttribute().

◆ CheckChannel()

bool ChannelBase::CheckChannel ( const QString &  channum) const

◆ SetInputID()

void ChannelBase::SetInputID ( uint  _inputid)
inline

Definition at line 101 of file channelbase.h.

Referenced by ChannelScanner::PreScanCommon().

◆ GetMajorID()

int ChannelBase::GetMajorID ( void  )

◆ CreateChannel()

ChannelBase * ChannelBase::CreateChannel ( TVRec tvrec,
const GeneralDBOptions genOpt,
const DVBDBOptions dvbOpt,
const FireWireDBOptions fwOpt,
const QString &  startchannel,
bool  enter_power_save_mode,
QString &  rbFileExt,
bool  setchan 
)
static

Definition at line 696 of file channelbase.cpp.

Referenced by TVRec::CreateChannel().

◆ IsInputAvailable()

bool ChannelBase::IsInputAvailable ( uint mplexid_restriction,
uint chanid_restriction 
) const
protectedvirtual

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

Definition at line 229 of file channelbase.cpp.

Referenced by GetNextChannel(), Init(), IsTunable(), DTVChannel::SetChannelByString(), and V4LChannel::Tune().

◆ IsExternalChannelChangeSupported()

virtual bool ChannelBase::IsExternalChannelChangeSupported ( void  )
inlineprotectedvirtual

Reimplemented in V4LChannel, IPTVChannel, ExternalChannel, and FirewireChannel.

Definition at line 121 of file channelbase.h.

Referenced by InitializeInput(), and IsExternalChannelChangeInUse().

◆ KillScript()

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

Definition at line 268 of file channelbase.cpp.

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

◆ HandleScript()

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

Definition at line 281 of file channelbase.cpp.

Referenced by DTVChannel::SetChannelByString().

◆ HandleScriptEnd()

void ChannelBase::HandleScriptEnd ( bool  ok)
protectedvirtual
Note
m_systemLock must be held when this is called

Reimplemented in DTVChannel.

Definition at line 477 of file channelbase.cpp.

Referenced by GetScriptStatus(), and HandleScript().

◆ GetScriptStatus()

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

Definition at line 429 of file channelbase.cpp.

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

◆ ChangeExternalChannel()

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

Definition at line 410 of file channelbase.cpp.

Referenced by HandleScript().

◆ ChangeInternalChannel()

bool ChannelBase::ChangeInternalChannel ( const QString &  freqid,
uint  cardinputid 
) const
protected

Definition at line 364 of file channelbase.cpp.

Referenced by HandleScript().

Friends And Related Function Documentation

◆ SignalMonitor

friend class SignalMonitor
friend

Definition at line 33 of file channelbase.h.

Member Data Documentation

◆ m_pParent

TVRec* ChannelBase::m_pParent {nullptr}
protected

◆ m_curChannelName

QString ChannelBase::m_curChannelName
protected

◆ m_commFree

bool ChannelBase::m_commFree {false}
protected

Definition at line 136 of file channelbase.h.

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

◆ m_inputId

uint ChannelBase::m_inputId {0}
protected

◆ m_sourceId

uint ChannelBase::m_sourceId {0}
protected

◆ m_name

QString ChannelBase::m_name
protected

◆ m_startChanNum

QString ChannelBase::m_startChanNum
protected

◆ m_externalChanger

QString ChannelBase::m_externalChanger
protected

Definition at line 141 of file channelbase.h.

Referenced by HandleScript(), InitializeInput(), and IsExternalChannelChangeInUse().

◆ m_tuneToChannel

QString ChannelBase::m_tuneToChannel
protected

◆ m_channels

ChannelInfoList ChannelBase::m_channels
protected

channels across all inputs

Definition at line 143 of file channelbase.h.

Referenced by GetNextChannel(), Init(), and InitializeInput().

◆ m_systemLock

QMutex ChannelBase::m_systemLock
protected

Definition at line 145 of file channelbase.h.

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

◆ m_system

MythSystemLegacy* ChannelBase::m_system {nullptr}
protected

◆ m_systemStatus

uint ChannelBase::m_systemStatus {0}
protected

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 150 of file channelbase.h.

Referenced by GetScriptStatus(), ExternalChannel::GetTuneStatus(), and HandleScript().


The documentation for this class was generated from the following files: