MythTV  master
inputinfo.cpp
Go to the documentation of this file.
1 // -*- Mode: c++ -*-
2 
3 // MythTV headers
4 #include "inputinfo.h"
5 
6 void InputInfo::Clear(void)
7 {
8  InputInfo blank;
9  *this = blank;
10 }
11 
12 // NOLINTNEXTLINE(cppcoreguidelines-macro-usage)
13 #define NEXT() do { ++it; if (it == end) return false; } while (false)
14 bool InputInfo::FromStringList(QStringList::const_iterator &it,
15  const QStringList::const_iterator& end)
16 {
17  if (it == end)
18  return false;
19 
20  m_name = *it;
21  m_name = (m_name == "<EMPTY>") ? QString() : m_name;
22  NEXT();
23 
24  m_sourceId = (*it).toUInt(); NEXT();
25  m_inputId = (*it).toUInt(); NEXT();
26  m_mplexId = (*it).toUInt(); NEXT();
27  m_liveTvOrder = (*it).toUInt(); NEXT();
28 
29  m_displayName = *it;
30  m_displayName = (m_displayName == "<EMPTY>") ? QString() : m_displayName;
31  NEXT();
32 
33  m_recPriority = (*it).toInt(); NEXT();
34  m_scheduleOrder = (*it).toUInt(); NEXT();
35  m_quickTune = ((*it).toUInt() != 0U); NEXT();
36  m_chanId = (*it).toUInt(); ++it;
37 
38  return true;
39 }
40 #undef NEXT
41 
42 void InputInfo::ToStringList(QStringList &list) const
43 {
44  list.push_back(m_name.isEmpty() ? "<EMPTY>" : m_name);
45  list.push_back(QString::number(m_sourceId));
46  list.push_back(QString::number(m_inputId));
47  list.push_back(QString::number(m_mplexId));
48  list.push_back(QString::number(m_liveTvOrder));
49  list.push_back(m_displayName.isEmpty() ? "<EMPTY>" : m_displayName);
50  list.push_back(QString::number(m_recPriority));
51  list.push_back(QString::number(m_scheduleOrder));
52  list.push_back(QString::number(static_cast<int>(m_quickTune)));
53  list.push_back(QString::number(m_chanId));
54 }
55 
NEXT
#define NEXT()
Definition: inputinfo.cpp:13
InputInfo::m_chanId
uint m_chanId
chanid restriction if applicable
Definition: inputinfo.h:51
InputInfo::m_recPriority
int m_recPriority
Definition: inputinfo.h:53
InputInfo::m_liveTvOrder
uint m_liveTvOrder
order for live TV use
Definition: inputinfo.h:55
InputInfo::ToStringList
virtual void ToStringList(QStringList &list) const
Definition: inputinfo.cpp:42
InputInfo::Clear
virtual void Clear(void)
Definition: inputinfo.cpp:6
InputInfo::m_inputId
uint m_inputId
unique key in DB for this input
Definition: inputinfo.h:49
InputInfo::m_quickTune
bool m_quickTune
Definition: inputinfo.h:56
InputInfo::m_scheduleOrder
uint m_scheduleOrder
Definition: inputinfo.h:54
InputInfo::m_sourceId
uint m_sourceId
associated channel listings source
Definition: inputinfo.h:48
inputinfo.h
InputInfo
Definition: inputinfo.h:14
InputInfo::m_displayName
QString m_displayName
Definition: inputinfo.h:52
InputInfo::m_mplexId
uint m_mplexId
mplexid restriction if applicable
Definition: inputinfo.h:50
InputInfo::m_name
QString m_name
input name
Definition: inputinfo.h:47
InputInfo::FromStringList
virtual bool FromStringList(QStringList::const_iterator &it, const QStringList::const_iterator &end)
Definition: inputinfo.cpp:14