#include <channelbase.h>

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 25 of file channelbase.h.
Public Member Functions | |
| ChannelBase (TVRec *parent) | |
| virtual | ~ChannelBase () |
| 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 | SetChannelByString (const QString &chan)=0 |
| virtual bool | IsOpen (void) const =0 |
| Reports whether channel is already open. | |
| virtual void | SetFd (int fd) |
| Sets file descriptor. | |
| virtual int | GetFd (void) const |
| Returns file descriptor, -1 if it does not exist. | |
| 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 | GetInputCardID (int inputNum) const |
| virtual DBChanList | GetChannels (int inputNum) const |
| virtual DBChanList | GetChannels (const QString &inputname) const |
| virtual vector< InputInfo > | GetFreeInputs (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) |
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 |
| virtual int | GetCardID (void) const |
| Returns card id. | |
| virtual bool | ChangeExternalChannel (const QString &newchan) |
Static Protected Member Functions | |
| static void | StoreInputChannels (const InputMap &) |
| Sets starting channel for the each input in the input map. | |
| static void | StoreDefaultInput (uint cardid, const QString &input) |
| Sets default input for the cardid. | |
Protected Attributes | |
| TVRec * | pParent |
| QString | curchannelname |
| int | currentInputID |
| bool | commfree |
| uint | cardid |
| InputMap | inputs |
| DBChanList | allchannels |
| channels across all inputs | |
| ChannelBase::ChannelBase | ( | TVRec * | parent | ) |
Definition at line 37 of file channelbase.cpp.
| ChannelBase::~ChannelBase | ( | void | ) | [virtual] |
Definition at line 44 of file channelbase.cpp.
Reimplemented in Channel, and DVBChannel.
Definition at line 48 of file channelbase.cpp.
Referenced by DVBChannel::Init(), Channel::Init(), TVRec::InitChannel(), and TVRec::TuningGetChanNum().
| bool ChannelBase::IsTunable | ( | const QString & | input, | |
| const QString & | channum | |||
| ) | const [virtual] |
| virtual bool ChannelBase::Open | ( | void | ) | [pure virtual] |
Opens the channel changing hardware for use.
Implemented in Channel, DBox2Channel, DummyChannel, DVBChannel, FirewireChannel, HDHRChannel, and IPTVChannel.
Referenced by TVRec::CreateChannel(), ScanWizardScanner::PreScanCommon(), TVRec::SetupSignalMonitor(), TVRec::TuningFrequency(), TVRec::TuningNewRecorder(), and TVRec::TuningShutdowns().
| virtual void ChannelBase::Close | ( | void | ) | [pure virtual] |
Closes the channel changing hardware to use.
Implemented in Channel, DBox2Channel, DummyChannel, DVBChannel, FirewireChannel, HDHRChannel, and IPTVChannel.
Referenced by TVRec::CloseChannel(), TVRec::TuningNewRecorder(), and TVRec::TuningShutdowns().
| virtual bool ChannelBase::SetChannelByString | ( | const QString & | chan | ) | [pure virtual] |
Implemented in Channel, DBox2Channel, DummyChannel, DVBChannel, FirewireChannel, HDHRChannel, and IPTVChannel.
Referenced by Init(), SwitchToInput(), and TVRec::TuningFrequency().
| virtual bool ChannelBase::IsOpen | ( | void | ) | const [pure virtual] |
Reports whether channel is already open.
Implemented in Channel, DBox2Channel, DummyChannel, DVBChannel, FirewireChannel, HDHRChannel, and IPTVChannel.
Referenced by TVRec::TuningOnSameMultiplex().
| virtual void ChannelBase::SetFd | ( | int | fd | ) | [inline, virtual] |
Sets file descriptor.
Reimplemented in Channel.
Definition at line 45 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 Channel, and DVBChannel.
Definition at line 47 of file channelbase.h.
Referenced by AnalogSignalMonitor::AnalogSignalMonitor(), and AnalogSignalMonitor::UpdateValues().
Definition at line 221 of file channelbase.cpp.
Referenced by DBox2Channel::EPGFinished(), GetNextChannel(), TVRec::GetNextProgram(), DBox2Channel::RecorderAlive(), and TVRec::TuningGetChanNum().
| uint ChannelBase::GetNextChannel | ( | const QString & | channum, | |
| int | direction | |||
| ) | const [virtual] |
Definition at line 239 of file channelbase.cpp.
| int ChannelBase::GetInputByName | ( | const QString & | input | ) | const [virtual] |
Returns number of named input, returns -1 if not found.
Definition at line 316 of file channelbase.cpp.
Referenced by GetChannels(), GetFreeInputs(), Init(), TVRec::IsBusy(), IsTunable(), DVBChannel::SetChannelByString(), DVBChannel::SwitchToInput(), SwitchToInput(), DVBChannel::Tune(), Channel::Tune(), and TVRec::TuningCheckForHWChange().
| QString ChannelBase::GetInputByNum | ( | int | capchannel | ) | const [virtual] |
Returns name of numbered input, returns null if not found.
Definition at line 305 of file channelbase.cpp.
| virtual QString ChannelBase::GetCurrentName | ( | void | ) | const [inline, virtual] |
Definition at line 54 of file channelbase.h.
Referenced by TVRec::CreateLiveTVRingBuffer(), TVRec::GetProgramRingBufferForLiveTV(), TVRec::SetSignalMonitoringRate(), TVRec::SwitchLiveTVRingBuffer(), TVRec::ToggleChannelFavorite(), TVRec::TuningNewRecorder(), and TVRec::TuningOnSameMultiplex().
| int ChannelBase::GetChanID | ( | void | ) | const [virtual] |
Reimplemented in DVBChannel.
Definition at line 718 of file channelbase.cpp.
Referenced by Channel::GetCachedPids(), TVRec::GetChannelInfo(), GetFreeInputs(), TVRec::IsBusy(), IsInputAvailable(), and Channel::SaveCachedPids().
| virtual int ChannelBase::GetCurrentInputNum | ( | void | ) | const [inline, virtual] |
Definition at line 57 of file channelbase.h.
Referenced by GetCurrentInput(), GetCurrentSourceID(), InitializeInputs(), TVRec::IsBusy(), NuppelVideoRecorder::StartRecording(), Channel::Tune(), and TVRec::TuningCheckForHWChange().
| virtual QString ChannelBase::GetCurrentInput | ( | void | ) | const [inline, virtual] |
Reimplemented in DummyChannel.
Definition at line 59 of file channelbase.h.
Referenced by CheckChannel(), TVRec::CreateLiveTVRingBuffer(), TVRec::GetInput(), DTVChannel::GetSuggestedTuningMode(), InitializeInputs(), TVRec::NotifySchedulerOfRecording(), TVRec::SetInput(), StoreInputChannels(), and TVRec::SwitchLiveTVRingBuffer().
| int ChannelBase::GetNextInputNum | ( | void | ) | const [virtual] |
Definition at line 249 of file channelbase.cpp.
Referenced by GetNextInput(), GetNextInputStartChan(), InitializeInputs(), and Channel::SetFormat().
| virtual QString ChannelBase::GetNextInput | ( | void | ) | const [inline, virtual] |
| virtual QString ChannelBase::GetNextInputStartChan | ( | void | ) | [inline, virtual] |
| virtual uint ChannelBase::GetCurrentSourceID | ( | void | ) | const [inline, virtual] |
Definition at line 66 of file channelbase.h.
Referenced by Channel::ChangePictureAttribute(), TVRec::GetChannelInfo(), Channel::GetPictureAttribute(), TVRec::GetProgramRingBufferForLiveTV(), Channel::InitPictureAttribute(), Renumber(), Channel::SetChannelByString(), EITScanner::StartPassiveScan(), TVRec::ToggleChannelFavorite(), TVRec::TuningNewRecorder(), and TVRec::TuningOnSameMultiplex().
| uint ChannelBase::GetInputCardID | ( | int | inputNum | ) | const [virtual] |
| DBChanList ChannelBase::GetChannels | ( | int | inputNum | ) | const [virtual] |
| DBChanList ChannelBase::GetChannels | ( | const QString & | inputname | ) | const [virtual] |
Definition at line 591 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 517 of file channelbase.cpp.
Referenced by TVRec::GetFreeInputs().
| QStringList ChannelBase::GetConnectedInputs | ( | void | ) | const [virtual] |
Returns names of connected inputs.
Definition at line 290 of file channelbase.cpp.
Referenced by GetFreeInputs(), Init(), and TVRec::IsBusy().
| bool ChannelBase::IsCommercialFree | ( | void | ) | const [inline] |
| virtual QString ChannelBase::GetDevice | ( | void | ) | const [inline, virtual] |
Returns String representing device, useful for debugging.
Reimplemented in Channel, DummyChannel, DVBChannel, FirewireChannel, and HDHRChannel.
Definition at line 79 of file channelbase.h.
Referenced by GetCardID(), and SIScan::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 828 of file channelbase.cpp.
Referenced by TVRec::SetChannelInfo().
| bool ChannelBase::SwitchToInput | ( | const QString & | input | ) | [virtual] |
Definition at line 327 of file channelbase.cpp.
Referenced by Init(), HDHRChannel::SetChannelByString(), Channel::SetChannelByString(), SwitchToInput(), and TVRec::TuningFrequency().
| bool ChannelBase::SwitchToInput | ( | const QString & | input, | |
| const QString & | chan | |||
| ) | [virtual] |
| bool ChannelBase::InitializeInputs | ( | void | ) | [virtual] |
Fills in input map from DB.
Reimplemented in Channel.
Definition at line 748 of file channelbase.cpp.
Referenced by FirewireChannel::FirewireChannel(), Channel::InitializeInputs(), IPTVChannel::Open(), HDHRChannel::Open(), DVBChannel::Open(), DummyChannel::Open(), and DBox2Channel::Open().
| virtual bool ChannelBase::Retune | ( | void | ) | [inline, virtual] |
Reimplemented in Channel, DVBChannel, and FirewireChannel.
Definition at line 92 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 95 of file channelbase.h.
Referenced by TVRec::HandleTuning(), and Renumber().
| virtual bool ChannelBase::InitPictureAttributes | ( | void | ) | [inline, virtual] |
Reimplemented in Channel.
Definition at line 100 of file channelbase.h.
Referenced by TVRec::TuningNewRecorder().
| virtual int ChannelBase::GetPictureAttribute | ( | PictureAttribute | ) | const [inline, virtual] |
Reimplemented in Channel.
Definition at line 101 of file channelbase.h.
Referenced by TVRec::GetPictureAttribute().
| virtual int ChannelBase::ChangePictureAttribute | ( | PictureAdjustType | , | |
| PictureAttribute | , | |||
| bool | up | |||
| ) | [inline, virtual] |
Reimplemented in Channel.
Definition at line 102 of file channelbase.h.
Referenced by TVRec::ChangePictureAttribute().
| bool ChannelBase::CheckChannel | ( | const QString & | channum, | |
| QString & | inputName | |||
| ) | const |
Definition at line 894 of file channelbase.cpp.
Referenced by TVRec::CheckChannel(), HDHRChannel::SetChannelByString(), DVBChannel::SetChannelByString(), Channel::SetChannelByString(), and TVRec::TuningCheckForHWChange().
| void ChannelBase::SetCardID | ( | uint | _cardid | ) | [inline] |
Switches to another input on hardware, and sets the channel is setstarting is true.
Reimplemented in Channel, DummyChannel, and DVBChannel.
Definition at line 359 of file channelbase.cpp.
| bool ChannelBase::IsInputAvailable | ( | int | inputNum, | |
| uint & | mplexid_restriction | |||
| ) | const [protected, virtual] |
Definition at line 476 of file channelbase.cpp.
Referenced by GetNextChannel(), Init(), IsTunable(), IPTVChannel::SetChannelByString(), HDHRChannel::SetChannelByString(), FirewireChannel::SetChannelByString(), DVBChannel::SetChannelByString(), DBox2Channel::SetChannelByString(), Channel::SetChannelByString(), DVBChannel::SwitchToInput(), SwitchToInput(), and Channel::SwitchToInput().
| int ChannelBase::GetCardID | ( | void | ) | const [protected, virtual] |
Returns card id.
Definition at line 703 of file channelbase.cpp.
Referenced by Channel::ChangePictureAttribute(), CheckChannel(), DVBChannel::GetChanID(), Channel::GetFormatForChannel(), GetFreeInputs(), Channel::GetPictureAttribute(), DTVChannel::GetSuggestedTuningMode(), InitializeInputs(), Channel::InitPictureAttribute(), IsInputAvailable(), DVBChannel::Open(), and StoreInputChannels().
| bool ChannelBase::ChangeExternalChannel | ( | const QString & | newchan | ) | [protected, virtual] |
Definition at line 603 of file channelbase.cpp.
Referenced by IPTVChannel::SetChannelByString(), HDHRChannel::SetChannelByString(), FirewireChannel::SetChannelByString(), and Channel::SetChannelByString().
| void ChannelBase::StoreInputChannels | ( | const InputMap & | inputs | ) | [static, protected] |
Sets starting channel for the each input in the input map.
| input | Map from cardinputid to input params. |
Definition at line 854 of file channelbase.cpp.
| void ChannelBase::StoreDefaultInput | ( | uint | cardid, | |
| const QString & | input | |||
| ) | [static, protected] |
Sets default input for the cardid.
| cardid | ChannelBase::GetCardID() | |
| input | ChannelBase::GetCurrentInput() |
Definition at line 880 of file channelbase.cpp.
Referenced by StoreInputChannels().
TVRec* ChannelBase::pParent [protected] |
Definition at line 122 of file channelbase.h.
Referenced by Channel::ChangePictureAttribute(), GetCardID(), GetFreeInputs(), Channel::InitPictureAttribute(), IsInputAvailable(), and Channel::SetChannelByString().
QString ChannelBase::curchannelname [protected] |
Definition at line 123 of file channelbase.h.
Referenced by Channel::ChangePictureAttribute(), DummyChannel::DummyChannel(), DVBChannel::GetChanID(), GetChanID(), IPTVChannel::GetCurrentChanInfo(), GetCurrentName(), GetNextChannel(), Channel::GetPictureAttribute(), DBox2Channel::HttpChannelChangeDone(), Channel::InitPictureAttribute(), Renumber(), IPTVChannel::SetChannelByString(), HDHRChannel::SetChannelByString(), FirewireChannel::SetChannelByString(), DVBChannel::SetChannelByString(), DummyChannel::SetChannelByString(), DBox2Channel::SetChannelByString(), Channel::SetChannelByString(), DummyChannel::SwitchToInput(), and Channel::SwitchToInput().
int ChannelBase::currentInputID [protected] |
Definition at line 124 of file channelbase.h.
Referenced by ChangeExternalChannel(), GetChanID(), IPTVChannel::GetChanInfo(), GetChannels(), GetCurrentInputNum(), GetNextChannel(), GetNextInputNum(), InitializeInputs(), IsTunable(), FirewireChannel::Open(), DVBChannel::Open(), DVBChannel::Retune(), IPTVChannel::SetChannelByString(), HDHRChannel::SetChannelByString(), FirewireChannel::SetChannelByString(), DVBChannel::SetChannelByString(), DBox2Channel::SetChannelByString(), Channel::SetChannelByString(), Channel::SetFormat(), DVBChannel::SwitchToInput(), DummyChannel::SwitchToInput(), Channel::SwitchToInput(), and DVBChannel::Tune().
bool ChannelBase::commfree [protected] |
Definition at line 125 of file channelbase.h.
Referenced by IsCommercialFree(), IsTunable(), HDHRChannel::SetChannelByString(), FirewireChannel::SetChannelByString(), DVBChannel::SetChannelByString(), and Channel::SetChannelByString().
uint ChannelBase::cardid [protected] |
Definition at line 126 of file channelbase.h.
Referenced by GetCardID(), DVBChannel::GetChanID(), DTVChannel::GetSuggestedTuningMode(), InitializeInputs(), and SetCardID().
InputMap ChannelBase::inputs [protected] |
Definition at line 127 of file channelbase.h.
Referenced by ChangeExternalChannel(), GetChanID(), IPTVChannel::GetChanInfo(), GetChannels(), GetConnectedInputs(), GetCurrentInput(), GetCurrentSourceID(), GetInputByName(), GetInputByNum(), GetInputCardID(), GetNextChannel(), GetNextInput(), GetNextInputNum(), GetNextInputStartChan(), Init(), InitializeInputs(), Channel::InitializeInputs(), IsTunable(), FirewireChannel::Open(), Renumber(), IPTVChannel::SetChannelByString(), HDHRChannel::SetChannelByString(), FirewireChannel::SetChannelByString(), DVBChannel::SetChannelByString(), DBox2Channel::SetChannelByString(), Channel::SetChannelByString(), Channel::SetFormat(), Channel::SetInputAndFormat(), StoreInputChannels(), DVBChannel::SwitchToInput(), SwitchToInput(), and Channel::SwitchToInput().
DBChanList ChannelBase::allchannels [protected] |
channels across all inputs
Definition at line 128 of file channelbase.h.
Referenced by GetNextChannel(), and InitializeInputs().
1.5.5