/
ExternalChannel.h
64 lines (51 loc) · 1.81 KB
/
ExternalChannel.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
/// -*- Mode: c++ -*-
#ifndef EXTERNAL_CHANNEL_H
#define EXTERNAL_CHANNEL_H
#include <cstdint>
#include <utility>
#include <vector>
// Qt headers
#include <QString>
// MythTV headers
#include "dtvchannel.h"
#include "ExternalStreamHandler.h"
class ExternalChannel : public DTVChannel
{
public:
ExternalChannel(TVRec *parent, QString device)
: DTVChannel(parent), m_device(std::move(device)),
m_loc(ExternalChannel::GetDevice()) {}
~ExternalChannel(void) override;
// Commands
bool Open(void) override; // ChannelBase
void Close(void) override; // ChannelBase
// ATSC/DVB scanning/tuning stuff
using DTVChannel::Tune;
bool Tune(const DTVMultiplex &/*tuning*/) override // DTVChannel
{ return true; }
bool Tune(const QString &channum) override; // DTVChannel
bool Tune(const QString &freqid, int /*finetune*/) override; // DTVChannel
bool EnterPowerSavingMode(void) override; // DTVChannel
// Gets
bool IsOpen(void) const override // ChannelBase
{ return m_streamHandler; }
QString GetDevice(void) const override // ChannelBase
{ return m_device; }
bool IsPIDTuningSupported(void) const override // DTVChannel
{ return true; }
QString UpdateDescription(void);
QString GetDescription(void);
bool IsBackgroundTuning(void) const { return m_backgroundTuning; }
uint GetTuneStatus(void);
protected:
bool IsExternalChannelChangeSupported(void) override // ChannelBase
{ return true; }
private:
int m_tuneTimeout { -1 };
bool m_backgroundTuning {false};
QString m_device;
QStringList m_args;
ExternalStreamHandler *m_streamHandler {nullptr};
QString m_loc;
};
#endif // EXTERNAL_CHANNEL_H