12#define LOC QString("ExternChan[%1](%2): ").arg(m_inputId).arg(m_loc)
22 LOG(VB_CHANNEL, LOG_INFO,
LOC +
"Open()");
32 LOG(VB_GENERAL, LOG_ERR,
LOC +
33 QString(
"Valid stream handler, but app is not open! Resetting."));
48 LOG(VB_GENERAL, LOG_ERR,
LOC +
"Open failed");
54 LOG(VB_RECORD, LOG_INFO,
LOC +
"Opened");
60 LOG(VB_CHANNEL, LOG_INFO,
LOC +
"Close()");
91 LOG(VB_CHANNEL, LOG_INFO,
LOC + QString(
"Tune(%1)").arg(channum));
95 LOG(VB_CHANNEL, LOG_ERR,
LOC +
"Tune failed, not open");
107 LOG(VB_CHANNEL, LOG_ERR,
LOC + QString
108 (
"Failed to retrieve LockTimeout: %1").arg(result));
113 m_tuneTimeout = std::chrono::milliseconds(result.split(
":")[1].toInt());
116 LOG(VB_CHANNEL, LOG_INFO,
LOC + QString(
"Using Tune timeout of %1ms")
120 LOG(VB_CHANNEL, LOG_INFO,
LOC +
"Tuning to " + channum);
127 LOG(VB_CHANNEL, LOG_ERR,
LOC + QString
128 (
"Failed to Tune %1: %2").arg(channum, result));
139 cmd[
"command"] =
"TuneChannel";
140 cmd[
"channum"] = channum;
150 cmd[
"recordid"] = recordid;
170 uint64_t frequency = 0;
172 int mpeg_prog_num = 0;
175 uint dvb_transportid = 0;
176 uint dvb_networkid = 0;
178 bool commfree =
false;
182 tvformat, modulation,
184 finetune, frequency, dtv_si_std,
185 mpeg_prog_num, atsc_major, atsc_minor,
186 dvb_transportid, dvb_networkid,
189 LOG(VB_GENERAL, LOG_ERR,
LOC +
" " +
190 QString(
"Failed to find channel in DB on input '%1' ")
196 cmd[
"callsign"] = callsign;
197 cmd[
"chanid"] = chanid;
198 cmd[
"freqid"] = freqid;
199 cmd[
"atsc_major"] = atsc_major;
200 cmd[
"atsc_minor"] = atsc_minor;
201 cmd[
"mplexid"] = mplexid;
206 LOG(VB_CHANNEL, LOG_ERR,
LOC + QString
207 (
"Failed to Tune %1: %2").arg(channum, QString(response)));
211 .toString().startsWith(
"InProgress");
235 LOG(VB_CHANNEL, LOG_DEBUG,
LOC + QString(
"GetScriptStatus() %1")
243 LOG(VB_CHANNEL, LOG_ERR,
LOC + QString
244 (
"Failed to Tune: %1").arg(result));
250 if (result.startsWith(
"OK:InProgress"))
260 LOG(VB_CHANNEL, LOG_DEBUG,
LOC + QString(
"GetScriptStatus() %1 -> %2")
#define LOC
-*- Mode: c++ -*- Class ExternalChannel
uint m_systemStatus
These get mapped from the GENERIC_EXIT_* to these values for use with the signalmonitor code.
virtual int GetInputID(void) const
virtual bool InitializeInput(void)
Fills in input map from DB.
static bool GetChannelData(uint sourceid, uint &chanid, const QString &channum, QString &name, QString &callsign, QString &tvformat, QString &modulation, QString &freqtable, QString &freqid, int &finetune, uint64_t &frequency, QString &dtv_si_std, int &mpeg_prog_num, uint &atsc_major, uint &atsc_minor, uint &dvb_transportid, uint &dvb_networkid, uint &mplexid, bool &commfree)
ExternalStreamHandler * m_streamHandler
~ExternalChannel(void) override
QString GetDevice(void) const override
Returns String representing device, useful for debugging.
bool Tune(const DTVMultiplex &) override
This performs the actual frequency tuning and in some cases input switching.
bool EnterPowerSavingMode(void) override
Enters power saving mode if the card supports it.
bool Open(void) override
Opens the channel changing hardware for use.
void Close(void) override
Closes the channel changing hardware to use.
bool IsOpen(void) const override
Reports whether channel is already open.
std::chrono::milliseconds m_tuneTimeout
QString UpdateDescription(void)
QString GetDescription(void)
static ExternalStreamHandler * Get(const QString &devname, int inputid, int majorid)
QString GetDescription(void)
bool ProcessCommand(const QString &cmd, QString &result, std::chrono::milliseconds timeout=4s, uint retry_cnt=3)
QString UpdateDescription(void)
bool HasTuner(void) const
bool ProcessJson(const QVariantMap &vmsg, QVariantMap &elements, QByteArray &response, std::chrono::milliseconds timeout=4s, uint retry_cnt=3)
int APIVersion(void) const
static void Return(ExternalStreamHandler *&ref, int inputid)
Holds information on recordings and videos.
uint GetRecordingRuleID(void) const
QString GetSeriesID(void) const
QString GetProgramID(void) const
QString GetDescription(void) const
QString GetTitle(void) const
QDateTime GetRecordingStartTime(void) const
Approximate time the recording started.
QDateTime GetRecordingEndTime(void) const
Approximate time the recording should have ended, did end, or is intended to end.
QString GetSubtitle(void) const
bool HasError(void) const
ProgramInfo * GetRecording(void)
Allocates and returns a ProgramInfo for the current recording.
#define LOG(_MASK_, _LEVEL_, _QSTRING_)