00001 #ifndef DB_CHANNEL_INFO_H_
00002 #define DB_CHANNEL_INFO_H_
00003
00004
00005 #include <stdint.h>
00006
00007
00008 #include <vector>
00009 using namespace std;
00010
00011
00012 #include <QString>
00013 #include <QImage>
00014 #include <QVariant>
00015
00016
00017 #include "mythtvexp.h"
00018 #include "programtypes.h"
00019
00020
00021
00022 class MTV_PUBLIC DBChannel
00023 {
00024 public:
00025 DBChannel(const DBChannel&);
00026 DBChannel(const QString &_channum, const QString &_callsign,
00027 uint _chanid, uint _major_chan, uint _minor_chan,
00028 uint _mplexid, bool _visible,
00029 const QString &_name, const QString &_icon,
00030 uint _sourceid, uint _cardid, uint _grpid);
00031 DBChannel& operator=(const DBChannel&);
00032
00033 bool operator == (uint _chanid) const
00034 { return chanid == _chanid; }
00035
00036 enum ChannelFormat { kChannelShort, kChannelLong };
00037 QString GetFormatted(const ChannelFormat &format) const;
00038 void ToMap(InfoMap &infoMap) const;
00039
00040 public:
00041 QString channum;
00042 QString callsign;
00043 QString name;
00044 QString icon;
00045 uint chanid;
00046 uint major_chan;
00047 uint minor_chan;
00048 uint mplexid;
00049 uint sourceid;
00050 uint cardid;
00051 uint grpid;
00052 bool visible;
00053 };
00054 typedef vector<DBChannel> DBChanList;
00055
00056 class MTV_PUBLIC ChannelInfo
00057 {
00058 public:
00059 ChannelInfo() : chanid(-1), sourceid(-1), favid(-1) {}
00060 enum ChannelFormat { kChannelShort, kChannelLong };
00061 QString GetFormatted(const ChannelFormat &format) const;
00062 void ToMap(InfoMap &infoMap) const;
00063
00064 QString callsign;
00065 QString iconpath;
00066 QString chanstr;
00067 QString channame;
00068 int chanid;
00069 int sourceid;
00070 QString sourcename;
00071 int favid;
00072 QString recpriority;
00073 };
00074
00075 class MTV_PUBLIC ChannelInsertInfo
00076 {
00077 public:
00078 ChannelInsertInfo(void) :
00079 db_mplexid(0), source_id(0), channel_id(0),
00080 callsign(""), service_name(""),
00081 chan_num(""), service_id(0),
00082 atsc_major_channel(0), atsc_minor_channel(0),
00083 use_on_air_guide(false),
00084 hidden(false), hidden_in_guide(false),
00085 freqid(""), icon(""),
00086 format(""), xmltvid(""),
00087 default_authority(""),
00088 pat_tsid(0), vct_tsid(0), vct_chan_tsid(0), sdt_tsid(0),
00089 orig_netid(0), netid(0),
00090 si_standard(""),
00091 in_channels_conf(false),
00092 in_pat(false), in_pmt(false),
00093 in_vct(false),
00094 in_nit(false), in_sdt(false),
00095 is_encrypted(false),
00096 is_data_service(false), is_audio_service(false),
00097 is_opencable(false), could_be_opencable(false),
00098 decryption_status(0) { }
00099
00100 ChannelInsertInfo(
00101 uint _db_mplexid, uint _source_id,
00102 uint _channel_id, QString _callsign,
00103 QString _service_name, QString _chan_num,
00104 uint _service_id,
00105
00106 uint _atsc_major_channel, uint _atsc_minor_channel,
00107 bool _use_on_air_guide, bool _hidden,
00108 bool _hidden_in_guide,
00109
00110 QString _freqid, QString _icon,
00111 QString _format, QString _xmltvid,
00112
00113 uint _pat_tsid, uint _vct_tsid,
00114 uint _vct_chan_tsid, uint _sdt_tsid,
00115
00116 uint _orig_netid, uint _netid,
00117
00118 QString _si_standard,
00119
00120 bool _in_channels_conf, bool _in_pat,
00121 bool _in_pmt, bool _in_vct,
00122 bool _in_nit, bool _in_sdt,
00123
00124 bool _is_encrypted, bool _is_data_service,
00125 bool _is_audio_service, bool _is_opencable,
00126 bool _could_be_opencable, int _decryption_status,
00127 QString _default_authority);
00128
00129 ChannelInsertInfo(const ChannelInsertInfo &other) { (*this = other); }
00130 ChannelInsertInfo &operator=(const ChannelInsertInfo &other);
00131
00132 bool IsSameChannel(const ChannelInsertInfo&) const;
00133
00134 bool SaveScan(uint scanid, uint transportid) const;
00135
00136 void ImportExtraInfo(const ChannelInsertInfo &other);
00137
00138 public:
00139 uint db_mplexid;
00140 uint source_id;
00141 uint channel_id;
00142 QString callsign;
00143 QString service_name;
00144 QString chan_num;
00145 uint service_id;
00146 uint atsc_major_channel;
00147 uint atsc_minor_channel;
00148 bool use_on_air_guide;
00149 bool hidden;
00150 bool hidden_in_guide;
00151 QString freqid;
00152 QString icon;
00153 QString format;
00154 QString xmltvid;
00155 QString default_authority;
00156
00157
00158 uint pat_tsid;
00159 uint vct_tsid;
00160 uint vct_chan_tsid;
00161 uint sdt_tsid;
00162 uint orig_netid;
00163 uint netid;
00164 QString si_standard;
00165 bool in_channels_conf;
00166 bool in_pat;
00167 bool in_pmt;
00168 bool in_vct;
00169 bool in_nit;
00170 bool in_sdt;
00171 bool is_encrypted;
00172 bool is_data_service;
00173 bool is_audio_service;
00174 bool is_opencable;
00175 bool could_be_opencable;
00176 int decryption_status;
00177 };
00178 typedef vector<ChannelInsertInfo> ChannelInsertInfoList;
00179
00180 Q_DECLARE_METATYPE(ChannelInfo*)
00181
00182 #endif // DB_CHANNEL_INFO_H_