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