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)
 

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_system_lock
 
MythSystemLegacym_system {nullptr}
 
uint m_system_status {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)
inlineexplicit

Definition at line 36 of file channelbase.h.

◆ ~ChannelBase()

ChannelBase::~ChannelBase ( void  )
virtual

Definition at line 50 of file channelbase.cpp.

Member Function Documentation

◆ Init()

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

Reimplemented in DVBChannel, and V4LChannel.

Definition at line 57 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 127 of file channelbase.cpp.

◆ 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

◆ 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 DTVChannel, CetonChannel, HDHRChannel, V4LChannel, ExternalChannel, 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 188 of file channelbase.cpp.

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

◆ GetNextChannel() [2/2]

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

Definition at line 207 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 616 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 636 of file channelbase.cpp.

Referenced by TVRec::HandleTuning().

◆ 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.

◆ 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 684 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 216 of file channelbase.cpp.

Referenced by DTVChannel::SetChannelByString().

◆ IsExternalChannelChangeSupported()

virtual bool ChannelBase::IsExternalChannelChangeSupported ( void  )
inlineprotectedvirtual

Reimplemented in V4LChannel, IPTVChannel, ExternalChannel, and FirewireChannel.

Definition at line 121 of file channelbase.h.

◆ KillScript()

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

Definition at line 255 of file channelbase.cpp.

◆ HandleScript()

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

Definition at line 268 of file channelbase.cpp.

Referenced by DTVChannel::SetChannelByString().

◆ HandleScriptEnd()

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

Reimplemented in DTVChannel.

Definition at line 467 of file channelbase.cpp.

◆ GetScriptStatus()

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

Definition at line 419 of file channelbase.cpp.

Referenced by SignalMonitor::UpdateValues().

◆ ChangeExternalChannel()

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

Definition at line 400 of file channelbase.cpp.

◆ ChangeInternalChannel()

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

Definition at line 350 of file channelbase.cpp.

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

Definition at line 138 of file channelbase.h.

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

◆ m_name

QString ChannelBase::m_name
protected

Definition at line 139 of file channelbase.h.

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

◆ m_startChanNum

QString ChannelBase::m_startChanNum
protected

Definition at line 140 of file channelbase.h.

◆ m_externalChanger

QString ChannelBase::m_externalChanger
protected

Definition at line 141 of file channelbase.h.

◆ m_tuneToChannel

QString ChannelBase::m_tuneToChannel
protected

Definition at line 142 of file channelbase.h.

Referenced by DTVChannel::SetChannelByString().

◆ m_channels

ChannelInfoList ChannelBase::m_channels
protected

channels across all inputs

Definition at line 143 of file channelbase.h.

◆ m_system_lock

QMutex ChannelBase::m_system_lock
protected

Definition at line 145 of file channelbase.h.

◆ m_system

MythSystemLegacy* ChannelBase::m_system {nullptr}
protected

Definition at line 146 of file channelbase.h.

◆ m_system_status

uint ChannelBase::m_system_status {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.


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