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 
42  return m_streamHandler->IsConnected();
43 }
44 
46 {
47  LOG(VB_CHANNEL, LOG_INFO, LOC + "Closing Ceton channel");
48 
49  if (!CetonChannel::IsOpen())
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 
62 bool CetonChannel::IsOpen(void) const
63 {
64  return m_streamHandler;
65 }
66 
68 bool CetonChannel::Tune(const QString &freqid, int /*finetune*/)
69 {
70  return m_streamHandler->TuneVChannel(freqid);
71 }
72 
73 static 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 
86 bool CetonChannel::Tune(const DTVMultiplex &tuning)
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 
102 bool CetonChannel::SetChannelByString(const QString &channum)
103 {
104  bool ok = DTVChannel::SetChannelByString(channum);
105 
106  if (ok)
107  {
110  else
112  }
113  return ok;
114 }
DTVMultiplex::m_frequency
uint64_t m_frequency
Definition: dtvmultiplex.h:94
DTVMultiplex
Definition: dtvmultiplex.h:24
CetonChannel::IsOpen
bool IsOpen(void) const override
Reports whether channel is already open.
Definition: cetonchannel.cpp:62
CetonStreamHandler::IsCableCardInstalled
bool IsCableCardInstalled() const
Definition: cetonstreamhandler.h:32
mythdbcon.h
CetonChannel::~CetonChannel
~CetonChannel(void) override
Definition: cetonchannel.cpp:19
DTVChannel::SetChannelByString
bool SetChannelByString(const QString &chan) override
Definition: dtvchannel.cpp:157
LOG
#define LOG(_MASK_, _LEVEL_, _QSTRING_)
Definition: mythlogging.h:39
CetonStreamHandler::TuneVChannel
bool TuneVChannel(const QString &vchannel)
Definition: cetonstreamhandler.cpp:415
DTVChannel::m_currentProgramNum
int m_currentProgramNum
Definition: dtvchannel.h:166
CetonChannel::Close
void Close(void) override
Closes the channel changing hardware to use.
Definition: cetonchannel.cpp:45
DTVModulation::kModulationQAM256
@ kModulationQAM256
Definition: dtvconfparserhelpers.h:363
CetonChannel::Tune
bool Tune(const DTVMultiplex &tuning) override
This performs the actual frequency tuning and in some cases input switching.
Definition: cetonchannel.cpp:86
cetonchannel.h
mythlogging.h
DTVChannel::SetSIStandard
void SetSIStandard(const QString &si_std)
Sets PSIP table standard: MPEG, DVB, ATSC, or OpenCable.
Definition: dtvchannel.cpp:51
CetonStreamHandler::IsConnected
bool IsConnected(void) const
Definition: cetonstreamhandler.cpp:224
CetonChannel::m_deviceId
QString m_deviceId
Definition: cetonchannel.h:54
CetonStreamHandler::TuneProgram
bool TuneProgram(uint program)
Definition: cetonstreamhandler.cpp:355
CetonStreamHandler::GetProgramNumber
uint GetProgramNumber(void) const
Definition: cetonstreamhandler.cpp:448
format_modulation
static QString format_modulation(const DTVMultiplex &tuning)
Definition: cetonchannel.cpp:73
cetonstreamhandler.h
CetonStreamHandler::EnterPowerSavingMode
bool EnterPowerSavingMode(void)
Definition: cetonstreamhandler.cpp:208
channelutil.h
DTVChannel::m_tunerType
DTVTunerType m_tunerType
Definition: dtvchannel.h:161
CetonStreamHandler::Return
static void Return(CetonStreamHandler *&ref, int inputid)
Definition: cetonstreamhandler.cpp:72
CetonChannel::m_streamHandler
CetonStreamHandler * m_streamHandler
Definition: cetonchannel.h:55
CetonStreamHandler::Get
static CetonStreamHandler * Get(const QString &devname, int inputid)
Definition: cetonstreamhandler.cpp:39
LOC
#define LOC
-*- Mode: c++ -*- CetonChannel Copyright (c) 2011 Ronald Frazier Copyright (c) 2006-2009 by Silicondu...
Definition: cetonchannel.cpp:17
DTVMultiplex::m_sistandard
QString m_sistandard
Definition: dtvmultiplex.h:111
ChannelBase::GetInputID
virtual int GetInputID(void) const
Definition: channelbase.h:67
CetonStreamHandler::TuneFrequency
bool TuneFrequency(uint frequency, const QString &modulation)
Definition: cetonstreamhandler.cpp:311
DTVModulation::kModulation8VSB
@ kModulation8VSB
Definition: dtvconfparserhelpers.h:365
DTVMultiplex::m_modulation
DTVModulation m_modulation
Definition: dtvmultiplex.h:100
DTVTunerType::kTunerTypeATSC
static const int kTunerTypeATSC
Definition: dtvconfparserhelpers.h:98
CetonChannel::SetChannelByString
bool SetChannelByString(const QString &channum) override
Definition: cetonchannel.cpp:102
CetonChannel::m_tunerTypes
std::vector< DTVTunerType > m_tunerTypes
Definition: cetonchannel.h:56
ChannelBase::InitializeInput
virtual bool InitializeInput(void)
Fills in input map from DB.
Definition: channelbase.cpp:548
DTVModulation::kModulationQAM64
@ kModulationQAM64
Definition: dtvconfparserhelpers.h:361
CetonChannel::Open
bool Open(void) override
Opens the channel changing hardware for use.
Definition: cetonchannel.cpp:24
videosource.h
CetonChannel::EnterPowerSavingMode
bool EnterPowerSavingMode(void) override
Enters power saving mode if the card supports it.
Definition: cetonchannel.cpp:55