MythTV  master
frequencytables.cpp
Go to the documentation of this file.
1 #include <utility>
2 
3 #include <QMutex>
4 
5 #include "frequencies.h"
6 #include "frequencytables.h"
7 #include "channelutil.h"
8 #include "compat.h"
9 
10 static bool frequencies_initialized = false;
11 static QMutex frequencies_lock;
13 
14 static void init_freq_tables(freq_table_map_t& /*fmap*/);
16  const QString &format, const QString &modulation, const QString &country);
17 
19 {
20  m_tuning.Clear();
21 }
22 
24  const QString &_si_std,
25  QString _name,
26  uint _mplexid,
27  uint _timeoutTune)
28  : m_mplexid(_mplexid), m_friendlyName(std::move(_name)),
29  m_sourceID(sourceid),
30  m_timeoutTune(_timeoutTune)
31 {
32  m_tuning.Clear();
33  m_tuning.m_sistandard = _si_std;
34 
35  if (_si_std == "analog")
36  {
37  m_tuning.m_sistandard = "analog";
39  }
40 }
41 
43  QString _name,
44  DTVMultiplex &_tuning,
45  uint _timeoutTune)
46  : m_mplexid(0),
47  m_friendlyName(std::move(_name)),
48  m_sourceID(_sourceid),
49  m_timeoutTune(_timeoutTune)
50 {
51  m_tuning = _tuning;
52 }
53 
55  QString _name,
56  DTVTunerType _tuner_type,
57  const DTVTransport &_tuning,
58  uint _timeoutTune)
59  : m_mplexid(0),
60  m_friendlyName(std::move(_name)),
61  m_sourceID(_sourceid),
62  m_timeoutTune(_timeoutTune)
63 {
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  uint 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 params
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  uint _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);
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);
191  str += QString("bandwidth(%1) " ).arg(m_tuning.m_bandwidth);
192  str += QString("hp(%1) " ).arg(m_tuning.m_hpCodeRate);
193  str += QString("lp(%1) " ).arg(m_tuning.m_lpCodeRate);
194  str += "\n\t";
195  str += QString("trans_mode(%1) " ).arg(m_tuning.m_transMode);
196  str += QString("guard_int(%1) " ).arg(m_tuning.m_guardInterval);
197  str += QString("hierarchy(%1) " ).arg(m_tuning.m_hierarchy);
198  str += QString("symbol_rate(%1) " ).arg(m_tuning.m_symbolRate);
199  str += QString("fec(%1) " ).arg(m_tuning.m_fec);
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).arg(modulation).arg(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 
317 {
318  // United Kingdom
319  fmap["dvbt_ofdm_gb0"] = new FrequencyTable(
320  474000000, 850000000, 8000000, "Channel %1", 21,
326  DTVModulation::kModulationQAMAuto, 166670, -166670);
327 
328  // Finland
329  fmap["dvbt_ofdm_fi0"] = new FrequencyTable(
330  474000000, 850000000, 8000000, "Channel %1", 21,
337 
338  // Sweden
339  fmap["dvbt_ofdm_se0"] = new FrequencyTable(
340  474000000, 850000000, 8000000, "Channel %1", 21,
347 
348  // Australia
349  fmap["dvbt_ofdm_au0"] = new FrequencyTable(
350  177500000, 226500000, 7000000, "Channel %1", 5,
356  DTVModulation::kModulationQAMAuto, 125000, 0); // VHF 5-12
357  fmap["dvbt_ofdm_au1"] = new FrequencyTable(
358  529500000, 816500000, 7000000, "Channel %1", 28,
364  DTVModulation::kModulationQAMAuto, 125000, 0); // UHF 28-69
365 
366  // Germany (Deutschland)
367  fmap["dvbt_ofdm_de0"] = new FrequencyTable(
368  177500000, 226500000, 7000000, "Channel %1", 5,
374  DTVModulation::kModulationQAMAuto, 0, 0); // VHF 5-12, deprecated
375  fmap["dvbt_ofdm_de1"] = new FrequencyTable(
376  474000000, 826000000, 8000000, "Channel %1", 21,
382  DTVModulation::kModulationQAMAuto, 0, 0); // UHF 21-65
383 
384  // Israel
385  fmap["dvbt_ofdm_il0"] = new FrequencyTable(
386  514000000, 514000000+1, 8000000, "Channel %1", 26,
392  DTVModulation::kModulationQAMAuto, 0, 0); // UHF 26 - central Israel
393  fmap["dvbt_ofdm_il1"] = new FrequencyTable(
394  538000000, 538000000+1, 8000000, "Channel %1", 29,
400  DTVModulation::kModulationQAMAuto, 0, 0); // UHF 29 - North and Eilat area
401 
402  // Italy (Italia)
403  fmap["dvbt_ofdm_it0"] = new FrequencyTable(
404  177500000, 226500000, 7000000, "Channel %1", 5,
410  DTVModulation::kModulationQAMAuto, 0, 0); // VHF 5-12, deprecated
411  fmap["dvbt_ofdm_it1"] = new FrequencyTable(
412  474000000, 858000000, 8000000, "Channel %1", 21,
418  DTVModulation::kModulationQAMAuto, 0, 0); // UHF 21-65
419 
420  // Czech Republic
421  fmap["dvbt_ofdm_cz0"] = new FrequencyTable(
422  474000000, 858000000, 8000000, "Channel %1", 21,
428  DTVModulation::kModulationQAM64, 0, 0); // UHF 21-69
429 
430  // Greece (Hellas)
431  fmap["dvbt_ofdm_gr0"] = new FrequencyTable(
432  174000000, 230000000, 7000000, "Channel %1", 5,
438  DTVModulation::kModulationQAMAuto, 0, 0); // VHF 5-12, deprecated
439  fmap["dvbt_ofdm_gr1"] = new FrequencyTable(
440  474000000, 866000000, 8000000, "Channel %1", 21,
446  DTVModulation::kModulationQAMAuto, 0, 0); // UHF 21-65
447 
448  // Spain
449  fmap["dvbt_ofdm_es0"] = new FrequencyTable(
450  474000000, 858000000, 8000000, "Channel %1", 21,
456  DTVModulation::kModulationQAMAuto, 125000, 0); // UHF 21-69
457 
458  // New Zealand
459  fmap["dvbt_ofdm_nz0"] = new FrequencyTable(
460  474000000, 690000000, 8000000, "Channel %1", 21,
466  DTVModulation::kModulationQAM64, 0 , 0); // UHF 21-48
467 
468  // France
469  fmap["dvbt_ofdm_fr0"] = new FrequencyTable(
470  474000000, 850000000, 8000000, "Channel %1", 21,
476  DTVModulation::kModulationQAMAuto, 167000, -166000);
477 
478  // Denmark
479  fmap["dvbt_ofdm_dk0"] = new FrequencyTable(
480  474000000, 858000000, 8000000, "Channel %1", 21,
487 
488  // Netherlands
489  fmap["dvbt_ofdm_nl0"] = new FrequencyTable(
490  474000000, 690000000, 8000000, "Channel %1", 21,
496  DTVModulation::kModulationQAMAuto, 0, 0); // UHF 21-48
497 
498  // Chile (ISDB-Tb)
499  fmap["dvbt_ofdm_cl0"] = new FrequencyTable(
500  473000000, 803000000, 6000000, "Channel %1", 14,
507 
508  // DVB-C Germany
509  fmap["dvbc_qam_de0"] = new FrequencyTable(
510  73000000, 73000000, 8000000, "Channel D%1", 73,
512  6900000, 0, 0);
513  fmap["dvbc_qam_de1"] = new FrequencyTable(
514  81000000, 81000000, 8000000, "Channel D%1", 81,
516  6900000, 0, 0);
517  fmap["dvbc_qam_de2"] = new FrequencyTable(
518  113000000, 121000000, 8000000, "Channel S0%1", 2,
520  6900000, 0, 0);
521  fmap["dvbc_qam_de3"] = new FrequencyTable(
522  306000000, 466000000, 8000000, "Channel S%1", 21,
524  6900000, 0, 0);
525  fmap["dvbc_qam_de4"] = new FrequencyTable(
526  474000000, 858000000, 8000000, "Channel %1", 21,
528  6900000, 0, 0);
529 
530  // DVB-C Netherlands
531  fmap["dvbc_qam_nl0"] = new FrequencyTable(
532  474000000, 474000000, 8000000, "Channel %1", 21,
534  6875000, 0, 0);
535 
536  // DVB-C United Kingdom
537  fmap["dvbc_qam_gb0"] = new FrequencyTable(
538  12324000, 12324000+1, 10, "Channel %1", 1,
540  29500000, 0, 0);
541  fmap["dvbc_qam_gb1"] = new FrequencyTable(
542  459000000, 459000000+1, 10, "Channel %1", 2,
544  6952000, 0, 0);
545 
546  // DVB-C Unknown (British Forces ?)
547  fmap["dvbc_qam_bf0"] = new FrequencyTable(
548  203000000, 795000000, 100000, "BF Channel %1", 1,
550  6900000, 0, 0);
551  fmap["dvbc_qam_bf1"] = new FrequencyTable(
552  194750000, 794750000, 100000, "BF Channel %1", 1 + (795000-203000) / 100,
554  6900000, 0, 0);
555 
556 //#define DEBUG_DVB_OFFSETS
557 #ifdef DEBUG_DVB_OFFSETS
558  // UHF 14-51
559  fmap["atsc_vsb8_us0"] = new FrequencyTable(
560  533000000, 695000000, 6000000, "xATSC Channel %1", 24,
566  DTVModulation::kModulation8VSB, -100000, 100000);
567 #else // if !DEBUG_DVB_OFFSETS
568  // USA Terrestrial (center frequency, subtract 1.75 MHz for visual carrier)
569  // VHF 2-4
570  fmap["atsc_vsb8_us0"] = new FrequencyTable(
571  "ATSC Channel %1", 2, 57000000, 69000000, 6000000,
573  // VHF 5-6
574  fmap["atsc_vsb8_us1"] = new FrequencyTable(
575  "ATSC Channel %1", 5, 79000000, 85000000, 6000000,
577  // VHF 7-13
578  fmap["atsc_vsb8_us2"] = new FrequencyTable(
579  "ATSC Channel %1", 7, 177000000, 213000000, 6000000,
581  // UHF 14-51
582  fmap["atsc_vsb8_us3"] = new FrequencyTable(
583  "ATSC Channel %1", 14, 473000000, 695000000, 6000000,
585 #endif // !DEBUG_DVB_OFFSETS
586 
587  const std::array<const QString,4> modStr {
588  "vsb8", "qam256", "qam128", "qam64" };
589  const std::array<const DTVModulation::Types,4> mod {
594  const std::array<const QString,4> desc {
595  "ATSC ", "QAM-256 ", "QAM-128 ", "QAM-64 ", };
596 
597 #define FREQ(A,B, C,D, E,F,G, H, I) \
598  fmap[QString("atsc_%1_us%2").arg(A).arg(B)] = \
599  new FrequencyTable((C)+(D), E, F, G, H, I);
600 
601 // The maximum channel defined in the US frequency tables (standard, HRC, IRC)
602 #define US_MAX_CHAN 159
603 // Equation for computing EIA-542 frequency of channels > 99
604 // A = bandwidth, B = offset, C = channel designation (number)
605 #define EIA_542_FREQUENCY(A,B,C) ( ( (A) * ( 8 + (C) ) ) + (B) )
606 
607  for (uint i = 0; i < 4; i++)
608  {
609  // USA Cable, ch 2 to US_MAX_CHAN and T.7 to T.14
610  FREQ(modStr[i], "cable0", desc[i], "Channel %1",
611  2, 57000000, 69000000, 6000000, mod[i]); // 2-4
612  FREQ(modStr[i], "cable1", desc[i], "Channel %1",
613  5, 79000000, 85000000, 6000000, mod[i]); // 5-6
614  FREQ(modStr[i], "cable2", desc[i], "Channel %1",
615  7, 177000000, 213000000, 6000000, mod[i]); // 7-13
616  FREQ(modStr[i], "cable3", desc[i], "Channel %1",
617  14, 123000000, 171000000, 6000000, mod[i]); // 14-22
618  FREQ(modStr[i], "cable4", desc[i], "Channel %1",
619  23, 219000000, 645000000, 6000000, mod[i]); // 23-94
620  FREQ(modStr[i], "cable5", desc[i], "Channel %1",
621  95, 93000000, 117000000, 6000000, mod[i]); // 95-99
622  // The center frequency of any EIA-542 std cable channel over 99 is
623  // Frequency_MHz = ( 6 * ( 8 + channel_designation ) ) + 3
624  FREQ(modStr[i], "cable6", desc[i], "Channel %1",
625  100, 651000000,
626  EIA_542_FREQUENCY(6000000, 3000000, US_MAX_CHAN),
627  6000000, mod[i]); // 100-US_MAX_CHAN
628  FREQ(modStr[i], "cable7", desc[i], "Channel T-%1",
629  7, 8750000, 50750000, 6000000, mod[i]); // T7-14
630 
631  // USA Cable, QAM 256 ch 78 to US_MAX_CHAN
632  FREQ(modStr[i], "cablehigh0", desc[i], "Channel %1",
633  78, 549000000, 645000000, 6000000, mod[i]); // 78-94
634  FREQ(modStr[i], "cablehigh1", desc[i], "Channel %1",
635  100, 651000000,
636  EIA_542_FREQUENCY(6000000, 3000000, US_MAX_CHAN),
637  6000000, mod[i]); // 100-US_MAX_CHAN
638 
639  // USA Cable HRC, ch 1 to US_MAX_CHAN
640  FREQ(modStr[i], "hrc0", desc[i], "HRC %1",
641  1, 73753600, 73753601, 6000300, mod[i]); // 1
642  FREQ(modStr[i], "hrc1", desc[i], "HRC %1",
643  2, 55752700, 67753300, 6000300, mod[i]); // 2-4
644  FREQ(modStr[i], "hrc2", desc[i], "HRC %1",
645  5, 79753900, 85754200, 6000300, mod[i]); // 5-6
646  FREQ(modStr[i], "hrc3", desc[i], "HRC %1",
647  7, 175758700, 211760500, 6000300, mod[i]); // 7-13
648  FREQ(modStr[i], "hrc4", desc[i], "HRC %1",
649  14, 121756000, 169758400, 6000300, mod[i]); // 14-22
650  FREQ(modStr[i], "hrc5", desc[i], "HRC %1",
651  23, 217760800, 643782100, 6000300, mod[i]); // 23-94
652  FREQ(modStr[i], "hrc6", desc[i], "HRC %1",
653  95, 91754500, 115755700, 6000300, mod[i]); // 95-99
654  // The center frequency of any EIA-542 HRC cable channel over 99 is
655  // Frequency_MHz = ( 6.0003 * ( 8 + channel_designation ) ) + 1.75
656  FREQ(modStr[i], "hrc7", desc[i], "HRC %1",
657  100, 649782400,
658  EIA_542_FREQUENCY(6000300, 1750000, US_MAX_CHAN),
659  6000300, mod[i]); // 100-US_MAX_CHAN
660 
661  // USA Cable HRC, ch 76-94 and 100-US_MAX_CHAN
662  // Channels 95-99 are low frequency despite high channel numbers
663  FREQ(modStr[i], "hrchigh0", desc[i], "HRC %1",
664  76, 535776700, 643782100, 6000300, mod[i]); // 76-94
665  FREQ(modStr[i], "hrchigh1", desc[i], "HRC %1",
666  100, 649782400,
667  EIA_542_FREQUENCY(6000300, 1750000, US_MAX_CHAN),
668  6000300, mod[i]); // 100-US_MAX_CHAN
669 
670  // USA Cable IRC, ch 1 to US_MAX_CHAN
671  FREQ(modStr[i], "irc0", desc[i], "IRC %1",
672  1, 75012500, 75012501, 6000000, mod[i]); // 1
673  FREQ(modStr[i], "irc1", desc[i], "IRC %1",
674  2, 57012500, 69012500, 6000000, mod[i]); // 2-4
675  FREQ(modStr[i], "irc2", desc[i], "IRC %1",
676  5, 81012500, 87012500, 6000000, mod[i]); // 5-6
677  FREQ(modStr[i], "irc3", desc[i], "IRC %1",
678  7, 177012500, 213012500, 6000000, mod[i]); // 7-13
679  FREQ(modStr[i], "irc4", desc[i], "IRC %1",
680  14, 123012500, 171012500, 6000000, mod[i]); // 14-22
681  FREQ(modStr[i], "irc5", desc[i], "IRC %1",
682  23, 219012500, 327012500, 6000000, mod[i]); // 23-41
683  FREQ(modStr[i], "irc6", desc[i], "IRC %1",
684  42, 333025000, 333025001, 6000000, mod[i]); // 42
685  FREQ(modStr[i], "irc7", desc[i], "IRC %1",
686  43, 339012500, 645012500, 6000000, mod[i]); // 43-94
687  FREQ(modStr[i], "irc8", desc[i], "IRC %1",
688  95, 93012500, 105012500, 6000000, mod[i]); // 95-97
689  FREQ(modStr[i], "irc9", desc[i], "IRC %1",
690  98, 111025000, 117025000, 6000000, mod[i]); // 98-99
691  // The center frequency of any EIA-542 IRC cable channel over 99 is
692  // Frequency_MHz = ( 6 * ( 8 + channel_designation ) ) + 3.0125
693  FREQ(modStr[i], "irc10", desc[i], "IRC %1",
694  100, 651012500,
695  EIA_542_FREQUENCY(6000000, 3012500, US_MAX_CHAN),
696  6000000, mod[i]); // 100-US_MAX_CHAN
697 
698  // USA Cable IRC, ch 76-94 and 100-125
699  // Channels 95-99 are low frequency despite high channel numbers
700  FREQ(modStr[i], "irchigh0", desc[i], "IRC %1",
701  76, 537012500, 645012500, 6000000, mod[i]); // 76-94
702  FREQ(modStr[i], "irchigh1", desc[i], "IRC %1",
703  100, 651012500,
704  EIA_542_FREQUENCY(6000000, 3012500, US_MAX_CHAN),
705  6000000, mod[i]); // 100-US_MAX_CHAN
706  }
707 
708  // create old school frequency tables...
709  for (const auto & [name, list] : gChanLists)
710  {
711  for (uint i = 0; i < (uint)list.size(); i++)
712  {
713  uint64_t freq = (list[i].freq * 1000LL) + 1750000;
714  fmap[QString("analog_analog_%1%2").arg(name).arg(i)] =
715  new FrequencyTable(
716  QString("%1 %2").arg(name).arg(list[i].name), i+2,
717  freq, freq + 3000000,
719  }
720  }
721 }
DTVModulation::toString
QString toString() const
Definition: dtvconfparserhelpers.h:410
DTVMultiplex::m_frequency
uint64_t m_frequency
Definition: dtvmultiplex.h:94
TransportScanItem::m_tuning
DTVMultiplex m_tuning
Tuning info.
Definition: frequencytables.h:183
DTVGuardInterval::kGuardInterval_1_4
@ kGuardInterval_1_4
Definition: dtvconfparserhelpers.h:499
FrequencyTable::m_transMode
DTVTransmitMode m_transMode
Definition: frequencytables.h:111
DTVMultiplex
Definition: dtvmultiplex.h:25
TransportScanItem::TransportScanItem
TransportScanItem()
Definition: frequencytables.cpp:18
DTVCodeRate::kFEC_3_4
@ kFEC_3_4
Definition: dtvconfparserhelpers.h:292
FrequencyTable
Definition: frequencytables.h:40
TransportScanItem::m_scanning
bool m_scanning
Probably Unnecessary.
Definition: frequencytables.h:179
DTVMultiplex::m_rolloff
DTVRollOff m_rolloff
Definition: dtvmultiplex.h:107
DTVGuardInterval::kGuardIntervalAuto
@ kGuardIntervalAuto
Definition: dtvconfparserhelpers.h:500
DTVCodeRate::kFEC_2_3
@ kFEC_2_3
Definition: dtvconfparserhelpers.h:291
FrequencyTable::m_modulation
DTVModulation m_modulation
Definition: frequencytables.h:101
TransportScanItem::m_iptvChannel
QString m_iptvChannel
IPTV base channel.
Definition: frequencytables.h:185
DTVCodeRate::kFECNone
@ kFECNone
Definition: dtvconfparserhelpers.h:289
TransportScanItem::m_useTimer
bool m_useTimer
Set if timer is used after lock for getting PAT.
Definition: frequencytables.h:176
frequencies.h
DTVHierarchy::toString
QString toString() const
Definition: dtvconfparserhelpers.h:591
TransportScanItem::m_friendlyNum
uint m_friendlyNum
Frequency number (freqid w/freq table)
Definition: frequencytables.h:174
arg
arg(title).arg(filename).arg(doDelete))
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
DTVHierarchy::kHierarchyAuto
@ kHierarchyAuto
Definition: dtvconfparserhelpers.h:559
US_MAX_CHAN
#define US_MAX_CHAN
LOG
#define LOG(_MASK_, _LEVEL_, _QSTRING_)
Definition: mythlogging.h:23
TransportScanItem::m_sourceID
int m_sourceID
Associated SourceID.
Definition: frequencytables.h:175
TransportScanItem::m_iptvTuning
IPTVTuningData m_iptvTuning
IPTV Tuning info.
Definition: frequencytables.h:184
ChannelUtil::GetMplexID
static uint GetMplexID(uint sourceid, const QString &channum)
Definition: channelutil.cpp:461
DTVMultiplex::m_bandwidth
DTVBandwidth m_bandwidth
Definition: dtvmultiplex.h:97
DTVCodeRate::toString
QString toString() const
Definition: dtvconfparserhelpers.h:339
frequencies_initialized
static bool frequencies_initialized
Definition: frequencytables.cpp:10
DTVCodeRate::kFECAuto
@ kFECAuto
Definition: dtvconfparserhelpers.h:298
IPTVTuningData::GetDeviceKey
QString GetDeviceKey(void) const
Definition: iptvtuningdata.h:97
DTVTunerType
Definition: dtvconfparserhelpers.h:77
FrequencyTable::m_inversion
DTVInversion m_inversion
Definition: frequencytables.h:106
DTVTransmitMode::kTransmissionModeAuto
@ kTransmissionModeAuto
Definition: dtvconfparserhelpers.h:435
DTVModulation::kModulationQAM256
@ kModulationQAM256
Definition: dtvconfparserhelpers.h:361
TransportScanItem::m_timeoutTune
unsigned m_timeoutTune
Timeout to tune to a frequency.
Definition: frequencytables.h:181
DTVMultiplex::m_inversion
DTVInversion m_inversion
Definition: dtvmultiplex.h:96
DTVGuardInterval::kGuardInterval_1_16
@ kGuardInterval_1_16
Definition: dtvconfparserhelpers.h:497
FrequencyTable::m_coderateHp
DTVCodeRate m_coderateHp
Definition: frequencytables.h:108
DTVRollOff::toString
QString toString() const
Definition: dtvconfparserhelpers.h:768
FrequencyTable::m_offset2
int m_offset2
The second offset from the centre freq.
Definition: frequencytables.h:103
DTVMultiplex::m_guardInterval
DTVGuardInterval m_guardInterval
Definition: dtvmultiplex.h:102
compat.h
teardown_frequency_tables
bool teardown_frequency_tables(void)
Definition: frequencytables.cpp:214
DTVModulation::kModulationQAM128
@ kModulationQAM128
Definition: dtvconfparserhelpers.h:360
DTVMultiplex::m_hpCodeRate
DTVCodeRate m_hpCodeRate
High Priority FEC rate.
Definition: dtvmultiplex.h:98
DTVInversion::kInversionAuto
@ kInversionAuto
Definition: dtvconfparserhelpers.h:173
IPTVTuningData
Definition: iptvtuningdata.h:17
FrequencyTable::m_coderateLp
DTVCodeRate m_coderateLp
Definition: frequencytables.h:109
TransportScanItem::GetMultiplexIdFromDB
uint GetMultiplexIdFromDB(void) const
Fetches mplexid if it exists, based on the frequency and sourceid.
Definition: frequencytables.cpp:147
DTVInversion::kInversionOff
@ kInversionOff
Definition: dtvconfparserhelpers.h:171
FrequencyTable::m_symbolRate
uint m_symbolRate
Definition: frequencytables.h:116
DTVMultiplex::m_modSys
DTVModulationSystem m_modSys
Modulation system.
Definition: dtvmultiplex.h:106
DTVModulation::kModulationQAMAuto
@ kModulationQAMAuto
Definition: dtvconfparserhelpers.h:362
DTVMultiplex::m_fec
DTVCodeRate m_fec
Inner Forward Error Correction rate.
Definition: dtvmultiplex.h:105
uint
unsigned int uint
Definition: compat.h:140
TransportScanItem::m_freqOffsets
std::array< int, 3 > m_freqOffsets
Frequency offsets.
Definition: frequencytables.h:180
TransportScanItem::m_friendlyName
QString m_friendlyName
Name to display in scanner dialog.
Definition: frequencytables.h:173
FrequencyTable::m_hierarchy
DTVHierarchy m_hierarchy
Definition: frequencytables.h:113
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:25
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
DTVBandwidth::kBandwidthAuto
@ kBandwidthAuto
Definition: dtvconfparserhelpers.h:229
DTVTransport::channels
DTVChannelInfoList channels
Definition: dtvconfparser.h:69
channelutil.h
DTVMultiplex::m_symbolRate
uint64_t m_symbolRate
Definition: dtvmultiplex.h:95
TransportScanItem::m_expectedChannels
DTVChannelInfoList m_expectedChannels
Definition: frequencytables.h:187
FrequencyTable::m_fecInner
DTVCodeRate m_fecInner
Definition: frequencytables.h:117
DTVModulationSystem::toString
QString toString() const
Definition: dtvconfparserhelpers.h:719
TransportScanItem::m_mplexid
uint m_mplexid
DB Mplexid.
Definition: frequencytables.h:171
gChanLists
const CHANLISTS_vec gChanLists
Definition: frequencies.cpp:2230
TransportScanItem::freq_offset
uint64_t freq_offset(uint i) const
Definition: frequencytables.cpp:157
DTVPolarity::toString
QString toString() const
Definition: dtvconfparserhelpers.h:630
frequencytables.h
DTVTransmitMode::kTransmissionMode8K
@ kTransmissionMode8K
Definition: dtvconfparserhelpers.h:434
freq
uint32_t freq[4]
Definition: element.cpp:44
DTVHierarchy::kHierarchyNone
@ kHierarchyNone
Definition: dtvconfparserhelpers.h:555
frequencies_lock
static QMutex frequencies_lock
Definition: frequencytables.cpp:11
DTVMultiplex::m_sistandard
QString m_sistandard
Definition: dtvmultiplex.h:111
DTVTransmitMode::toString
QString toString() const
Definition: dtvconfparserhelpers.h:473
FrequencyTable::m_guardInterval
DTVGuardInterval m_guardInterval
Definition: frequencytables.h:112
DTVBandwidth::toString
QString toString() const
Definition: dtvconfparserhelpers.h:266
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:356
DTVTransport
Definition: dtvconfparser.h:64
get_center_frequency
long long get_center_frequency(const QString &format, const QString &modulation, const QString &country, int freqid)
Definition: frequencytables.cpp:262
DTVGuardInterval::kGuardInterval_1_32
@ kGuardInterval_1_32
Definition: dtvconfparserhelpers.h:496
DTVModulation::kModulation8VSB
@ kModulation8VSB
Definition: dtvconfparserhelpers.h:363
DTVModulation::kModulationAnalog
@ kModulationAnalog
Definition: dtvconfparserhelpers.h:370
DTVMultiplex::m_modulation
DTVModulation m_modulation
Definition: dtvmultiplex.h:100
DTVBandwidth::kBandwidth8MHz
@ kBandwidth8MHz
Definition: dtvconfparserhelpers.h:226
DTVMultiplex::m_polarity
DTVPolarity m_polarity
Definition: dtvmultiplex.h:104
frequencies
static freq_table_map_t frequencies
Definition: frequencytables.cpp:12
return
return
Definition: mythplugins/mytharchive/mytharchivehelper/main.cpp:1247
init_freq_tables
static void init_freq_tables(freq_table_map_t &)
Definition: frequencytables.cpp:316
FrequencyTable::m_bandwidth
DTVBandwidth m_bandwidth
Definition: frequencytables.h:107
FREQ
#define FREQ(A, B, C, D, E, F, G, H, I)
DTVInversion::toString
QString toString() const
Definition: dtvconfparserhelpers.h:203
DTVGuardInterval::toString
QString toString() const
Definition: dtvconfparserhelpers.h:538
TransportScanItem::offset_cnt
uint offset_cnt() const
Definition: frequencytables.h:160
DTVModulation::kModulationQAM64
@ kModulationQAM64
Definition: dtvconfparserhelpers.h:359
TransportScanItem::toString
QString toString() const
Definition: frequencytables.cpp:164
FrequencyTable::m_offset1
int m_offset1
The first offset from the centre freq.
Definition: frequencytables.h:102
DTVBandwidth::kBandwidth7MHz
@ kBandwidth7MHz
Definition: dtvconfparserhelpers.h:227
freq_table_list_t
vector< const FrequencyTable * > freq_table_list_t
Definition: frequencytables.h:26
DTVMultiplex::m_transMode
DTVTransmitMode m_transMode
Definition: dtvmultiplex.h:101
EIA_542_FREQUENCY
#define EIA_542_FREQUENCY(A, B, C)
DTVMultiplex::Clear
void Clear(void)
Definition: dtvmultiplex.h:34
DTVMultiplex::m_lpCodeRate
DTVCodeRate m_lpCodeRate
Low Priority FEC rate.
Definition: dtvmultiplex.h:99