MythTV  master
frequencytables.cpp
Go to the documentation of this file.
1 #include <QMutex>
2 
3 #include "frequencies.h"
4 #include "frequencytables.h"
5 #include "channelutil.h"
6 #include "compat.h"
7 
8 static bool frequencies_initialized = false;
9 static QMutex frequencies_lock;
11 
12 static void init_freq_tables(freq_table_map_t& /*fmap*/);
14  const QString &format, const QString &modulation, const QString &country);
15 
17 {
18  memset(m_freqOffsets, 0, sizeof(int)*3);
19 
20  m_tuning.Clear();
21 }
22 
24  const QString &_si_std,
25  const QString &_name,
26  uint _mplexid,
27  uint _timeoutTune)
28  : m_mplexid(_mplexid), m_friendlyName(_name),
29  m_sourceID(sourceid),
30  m_timeoutTune(_timeoutTune)
31 {
32  memset(m_freqOffsets, 0, sizeof(int)*3);
33 
34  m_tuning.Clear();
35  m_tuning.m_sistandard = _si_std;
36 
37  if (_si_std == "analog")
38  {
39  m_tuning.m_sistandard = "analog";
41  }
42 }
43 
45  const QString &_name,
46  DTVMultiplex &_tuning,
47  uint _timeoutTune)
48  : m_mplexid(0),
49  m_friendlyName(_name),
50  m_sourceID(_sourceid),
51  m_timeoutTune(_timeoutTune)
52 {
53  memset(m_freqOffsets, 0, sizeof(int)*3);
54  m_tuning = _tuning;
55 }
56 
58  const QString &_name,
59  DTVTunerType _tuner_type,
60  const DTVTransport &_tuning,
61  uint _timeoutTune)
62  : m_mplexid(0),
63  m_friendlyName(_name),
64  m_sourceID(_sourceid),
65  m_timeoutTune(_timeoutTune)
66 {
67  memset(m_freqOffsets, 0, sizeof(int)*3);
68  m_expectedChannels = _tuning.channels;
69 
70  m_tuning.Clear();
71 
73  _tuner_type,
74  QString::number(_tuning.m_frequency), _tuning.m_inversion.toString(),
75  QString::number(_tuning.m_symbolrate), _tuning.m_fec.toString(),
76  _tuning.m_polarity.toString(), _tuning.m_hp_code_rate.toString(),
77  _tuning.m_lp_code_rate.toString(), _tuning.m_modulation.toString(),
78  _tuning.m_trans_mode.toString(), _tuning.m_guard_interval.toString(),
79  _tuning.m_hierarchy.toString(), _tuning.m_modulation.toString(),
80  _tuning.m_bandwidth.toString(), _tuning.m_mod_sys.toString(),
81  _tuning.m_rolloff.toString());
82 }
83 
85  const QString &std,
86  const QString &strFmt,
87  uint freqNum,
88  uint freq,
89  const FrequencyTable &ft,
90  uint timeoutTune)
91  : m_mplexid(0), m_friendlyName(strFmt),
92  m_friendlyNum(freqNum), m_sourceID(sourceid),
93  m_timeoutTune(timeoutTune)
94 {
95  memset(m_freqOffsets, 0, sizeof(int)*3);
96 
97  m_tuning.Clear();
98 
99  // setup tuning params
101  m_tuning.m_sistandard = "dvb";
103 
104  if (std.toLower() == "atsc")
105  m_tuning.m_sistandard = "atsc";
106  else if (std.toLower() == "analog")
107  {
108  m_tuning.m_sistandard = "analog";
110  }
111 
112  m_freqOffsets[1] = ft.m_offset1;
113  m_freqOffsets[2] = ft.m_offset2;
114 
115  if (std == "dvbt")
116  {
124  }
125  else if (std == "dvbc" || std == "dvbs")
126  {
129  }
130 
132 }
133 
135  const QString &_name,
136  const IPTVTuningData &_tuning,
137  const QString &_channel,
138  uint _timeoutTune) :
139  m_mplexid(0),
140  m_friendlyName(_name),
141  m_sourceID(_sourceid),
142  m_timeoutTune(_timeoutTune),
143  m_iptvTuning(_tuning), m_iptvChannel(_channel)
144 {
145  memset(m_freqOffsets, 0, sizeof(int)*3);
146  m_tuning.Clear();
147  m_tuning.m_sistandard = "MPEG";
148 }
149 
154 {
155  int mplexid = 0;
156 
157  for (uint i = 0; (i < offset_cnt()) && (mplexid <= 0); i++)
159 
160  return mplexid < 0 ? 0 : mplexid;
161 }
162 
164 {
165  int64_t freq = (int64_t) m_tuning.m_frequency;
166 
167  return (uint64_t) (freq + m_freqOffsets[i]);
168 }
169 
171 {
172  if (m_tuning.m_sistandard == "MPEG")
173  {
174  return m_iptvChannel + ": " + m_iptvTuning.GetDeviceKey();
175  }
176 
177  QString str = QString("Transport Scan Item '%1' #%2\n")
178  .arg(m_friendlyName).arg(m_friendlyNum);
179  str += QString("\tmplexid(%1) standard(%2) sourceid(%3)\n")
180  .arg(m_mplexid).arg(m_tuning.m_sistandard).arg(m_sourceID);
181  str += QString("\tuseTimer(%1) scanning(%2)\n")
182  .arg(m_useTimer).arg(m_scanning);
183  str += QString("\ttimeoutTune(%3 msec)\n").arg(m_timeoutTune);
184  if (m_tuning.m_sistandard == "atsc" || m_tuning.m_sistandard == "analog")
185  {
186  str += QString("\tfrequency(%1) modulation(%2)\n")
187  .arg(m_tuning.m_frequency)
189  }
190  else
191  {
192  str += QString("\tfrequency(%1) constellation(%2)\n")
193  .arg(m_tuning.m_frequency)
195  str += QString("\t inv(%1) bandwidth(%2) hp(%3) lp(%4)\n")
196  .arg(m_tuning.m_inversion)
197  .arg(m_tuning.m_bandwidth)
199  .arg(m_tuning.m_lp_code_rate);
200  str += QString("\t trans_mode(%1) guard_int(%2) hierarchy(%3)\n")
201  .arg(m_tuning.m_trans_mode)
203  .arg(m_tuning.m_hierarchy);
204  }
205  str += QString("\t offset[0..2]: %1 %2 %3")
206  .arg(m_freqOffsets[0]).arg(m_freqOffsets[1]).arg(m_freqOffsets[2]);
207  return str;
208 }
209 
210 static bool init_freq_tables(void)
211 {
213  {
216  }
217  return true;
218 }
219 
221 {
222  QMutexLocker locker(&frequencies_lock);
224  {
225  frequencies.clear();
226  frequencies_initialized = false;
227  }
228  return true;
229 }
230 
232  const QString &format, const QString &modulation, const QString &country)
233 {
234  const freq_table_map_t &fmap = frequencies;
235 
237 
238  QString lookup = QString("%1_%2_%3%4")
239  .arg(format).arg(modulation).arg(country);
240 
241  freq_table_map_t::const_iterator it = fmap.begin();
242  for (uint i = 0; it != fmap.end(); i++)
243  {
244  it = fmap.find(lookup.arg(i));
245  if (it != fmap.end())
246  list.push_back(*it);
247  }
248 
249  return list;
250 }
251 
253  const QString &format, const QString &modulation, const QString &country)
254 {
255  QMutexLocker locker(&frequencies_lock);
257 
259  get_matching_freq_tables_internal(format, modulation, country);
260 
261  freq_table_list_t new_list;
262  for (size_t i = 0; i < list.size(); i++)
263  new_list.push_back(new FrequencyTable(*list[i]));
264 
265  return new_list;
266 }
267 
269  const QString& format, const QString& modulation, const QString& country, int freqid)
270 {
271  QMutexLocker locker(&frequencies_lock);
273 
275  get_matching_freq_tables_internal(format, modulation, country);
276 
277  for (size_t i = 0; i < list.size(); ++i)
278  {
279  int min_freqid = list[i]->m_nameOffset;
280  int max_freqid = min_freqid +
281  ((list[i]->m_frequencyEnd - list[i]->m_frequencyStart) /
282  list[i]->m_frequencyStep);
283 
284  if ((min_freqid <= freqid) && (freqid <= max_freqid))
285  return list[i]->m_frequencyStart +
286  list[i]->m_frequencyStep * (freqid - min_freqid);
287  }
288  return -1;
289 }
290 
292  const QString& format, QString modulation, const QString& country, long long centerfreq)
293 {
294  modulation = (modulation == "8vsb") ? "vsb8" : modulation;
295 
297  get_matching_freq_tables_internal(format, modulation, country);
298 
299  for (size_t i = 0; i < list.size(); ++i)
300  {
301  int min_freqid = list[i]->m_nameOffset;
302  int max_freqid = min_freqid +
303  ((list[i]->m_frequencyEnd - list[i]->m_frequencyStart) /
304  list[i]->m_frequencyStep);
305  int freqid =
306  ((centerfreq - list[i]->m_frequencyStart) /
307  list[i]->m_frequencyStep) + min_freqid;
308 
309  if ((min_freqid <= freqid) && (freqid <= max_freqid))
310  return freqid;
311  }
312 #if 0
313  LOG(VB_GENERAL, LOG_DEBUG,
314  QString("get_closest_freqid(%1, %2, %3, %4) Failed sz(%5)")
315  .arg(format) .arg(modulation) .arg(country) .arg(centerfreq)
316  .arg(list.size()));
317 #endif
318  return -1;
319 }
320 
321 
323 {
324  // United Kingdom
325  fmap["dvbt_ofdm_gb0"] = new FrequencyTable(
326  474000000, 850000000, 8000000, "Channel %1", 21,
332  DTVModulation::kModulationQAMAuto, 166670, -166670);
333 
334  // Finland
335  fmap["dvbt_ofdm_fi0"] = new FrequencyTable(
336  474000000, 850000000, 8000000, "Channel %1", 21,
343 
344  // Sweden
345  fmap["dvbt_ofdm_se0"] = new FrequencyTable(
346  474000000, 850000000, 8000000, "Channel %1", 21,
353 
354  // Australia
355  fmap["dvbt_ofdm_au0"] = new FrequencyTable(
356  177500000, 226500000, 7000000, "Channel %1", 5,
362  DTVModulation::kModulationQAMAuto, 125000, 0); // VHF 5-12
363  fmap["dvbt_ofdm_au1"] = new FrequencyTable(
364  529500000, 816500000, 7000000, "Channel %1", 28,
370  DTVModulation::kModulationQAMAuto, 125000, 0); // UHF 28-69
371 
372  // Germany (Deutschland)
373  fmap["dvbt_ofdm_de0"] = new FrequencyTable(
374  177500000, 226500000, 7000000, "Channel %1", 5,
380  DTVModulation::kModulationQAMAuto, 0, 0); // VHF 5-12, deprecated
381  fmap["dvbt_ofdm_de1"] = new FrequencyTable(
382  474000000, 826000000, 8000000, "Channel %1", 21,
388  DTVModulation::kModulationQAMAuto, 0, 0); // UHF 21-65
389 
390  // Israel
391  fmap["dvbt_ofdm_il0"] = new FrequencyTable(
392  514000000, 514000000+1, 8000000, "Channel %1", 26,
398  DTVModulation::kModulationQAMAuto, 0, 0); // UHF 26 - central Israel
399  fmap["dvbt_ofdm_il1"] = new FrequencyTable(
400  538000000, 538000000+1, 8000000, "Channel %1", 29,
406  DTVModulation::kModulationQAMAuto, 0, 0); // UHF 29 - North and Eilat area
407 
408  // Italy (Italia)
409  fmap["dvbt_ofdm_it0"] = new FrequencyTable(
410  177500000, 226500000, 7000000, "Channel %1", 5,
416  DTVModulation::kModulationQAMAuto, 0, 0); // VHF 5-12, deprecated
417  fmap["dvbt_ofdm_it1"] = new FrequencyTable(
418  474000000, 858000000, 8000000, "Channel %1", 21,
424  DTVModulation::kModulationQAMAuto, 0, 0); // UHF 21-65
425 
426  // Czech Republic
427  fmap["dvbt_ofdm_cz0"] = new FrequencyTable(
428  474000000, 858000000, 8000000, "Channel %1", 21,
434  DTVModulation::kModulationQAM64, 0, 0); // UHF 21-69
435 
436  // Greece (Hellas)
437  fmap["dvbt_ofdm_gr0"] = new FrequencyTable(
438  174000000, 230000000, 7000000, "Channel %1", 5,
444  DTVModulation::kModulationQAMAuto, 0, 0); // VHF 5-12, deprecated
445  fmap["dvbt_ofdm_gr1"] = new FrequencyTable(
446  474000000, 866000000, 8000000, "Channel %1", 21,
452  DTVModulation::kModulationQAMAuto, 0, 0); // UHF 21-65
453 
454  // Spain
455  fmap["dvbt_ofdm_es0"] = new FrequencyTable(
456  474000000, 858000000, 8000000, "Channel %1", 21,
462  DTVModulation::kModulationQAMAuto, 125000, 0); // UHF 21-69
463 
464  // New Zealand
465  fmap["dvbt_ofdm_nz0"] = new FrequencyTable(
466  474000000, 858000000, 8000000, "Channel %1", 21,
472  DTVModulation::kModulationQAM64, 0 , 0); // UHF 21-69
473 
474  // France
475  fmap["dvbt_ofdm_fr0"] = new FrequencyTable(
476  474000000, 850000000, 8000000, "Channel %1", 21,
482  DTVModulation::kModulationQAMAuto, 167000, -166000);
483 
484  // Denmark
485  fmap["dvbt_ofdm_dk0"] = new FrequencyTable(
486  474000000, 858000000, 8000000, "Channel %1", 21,
493 
494  // Netherlands
495  fmap["dvbt_ofdm_nl0"] = new FrequencyTable(
496  474000000, 786000000, 8000000, "Channel %1", 21,
502  DTVModulation::kModulationQAMAuto, 0, 0); // UHF 21-60
503 
504  // Chile (ISDB-Tb)
505  fmap["dvbt_ofdm_cl0"] = new FrequencyTable(
506  473000000, 803000000, 6000000, "Channel %1", 14,
513 
514  // DVB-C Germany
515  fmap["dvbc_qam_de0"] = new FrequencyTable(
516  73000000, 73000000, 8000000, "Channel D%1", 73,
518  6900000, 0, 0);
519  fmap["dvbc_qam_de1"] = new FrequencyTable(
520  81000000, 81000000, 8000000, "Channel D%1", 81,
522  6900000, 0, 0);
523  fmap["dvbc_qam_de2"] = new FrequencyTable(
524  113000000, 121000000, 8000000, "Channel S0%1", 2,
526  6900000, 0, 0);
527  fmap["dvbc_qam_de3"] = new FrequencyTable(
528  306000000, 466000000, 8000000, "Channel S%1", 21,
530  6900000, 0, 0);
531  fmap["dvbc_qam_de4"] = new FrequencyTable(
532  474000000, 858000000, 8000000, "Channel %1", 21,
534  6900000, 0, 0);
535 
536  fmap["dvbc_qam_gb0"] = new FrequencyTable(
537  12324000, 12324000+1, 10, "Channel %1", 1,
539  29500000, 0, 0);
540  fmap["dvbc_qam_gb1"] = new FrequencyTable(
541  459000000, 459000000+1, 10, "Channel %1", 2,
543  6952000, 0, 0);
544 
545  fmap["dvbc_qam_bf0"] = new FrequencyTable(
546  203000000, 795000000, 100000, "BF Channel %1", 1,
548  6900000, 0, 0);
549  fmap["dvbc_qam_bf1"] = new FrequencyTable(
550  194750000, 794750000, 100000, "BF Channel %1", 1 + (795000-203000) / 100,
552  6900000, 0, 0);
553 
554 //#define DEBUG_DVB_OFFSETS
555 #ifdef DEBUG_DVB_OFFSETS
556  // UHF 14-51
557  fmap["atsc_vsb8_us0"] = new FrequencyTable(
558  533000000, 695000000, 6000000, "xATSC Channel %1", 24,
564  DTVModulation::kModulation8VSB, -100000, 100000);
565 #else // if !DEBUG_DVB_OFFSETS
566  // USA Terrestrial (center frequency, subtract 1.75 MHz for visual carrier)
567  // VHF 2-4
568  fmap["atsc_vsb8_us0"] = new FrequencyTable(
569  "ATSC Channel %1", 2, 57000000, 69000000, 6000000,
571  // VHF 5-6
572  fmap["atsc_vsb8_us1"] = new FrequencyTable(
573  "ATSC Channel %1", 5, 79000000, 85000000, 6000000,
575  // VHF 7-13
576  fmap["atsc_vsb8_us2"] = new FrequencyTable(
577  "ATSC Channel %1", 7, 177000000, 213000000, 6000000,
579  // UHF 14-51
580  fmap["atsc_vsb8_us3"] = new FrequencyTable(
581  "ATSC Channel %1", 14, 473000000, 695000000, 6000000,
583 #endif // !DEBUG_DVB_OFFSETS
584 
585  QString modStr[] = { "vsb8", "qam256", "qam128", "qam64", };
590  QString desc[] = { "ATSC ", "QAM-256 ", "QAM-128 ", "QAM-64 ", };
591 
592 #define FREQ(A,B, C,D, E,F,G, H, I) \
593  fmap[QString("atsc_%1_us%2").arg(A).arg(B)] = \
594  new FrequencyTable((C)+(D), E, F, G, H, I);
595 
596 // The maximum channel defined in the US frequency tables (standard, HRC, IRC)
597 #define US_MAX_CHAN 159
598 // Equation for computing EIA-542 frequency of channels > 99
599 // A = bandwidth, B = offset, C = channel designation (number)
600 #define EIA_542_FREQUENCY(A,B,C) ( ( (A) * ( 8 + (C) ) ) + (B) )
601 
602  for (uint i = 0; i < 4; i++)
603  {
604  // USA Cable, ch 2 to US_MAX_CHAN and T.7 to T.14
605  FREQ(modStr[i], "cable0", desc[i], "Channel %1",
606  2, 57000000, 69000000, 6000000, mod[i]); // 2-4
607  FREQ(modStr[i], "cable1", desc[i], "Channel %1",
608  5, 79000000, 85000000, 6000000, mod[i]); // 5-6
609  FREQ(modStr[i], "cable2", desc[i], "Channel %1",
610  7, 177000000, 213000000, 6000000, mod[i]); // 7-13
611  FREQ(modStr[i], "cable3", desc[i], "Channel %1",
612  14, 123000000, 171000000, 6000000, mod[i]); // 14-22
613  FREQ(modStr[i], "cable4", desc[i], "Channel %1",
614  23, 219000000, 645000000, 6000000, mod[i]); // 23-94
615  FREQ(modStr[i], "cable5", desc[i], "Channel %1",
616  95, 93000000, 117000000, 6000000, mod[i]); // 95-99
617  // The center frequency of any EIA-542 std cable channel over 99 is
618  // Frequency_MHz = ( 6 * ( 8 + channel_designation ) ) + 3
619  FREQ(modStr[i], "cable6", desc[i], "Channel %1",
620  100, 651000000,
621  EIA_542_FREQUENCY(6000000, 3000000, US_MAX_CHAN),
622  6000000, mod[i]); // 100-US_MAX_CHAN
623  FREQ(modStr[i], "cable7", desc[i], "Channel T-%1",
624  7, 8750000, 50750000, 6000000, mod[i]); // T7-14
625 
626  // USA Cable, QAM 256 ch 78 to US_MAX_CHAN
627  FREQ(modStr[i], "cablehigh0", desc[i], "Channel %1",
628  78, 549000000, 645000000, 6000000, mod[i]); // 78-94
629  FREQ(modStr[i], "cablehigh1", desc[i], "Channel %1",
630  100, 651000000,
631  EIA_542_FREQUENCY(6000000, 3000000, US_MAX_CHAN),
632  6000000, mod[i]); // 100-US_MAX_CHAN
633 
634  // USA Cable HRC, ch 1 to US_MAX_CHAN
635  FREQ(modStr[i], "hrc0", desc[i], "HRC %1",
636  1, 73753600, 73753601, 6000300, mod[i]); // 1
637  FREQ(modStr[i], "hrc1", desc[i], "HRC %1",
638  2, 55752700, 67753300, 6000300, mod[i]); // 2-4
639  FREQ(modStr[i], "hrc2", desc[i], "HRC %1",
640  5, 79753900, 85754200, 6000300, mod[i]); // 5-6
641  FREQ(modStr[i], "hrc3", desc[i], "HRC %1",
642  7, 175758700, 211760500, 6000300, mod[i]); // 7-13
643  FREQ(modStr[i], "hrc4", desc[i], "HRC %1",
644  14, 121756000, 169758400, 6000300, mod[i]); // 14-22
645  FREQ(modStr[i], "hrc5", desc[i], "HRC %1",
646  23, 217760800, 643782100, 6000300, mod[i]); // 23-94
647  FREQ(modStr[i], "hrc6", desc[i], "HRC %1",
648  95, 91754500, 115755700, 6000300, mod[i]); // 95-99
649  // The center frequency of any EIA-542 HRC cable channel over 99 is
650  // Frequency_MHz = ( 6.0003 * ( 8 + channel_designation ) ) + 1.75
651  FREQ(modStr[i], "hrc7", desc[i], "HRC %1",
652  100, 649782400,
653  EIA_542_FREQUENCY(6000300, 1750000, US_MAX_CHAN),
654  6000300, mod[i]); // 100-US_MAX_CHAN
655 
656  // USA Cable HRC, ch 76-94 and 100-US_MAX_CHAN
657  // Channels 95-99 are low frequency despite high channel numbers
658  FREQ(modStr[i], "hrchigh0", desc[i], "HRC %1",
659  76, 535776700, 643782100, 6000300, mod[i]); // 76-94
660  FREQ(modStr[i], "hrchigh1", desc[i], "HRC %1",
661  100, 649782400,
662  EIA_542_FREQUENCY(6000300, 1750000, US_MAX_CHAN),
663  6000300, mod[i]); // 100-US_MAX_CHAN
664 
665  // USA Cable IRC, ch 1 to US_MAX_CHAN
666  FREQ(modStr[i], "irc0", desc[i], "IRC %1",
667  1, 75012500, 75012501, 6000000, mod[i]); // 1
668  FREQ(modStr[i], "irc1", desc[i], "IRC %1",
669  2, 57012500, 69012500, 6000000, mod[i]); // 2-4
670  FREQ(modStr[i], "irc2", desc[i], "IRC %1",
671  5, 81012500, 87012500, 6000000, mod[i]); // 5-6
672  FREQ(modStr[i], "irc3", desc[i], "IRC %1",
673  7, 177012500, 213012500, 6000000, mod[i]); // 7-13
674  FREQ(modStr[i], "irc4", desc[i], "IRC %1",
675  14, 123012500, 171012500, 6000000, mod[i]); // 14-22
676  FREQ(modStr[i], "irc5", desc[i], "IRC %1",
677  23, 219012500, 327012500, 6000000, mod[i]); // 23-41
678  FREQ(modStr[i], "irc6", desc[i], "IRC %1",
679  42, 333025000, 333025001, 6000000, mod[i]); // 42
680  FREQ(modStr[i], "irc7", desc[i], "IRC %1",
681  43, 339012500, 645012500, 6000000, mod[i]); // 43-94
682  FREQ(modStr[i], "irc8", desc[i], "IRC %1",
683  95, 93012500, 105012500, 6000000, mod[i]); // 95-97
684  FREQ(modStr[i], "irc9", desc[i], "IRC %1",
685  98, 111025000, 117025000, 6000000, mod[i]); // 98-99
686  // The center frequency of any EIA-542 IRC cable channel over 99 is
687  // Frequency_MHz = ( 6 * ( 8 + channel_designation ) ) + 3.0125
688  FREQ(modStr[i], "irc10", desc[i], "IRC %1",
689  100, 651012500,
690  EIA_542_FREQUENCY(6000000, 3012500, US_MAX_CHAN),
691  6000000, mod[i]); // 100-US_MAX_CHAN
692 
693  // USA Cable IRC, ch 76-94 and 100-125
694  // Channels 95-99 are low frequency despite high channel numbers
695  FREQ(modStr[i], "irchigh0", desc[i], "IRC %1",
696  76, 537012500, 645012500, 6000000, mod[i]); // 76-94
697  FREQ(modStr[i], "irchigh1", desc[i], "IRC %1",
698  100, 651012500,
699  EIA_542_FREQUENCY(6000000, 3012500, US_MAX_CHAN),
700  6000000, mod[i]); // 100-US_MAX_CHAN
701  }
702 
703  // create old school frequency tables...
704  for (struct CHANLISTS *ptr = chanlists; ptr->name ; ptr++)
705  {
706  QString tbl_name = ptr->name;
707  for (uint i = 0; i < (uint)ptr->count; i++)
708  {
709  uint64_t freq = (ptr->list[i].freq * 1000LL) + 1750000;
710  fmap[QString("analog_analog_%1%2").arg(tbl_name).arg(i)] =
711  new FrequencyTable(
712  QString("%1 %2").arg(tbl_name).arg(ptr->list[i].name), i+2,
713  freq, freq + 3000000,
715  }
716  }
717 
718 }
#define US_MAX_CHAN
uint64_t m_symbolrate
Definition: dtvmultiplex.h:95
DTVHierarchy m_hierarchy
DTVCodeRate m_coderateLp
DTVGuardInterval m_guard_interval
Definition: dtvmultiplex.h:102
int m_sourceID
Associated SourceID.
DTVInversion m_inversion
DTVBandwidth m_bandwidth
Definition: dtvmultiplex.h:97
DTVHierarchy m_hierarchy
Definition: dtvmultiplex.h:103
uint m_friendlyNum
Frequency number (freqid w/freq table)
int m_freqOffsets[3]
Frequency offsets.
DTVGuardInterval m_guardInterval
DTVModulation m_modulation
DTVPolarity m_polarity
Definition: dtvmultiplex.h:104
unsigned m_timeoutTune
Timeout to tune to a frequency.
IPTVTuningData m_iptvTuning
IPTV Tuning info.
vector< const FrequencyTable * > freq_table_list_t
QString toString() const
struct CHANLIST * list
Definition: frequencies.h:103
unsigned int uint
Definition: compat.h:140
freq_table_list_t get_matching_freq_tables(const QString &format, const QString &modulation, const QString &country)
QMap< QString, const FrequencyTable * > freq_table_map_t
DTVInversion m_inversion
Definition: dtvmultiplex.h:96
uint32_t freq[4]
Definition: element.c:44
bool teardown_frequency_tables(void)
DTVCodeRate m_lp_code_rate
Low Priority FEC rate.
Definition: dtvmultiplex.h:99
QString m_iptvChannel
IPTV base channel.
static uint GetMplexID(uint sourceid, const QString &channum)
bool m_useTimer
Set if timer is used after lock for getting PAT.
QString toString() const
int get_closest_freqid(const QString &format, QString modulation, const QString &country, long long centerfreq)
DTVCodeRate m_fec
Inner Forward Error Correction rate.
Definition: dtvmultiplex.h:105
const char * name
Definition: frequencies.h:102
uint GetMultiplexIdFromDB(void) const
Fetches mplexid if it exists, based on the frequency and sourceid.
QString toString() const
DTVCodeRate m_hp_code_rate
High Priority FEC rate.
Definition: dtvmultiplex.h:98
DTVModulation m_modulation
Definition: dtvmultiplex.h:100
struct CHANLISTS chanlists[]
DTVCodeRate m_fecInner
QString toString() const
long long get_center_frequency(const QString &format, const QString &modulation, const QString &country, int freqid)
DTVChannelInfoList m_expectedChannels
DTVCodeRate m_coderateHp
QString toString() const
QString toString() const
#define FREQ(A, B, C, D, E, F, G, H, I)
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)
static void init_freq_tables(freq_table_map_t &)
DTVBandwidth m_bandwidth
QString m_sistandard
Definition: dtvmultiplex.h:111
QString m_friendlyName
Name to display in scanner dialog.
QString GetDeviceKey(void) const
QString toString() const
DTVRollOff m_rolloff
Definition: dtvmultiplex.h:107
static freq_table_list_t get_matching_freq_tables_internal(const QString &format, const QString &modulation, const QString &country)
#define LOG(_MASK_, _LEVEL_, _STRING_)
Definition: mythlogging.h:41
uint64_t freq_offset(uint i) const
QString toString() const
QString toString() const
static QMutex frequencies_lock
DTVTransmitMode m_transMode
int m_offset1
The first offset from the centre freq.
void Clear(void)
Definition: dtvmultiplex.h:34
int m_offset2
The second offset from the centre freq.
uint m_mplexid
DB Mplexid.
DTVChannelInfoList channels
Definition: dtvconfparser.h:68
static freq_table_map_t frequencies
uint offset_cnt() const
static bool frequencies_initialized
QString toString() const
DTVModulationSystem m_mod_sys
Modulation system.
Definition: dtvmultiplex.h:106
#define EIA_542_FREQUENCY(A, B, C)
bool m_scanning
Probbably Unnecessary.
DTVMultiplex m_tuning
Tuning info.
uint64_t m_frequency
Definition: dtvmultiplex.h:94
DTVTransmitMode m_trans_mode
Definition: dtvmultiplex.h:101