MythTV  master
ExternalChannel.h
Go to the documentation of this file.
1 
3 #ifndef EXTERNAL_CHANNEL_H
4 #define EXTERNAL_CHANNEL_H
5 
6 #include <cstdint>
7 #include <utility>
8 #include <vector>
9 using namespace std;
10 
11 // Qt headers
12 #include <QString>
13 
14 // MythTV headers
15 #include "dtvchannel.h"
16 #include "ExternalStreamHandler.h"
17 
19 {
20  public:
21  ExternalChannel(TVRec *parent, QString device)
22  : DTVChannel(parent), m_device(std::move(device)),
23  m_loc(ExternalChannel::GetDevice()) {}
24  ~ExternalChannel(void) override;
25 
26  // Commands
27  bool Open(void) override; // ChannelBase
28  void Close(void) override; // ChannelBase
29 
30  // ATSC/DVB scanning/tuning stuff
31  using DTVChannel::Tune;
32  bool Tune(const DTVMultiplex &/*tuning*/) override // DTVChannel
33  { return true; }
34  bool Tune(const QString &channum) override; // DTVChannel
35  bool Tune(const QString &freqid, int /*finetune*/) override; // DTVChannel
36 
37  bool EnterPowerSavingMode(void) override; // DTVChannel
38 
39  // Gets
40  bool IsOpen(void) const override // ChannelBase
41  { return m_streamHandler; }
42  QString GetDevice(void) const override // ChannelBase
43  { return m_device; }
44  bool IsPIDTuningSupported(void) const override // DTVChannel
45  { return true; }
46 
47  QString UpdateDescription(void);
48  QString GetDescription(void);
49  bool IsBackgroundTuning(void) const { return m_backgroundTuning; }
50  uint GetTuneStatus(void);
51 
52  protected:
53  bool IsExternalChannelChangeSupported(void) override // ChannelBase
54  { return true; }
55 
56  private:
57  int m_tuneTimeout { -1 };
58  bool m_backgroundTuning {false};
59  QString m_device;
60  QStringList m_args;
61  ExternalStreamHandler *m_streamHandler {nullptr};
62  QString m_loc;
63 };
64 
65 #endif // EXTERNAL_CHANNEL_H
DTVMultiplex
Definition: dtvmultiplex.h:25
dtvchannel.h
ExternalChannel::IsPIDTuningSupported
bool IsPIDTuningSupported(void) const override
Definition: ExternalChannel.h:44
ExternalChannel::IsExternalChannelChangeSupported
bool IsExternalChannelChangeSupported(void) override
Definition: ExternalChannel.h:53
ExternalChannel::m_loc
QString m_loc
Definition: ExternalChannel.h:62
ExternalChannel::IsBackgroundTuning
bool IsBackgroundTuning(void) const
Definition: ExternalChannel.h:49
DTVChannel::Tune
virtual bool Tune(const DTVMultiplex &tuning)=0
This performs the actual frequency tuning and in some cases input switching.
ExternalStreamHandler.h
ExternalStreamHandler
Definition: ExternalStreamHandler.h:61
ExternalChannel::GetDevice
QString GetDevice(void) const override
Returns String representing device, useful for debugging.
Definition: ExternalChannel.h:42
ExternalChannel::ExternalChannel
ExternalChannel(TVRec *parent, QString device)
Definition: ExternalChannel.h:21
ExternalChannel::m_args
QStringList m_args
Definition: ExternalChannel.h:60
uint
unsigned int uint
Definition: compat.h:140
ExternalChannel
Definition: ExternalChannel.h:19
ExternalChannel::Tune
bool Tune(const DTVMultiplex &) override
This performs the actual frequency tuning and in some cases input switching.
Definition: ExternalChannel.h:32
TVRec
This is the coordinating class of the Recorder Subsystem.
Definition: tv_rec.h:143
DTVChannel
Class providing a generic interface to digital tuning hardware.
Definition: dtvchannel.h:35
ExternalChannel::IsOpen
bool IsOpen(void) const override
Reports whether channel is already open.
Definition: ExternalChannel.h:40
ExternalChannel::m_device
QString m_device
Definition: ExternalChannel.h:59