5 #include <QCoreApplication>
20 QString fieldTag = (
":WHERE" +
m_id.
getField().toUpper());
52 setLabel(QCoreApplication::translate(
"(Common)",
"Channel Name"));
62 setLabel(QCoreApplication::translate(
"(Common)",
"Channel Number"));
64 "This is the number by which the channel is known to MythTV."));
75 setLabel(QCoreApplication::translate(
"(Common)",
"Video Source"));
77 "It is NOT a good idea to change this value as it only changes "
78 "the sourceid in table channel but not in dtv_multiplex. "
79 "The sourceid in dtv_multiplex cannot and should not be changed."));
97 addSelection(QCoreApplication::translate(
"(ChannelSettings)",
98 "[Not Selected]"),
"0");
103 "ORDER BY sourceid");
133 setLabel(QCoreApplication::translate(
"(Common)",
"Callsign"));
140 setLabel(QCoreApplication::translate(
"(ChannelSettings)",
"TV Format"));
141 setHelpText(QCoreApplication::translate(
"(ChannelSettings)",
142 "If this channel uses a format other than TV Format in the General "
143 "Backend Setup screen, set it here."));
145 addSelection(QCoreApplication::translate(
"(Common)",
"Default"),
"Default");
148 for (
int i = 0; i < list.size(); i++)
156 list.push_back(
"NTSC");
157 list.push_back(
"NTSC-JP");
158 list.push_back(
"PAL");
159 list.push_back(
"PAL-60");
160 list.push_back(
"PAL-BG");
161 list.push_back(
"PAL-DK");
162 list.push_back(
"PAL-D");
163 list.push_back(
"PAL-I");
164 list.push_back(
"PAL-M");
165 list.push_back(
"PAL-N");
166 list.push_back(
"PAL-NC");
167 list.push_back(
"SECAM");
168 list.push_back(
"SECAM-D");
169 list.push_back(
"SECAM-DK");
181 setLabel(QCoreApplication::translate(
"(ChannelSettings)",
182 "DataDirect Time Offset"));
184 setHelpText(QCoreApplication::translate(
"(ChannelSettings)",
185 "Offset (in minutes) to apply to the program guide data during "
186 "import. This can be used when the listings for a particular "
187 "channel are in a different time zone."));
198 setLabel(QCoreApplication::translate(
"(ChannelSettings)",
"Priority"));
200 setHelpText(QCoreApplication::translate(
"(ChannelSettings)",
201 "Number of priority points to be added to any recording on this "
202 "channel during scheduling. Use a positive number as the priority "
203 "if you want this to be a preferred channel, a negative one to "
204 "depreciate this channel."));
214 setLabel(QCoreApplication::translate(
"(ChannelSettings)",
"Icon"));
216 setHelpText(QCoreApplication::translate(
"(ChannelSettings)",
217 "Image file to use as the icon for this channel on various MythTV "
228 setLabel(QCoreApplication::translate(
"(ChannelSettings)",
231 setHelpText(QCoreApplication::translate(
"(ChannelSettings)",
232 "Filters to be used when recording from this channel. Not used "
233 "with hardware encoding cards."));
245 setLabel(QCoreApplication::translate(
"(ChannelSettings)",
246 "Playback filters"));
248 setHelpText(QCoreApplication::translate(
"(ChannelSettings)",
249 "Filters to be used when recordings from this channel are viewed. "
250 "Start with a plus to append to the global playback filters."));
261 setLabel(QCoreApplication::translate(
"(Common)",
"XMLTV ID"));
263 setHelpText(QCoreApplication::translate(
"(ChannelSettings)",
264 "ID used by listing services to get an exact correspondence "
265 "between a channel in your line-up and a channel in their "
266 "database. Normally this is set automatically when "
267 "'mythfilldatabase' is run."));
282 if (QFile::exists(xmltvFile))
284 QFile
file(xmltvFile);
285 if (!
file.open(QIODevice::ReadOnly | QIODevice::Text))
290 while (!
file.atEnd())
292 QByteArray line =
file.readLine();
294 if (line.startsWith(
"channel="))
296 QString
id = line.mid(8, -1).trimmed();
303 for (
int x = 0; x < idList.size(); x++)
317 -1, UINT16_MAX, 1, 1,
"NULL")
319 setLabel(QCoreApplication::translate(
"(ChannelSettings)",
"Service ID"));
321 setHelpText(QCoreApplication::translate(
"(ChannelSettings)",
322 "Service ID (Program Number) of desired channel within the transport stream. "
323 "If there is only one channel, then setting this to anything will still find it."));
348 setLabel(QObject::tr(
"Transport ID"));
350 QObject::tr(
"The transport stream ID (tid) can be used to identify "
351 "the transport of this channel in the Transport Editor."));
363 QObject::tr(
"Frequency of the transport of this channel in Hz for "
364 "DVB-T/T2/C or in kHz plus polarization H or V for DVB-S/S2."));
374 setLabel(QCoreApplication::translate(
"(ChannelSettings)",
375 "Commercial Detection Method"));
377 setHelpText(QCoreApplication::translate(
"(ChannelSettings)",
378 "Changes the method of commercial detection used for recordings on "
379 "this channel or skips detection by marking the channel as "
380 "Commercial Free."));
399 setLabel(QCoreApplication::translate(
"(ChannelSettings)",
"Visible"));
401 setHelpText(QCoreApplication::translate(
"(ChannelSettings)",
402 "If set to Always Visible or Visible, the channel will be visible in the "
403 "EPG. Set to Always Visible or Never Visible to prevent MythTV and other "
404 "utilities from automatically managing the value for this "
407 addSelection(QCoreApplication::translate(
"(Common)",
"Always Visible"),
409 addSelection(QCoreApplication::translate(
"(Common)",
"Visible"),
411 addSelection(QCoreApplication::translate(
"(Common)",
"Not Visible"),
413 addSelection(QCoreApplication::translate(
"(Common)",
"Never Visible"),
424 setLabel(QCoreApplication::translate(
"(ChannelSettings)",
425 "Use on air guide"));
427 setHelpText(QCoreApplication::translate(
"(ChannelSettings)",
428 "If enabled, guide information for this channel will be updated "
429 "using 'Over-the-Air' program listings."));
443 setLabel(QCoreApplication::translate(
"(ChannelSettings)",
445 setHelpText(QCoreApplication::translate(
"(ChannelSettings)",
446 "N.B. This setting is only used for analog channels. "
447 "Depending on the tuner type, specify either the exact "
448 "frequency (in kHz) or a valid channel "
449 "number that will be understood by your tuners."));
460 setLabel(QCoreApplication::translate(
"(ChannelSettings)",
463 setHelpText(QCoreApplication::translate(
"(ChannelSettings)",
464 "Value to be added to your desired frequency (in kHz) for "
478 setLabel(QCoreApplication::translate(
"(Common)",
"Contrast"));
489 setLabel(QCoreApplication::translate(
"(Common)",
"Brightness"));
500 setLabel(QCoreApplication::translate(
"(Common)",
"Color"));
511 setLabel(QCoreApplication::translate(
"(Common)",
"Hue"));
516 uint default_sourceid,
bool add_freqid)
518 setLabel(QCoreApplication::translate(
"(ChannelSettings)",
519 "Channel Options - Common"));
522 auto *source =
new Source(
id, default_sourceid);
524 auto *channum =
new Channum(
id);
562 "SELECT transportid, frequency, polarity, mod_sys FROM dtv_multiplex "
563 "JOIN channel ON channel.mplexid = dtv_multiplex.mplexid "
564 "WHERE channel.chanid = :CHANID");
574 QString frequency =
query.
value(1).toString();
580 QString polarization =
query.
value(2).toString().toUpper();
581 frequency.append(polarization);
595 bool supports_eit =
true;
596 bool uses_eit_only =
false;
600 "FROM capturecard, videosource "
601 "WHERE capturecard.sourceid = videosource.sourceid AND "
602 " videosource.sourceid = :SOURCEID");
618 "WHERE sourceid = :SOURCEID");
628 uses_eit_only &= (
query.
value(0).toString() ==
"eitonly");
640 setLabel(QCoreApplication::translate(
"(ChannelSettings)",
641 "Channel Options - Filters"));
649 setLabel(QCoreApplication::translate(
"(ChannelSettings)",
650 "Channel Options - Video4Linux"));
667 setLabel(QCoreApplication::translate(
"(ChannelSettings)",
668 "Channel Options - Raw Transport Stream"));
675 for (
uint i = 0; i < mx; i++)
678 m_pids[i]->setLabel(
"PID");
680 m_sids[i]->setLabel(
" StreamID");
681 for (
uint j = 0x101; j <= 0x1ff; j++)
688 .
arg(desc).
arg(j&0xff,2,16,QLatin1Char(
'0')),
689 QString::number(j),
false);
692 for (
uint j = 0x101; j <= 0x1ff; j++)
698 QString(
"0x%1").
arg(j&0xff,2,16,QLatin1Char(
'0')),
699 QString::number(j),
false);
716 m_pcrs[i]->setLabel(
" Is PCR");
728 auto it = pid_cache.begin();
729 for (
uint i = 0; i <
kMaxPIDs && it != pid_cache.end(); )
731 if (!(it->IsPermanent()))
737 m_pids[i]->setValue(QString(
"0x%1")
738 .
arg(it->GetPID(),2,16,QLatin1Char(
'0')));
739 m_sids[i]->setValue(QString::number(it->GetComposite()&0x1ff));
740 m_pcrs[i]->setValue(it->IsPCRPID());
755 uint pid =
m_pids[i]->getValue().toUInt(&ok, 0);