MythTV master
cetonchannel.cpp
Go to the documentation of this file.
1
8// MythTV includes
11
12#include "cetonchannel.h"
13#include "cetonstreamhandler.h"
14#include "channelutil.h"
15#include "videosource.h"
16
17#define LOC QString("CetonChan[%1](%2): ").arg(m_inputId).arg(CetonChannel::GetDevice())
18
20{
22}
23
25{
26 LOG(VB_CHANNEL, LOG_INFO, LOC + "Opening Ceton channel");
27
28 if (IsOpen())
29 return true;
30
32
34 m_tunerTypes.push_back(m_tunerType);
35
36 if (!InitializeInput())
37 {
38 Close();
39 return false;
40 }
41
43}
44
46{
47 LOG(VB_CHANNEL, LOG_INFO, LOC + "Closing Ceton channel");
48
50 return; // this caller didn't have it open in the first place..
51
53}
54
56{
57 if (IsOpen())
59 return true;
60}
61
62bool CetonChannel::IsOpen(void) const
63{
64 return m_streamHandler;
65}
66
68bool CetonChannel::Tune(const QString &freqid, int /*finetune*/)
69{
70 return m_streamHandler->TuneVChannel(freqid);
71}
72
73static QString format_modulation(const DTVMultiplex &tuning)
74{
76 return "qam_256";
78 return "qam_64";
79 //note...ceton also supports NTSC-M, but not sure what to use that for
81 return "8vsb";
82
83 return "unknown";
84}
85
87{
88 QString modulation = format_modulation(tuning);
89
90 LOG(VB_CHANNEL, LOG_INFO, LOC + QString("Tuning to %1 %2")
91 .arg(tuning.m_frequency).arg(modulation));
92
93 if (m_streamHandler->TuneFrequency(tuning.m_frequency, modulation))
94 {
96 return true;
97 }
98
99 return false;
100}
101
102bool CetonChannel::SetChannelByString(const QString &channum)
103{
104 bool ok = DTVChannel::SetChannelByString(channum);
105
106 if (ok)
107 {
110 else
112 }
113 return ok;
114}
#define LOC
-*- Mode: c++ -*- CetonChannel Copyright (c) 2011 Ronald Frazier Copyright (c) 2006-2009 by Silicondu...
static QString format_modulation(const DTVMultiplex &tuning)
bool EnterPowerSavingMode(void) override
Enters power saving mode if the card supports it.
void Close(void) override
Closes the channel changing hardware to use.
QString m_deviceId
Definition: cetonchannel.h:54
bool IsOpen(void) const override
Reports whether channel is already open.
std::vector< DTVTunerType > m_tunerTypes
Definition: cetonchannel.h:56
bool Tune(const DTVMultiplex &tuning) override
This performs the actual frequency tuning and in some cases input switching.
CetonStreamHandler * m_streamHandler
Definition: cetonchannel.h:55
bool SetChannelByString(const QString &channum) override
bool Open(void) override
Opens the channel changing hardware for use.
~CetonChannel(void) override
bool IsCableCardInstalled() const
static void Return(CetonStreamHandler *&ref, int inputid)
bool TuneVChannel(const QString &vchannel)
bool IsConnected(void) const
static CetonStreamHandler * Get(const QString &devname, int inputid)
bool TuneFrequency(uint frequency, const QString &modulation)
uint GetProgramNumber(void) const
bool TuneProgram(uint program)
virtual int GetInputID(void) const
Definition: channelbase.h:67
virtual bool InitializeInput(void)
Fills in input map from DB.
DTVTunerType m_tunerType
Definition: dtvchannel.h:161
bool SetChannelByString(const QString &chan) override
Definition: dtvchannel.cpp:157
void SetSIStandard(const QString &si_std)
Sets PSIP table standard: MPEG, DVB, ATSC, or OpenCable.
Definition: dtvchannel.cpp:51
int m_currentProgramNum
Definition: dtvchannel.h:166
DTVModulation m_modulation
Definition: dtvmultiplex.h:100
uint64_t m_frequency
Definition: dtvmultiplex.h:94
QString m_sistandard
Definition: dtvmultiplex.h:111
static const int kTunerTypeATSC
#define LOG(_MASK_, _LEVEL_, _QSTRING_)
Definition: mythlogging.h:39