12 #include <QCoreApplication>
50 friend class TestEITFixups;
57 static uint CreateMultiplex(
58 int sourceid,
const QString& sistandard,
59 uint64_t frequency,
const QString& modulation,
60 int transport_id = -1,
int network_id = -1);
62 static uint CreateMultiplex(
63 int sourceid,
const QString& sistandard,
64 uint64_t frequency,
const QString& modulation,
66 int transport_id,
int network_id,
67 int symbol_rate,
signed char bandwidth,
68 signed char polarity,
signed char inversion,
69 signed char trans_mode,
70 const QString& inner_FEC,
const QString& constellation,
71 signed char hierarchy,
const QString& hp_code_rate,
72 const QString& lp_code_rate,
const QString& guard_interval,
73 const QString& mod_sys,
const QString& rolloff);
76 int transport_id,
int network_id);
78 static std::vector<uint> CreateMultiplexes(
81 static uint GetMplexID(
uint sourceid,
const QString &channum);
82 static int GetMplexID(
uint sourceid, uint64_t frequency);
83 static int GetMplexID(
uint sourceid, uint64_t frequency,
85 static int GetMplexID(
uint sourceid,
88 static int GetBetterMplexID(
int current_mplexid,
89 int transport_id,
int network_id);
91 static bool GetTuningParams(
uint mplexid,
94 uint &dvb_transportid,
98 static bool GetATSCChannel(
uint sourceid,
const QString &channum,
104 GetATSCChannel(sourceid, channum, m1,m2);
109 static int CreateChanID(
uint sourceid,
const QString &chan_num);
111 static bool CreateChannel(
uint db_mplexid,
114 const QString &callsign,
115 const QString &service_name,
116 const QString &chan_num,
118 uint atsc_major_channel,
119 uint atsc_minor_channel,
120 bool use_on_air_guide,
122 const QString &freqid,
123 const QString& icon = QString(),
124 QString format =
"Default",
125 const QString& xmltvid = QString(),
126 const QString& default_authority = QString(),
127 uint service_type = 0,
130 int commMethod = -1);
132 static bool UpdateChannel(
uint db_mplexid,
135 const QString &callsign,
136 const QString &service_name,
137 const QString &chan_num,
139 uint atsc_major_channel,
140 uint atsc_minor_channel,
141 bool use_on_air_guide,
143 const QString& freqid = QString(),
144 const QString& icon = QString(),
145 QString format = QString(),
146 const QString& xmltvid = QString(),
147 const QString& default_authority = QString(),
148 uint service_type = 0,
151 int recpriority = INT_MIN,
152 int tmOffset = INT_MIN,
153 int commMethod = INT_MIN);
158 return UpdateIPTVTuningData(channel_id, tuning);
161 static bool UpdateIPTVTuningData(
167 static bool DeleteChannel(
uint channel_id);
171 static bool SetServiceVersion(
int mplexid,
int version);
173 static int GetChanID(
int db_mplexid,
int service_transport_id,
174 int major_channel,
int minor_channel,
177 static int GetServiceVersion(
int mplexid);
180 static QString GetDefaultAuthority(
uint chanid);
181 static QString GetIcon(
uint chanid);
182 static std::vector<uint> GetInputIDs(
uint chanid);
183 static QString GetUnknownCallsign(
void);
184 static uint FindChannel(
uint sourceid,
const QString &freqid);
186 {
return GetChannelValueInt(
"chanid", sourceid, channum); }
187 static bool GetChannelData(
189 uint &chanid,
const QString &channum,
190 QString &tvformat, QString &modulation,
191 QString &freqtable, QString &freqid,
192 int &finetune, uint64_t &frequency,
193 QString &dtv_si_std,
int &mpeg_prog_num,
195 uint &dvb_transportid,
uint &dvb_networkid,
196 uint &mplexid,
bool &commfree);
198 {
return GetChannelValueInt(
"serviceid", sourceid, channum); }
200 {
return GetChannelValueStr(
"videofilters", sourceid, channum); }
237 uint &totalAvailable,
238 bool ignoreHidden =
true,
239 OrderBy orderBy = kChanOrderByChanNum,
240 GroupBy groupBy = kChanGroupByChanid,
242 uint channelGroupID = 0,
243 bool liveTVOnly =
false,
244 const QString& callsign =
"",
245 const QString& channum =
"",
246 bool ignoreUntunable =
true);
252 uint sourceid,
bool visible_only,
253 const QString &group_by = QString(),
uint channel_groupid = 0)
255 return GetChannelsInternal(sourceid, visible_only,
false,
256 group_by, channel_groupid);
266 return GetChannelsInternal(sourceid,
false,
true, QString(), 0);
268 static std::vector<uint> GetChanIDs(
int sourceid = -1,
bool onlyVisible =
false);
269 static uint GetChannelCount(
int sourceid = -1);
271 bool eliminate_duplicates =
false);
273 const QString &channum);
277 uint mplexid_restriction,
278 uint chanid_restriction,
280 bool skip_non_visible =
true,
281 bool skip_same_channum_and_callsign =
false,
282 bool skip_other_sources =
false);
284 static QString GetChannelValueStr(
const QString &channel_field,
286 const QString &channum);
288 static int GetChannelValueInt(
const QString &channel_field,
290 const QString &channum);
292 static QString GetChannelNumber(
uint sourceid,
293 const QString &channel_name);
295 static bool IsOnSameMultiplex(
uint srcid,
296 const QString &new_channum,
297 const QString &old_channum);
299 static QStringList GetValidRecorderList(
uint chanid,
300 const QString &channum);
303 uint sourceid = 0,
uint excluded_chanid = 0)
305 std::vector<uint> chanids = GetConflicting(channum, sourceid);
306 return (chanids.size() > 1) ||
307 ((1 == chanids.size()) && (chanids[0] != excluded_chanid));
310 static std::vector<uint> GetConflicting(
const QString &channum,
317 static QString GetChanNum(
int chan_id);
323 static std::chrono::minutes GetTimeOffset(
int chan_id);
324 static int GetSourceID(
int mplexid);
325 static uint GetSourceIDForChannel(
uint chanid);
327 static QStringList GetInputTypes(
uint chanid);
332 static bool SetChannelValue(
const QString &field_name,
333 const QString& value,
335 const QString &channum);
337 static bool SetChannelValue(
const QString &field_name,
338 const QString& value,
341 static bool SaveCachedPids(
uint chanid,
343 bool delete_all =
false);
352 uint sourceid,
bool visible_only,
bool include_disconnected,
353 const QString &group_by,
uint channel_groupid);
354 static QString GetChannelStringField(
int chan_id,
const QString &field);