MythTV  master
frequencytables.cpp
Go to the documentation of this file.
1 #include <utility>
2 
3 #include <QMutex>
4 
5 #include "libmythbase/compat.h"
6 
7 #include "frequencies.h"
8 #include "frequencytables.h"
9 #include "channelutil.h"
10 
11 static bool frequencies_initialized = false;
12 static QMutex frequencies_lock;
14 
15 static void init_freq_tables(freq_table_map_t& /*fmap*/);
17  const QString &format, const QString &modulation, const QString &country);
18 
20 {
21  m_tuning.Clear();
22 }
23 
25  const QString &_si_std,
26  QString _name,
27  uint _mplexid,
28  std::chrono::milliseconds _timeoutTune)
29  : m_mplexid(_mplexid), m_friendlyName(std::move(_name)),
30  m_sourceID(sourceid),
31  m_timeoutTune(_timeoutTune)
32 {
33  m_tuning.Clear();
34  m_tuning.m_sistandard = _si_std;
35 
36  if (_si_std == "analog")
37  {
38  m_tuning.m_sistandard = "analog";
40  }
41 }
42 
44  QString _name,
45  const DTVMultiplex &_tuning,
46  std::chrono::milliseconds _timeoutTune)
47  : m_mplexid(0),
48  m_friendlyName(std::move(_name)),
49  m_sourceID(_sourceid),
50  m_timeoutTune(_timeoutTune),
51  m_tuning(_tuning)
52 {
53 }
54 
56  QString _name,
57  DTVTunerType _tuner_type,
58  const DTVTransport &_tuning,
59  std::chrono::milliseconds _timeoutTune)
60  : m_mplexid(0),
61  m_friendlyName(std::move(_name)),
62  m_sourceID(_sourceid),
63  m_timeoutTune(_timeoutTune),
64  m_expectedChannels(_tuning.channels)
65 {
66  m_tuning.Clear();
67 
69  _tuner_type,
70  QString::number(_tuning.m_frequency), _tuning.m_inversion.toString(),
71  QString::number(_tuning.m_symbolRate), _tuning.m_fec.toString(),
72  _tuning.m_polarity.toString(), _tuning.m_hpCodeRate.toString(),
73  _tuning.m_lpCodeRate.toString(), _tuning.m_modulation.toString(),
74  _tuning.m_transMode.toString(), _tuning.m_guardInterval.toString(),
75  _tuning.m_hierarchy.toString(), _tuning.m_modulation.toString(),
76  _tuning.m_bandwidth.toString(), _tuning.m_modSys.toString(),
77  _tuning.m_rolloff.toString());
78 }
79 
81  const QString &std,
82  QString strFmt,
83  uint freqNum,
84  uint freq,
85  const FrequencyTable &ft,
86  std::chrono::milliseconds timeoutTune)
87  : m_mplexid(0), m_friendlyName(std::move(strFmt)),
88  m_friendlyNum(freqNum), m_sourceID(sourceid),
89  m_timeoutTune(timeoutTune)
90 {
91  m_tuning.Clear();
92 
93  // Setup tuning parameters
95  m_tuning.m_sistandard = "dvb";
97 
98  if (std.toLower() == "atsc")
99  m_tuning.m_sistandard = "atsc";
100  else if (std.toLower() == "analog")
101  {
102  m_tuning.m_sistandard = "analog";
104  }
105 
106  m_freqOffsets[1] = ft.m_offset1;
107  m_freqOffsets[2] = ft.m_offset2;
108 
109  if (std == "dvbt")
110  {
118  }
119  else if (std == "dvbc" || std == "dvbs")
120  {
123  }
124 
125  // Do not use tuning information from database for the "Full Scan"
126  // m_mplexid = GetMultiplexIdFromDB();
127 }
128 
130  QString _name,
131  IPTVTuningData _tuning,
132  QString _channel,
133  std::chrono::milliseconds _timeoutTune) :
134  m_mplexid(0),
135  m_friendlyName(std::move(_name)),
136  m_sourceID(_sourceid),
137  m_timeoutTune(_timeoutTune),
138  m_iptvTuning(std::move(_tuning)), m_iptvChannel(std::move(_channel))
139 {
140  m_tuning.Clear();
141  m_tuning.m_sistandard = "MPEG";
142 }
143 
148 {
149  int mplexid = 0;
150 
151  for (uint i = 0; (i < offset_cnt()) && (mplexid <= 0); i++)
153 
154  return mplexid < 0 ? 0 : mplexid;
155 }
156 
158 {
159  auto freq = (int64_t) m_tuning.m_frequency;
160 
161  return (uint64_t) (freq + m_freqOffsets[i]);
162 }
163 
165 {
166  if (m_tuning.m_sistandard == "MPEG")
167  {
168  return m_iptvChannel + ": " + m_iptvTuning.GetDeviceKey();
169  }
170 
171  QString str = QString("Transport Scan Item '%1' #%2").arg(m_friendlyName).arg(m_friendlyNum);
172  str += "\n\t";
173  str += QString("mplexid(%1) " ).arg(m_mplexid);
174  str += QString("standard(%1) " ).arg(m_tuning.m_sistandard);
175  str += QString("sourceid(%1) " ).arg(m_sourceID);
176  str += QString("useTimer(%1) " ).arg(static_cast<int>(m_useTimer));
177  str += QString("scanning(%1) " ).arg(static_cast<int>(m_scanning));
178  str += QString("timeoutTune(%3 msec) " ).arg(m_timeoutTune.count());
179  str += "\n\t";
180  str += QString("frequency(%1) " ).arg(m_tuning.m_frequency);
181  str += QString("offset[0..2]: %1 %2 %3 ").arg(m_freqOffsets[0]).arg(m_freqOffsets[1]).arg(m_freqOffsets[2]);
182 
183  if (m_tuning.m_sistandard == "atsc" || m_tuning.m_sistandard == "analog")
184  {
185  str += QString("modulation(%1) " ).arg(m_tuning.m_modulation.toString());
186  }
187  else
188  {
189  str += QString("constellation(%1) " ).arg(m_tuning.m_modulation.toString());
190  str += QString("inv(%1) " ).arg(m_tuning.m_inversion.toString());
191  str += QString("bandwidth(%1) " ).arg(m_tuning.m_bandwidth.toString());
192  str += QString("hp(%1) " ).arg(m_tuning.m_hpCodeRate.toString());
193  str += QString("lp(%1) " ).arg(m_tuning.m_lpCodeRate.toString());
194  str += "\n\t";
195  str += QString("trans_mode(%1) " ).arg(m_tuning.m_transMode.toString());
196  str += QString("guard_int(%1) " ).arg(m_tuning.m_guardInterval.toString());
197  str += QString("hierarchy(%1) " ).arg(m_tuning.m_hierarchy.toString());
198  str += QString("symbol_rate(%1) " ).arg(m_tuning.m_symbolRate);
199  str += QString("fec(%1) " ).arg(m_tuning.m_fec.toString());
200  }
201  return str;
202 }
203 
204 static bool init_freq_tables(void)
205 {
207  {
210  }
211  return true;
212 }
213 
215 {
216  QMutexLocker locker(&frequencies_lock);
218  {
219  frequencies.clear();
220  frequencies_initialized = false;
221  }
222  return true;
223 }
224 
226  const QString &format, const QString &modulation, const QString &country)
227 {
228  const freq_table_map_t &fmap = frequencies;
229 
230  freq_table_list_t list;
231 
232  QString lookup = QString("%1_%2_%3%4")
233  .arg(format, modulation, country);
234 
235  freq_table_map_t::const_iterator it = fmap.begin();
236  for (uint i = 0; it != fmap.end(); i++)
237  {
238  it = fmap.find(lookup.arg(i));
239  if (it != fmap.end())
240  list.push_back(*it);
241  }
242 
243  return list;
244 }
245 
247  const QString &format, const QString &modulation, const QString &country)
248 {
249  QMutexLocker locker(&frequencies_lock);
251 
252  freq_table_list_t list =
253  get_matching_freq_tables_internal(format, modulation, country);
254 
255  freq_table_list_t new_list;
256  for (auto & ft : list)
257  new_list.push_back(new FrequencyTable(*ft));
258 
259  return new_list;
260 }
261 
263  const QString& format, const QString& modulation, const QString& country, int freqid)
264 {
265  QMutexLocker locker(&frequencies_lock);
267 
268  freq_table_list_t list =
269  get_matching_freq_tables_internal(format, modulation, country);
270 
271  for (auto & ft : list)
272  {
273  int min_freqid = ft->m_nameOffset;
274  int max_freqid = min_freqid +
275  ((ft->m_frequencyEnd - ft->m_frequencyStart) /
276  ft->m_frequencyStep);
277 
278  if ((min_freqid <= freqid) && (freqid <= max_freqid))
279  return ft->m_frequencyStart +
280  (ft->m_frequencyStep * (freqid - min_freqid));
281  }
282  return -1;
283 }
284 
286  const QString& format, QString modulation, const QString& country, long long centerfreq)
287 {
288  modulation = (modulation == "8vsb") ? "vsb8" : modulation;
289 
290  freq_table_list_t list =
291  get_matching_freq_tables_internal(format, modulation, country);
292 
293  for (auto & ft : list)
294  {
295  int min_freqid = ft->m_nameOffset;
296  int max_freqid = min_freqid +
297  ((ft->m_frequencyEnd - ft->m_frequencyStart) /
298  ft->m_frequencyStep);
299  int freqid =
300  ((centerfreq - ft->m_frequencyStart) /
301  ft->m_frequencyStep) + min_freqid;
302 
303  if ((min_freqid <= freqid) && (freqid <= max_freqid))
304  return freqid;
305  }
306 #if 0
307  LOG(VB_GENERAL, LOG_DEBUG,
308  QString("get_closest_freqid(%1, %2, %3, %4) Failed sz(%5)")
309  .arg(format) .arg(modulation) .arg(country) .arg(centerfreq)
310  .arg(list.size()));
311 #endif
312  return -1;
313 }
314 
315 
316 //NOLINTNEXTLINE(cppcoreguidelines-macro-usage)
317 #define FREQ(A,B, C,D, E,F,G, H, I) \
318  fmap[QString("atsc_%1_us%2").arg(A,B)] = \
319  new FrequencyTable((C)+(D), E, F, G, H, I);
320 
321 // The maximum channel defined in the US frequency tables (standard, HRC, IRC)
322 static constexpr uint8_t US_MAX_CHAN { 158 };
323 // Equation for computing EIA-542 frequency of channels > 99
324 static constexpr uint64_t EIA_542_FREQUENCY(uint64_t bandwidth,
325  uint64_t offset,
326  uint64_t channel)
327 { return (bandwidth * (8 + channel)) + offset;}
328 static_assert(EIA_542_FREQUENCY(6000000, 3000000, US_MAX_CHAN) == 999000000);
329 static_assert(EIA_542_FREQUENCY(6000300, 1750000, US_MAX_CHAN) == 997799800);
330 
332 {
333  // United Kingdom
334  fmap["dvbt_ofdm_gb0"] = new FrequencyTable(
335  474000000, 698000000, 8000000, "Channel %1", 21,
341  DTVModulation::kModulationQAMAuto, 166670, -166670);
342 
343  // Finland
344  fmap["dvbt_ofdm_fi0"] = new FrequencyTable(
345  474000000, 850000000, 8000000, "Channel %1", 21,
352 
353  // Sweden
354  fmap["dvbt_ofdm_se0"] = new FrequencyTable(
355  474000000, 850000000, 8000000, "Channel %1", 21,
362 
363  // Australia
364  fmap["dvbt_ofdm_au0"] = new FrequencyTable(
365  177500000, 226500000, 7000000, "Channel %1", 5,
371  DTVModulation::kModulationQAMAuto, 125000, 0); // VHF 5-12
372  fmap["dvbt_ofdm_au1"] = new FrequencyTable(
373  529500000, 816500000, 7000000, "Channel %1", 28,
379  DTVModulation::kModulationQAMAuto, 125000, 0); // UHF 28-69
380 
381  // Germany (Deutschland)
382  fmap["dvbt_ofdm_de0"] = new FrequencyTable(
383  177500000, 226500000, 7000000, "Channel %1", 5,
389  DTVModulation::kModulationQAMAuto, 0, 0); // VHF 5-12, deprecated
390  fmap["dvbt_ofdm_de1"] = new FrequencyTable(
391  474000000, 826000000, 8000000, "Channel %1", 21,
397  DTVModulation::kModulationQAMAuto, 0, 0); // UHF 21-65
398 
399  // Israel
400  fmap["dvbt_ofdm_il0"] = new FrequencyTable(
401  514000000, 514000000+1, 8000000, "Channel %1", 26,
407  DTVModulation::kModulationQAMAuto, 0, 0); // UHF 26 - central Israel
408  fmap["dvbt_ofdm_il1"] = new FrequencyTable(
409  538000000, 538000000+1, 8000000, "Channel %1", 29,
415  DTVModulation::kModulationQAMAuto, 0, 0); // UHF 29 - North and Eilat area
416 
417  // Italy (Italia)
418  fmap["dvbt_ofdm_it0"] = new FrequencyTable(
419  177500000, 226500000, 7000000, "Channel %1", 5,
425  DTVModulation::kModulationQAMAuto, 0, 0); // VHF 5-12, deprecated
426  fmap["dvbt_ofdm_it1"] = new FrequencyTable(
427  474000000, 858000000, 8000000, "Channel %1", 21,
433  DTVModulation::kModulationQAMAuto, 0, 0); // UHF 21-65
434 
435  // Czech Republic
436  fmap["dvbt_ofdm_cz0"] = new FrequencyTable(
437  474000000, 858000000, 8000000, "Channel %1", 21,
443  DTVModulation::kModulationQAM64, 0, 0); // UHF 21-69
444 
445  // Greece (Hellas)
446  fmap["dvbt_ofdm_gr0"] = new FrequencyTable(
447  174000000, 230000000, 7000000, "Channel %1", 5,
453  DTVModulation::kModulationQAMAuto, 0, 0); // VHF 5-12, deprecated
454  fmap["dvbt_ofdm_gr1"] = new FrequencyTable(
455  474000000, 866000000, 8000000, "Channel %1", 21,
461  DTVModulation::kModulationQAMAuto, 0, 0); // UHF 21-65
462 
463  // Spain
464  fmap["dvbt_ofdm_es0"] = new FrequencyTable(
465  474000000, 858000000, 8000000, "Channel %1", 21,
471  DTVModulation::kModulationQAMAuto, 125000, 0); // UHF 21-69
472 
473  // New Zealand
474  fmap["dvbt_ofdm_nz0"] = new FrequencyTable(
475  474000000, 690000000, 8000000, "Channel %1", 21,
481  DTVModulation::kModulationQAM64, 0 , 0); // UHF 21-48
482 
483  // France
484  fmap["dvbt_ofdm_fr0"] = new FrequencyTable(
485  474000000, 850000000, 8000000, "Channel %1", 21,
491  DTVModulation::kModulationQAMAuto, 167000, -166000);
492 
493  // Denmark
494  fmap["dvbt_ofdm_dk0"] = new FrequencyTable(
495  474000000, 858000000, 8000000, "Channel %1", 21,
502 
503  // Netherlands
504  fmap["dvbt_ofdm_nl0"] = new FrequencyTable(
505  474000000, 690000000, 8000000, "Channel %1", 21,
511  DTVModulation::kModulationQAMAuto, 0, 0); // UHF 21-48
512 
513  // Chile (ISDB-Tb)
514  fmap["dvbt_ofdm_cl0"] = new FrequencyTable(
515  473000000, 803000000, 6000000, "Channel %1", 14,
522 
523  // DVB-C Germany
524  fmap["dvbc_qam_de0"] = new FrequencyTable(
525  73000000, 73000000, 8000000, "Channel D%1", 73,
527  6900000, 0, 0);
528  fmap["dvbc_qam_de1"] = new FrequencyTable(
529  81000000, 81000000, 8000000, "Channel D%1", 81,
531  6900000, 0, 0);
532  fmap["dvbc_qam_de2"] = new FrequencyTable(
533  113000000, 121000000, 8000000, "Channel S0%1", 2,
535  6900000, 0, 0);
536  fmap["dvbc_qam_de3"] = new FrequencyTable(
537  306000000, 466000000, 8000000, "Channel S%1", 21,
539  6900000, 0, 0);
540  fmap["dvbc_qam_de4"] = new FrequencyTable(
541  474000000, 858000000, 8000000, "Channel %1", 21,
543  6900000, 0, 0);
544 
545  // DVB-C Netherlands
546  fmap["dvbc_qam_nl0"] = new FrequencyTable(
547  474000000, 474000000, 8000000, "Channel %1", 21,
549  6875000, 0, 0);
550 
551  // DVB-C United Kingdom
552  fmap["dvbc_qam_gb0"] = new FrequencyTable(
553  12324000, 12324000+1, 10, "Channel %1", 1,
555  29500000, 0, 0);
556  fmap["dvbc_qam_gb1"] = new FrequencyTable(
557  459000000, 459000000+1, 10, "Channel %1", 2,
559  6952000, 0, 0);
560 
561  // DVB-C Unknown (British Forces ?)
562  fmap["dvbc_qam_bf0"] = new FrequencyTable(
563  203000000, 795000000, 100000, "BF Channel %1", 1,
565  6900000, 0, 0);
566  fmap["dvbc_qam_bf1"] = new FrequencyTable(
567  194750000, 794750000, 100000, "BF Channel %1", 1 + ((795000-203000) / 100),
569  6900000, 0, 0);
570 
571 //#define DEBUG_DVB_OFFSETS
572 #ifdef DEBUG_DVB_OFFSETS
573  // UHF 24-36
574  fmap["atsc_vsb8_us0"] = new FrequencyTable(
575  533000000, 605000000, 6000000, "xATSC Channel %1", 24,
581  DTVModulation::kModulation8VSB, -100000, 100000);
582 #else // if !DEBUG_DVB_OFFSETS
583  // USA Terrestrial (center frequency, subtract 1.75 MHz for visual carrier)
584  // VHF 2-4
585  fmap["atsc_vsb8_us0"] = new FrequencyTable(
586  "ATSC Channel %1", 2, 57000000, 69000000, 6000000,
588  // VHF 5-6
589  fmap["atsc_vsb8_us1"] = new FrequencyTable(
590  "ATSC Channel %1", 5, 79000000, 85000000, 6000000,
592  // VHF 7-13
593  fmap["atsc_vsb8_us2"] = new FrequencyTable(
594  "ATSC Channel %1", 7, 177000000, 213000000, 6000000,
596  // UHF 14-36
597  fmap["atsc_vsb8_us3"] = new FrequencyTable(
598  "ATSC Channel %1", 14, 473000000, 605000000, 6000000,
600 #endif // !DEBUG_DVB_OFFSETS
601 
602  const std::array<const QString,4> modStr {
603  "vsb8", "qam256", "qam128", "qam64" };
604  const std::array<const DTVModulation::Types,4> mod {
609  const std::array<const QString,4> desc {
610  "ATSC ", "QAM-256 ", "QAM-128 ", "QAM-64 ", };
611 
612  for (uint i = 0; i < 4; i++)
613  {
614  // USA Cable, T13 to T14 and ch 2 to US_MAX_CHAN
615  FREQ(modStr[i], "cable0", desc[i], "Channel T-%1",
616  13, 44750000, 50750000, 6000000, mod[i]); // T13-T14
617  FREQ(modStr[i], "cable1", desc[i], "Channel %1",
618  2, 57000000, 69000000, 6000000, mod[i]); // 2-4
619  FREQ(modStr[i], "cable2", desc[i], "Channel %1",
620  5, 79000000, 85000000, 6000000, mod[i]); // 5-6
621  FREQ(modStr[i], "cable3", desc[i], "Channel %1",
622  7, 177000000, 213000000, 6000000, mod[i]); // 7-13
623  FREQ(modStr[i], "cable4", desc[i], "Channel %1",
624  14, 123000000, 171000000, 6000000, mod[i]); // 14-22
625  FREQ(modStr[i], "cable5", desc[i], "Channel %1",
626  23, 219000000, 645000000, 6000000, mod[i]); // 23-94
627  FREQ(modStr[i], "cable6", desc[i], "Channel %1",
628  95, 93000000, 117000000, 6000000, mod[i]); // 95-99
629  // The center frequency of any EIA-542 std cable channel over 99 is
630  // Frequency_MHz = ( 6 * ( 8 + channel_designation ) ) + 3
631  FREQ(modStr[i], "cable7", desc[i], "Channel %1",
632  100, 651000000,
633  EIA_542_FREQUENCY(6000000, 3000000, US_MAX_CHAN),
634  6000000, mod[i]); // 100-US_MAX_CHAN
635 
636  // USA Cable, QAM 256 ch 78 to US_MAX_CHAN
637  FREQ(modStr[i], "cablehigh0", desc[i], "Channel %1",
638  78, 549000000, 645000000, 6000000, mod[i]); // 78-94
639  FREQ(modStr[i], "cablehigh1", desc[i], "Channel %1",
640  100, 651000000,
641  EIA_542_FREQUENCY(6000000, 3000000, US_MAX_CHAN),
642  6000000, mod[i]); // 100-US_MAX_CHAN
643 
644  // USA Cable HRC, ch 1 to US_MAX_CHAN
645  FREQ(modStr[i], "hrc0", desc[i], "HRC %1",
646  1, 73753600, 73753601, 6000300, mod[i]); // 1
647  FREQ(modStr[i], "hrc1", desc[i], "HRC %1",
648  2, 55752700, 67753300, 6000300, mod[i]); // 2-4
649  FREQ(modStr[i], "hrc2", desc[i], "HRC %1",
650  5, 79753900, 85754200, 6000300, mod[i]); // 5-6
651  FREQ(modStr[i], "hrc3", desc[i], "HRC %1",
652  7, 175758700, 211760500, 6000300, mod[i]); // 7-13
653  FREQ(modStr[i], "hrc4", desc[i], "HRC %1",
654  14, 121756000, 169758400, 6000300, mod[i]); // 14-22
655  FREQ(modStr[i], "hrc5", desc[i], "HRC %1",
656  23, 217760800, 643782100, 6000300, mod[i]); // 23-94
657  FREQ(modStr[i], "hrc6", desc[i], "HRC %1",
658  95, 91754500, 115755700, 6000300, mod[i]); // 95-99
659  // The center frequency of any EIA-542 HRC cable channel over 99 is
660  // Frequency_MHz = ( 6.0003 * ( 8 + channel_designation ) ) + 1.75
661  FREQ(modStr[i], "hrc7", desc[i], "HRC %1",
662  100, 649782400,
663  EIA_542_FREQUENCY(6000300, 1750000, US_MAX_CHAN),
664  6000300, mod[i]); // 100-US_MAX_CHAN
665 
666  // USA Cable HRC, ch 76-94 and 100-US_MAX_CHAN
667  // Channels 95-99 are low frequency despite high channel numbers
668  FREQ(modStr[i], "hrchigh0", desc[i], "HRC %1",
669  76, 535776700, 643782100, 6000300, mod[i]); // 76-94
670  FREQ(modStr[i], "hrchigh1", desc[i], "HRC %1",
671  100, 649782400,
672  EIA_542_FREQUENCY(6000300, 1750000, US_MAX_CHAN),
673  6000300, mod[i]); // 100-US_MAX_CHAN
674 
675  // USA Cable IRC, ch 1 to US_MAX_CHAN
676  FREQ(modStr[i], "irc0", desc[i], "IRC %1",
677  1, 75012500, 75012501, 6000000, mod[i]); // 1
678  FREQ(modStr[i], "irc1", desc[i], "IRC %1",
679  2, 57012500, 69012500, 6000000, mod[i]); // 2-4
680  FREQ(modStr[i], "irc2", desc[i], "IRC %1",
681  5, 81012500, 87012500, 6000000, mod[i]); // 5-6
682  FREQ(modStr[i], "irc3", desc[i], "IRC %1",
683  7, 177012500, 213012500, 6000000, mod[i]); // 7-13
684  FREQ(modStr[i], "irc4", desc[i], "IRC %1",
685  14, 123012500, 171012500, 6000000, mod[i]); // 14-22
686  FREQ(modStr[i], "irc5", desc[i], "IRC %1",
687  23, 219012500, 327012500, 6000000, mod[i]); // 23-41
688  FREQ(modStr[i], "irc6", desc[i], "IRC %1",
689  42, 333025000, 333025001, 6000000, mod[i]); // 42
690  FREQ(modStr[i], "irc7", desc[i], "IRC %1",
691  43, 339012500, 645012500, 6000000, mod[i]); // 43-94
692  FREQ(modStr[i], "irc8", desc[i], "IRC %1",
693  95, 93012500, 105012500, 6000000, mod[i]); // 95-97
694  FREQ(modStr[i], "irc9", desc[i], "IRC %1",
695  98, 111025000, 117025000, 6000000, mod[i]); // 98-99
696  // The center frequency of any EIA-542 IRC cable channel over 99 is
697  // Frequency_MHz = ( 6 * ( 8 + channel_designation ) ) + 3.0125
698  FREQ(modStr[i], "irc10", desc[i], "IRC %1",
699  100, 651012500,
700  EIA_542_FREQUENCY(6000000, 3012500, US_MAX_CHAN),
701  6000000, mod[i]); // 100-US_MAX_CHAN
702 
703  // USA Cable IRC, ch 76-94 and 100-125
704  // Channels 95-99 are low frequency despite high channel numbers
705  FREQ(modStr[i], "irchigh0", desc[i], "IRC %1",
706  76, 537012500, 645012500, 6000000, mod[i]); // 76-94
707  FREQ(modStr[i], "irchigh1", desc[i], "IRC %1",
708  100, 651012500,
709  EIA_542_FREQUENCY(6000000, 3012500, US_MAX_CHAN),
710  6000000, mod[i]); // 100-US_MAX_CHAN
711  }
712 
713  // create old school frequency tables...
714  for (const auto & [name, list] : gChanLists)
715  {
716  for (uint i = 0; i < (uint)list.size(); i++)
717  {
718  uint64_t freq = (list[i].freq * 1000LL) + 1750000;
719  fmap[QString("analog_analog_%1%2").arg(name).arg(i)] =
720  new FrequencyTable(
721  QString("%1 %2").arg(name, list[i].name), i+2,
722  freq, freq + 3000000,
724  }
725  }
726 }
DTVModulation::toString
QString toString() const
Definition: dtvconfparserhelpers.h:412
DTVMultiplex::m_frequency
uint64_t m_frequency
Definition: dtvmultiplex.h:94
TransportScanItem::m_tuning
DTVMultiplex m_tuning
Definition: frequencytables.h:190
FrequencyTable::m_transMode
DTVTransmitMode m_transMode
Definition: frequencytables.h:113
DTVMultiplex
Definition: dtvmultiplex.h:24
TransportScanItem::TransportScanItem
TransportScanItem()
Definition: frequencytables.cpp:19
DTVGuardInterval::kGuardInterval_1_16
@ kGuardInterval_1_16
Definition: dtvconfparserhelpers.h:499
DTVModulation::kModulationQAM256
@ kModulationQAM256
Definition: dtvconfparserhelpers.h:363
FrequencyTable
Definition: frequencytables.h:38
TransportScanItem::m_scanning
bool m_scanning
Definition: frequencytables.h:186
DTVCodeRate::kFECNone
@ kFECNone
Definition: dtvconfparserhelpers.h:291
DTVMultiplex::m_rolloff
DTVRollOff m_rolloff
Definition: dtvmultiplex.h:107
freq_table_list_t
std::vector< const FrequencyTable * > freq_table_list_t
Definition: frequencytables.h:25
FrequencyTable::m_modulation
DTVModulation m_modulation
Definition: frequencytables.h:103
TransportScanItem::m_iptvChannel
QString m_iptvChannel
Definition: frequencytables.h:192
TransportScanItem::m_useTimer
bool m_useTimer
Definition: frequencytables.h:184
DTVHierarchy::kHierarchyAuto
@ kHierarchyAuto
Definition: dtvconfparserhelpers.h:561
freq
static const std::array< const uint32_t, 4 > freq
Definition: element.cpp:45
frequencies.h
DTVHierarchy::toString
QString toString() const
Definition: dtvconfparserhelpers.h:593
DTVTransmitMode::kTransmissionModeAuto
@ kTransmissionModeAuto
Definition: dtvconfparserhelpers.h:437
DTVTransmitMode::kTransmissionMode8K
@ kTransmissionMode8K
Definition: dtvconfparserhelpers.h:436
TransportScanItem::m_friendlyNum
uint m_friendlyNum
Definition: frequencytables.h:182
get_matching_freq_tables_internal
static freq_table_list_t get_matching_freq_tables_internal(const QString &format, const QString &modulation, const QString &country)
Definition: frequencytables.cpp:225
DTVMultiplex::m_hierarchy
DTVHierarchy m_hierarchy
Definition: dtvmultiplex.h:103
EIA_542_FREQUENCY
static constexpr uint64_t EIA_542_FREQUENCY(uint64_t bandwidth, uint64_t offset, uint64_t channel)
Definition: frequencytables.cpp:324
LOG
#define LOG(_MASK_, _LEVEL_, _QSTRING_)
Definition: mythlogging.h:39
TransportScanItem::m_sourceID
int m_sourceID
Definition: frequencytables.h:183
TransportScanItem::m_iptvTuning
IPTVTuningData m_iptvTuning
Definition: frequencytables.h:191
ChannelUtil::GetMplexID
static uint GetMplexID(uint sourceid, const QString &channum)
Definition: channelutil.cpp:462
DTVMultiplex::m_bandwidth
DTVBandwidth m_bandwidth
Definition: dtvmultiplex.h:97
DTVModulation::kModulationAnalog
@ kModulationAnalog
Definition: dtvconfparserhelpers.h:372
DTVCodeRate::toString
QString toString() const
Definition: dtvconfparserhelpers.h:341
US_MAX_CHAN
static constexpr uint8_t US_MAX_CHAN
Definition: frequencytables.cpp:322
DTVGuardInterval::kGuardIntervalAuto
@ kGuardIntervalAuto
Definition: dtvconfparserhelpers.h:502
frequencies_initialized
static bool frequencies_initialized
Definition: frequencytables.cpp:11
DTVCodeRate::kFEC_2_3
@ kFEC_2_3
Definition: dtvconfparserhelpers.h:293
IPTVTuningData::GetDeviceKey
QString GetDeviceKey(void) const
Definition: iptvtuningdata.h:102
DTVTunerType
Definition: dtvconfparserhelpers.h:76
DTVBandwidth::kBandwidthAuto
@ kBandwidthAuto
Definition: dtvconfparserhelpers.h:231
FrequencyTable::m_inversion
DTVInversion m_inversion
Definition: frequencytables.h:108
DTVMultiplex::m_inversion
DTVInversion m_inversion
Definition: dtvmultiplex.h:96
DTVModulation::kModulation8VSB
@ kModulation8VSB
Definition: dtvconfparserhelpers.h:365
FrequencyTable::m_coderateHp
DTVCodeRate m_coderateHp
Definition: frequencytables.h:110
DTVBandwidth::kBandwidth8MHz
@ kBandwidth8MHz
Definition: dtvconfparserhelpers.h:228
DTVRollOff::toString
QString toString() const
Definition: dtvconfparserhelpers.h:768
DTVGuardInterval::kGuardInterval_1_4
@ kGuardInterval_1_4
Definition: dtvconfparserhelpers.h:501
DTVBandwidth::kBandwidth7MHz
@ kBandwidth7MHz
Definition: dtvconfparserhelpers.h:229
FrequencyTable::m_offset2
int m_offset2
Definition: frequencytables.h:105
DTVMultiplex::m_guardInterval
DTVGuardInterval m_guardInterval
Definition: dtvmultiplex.h:102
compat.h
teardown_frequency_tables
bool teardown_frequency_tables(void)
Definition: frequencytables.cpp:214
DTVMultiplex::m_hpCodeRate
DTVCodeRate m_hpCodeRate
Definition: dtvmultiplex.h:98
IPTVTuningData
Definition: iptvtuningdata.h:21
FrequencyTable::m_coderateLp
DTVCodeRate m_coderateLp
Definition: frequencytables.h:111
TransportScanItem::GetMultiplexIdFromDB
uint GetMultiplexIdFromDB(void) const
Fetches mplexid if it exists, based on the frequency and sourceid.
Definition: frequencytables.cpp:147
FrequencyTable::m_symbolRate
uint m_symbolRate
Definition: frequencytables.h:118
DTVMultiplex::m_modSys
DTVModulationSystem m_modSys
Definition: dtvmultiplex.h:106
DTVMultiplex::m_fec
DTVCodeRate m_fec
Definition: dtvmultiplex.h:105
uint
unsigned int uint
Definition: compat.h:81
DTVHierarchy::kHierarchyNone
@ kHierarchyNone
Definition: dtvconfparserhelpers.h:557
TransportScanItem::m_freqOffsets
std::array< int, 3 > m_freqOffsets
Definition: frequencytables.h:187
TransportScanItem::m_friendlyName
QString m_friendlyName
Definition: frequencytables.h:181
FrequencyTable::m_hierarchy
DTVHierarchy m_hierarchy
Definition: frequencytables.h:115
get_closest_freqid
int get_closest_freqid(const QString &format, QString modulation, const QString &country, long long centerfreq)
Definition: frequencytables.cpp:285
freq_table_map_t
QMap< QString, const FrequencyTable * > freq_table_map_t
Definition: frequencytables.h:24
get_matching_freq_tables
freq_table_list_t get_matching_freq_tables(const QString &format, const QString &modulation, const QString &country)
Definition: frequencytables.cpp:246
channelutil.h
DTVMultiplex::m_symbolRate
uint64_t m_symbolRate
Definition: dtvmultiplex.h:95
FrequencyTable::m_fecInner
DTVCodeRate m_fecInner
Definition: frequencytables.h:119
DTVModulationSystem::toString
QString toString() const
Definition: dtvconfparserhelpers.h:719
TransportScanItem::m_mplexid
uint m_mplexid
Definition: frequencytables.h:179
gChanLists
const CHANLISTS_vec gChanLists
Definition: frequencies.cpp:2215
TransportScanItem::freq_offset
uint64_t freq_offset(uint i) const
Definition: frequencytables.cpp:157
DTVModulation::kModulationQAM128
@ kModulationQAM128
Definition: dtvconfparserhelpers.h:362
DTVCodeRate::kFEC_3_4
@ kFEC_3_4
Definition: dtvconfparserhelpers.h:294
DTVPolarity::toString
QString toString() const
Definition: dtvconfparserhelpers.h:632
frequencytables.h
frequencies_lock
static QMutex frequencies_lock
Definition: frequencytables.cpp:12
DTVMultiplex::m_sistandard
QString m_sistandard
Definition: dtvmultiplex.h:111
DTVTransmitMode::toString
QString toString() const
Definition: dtvconfparserhelpers.h:475
FrequencyTable::m_guardInterval
DTVGuardInterval m_guardInterval
Definition: frequencytables.h:114
DTVBandwidth::toString
QString toString() const
Definition: dtvconfparserhelpers.h:268
DTVInversion::kInversionOff
@ kInversionOff
Definition: dtvconfparserhelpers.h:173
DTVMultiplex::ParseTuningParams
bool ParseTuningParams(DTVTunerType type, const QString &frequency, const QString &inversion, const QString &symbolrate, const QString &fec, const QString &polarity, const QString &hp_code_rate, const QString &lp_code_rate, const QString &ofdm_modulation, const QString &trans_mode, const QString &guard_interval, const QString &hierarchy, const QString &modulation, const QString &bandwidth, const QString &mod_sys, const QString &rolloff)
Definition: dtvmultiplex.cpp:448
TransportScanItem::m_timeoutTune
std::chrono::milliseconds m_timeoutTune
Timeout to tune to a frequency.
Definition: frequencytables.h:188
DTVTransport
Definition: dtvconfparser.h:60
get_center_frequency
long long get_center_frequency(const QString &format, const QString &modulation, const QString &country, int freqid)
Definition: frequencytables.cpp:262
DTVMultiplex::m_modulation
DTVModulation m_modulation
Definition: dtvmultiplex.h:100
DTVMultiplex::m_polarity
DTVPolarity m_polarity
Definition: dtvmultiplex.h:104
DTVModulation::kModulationQAMAuto
@ kModulationQAMAuto
Definition: dtvconfparserhelpers.h:364
frequencies
static freq_table_map_t frequencies
Definition: frequencytables.cpp:13
init_freq_tables
static void init_freq_tables(freq_table_map_t &)
Definition: frequencytables.cpp:331
DTVGuardInterval::kGuardInterval_1_32
@ kGuardInterval_1_32
Definition: dtvconfparserhelpers.h:498
FrequencyTable::m_bandwidth
DTVBandwidth m_bandwidth
Definition: frequencytables.h:109
DTVModulation::kModulationQAM64
@ kModulationQAM64
Definition: dtvconfparserhelpers.h:361
FREQ
#define FREQ(A, B, C, D, E, F, G, H, I)
Definition: frequencytables.cpp:317
DTVInversion::toString
QString toString() const
Definition: dtvconfparserhelpers.h:205
DTVCodeRate::kFECAuto
@ kFECAuto
Definition: dtvconfparserhelpers.h:300
DTVGuardInterval::toString
QString toString() const
Definition: dtvconfparserhelpers.h:540
TransportScanItem::offset_cnt
uint offset_cnt() const
Definition: frequencytables.h:162
TransportScanItem::toString
QString toString() const
Definition: frequencytables.cpp:164
FrequencyTable::m_offset1
int m_offset1
Definition: frequencytables.h:104
DTVInversion::kInversionAuto
@ kInversionAuto
Definition: dtvconfparserhelpers.h:175
DTVMultiplex::m_transMode
DTVTransmitMode m_transMode
Definition: dtvmultiplex.h:101
DTVMultiplex::Clear
void Clear(void)
Definition: dtvmultiplex.h:34
DTVMultiplex::m_lpCodeRate
DTVCodeRate m_lpCodeRate
Definition: dtvmultiplex.h:99