00001
00002
00003
00004 #include <qdeepcopy.h>
00005
00006
00007 #include "inputinfo.h"
00008
00009 InputInfo::InputInfo(
00010 const QString &_name,
00011 uint _sourceid, uint _inputid, uint _cardid, uint _mplexid) :
00012 name(QDeepCopy<QString>(_name)),
00013 sourceid(_sourceid),
00014 inputid(_inputid),
00015 cardid(_cardid),
00016 mplexid(_mplexid)
00017 {
00018 }
00019
00020 InputInfo::InputInfo(const InputInfo &other) :
00021 name(QDeepCopy<QString>(other.name)),
00022 sourceid(other.sourceid),
00023 inputid(other.inputid),
00024 cardid(other.cardid),
00025 mplexid(other.mplexid)
00026 {
00027 }
00028
00029 InputInfo &InputInfo::operator=(const InputInfo &other)
00030 {
00031 name = QDeepCopy<QString>(other.name);
00032 sourceid = other.sourceid;
00033 inputid = other.inputid;
00034 cardid = other.cardid;
00035 mplexid = other.mplexid;
00036 return *this;
00037 }
00038
00039 void InputInfo::Clear(void)
00040 {
00041 InputInfo blank;
00042 *this = blank;
00043 }
00044
00045 #define NEXT() do { ++it; if (it == end) return false; } while (0)
00046 bool InputInfo::FromStringList(QStringList::const_iterator &it,
00047 QStringList::const_iterator end)
00048 {
00049 if (it == end)
00050 return false;
00051
00052 name = QDeepCopy<QString>(*it);
00053 name = (name == "<EMPTY>") ? QString::null : name;
00054 NEXT();
00055
00056 sourceid = (*it).toUInt(); NEXT();
00057 inputid = (*it).toUInt(); NEXT();
00058 cardid = (*it).toUInt(); NEXT();
00059 mplexid = (*it).toUInt(); ++it;
00060
00061 return true;
00062 }
00063 #undef NEXT
00064
00065 void InputInfo::ToStringList(QStringList &list) const
00066 {
00067 list.push_back(name.isEmpty() ? "<EMPTY>" : name);
00068 list.push_back(QString::number(sourceid));
00069 list.push_back(QString::number(inputid));
00070 list.push_back(QString::number(cardid));
00071 list.push_back(QString::number(mplexid));
00072 }
00073
00074 TunedInputInfo::TunedInputInfo(
00075 const QString &_name,
00076 uint _sourceid, uint _inputid, uint _cardid, uint _mplexid, uint _chanid) :
00077 InputInfo(_name, _sourceid, _inputid, _cardid, _mplexid), chanid(_chanid)
00078 {
00079 }
00080
00081 TunedInputInfo::TunedInputInfo(const TunedInputInfo &other) :
00082 InputInfo(other), chanid(other.chanid)
00083 {
00084 }
00085
00086 TunedInputInfo &TunedInputInfo::operator=(const TunedInputInfo &other)
00087 {
00088 *((InputInfo*)this) = other;
00089 chanid = other.chanid;
00090 return *this;
00091 }
00092
00093 void TunedInputInfo::Clear(void)
00094 {
00095 TunedInputInfo blank;
00096 *this = blank;
00097 }
00098
00099 bool TunedInputInfo::FromStringList(QStringList::const_iterator &it,
00100 QStringList::const_iterator end)
00101 {
00102 if (!InputInfo::FromStringList(it, end) || (it == end))
00103 return false;
00104
00105 chanid = (*it).toUInt();
00106 ++it;
00107 return true;
00108 }
00109
00110 void TunedInputInfo::ToStringList(QStringList &list) const
00111 {
00112 InputInfo::ToStringList(list);
00113 list.push_back(QString::number(chanid));
00114 }
00115
00116 ChannelInputInfo::ChannelInputInfo(const ChannelInputInfo &other) :
00117 InputInfo(*this),
00118 startChanNum(QDeepCopy<QString>(other.startChanNum)),
00119 tuneToChannel(QDeepCopy<QString>(other.tuneToChannel)),
00120 externalChanger(QDeepCopy<QString>(other.externalChanger)),
00121 channels(other.channels),
00122 inputNumV4L(other.inputNumV4L),
00123 videoModeV4L1(other.videoModeV4L1),
00124 videoModeV4L2(other.videoModeV4L2)
00125 {
00126 }
00127
00128 ChannelInputInfo &ChannelInputInfo::operator=(const ChannelInputInfo &other)
00129 {
00130 *((InputInfo*)this) = other;
00131
00132 startChanNum = QDeepCopy<QString>(other.startChanNum);
00133 tuneToChannel = QDeepCopy<QString>(other.tuneToChannel);
00134 externalChanger = QDeepCopy<QString>(other.externalChanger);
00135 channels = other.channels;
00136 inputNumV4L = other.inputNumV4L;
00137 videoModeV4L1 = other.videoModeV4L1;
00138 videoModeV4L2 = other.videoModeV4L2;
00139
00140 return *this;
00141 }
00142
00143 void ChannelInputInfo::Clear(void)
00144 {
00145 ChannelInputInfo blank;
00146 *this = blank;
00147 }
00148