00001
00002 #ifndef _INPUTINFO_H_
00003 #define _INPUTINFO_H_
00004
00005
00006 #include <qstringlist.h>
00007 #include <qmap.h>
00008
00009
00010 #include "channelutil.h"
00011
00012 class MPUBLIC InputInfo
00013 {
00014 public:
00015 InputInfo() : name(QString::null),
00016 sourceid(0), inputid(0), cardid(0), mplexid(0) {}
00017 InputInfo(const QString &name,
00018 uint sourceid, uint inputid, uint cardid, uint mplexid);
00019 InputInfo(const InputInfo &other);
00020 InputInfo &operator=(const InputInfo &other);
00021 virtual ~InputInfo() {}
00022
00023 virtual bool FromStringList(QStringList::const_iterator &it,
00024 QStringList::const_iterator end);
00025 virtual void ToStringList(QStringList &list) const;
00026
00027 virtual void Clear(void);
00028 virtual bool IsEmpty(void) const { return name.isEmpty(); }
00029
00030 bool operator == (uint _inputid) const
00031 { return inputid == _inputid; }
00032
00033 bool operator == (const QString &_name) const
00034 { return name == _name; }
00035
00036 public:
00037 QString name;
00038 uint sourceid;
00039 uint inputid;
00040 uint cardid;
00041 uint mplexid;
00042 };
00043
00044 class MPUBLIC TunedInputInfo : public InputInfo
00045 {
00046 public:
00047 TunedInputInfo() : chanid(0) { }
00048 TunedInputInfo(const QString &name,
00049 uint _sourceid, uint _inputid,
00050 uint _cardid, uint _mplexid, uint _chanid);
00051 TunedInputInfo(const TunedInputInfo &other);
00052 TunedInputInfo &operator=(const TunedInputInfo &other);
00053 virtual ~TunedInputInfo() {}
00054
00055 virtual bool FromStringList(QStringList::const_iterator &it,
00056 QStringList::const_iterator end);
00057 virtual void ToStringList(QStringList &list) const;
00058
00059 virtual void Clear(void);
00060
00061 public:
00062 uint chanid;
00063 };
00064
00065 class MPUBLIC ChannelInputInfo : public InputInfo
00066 {
00067 public:
00068 ChannelInputInfo() :
00069 startChanNum(QString::null), tuneToChannel(QString::null),
00070 externalChanger(QString::null),
00071 inputNumV4L(-1),
00072 videoModeV4L1(0), videoModeV4L2(0) {}
00073 ChannelInputInfo(QString _name, QString _startChanNum,
00074 QString _tuneToChannel, QString _externalChanger,
00075 uint _sourceid, uint _cardid,
00076 uint _inputid, uint _mplexid,
00077 const DBChanList &_channels) :
00078 InputInfo(_name, _sourceid, _inputid, _cardid, _mplexid),
00079 startChanNum(_startChanNum),
00080 tuneToChannel(_tuneToChannel), externalChanger(_externalChanger),
00081 channels(_channels),
00082 inputNumV4L(-1),
00083 videoModeV4L1(0), videoModeV4L2(0) {}
00084 ChannelInputInfo(const ChannelInputInfo &other);
00085 ChannelInputInfo &operator=(const ChannelInputInfo &other);
00086 virtual ~ChannelInputInfo() {}
00087
00088 virtual void Clear(void);
00089
00090 public:
00091 QString startChanNum;
00092 QString tuneToChannel;
00093 QString externalChanger;
00094 DBChanList channels;
00095 vector<uint> groups;
00096 int inputNumV4L;
00097 int videoModeV4L1;
00098 int videoModeV4L2;
00099 };
00100 typedef QMap<uint, ChannelInputInfo*> InputMap;
00101
00102 #endif // _INPUTINFO_H_