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 #define NEXT() do { ++it; if (it == end) return false; } while (false)
13 bool InputInfo::FromStringList(QStringList::const_iterator &it,
14  const QStringList::const_iterator& end)
15 {
16  if (it == end)
17  return false;
18 
19  m_name = *it;
20  m_name = (m_name == "<EMPTY>") ? QString() : m_name;
21  NEXT();
22 
23  m_sourceid = (*it).toUInt(); NEXT();
24  m_inputid = (*it).toUInt(); NEXT();
25  m_mplexid = (*it).toUInt(); NEXT();
26  m_livetvorder = (*it).toUInt(); NEXT();
27 
28  m_displayName = *it;
29  m_displayName = (m_displayName == "<EMPTY>") ? QString() : m_displayName;
30  NEXT();
31 
32  m_recPriority = (*it).toInt(); NEXT();
33  m_scheduleOrder = (*it).toUInt(); NEXT();
34  m_quickTune = ((*it).toUInt() != 0U); NEXT();
35  m_chanid = (*it).toUInt(); ++it;
36 
37  return true;
38 }
39 #undef NEXT
40 
41 void InputInfo::ToStringList(QStringList &list) const
42 {
43  list.push_back(m_name.isEmpty() ? "<EMPTY>" : m_name);
44  list.push_back(QString::number(m_sourceid));
45  list.push_back(QString::number(m_inputid));
46  list.push_back(QString::number(m_mplexid));
47  list.push_back(QString::number(m_livetvorder));
48  list.push_back(m_displayName.isEmpty() ? "<EMPTY>" : m_displayName);
49  list.push_back(QString::number(m_recPriority));
50  list.push_back(QString::number(m_scheduleOrder));
51  list.push_back(QString::number(m_quickTune));
52  list.push_back(QString::number(m_chanid));
53 }
54 
QString m_displayName
Definition: inputinfo.h:74
uint m_livetvorder
order for live TV use
Definition: inputinfo.h:77
uint m_inputid
unique key in DB for this input
Definition: inputinfo.h:71
uint m_mplexid
mplexid restriction if applicable
Definition: inputinfo.h:72
virtual void Clear(void)
Definition: inputinfo.cpp:6
virtual bool FromStringList(QStringList::const_iterator &it, const QStringList::const_iterator &end)
Definition: inputinfo.cpp:13
#define NEXT()
Definition: inputinfo.cpp:12
int m_recPriority
Definition: inputinfo.h:75
QString m_name
input name
Definition: inputinfo.h:69
uint m_chanid
chanid restriction if applicable
Definition: inputinfo.h:73
uint m_sourceid
associated channel listings source
Definition: inputinfo.h:70
bool m_quickTune
Definition: inputinfo.h:78
virtual void ToStringList(QStringList &list) const
Definition: inputinfo.cpp:41
uint m_scheduleOrder
Definition: inputinfo.h:76