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 using namespace std;
15 
16 class DummyChannel : public ChannelBase
17 {
18  public:
19  explicit DummyChannel(TVRec *parent): ChannelBase(parent)
20  { (void)parent; m_curChannelName.clear(); m_curInputName.clear(); }
21  ~DummyChannel(void) override = default;
22 
23  bool IsTunable(const QString &/*channum*/) const override // ChannelBase
24  { return true; }
25 
26  bool Open(void) override // ChannelBase
27  { return InitializeInput(); }
28  void Close(void) override { } // ChannelBase
29 
30  // Sets
31  bool SetChannelByString(const QString &chan) override // ChannelBase
32  { m_curChannelName = chan; return true; }
33 
34  // Gets
35  bool IsOpen(void) const override // ChannelBase
36  { return true; }
37  QString GetDevice(void) const override // ChannelBase
38  { return "/dev/dummy"; }
39  QString GetCurrentInput(void) const { return m_curInputName; }
40  static uint GetCurrentSourceID(void) { return 0; }
41 
42  private:
43  QString m_curInputName;
44 };
45 
46 #endif
DummyChannel::GetDevice
QString GetDevice(void) const override
Returns String representing device, useful for debugging.
Definition: dummychannel.h:37
DummyChannel::IsOpen
bool IsOpen(void) const override
Reports whether channel is already open.
Definition: dummychannel.h:35
DummyChannel::m_curInputName
QString m_curInputName
Definition: dummychannel.h:43
DummyChannel::IsTunable
bool IsTunable(const QString &) const override
Definition: dummychannel.h:23
DummyChannel::Open
bool Open(void) override
Opens the channel changing hardware for use.
Definition: dummychannel.h:26
DummyChannel::GetCurrentSourceID
static uint GetCurrentSourceID(void)
Definition: dummychannel.h:40
channelbase.h
ChannelBase
Abstract class providing a generic interface to tuning hardware.
Definition: channelbase.h:32
DummyChannel::~DummyChannel
~DummyChannel(void) override=default
uint
unsigned int uint
Definition: compat.h:140
DummyChannel::Close
void Close(void) override
Closes the channel changing hardware to use.
Definition: dummychannel.h:28
TVRec
This is the coordinating class of the Recorder Subsystem.
Definition: tv_rec.h:143
tv_rec.h
DummyChannel::GetCurrentInput
QString GetCurrentInput(void) const
Definition: dummychannel.h:39
DummyChannel
Definition: dummychannel.h:17
DummyChannel::SetChannelByString
bool SetChannelByString(const QString &chan) override
Definition: dummychannel.h:31
DummyChannel::DummyChannel
DummyChannel(TVRec *parent)
Definition: dummychannel.h:19