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 
10 // Qt headers
11 #include <QString>
12 
13 // MythTV headers
14 #include "dtvchannel.h"
15 #include "ExternalStreamHandler.h"
16 
18 {
19  public:
20  ExternalChannel(TVRec *parent, QString device)
21  : DTVChannel(parent), m_device(std::move(device)),
23  ~ExternalChannel(void) override;
24 
25  // Commands
26  bool Open(void) override; // ChannelBase
27  void Close(void) override; // ChannelBase
28 
29  // ATSC/DVB scanning/tuning stuff
30  using DTVChannel::Tune;
31  bool Tune(const DTVMultiplex &/*tuning*/) override // DTVChannel
32  { return true; }
33  bool Tune(const QString &channum) override; // DTVChannel
34  bool Tune(const QString &freqid, int /*finetune*/) override; // DTVChannel
35 
36  bool EnterPowerSavingMode(void) override; // DTVChannel
37 
38  // Gets
39  bool IsOpen(void) const override // ChannelBase
40  { return m_streamHandler; }
41  QString GetDevice(void) const override // ChannelBase
42  { return m_device; }
43  bool IsPIDTuningSupported(void) const override // DTVChannel
44  { return true; }
45 
46  QString UpdateDescription(void);
47  QString GetDescription(void);
48  bool IsBackgroundTuning(void) const { return m_backgroundTuning; }
49  uint GetTuneStatus(void);
50 
51  protected:
52  bool IsExternalChannelChangeSupported(void) override // ChannelBase
53  { return true; }
54 
55  private:
56  int m_tuneTimeout { -1 };
57  bool m_backgroundTuning {false};
58  QString m_device;
59  QStringList m_args;
61  QString m_loc;
62 };
63 
64 #endif // EXTERNAL_CHANNEL_H
DTVMultiplex
Definition: dtvmultiplex.h:24
dtvchannel.h
ExternalChannel::IsPIDTuningSupported
bool IsPIDTuningSupported(void) const override
Definition: ExternalChannel.h:43
ExternalChannel::IsExternalChannelChangeSupported
bool IsExternalChannelChangeSupported(void) override
Definition: ExternalChannel.h:52
ExternalChannel::GetDescription
QString GetDescription(void)
Definition: ExternalChannel.cpp:78
ExternalChannel::m_loc
QString m_loc
Definition: ExternalChannel.h:61
ExternalChannel::IsBackgroundTuning
bool IsBackgroundTuning(void) const
Definition: ExternalChannel.h:48
DTVChannel::Tune
virtual bool Tune(const DTVMultiplex &tuning)=0
This performs the actual frequency tuning and in some cases input switching.
ExternalStreamHandler.h
ExternalChannel::m_streamHandler
ExternalStreamHandler * m_streamHandler
Definition: ExternalChannel.h:60
ExternalChannel::Close
void Close(void) override
Closes the channel changing hardware to use.
Definition: ExternalChannel.cpp:57
ExternalStreamHandler
Definition: ExternalStreamHandler.h:59
ExternalChannel::GetDevice
QString GetDevice(void) const override
Returns String representing device, useful for debugging.
Definition: ExternalChannel.h:41
ExternalChannel::ExternalChannel
ExternalChannel(TVRec *parent, QString device)
Definition: ExternalChannel.h:20
ExternalChannel::m_args
QStringList m_args
Definition: ExternalChannel.h:59
ExternalChannel::Open
bool Open(void) override
Opens the channel changing hardware for use.
Definition: ExternalChannel.cpp:19
uint
unsigned int uint
Definition: compat.h:141
ExternalChannel
-*- Mode: c++ -*-
Definition: ExternalChannel.h:17
ExternalChannel::Tune
bool Tune(const DTVMultiplex &) override
This performs the actual frequency tuning and in some cases input switching.
Definition: ExternalChannel.h:31
ExternalChannel::GetTuneStatus
uint GetTuneStatus(void)
Definition: ExternalChannel.cpp:149
ExternalChannel::EnterPowerSavingMode
bool EnterPowerSavingMode(void) override
Enters power saving mode if the card supports it.
Definition: ExternalChannel.cpp:143
ExternalChannel::~ExternalChannel
~ExternalChannel(void) override
Definition: ExternalChannel.cpp:13
ExternalChannel::m_backgroundTuning
bool m_backgroundTuning
Definition: ExternalChannel.h:57
TVRec
This is the coordinating class of the Recorder Subsystem.
Definition: tv_rec.h:142
ExternalChannel::UpdateDescription
QString UpdateDescription(void)
Definition: ExternalChannel.cpp:68
DTVChannel
Class providing a generic interface to digital tuning hardware.
Definition: dtvchannel.h:33
ExternalChannel::IsOpen
bool IsOpen(void) const override
Reports whether channel is already open.
Definition: ExternalChannel.h:39
ExternalChannel::m_device
QString m_device
Definition: ExternalChannel.h:58
ExternalChannel::m_tuneTimeout
int m_tuneTimeout
Definition: ExternalChannel.h:56