17 const QString &format,
const QString &modulation,
const QString &country);
25 const QString &_si_std,
28 std::chrono::milliseconds _timeoutTune)
29 : m_mplexid(_mplexid), m_friendlyName(std::move(_name)),
31 m_timeoutTune(_timeoutTune)
36 if (_si_std ==
"analog")
46 std::chrono::milliseconds _timeoutTune)
48 m_friendlyName(std::move(_name)),
49 m_sourceID(_sourceid),
50 m_timeoutTune(_timeoutTune),
59 std::chrono::milliseconds _timeoutTune)
61 m_friendlyName(std::move(_name)),
62 m_sourceID(_sourceid),
63 m_timeoutTune(_timeoutTune),
64 m_expectedChannels(_tuning.channels)
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)
98 if (std.toLower() ==
"atsc")
100 else if (std.toLower() ==
"analog")
119 else if (std ==
"dvbc" || std ==
"dvbs")
133 std::chrono::milliseconds _timeoutTune) :
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))
154 return mplexid < 0 ? 0 : mplexid;
173 str += QString(
"mplexid(%1) " ).arg(
m_mplexid);
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());
226 const QString &format,
const QString &modulation,
const QString &country)
232 QString lookup = QString(
"%1_%2_%3%4")
233 .arg(format, modulation, country);
235 freq_table_map_t::const_iterator it = fmap.begin();
236 for (
uint i = 0; it != fmap.end(); i++)
238 it = fmap.find(lookup.arg(i));
239 if (it != fmap.end())
247 const QString &format,
const QString &modulation,
const QString &country)
256 for (
auto & ft : list)
263 const QString& format,
const QString& modulation,
const QString& country,
int freqid)
271 for (
auto & ft : list)
273 int min_freqid = ft->m_nameOffset;
274 int max_freqid = min_freqid +
275 ((ft->m_frequencyEnd - ft->m_frequencyStart) /
276 ft->m_frequencyStep);
278 if ((min_freqid <= freqid) && (freqid <= max_freqid))
279 return ft->m_frequencyStart +
280 (ft->m_frequencyStep * (freqid - min_freqid));
286 const QString& format, QString modulation,
const QString& country,
long long centerfreq)
288 modulation = (modulation ==
"8vsb") ?
"vsb8" : modulation;
293 for (
auto & ft : list)
295 int min_freqid = ft->m_nameOffset;
296 int max_freqid = min_freqid +
297 ((ft->m_frequencyEnd - ft->m_frequencyStart) /
298 ft->m_frequencyStep);
300 ((centerfreq - ft->m_frequencyStart) /
301 ft->m_frequencyStep) + min_freqid;
303 if ((min_freqid <= freqid) && (freqid <= max_freqid))
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)
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);
327 {
return (bandwidth * (8 + channel)) + offset;}
335 474000000, 698000000, 8000000,
"Channel %1", 21,
345 474000000, 850000000, 8000000,
"Channel %1", 21,
355 474000000, 850000000, 8000000,
"Channel %1", 21,
365 177500000, 226500000, 7000000,
"Channel %1", 5,
373 529500000, 816500000, 7000000,
"Channel %1", 28,
383 177500000, 226500000, 7000000,
"Channel %1", 5,
391 474000000, 826000000, 8000000,
"Channel %1", 21,
401 514000000, 514000000+1, 8000000,
"Channel %1", 26,
409 538000000, 538000000+1, 8000000,
"Channel %1", 29,
419 177500000, 226500000, 7000000,
"Channel %1", 5,
427 474000000, 858000000, 8000000,
"Channel %1", 21,
437 474000000, 858000000, 8000000,
"Channel %1", 21,
447 174000000, 230000000, 7000000,
"Channel %1", 5,
455 474000000, 866000000, 8000000,
"Channel %1", 21,
465 474000000, 858000000, 8000000,
"Channel %1", 21,
475 474000000, 690000000, 8000000,
"Channel %1", 21,
485 474000000, 850000000, 8000000,
"Channel %1", 21,
495 474000000, 858000000, 8000000,
"Channel %1", 21,
505 474000000, 690000000, 8000000,
"Channel %1", 21,
515 473000000, 803000000, 6000000,
"Channel %1", 14,
525 73000000, 73000000, 8000000,
"Channel D%1", 73,
529 81000000, 81000000, 8000000,
"Channel D%1", 81,
533 113000000, 121000000, 8000000,
"Channel S0%1", 2,
537 306000000, 466000000, 8000000,
"Channel S%1", 21,
541 474000000, 858000000, 8000000,
"Channel %1", 21,
547 474000000, 474000000, 8000000,
"Channel %1", 21,
553 12324000, 12324000+1, 10,
"Channel %1", 1,
557 459000000, 459000000+1, 10,
"Channel %1", 2,
563 203000000, 795000000, 100000,
"BF Channel %1", 1,
567 194750000, 794750000, 100000,
"BF Channel %1", 1 + ((795000-203000) / 100),
572 #ifdef DEBUG_DVB_OFFSETS
575 533000000, 605000000, 6000000,
"xATSC Channel %1", 24,
582 #else // if !DEBUG_DVB_OFFSETS
586 "ATSC Channel %1", 2, 57000000, 69000000, 6000000,
590 "ATSC Channel %1", 5, 79000000, 85000000, 6000000,
594 "ATSC Channel %1", 7, 177000000, 213000000, 6000000,
598 "ATSC Channel %1", 14, 473000000, 605000000, 6000000,
600 #endif // !DEBUG_DVB_OFFSETS
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 ", };
612 for (
uint i = 0; i < 4; i++)
615 FREQ(modStr[i],
"cable0", desc[i],
"Channel T-%1",
616 13, 44750000, 50750000, 6000000, mod[i]);
617 FREQ(modStr[i],
"cable1", desc[i],
"Channel %1",
618 2, 57000000, 69000000, 6000000, mod[i]);
619 FREQ(modStr[i],
"cable2", desc[i],
"Channel %1",
620 5, 79000000, 85000000, 6000000, mod[i]);
621 FREQ(modStr[i],
"cable3", desc[i],
"Channel %1",
622 7, 177000000, 213000000, 6000000, mod[i]);
623 FREQ(modStr[i],
"cable4", desc[i],
"Channel %1",
624 14, 123000000, 171000000, 6000000, mod[i]);
625 FREQ(modStr[i],
"cable5", desc[i],
"Channel %1",
626 23, 219000000, 645000000, 6000000, mod[i]);
627 FREQ(modStr[i],
"cable6", desc[i],
"Channel %1",
628 95, 93000000, 117000000, 6000000, mod[i]);
631 FREQ(modStr[i],
"cable7", desc[i],
"Channel %1",
637 FREQ(modStr[i],
"cablehigh0", desc[i],
"Channel %1",
638 78, 549000000, 645000000, 6000000, mod[i]);
639 FREQ(modStr[i],
"cablehigh1", desc[i],
"Channel %1",
645 FREQ(modStr[i],
"hrc0", desc[i],
"HRC %1",
646 1, 73753600, 73753601, 6000300, mod[i]);
647 FREQ(modStr[i],
"hrc1", desc[i],
"HRC %1",
648 2, 55752700, 67753300, 6000300, mod[i]);
649 FREQ(modStr[i],
"hrc2", desc[i],
"HRC %1",
650 5, 79753900, 85754200, 6000300, mod[i]);
651 FREQ(modStr[i],
"hrc3", desc[i],
"HRC %1",
652 7, 175758700, 211760500, 6000300, mod[i]);
653 FREQ(modStr[i],
"hrc4", desc[i],
"HRC %1",
654 14, 121756000, 169758400, 6000300, mod[i]);
655 FREQ(modStr[i],
"hrc5", desc[i],
"HRC %1",
656 23, 217760800, 643782100, 6000300, mod[i]);
657 FREQ(modStr[i],
"hrc6", desc[i],
"HRC %1",
658 95, 91754500, 115755700, 6000300, mod[i]);
661 FREQ(modStr[i],
"hrc7", desc[i],
"HRC %1",
668 FREQ(modStr[i],
"hrchigh0", desc[i],
"HRC %1",
669 76, 535776700, 643782100, 6000300, mod[i]);
670 FREQ(modStr[i],
"hrchigh1", desc[i],
"HRC %1",
676 FREQ(modStr[i],
"irc0", desc[i],
"IRC %1",
677 1, 75012500, 75012501, 6000000, mod[i]);
678 FREQ(modStr[i],
"irc1", desc[i],
"IRC %1",
679 2, 57012500, 69012500, 6000000, mod[i]);
680 FREQ(modStr[i],
"irc2", desc[i],
"IRC %1",
681 5, 81012500, 87012500, 6000000, mod[i]);
682 FREQ(modStr[i],
"irc3", desc[i],
"IRC %1",
683 7, 177012500, 213012500, 6000000, mod[i]);
684 FREQ(modStr[i],
"irc4", desc[i],
"IRC %1",
685 14, 123012500, 171012500, 6000000, mod[i]);
686 FREQ(modStr[i],
"irc5", desc[i],
"IRC %1",
687 23, 219012500, 327012500, 6000000, mod[i]);
688 FREQ(modStr[i],
"irc6", desc[i],
"IRC %1",
689 42, 333025000, 333025001, 6000000, mod[i]);
690 FREQ(modStr[i],
"irc7", desc[i],
"IRC %1",
691 43, 339012500, 645012500, 6000000, mod[i]);
692 FREQ(modStr[i],
"irc8", desc[i],
"IRC %1",
693 95, 93012500, 105012500, 6000000, mod[i]);
694 FREQ(modStr[i],
"irc9", desc[i],
"IRC %1",
695 98, 111025000, 117025000, 6000000, mod[i]);
698 FREQ(modStr[i],
"irc10", desc[i],
"IRC %1",
705 FREQ(modStr[i],
"irchigh0", desc[i],
"IRC %1",
706 76, 537012500, 645012500, 6000000, mod[i]);
707 FREQ(modStr[i],
"irchigh1", desc[i],
"IRC %1",
716 for (
uint i = 0; i < (
uint)list.size(); i++)
718 uint64_t
freq = (list[i].freq * 1000LL) + 1750000;
719 fmap[QString(
"analog_analog_%1%2").arg(name).arg(i)] =
721 QString(
"%1 %2").arg(name, list[i].name), i+2,