MythTV  master
asichannel.cpp
Go to the documentation of this file.
1 
5 // C/C++ includes
6 #include <utility>
7 
8 // MythTV includes
9 #include "mythlogging.h"
10 #include "mpegtables.h"
11 #include "asichannel.h"
12 
13 #define LOC QString("ASIChan[%1](%2): ").arg(GetInputID()).arg(ASIChannel::GetDevice())
14 
15 ASIChannel::ASIChannel(TVRec *parent, QString device) :
16  DTVChannel(parent), m_device(std::move(device))
17 {
19 }
20 
22 {
23  if (ASIChannel::IsOpen())
25 }
26 
27 bool ASIChannel::Open(void)
28 {
29  LOG(VB_CHANNEL, LOG_INFO, LOC + "Open()");
30 
31  if (m_device.isEmpty())
32  return false;
33 
34  if (m_isOpen)
35  return true;
36 
37  if (!InitializeInput())
38  return false;
39 
40  if (!m_inputId)
41  return false;
42 
43  m_isOpen = true;
44 
45  return true;
46 }
47 
49 {
50  LOG(VB_CHANNEL, LOG_INFO, LOC + "Close()");
51  m_isOpen = false;
52 }
LOC
#define LOC
-*- Mode: c++ -*- Class ASIChannel
Definition: asichannel.cpp:13
ChannelBase::m_inputId
uint m_inputId
Definition: channelbase.h:137
LOG
#define LOG(_MASK_, _LEVEL_, _QSTRING_)
Definition: mythlogging.h:23
ASIChannel::Open
bool Open(void) override
Opens the channel changing hardware for use.
Definition: asichannel.cpp:27
mythlogging.h
ASIChannel::m_isOpen
bool m_isOpen
Definition: asichannel.h:45
mpegtables.h
ASIChannel::ASIChannel
ASIChannel(TVRec *parent, QString device)
Definition: asichannel.cpp:15
ASIChannel::Close
void Close(void) override
Closes the channel changing hardware to use.
Definition: asichannel.cpp:48
asichannel.h
ASIChannel::~ASIChannel
~ASIChannel(void) override
Definition: asichannel.cpp:21
ASIChannel::m_tunerTypes
vector< DTVTunerType > m_tunerTypes
Definition: asichannel.h:43
TVRec
This is the coordinating class of the Recorder Subsystem.
Definition: tv_rec.h:143
ASIChannel::IsOpen
bool IsOpen(void) const override
Reports whether channel is already open.
Definition: asichannel.h:33
DTVTunerType::kTunerTypeASI
static const int kTunerTypeASI
Definition: dtvconfparserhelpers.h:100
DTVChannel
Class providing a generic interface to digital tuning hardware.
Definition: dtvchannel.h:35
ChannelBase::InitializeInput
virtual bool InitializeInput(void)
Fills in input map from DB.
Definition: channelbase.cpp:547
ASIChannel::m_device
QString m_device
Definition: asichannel.h:44