MythTV  master
dummychannel.h
Go to the documentation of this file.
1 
6 #ifndef DUMMYCHANNEL_H
7 #define DUMMYCHANNEL_H
8 
9 #include <QString>
10 
11 #include "tv_rec.h"
12 #include "channelbase.h"
13 
14 class DummyChannel : public ChannelBase
15 {
16  public:
17  explicit DummyChannel(TVRec *parent): ChannelBase(parent)
18  { m_curChannelName.clear(); m_curInputName.clear(); }
19  ~DummyChannel(void) override = default;
20 
21  bool IsTunable(const QString &/*channum*/) const override // ChannelBase
22  { return true; }
23 
24  bool Open(void) override // ChannelBase
25  { return InitializeInput(); }
26  void Close(void) override { } // ChannelBase
27 
28  // Sets
29  bool SetChannelByString(const QString &chan) override // ChannelBase
30  { m_curChannelName = chan; return true; }
31 
32  // Gets
33  bool IsOpen(void) const override // ChannelBase
34  { return true; }
35  QString GetDevice(void) const override // ChannelBase
36  { return "/dev/dummy"; }
37  QString GetCurrentInput(void) const { return m_curInputName; }
38  static uint GetCurrentSourceID(void) { return 0; }
39 
40  private:
41  QString m_curInputName;
42 };
43 
44 #endif
DummyChannel::GetDevice
QString GetDevice(void) const override
Returns String representing device, useful for debugging.
Definition: dummychannel.h:35
DummyChannel::IsOpen
bool IsOpen(void) const override
Reports whether channel is already open.
Definition: dummychannel.h:33
DummyChannel::m_curInputName
QString m_curInputName
Definition: dummychannel.h:41
DummyChannel::IsTunable
bool IsTunable(const QString &) const override
Definition: dummychannel.h:21
DummyChannel::Open
bool Open(void) override
Opens the channel changing hardware for use.
Definition: dummychannel.h:24
DummyChannel::GetCurrentSourceID
static uint GetCurrentSourceID(void)
Definition: dummychannel.h:38
channelbase.h
ChannelBase
Abstract class providing a generic interface to tuning hardware.
Definition: channelbase.h:31
ChannelBase::m_curChannelName
QString m_curChannelName
Definition: channelbase.h:135
DummyChannel::~DummyChannel
~DummyChannel(void) override=default
uint
unsigned int uint
Definition: compat.h:81
DummyChannel::Close
void Close(void) override
Closes the channel changing hardware to use.
Definition: dummychannel.h:26
TVRec
This is the coordinating class of the Recorder Subsystem.
Definition: tv_rec.h:142
tv_rec.h
DummyChannel::GetCurrentInput
QString GetCurrentInput(void) const
Definition: dummychannel.h:37
DummyChannel
DummyChannel.
Definition: dummychannel.h:14
ChannelBase::InitializeInput
virtual bool InitializeInput(void)
Fills in input map from DB.
Definition: channelbase.cpp:548
DummyChannel::SetChannelByString
bool SetChannelByString(const QString &chan) override
Definition: dummychannel.h:29
DummyChannel::DummyChannel
DummyChannel(TVRec *parent)
Definition: dummychannel.h:17