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