MythTV  master
dtvconfparserhelpers.h
Go to the documentation of this file.
1 /* -*- Mode: c++ -*-
2  * vim: set expandtab tabstop=4 shiftwidth=4:
3  *
4  * Original Project
5  * MythTV http://www.mythtv.org
6  *
7  * Author(s):
8  * John Pullan (john@pullan.org)
9  *
10  * Description:
11  * Collection of classes to provide dvb channel scanning
12  * functionallity
13  *
14  *
15  * This program is free software; you can redistribute it and/or
16  * modify it under the terms of the GNU General Public License
17  * as published by the Free Software Foundation; either version 2
18  * of the License, or (at your option) any later version.
19  *
20  * This program is distributed in the hope that it will be useful,
21  * but WITHOUT ANY WARRANTY; without even the implied warranty of
22  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23  * GNU General Public License for more details.
24  *
25  * You should have received a copy of the GNU General Public License
26  * along with this program; if not, write to the Free Software
27  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
28  * Or, point your browser to http://www.gnu.org/copyleft/gpl.html
29  *
30  */
31 
32 #ifndef DTVCONFPARSERHELPERS_H
33 #define DTVCONFPARSERHELPERS_H
34 
35 #include <QString>
36 #ifdef USING_DVB
37 #include <linux/dvb/frontend.h>
38 #endif
39 
40 // The following are a set of helper classes to allow easy translation
41 // between the different string representations of various tuning params.
42 
44 {
45  QString symbol;
46  int value;
47 };
48 
54 {
55  public:
56  explicit DTVParamHelper(int _value) : m_value(_value) { }
57  DTVParamHelper &operator=(int _value) { m_value = _value; return *this; }
58 
59  operator int() const { return m_value; }
60  bool operator==(const int& v) const { return m_value == v; }
61  bool operator!=(const int& v) const { return m_value != v; }
62 
63  protected:
64  static bool ParseParam(const QString &symbol, int &value,
65  const DTVParamHelperStruct *table);
66 
67  static QString toString(const char *strings[], int index,
68  uint strings_size);
69 
70  protected:
71  int m_value;
72 };
73 
75 {
77 
78  public:
79  // WARNING: kTunerTypes cannot be defined by a C++03 enum
80  // because gcc 4.3.3 will reportedly promote an enum inconsistently
81  // to int on IA-32 platforms. I don't know whether this is
82  // correct or not, it comes down to interpretation of section
83  // 7.2.5 and whether 0x80000000 should be considered to big
84  // for a 32 bit integer or not. Using an enum to represent int
85  // bitmasks is valid C code, but the C++03 standard was still a
86  // bit loosey gosey on this point. It looks like the breakage
87  // was caused by work in gcc to support C++0x which will allow
88  // one to specify things as exactly as C does. -- dtk 2009-10-05
89 
90  // // Modulations which may be supported
91  static const int kTunerTypeDVBS1; // QPSK
92  static const int kTunerTypeDVBS2; // QPSK, 8PSK, 16APSK, 32APSK
93  static const int kTunerTypeDVBC; // QAM-64, QAM-256
94  static const int kTunerTypeDVBT; // OFDM
95  static const int kTunerTypeDVBT2; // OFDM
96  static const int kTunerTypeATSC; // 8-VSB, 16-VSB,
97  // QAM-16, QAM-64, QAM-256, QPSK
98  static const int kTunerTypeASI; // baseband
99  static const int kTunerTypeOCUR; // Virtual Channel tuning of QAM-64/256
100  static const int kTunerTypeIPTV; // IPTV
101  static const int kTunerTypeUnknown;
102 
103  // Note: Just because some cards sold in different regions support the same
104  // modulation scheme does not mean that they decode the same signals, there
105  // are also region specific FEC algorithms and the tuner which precedes the
106  // demodulator may be limited to frequencies used in that specific market.
107  // The tuner may also be bandwidth limited to 6 or 7 Mhz, so it could not
108  // support the 8 Mhz channels used in some contries, and/or the ADC which
109  // sits between the tuner and the demodulator may be bandwidth limited.
110  // While often the same hardware could physically support more than it
111  // is designed for the card/device maker does not write the firmware
112  // but licenses blocks of it and so only selects the pieces absolutely
113  // necessary for their market segment. Some ATSC cards only supported
114  // 8-VSB, newer cards don't support the unpopular 16-VSB, no consumer
115  // card supports the QAM-16 or QPSK used for USA Cable PSIP, etc.
116  // DVB-S cards also generally support DiSEqC signaling, and future
117  // ATSC cards may support similar but incompatible signalling for
118  // pointable antennas.
119  //
120  // Note 2: These values are keyed to the Linux DVB driver values, in
121  // reality some hardware does support multiple formats and this should
122  // be a mask. Also the transmission schemes used in Asia and South
123  // America are not represented here.
124 
125  explicit DTVTunerType(int _default = kTunerTypeUnknown)
126  : DTVParamHelper(_default) { initStr(); }
127  DTVTunerType& operator=(int type) { m_value = type; return *this; }
128 
129  bool Parse(const QString &_value)
130  { return ParseParam(_value, m_value, kParseTable); }
131 
132  bool IsFECVariable(void) const
133  {
134  return ((kTunerTypeDVBC == m_value) ||
135  (kTunerTypeDVBS1 == m_value) ||
136  (kTunerTypeDVBS2 == m_value));
137  }
138 
139  bool IsModulationVariable(void) const
140  {
141  return ((kTunerTypeDVBC == m_value) ||
142  (kTunerTypeATSC == m_value) ||
143  (kTunerTypeDVBS2 == m_value));
144  }
145 
146  bool IsDiSEqCSupported(void) const
147  {
148  return ((kTunerTypeDVBS1 == m_value) ||
149  (kTunerTypeDVBS2 == m_value));
150  }
151 
152  QString toString() const { return toString(m_value); }
153 
154  static void initStr(void);
155  static QString toString(int _value);
156 };
157 
159 {
160  protected:
164  static const uint kDBStrCnt = 3;
165  static const char *s_dbStr[kDBStrCnt];
166 
167  public:
168  enum Types
169  {
173  };
174 #ifdef USING_DVB
175  static_assert((kInversionOff == (Types)INVERSION_OFF ) &&
176  (kInversionOn == (Types)INVERSION_ON ) &&
177  (kInversionAuto == (Types)INVERSION_AUTO),
178  "Inversion types don't match DVB includes.");
179 #endif
180 
181  explicit DTVInversion(Types _default = kInversionAuto)
182  : DTVParamHelper(_default) { }
183  DTVInversion& operator=(const Types _value)
184  { m_value = _value; return *this; }
185 #ifdef USING_DVB
186  DTVInversion& operator=(const fe_spectral_inversion_t type)
187  { m_value = type; return *this; }
188 #endif
189 
190  bool IsCompatible(const DTVInversion &other) const
191  { return m_value == other.m_value || m_value == kInversionAuto ||
192  other.m_value == kInversionAuto;
193  }
194 
195  bool ParseConf(const QString &_value)
196  { return ParseParam(_value, m_value, kConfTable); }
197  bool ParseVDR(const QString &_value)
198  { return ParseParam(_value, m_value, kVdrTable); }
199  bool Parse(const QString &_value)
200  { return ParseParam(_value, m_value, kParseTable); }
201 
202  QString toString() const { return toString(m_value); }
203  QChar toChar() const
204  {
205  if (toString().length() > 0)
206  return toString()[0];
207  return {0};
208  }
209 
210  static QString toString(int _value)
211  { return DTVParamHelper::toString(s_dbStr, _value, kDBStrCnt); }
212 };
213 
215 {
216  protected:
220  static const uint kDBStrCnt = 7;
221  static const char *s_dbStr[kDBStrCnt];
222 
223  public:
224  enum Types
225  {
233  };
234 #ifdef USING_DVB
235  static_assert((kBandwidth8MHz == (Types)BANDWIDTH_8_MHZ ) &&
236  (kBandwidth7MHz == (Types)BANDWIDTH_7_MHZ ) &&
237  (kBandwidth6MHz == (Types)BANDWIDTH_6_MHZ ) &&
238  (kBandwidthAuto == (Types)BANDWIDTH_AUTO ) &&
239  (kBandwidth5MHz == (Types)BANDWIDTH_5_MHZ ) &&
240  (kBandwidth10MHz == (Types)BANDWIDTH_10_MHZ ) &&
241  (kBandwidth1712kHz == (Types)BANDWIDTH_1_712_MHZ),
242  "Bandwidth types don't match DVB includes.");
243 #endif
244 
245  explicit DTVBandwidth(Types _default = kBandwidthAuto)
246  : DTVParamHelper(_default) { }
247  DTVBandwidth& operator=(const Types _value)
248  { m_value = _value; return *this; }
249 #ifdef USING_DVB
250  DTVBandwidth& operator=(const fe_bandwidth_t bwidth)
251  { m_value = bwidth; return *this; }
252 #endif
253 
254  bool IsCompatible(const DTVBandwidth &other) const
255  { return m_value == other.m_value || m_value == kBandwidthAuto ||
256  other.m_value == kBandwidthAuto;
257  }
258 
259  bool ParseConf(const QString &_value)
260  { return ParseParam(_value, m_value, kConfTable); }
261  bool ParseVDR(const QString &_value)
262  { return ParseParam(_value, m_value, kVdrTable); }
263  bool Parse(const QString &_value)
264  { return ParseParam(_value, m_value, kParseTable); }
265 
266  QString toString() const { return toString(m_value); }
267  QChar toChar() const
268  {
269  if (toString().length() > 0)
270  return toString()[0];
271  return {0};
272  }
273 
274  static QString toString(int _value)
275  { return DTVParamHelper::toString(s_dbStr, _value, kDBStrCnt); }
276 };
277 
279 {
280  protected:
284  static const uint kDBStrCnt = 12;
285  static const char *s_dbStr[kDBStrCnt];
286 
287  public:
288  enum Types
289  {
302  };
303 #ifdef USING_DVB
304  static_assert((kFECNone == (Types)FEC_NONE) &&
305  (kFEC_1_2 == (Types)FEC_1_2 ) &&
306  (kFEC_2_3 == (Types)FEC_2_3 ) &&
307  (kFEC_3_4 == (Types)FEC_3_4 ) &&
308  (kFEC_4_5 == (Types)FEC_4_5 ) &&
309  (kFEC_5_6 == (Types)FEC_5_6 ) &&
310  (kFEC_6_7 == (Types)FEC_6_7 ) &&
311  (kFEC_7_8 == (Types)FEC_7_8 ) &&
312  (kFEC_8_9 == (Types)FEC_8_9 ) &&
313  (kFECAuto == (Types)FEC_AUTO) &&
314  (kFEC_3_5 == (Types)FEC_3_5 ) &&
315  (kFEC_9_10 == (Types)FEC_9_10),
316  "FEC types don't match DVB includes.");
317 #endif
318 
319  explicit DTVCodeRate(Types _default = kFECAuto)
320  : DTVParamHelper(_default) { }
321  DTVCodeRate& operator=(const Types _value)
322  { m_value = _value; return *this; }
323 #ifdef USING_DVB
324  DTVCodeRate& operator=(const fe_code_rate_t rate)
325  { m_value = rate; return *this; }
326 #endif
327 
328  bool IsCompatible(const DTVCodeRate &other) const
329  { return m_value == other.m_value || m_value == kFECAuto ||
330  other.m_value == kFECAuto;
331  }
332 
333  bool ParseConf(const QString &_value)
334  { return ParseParam(_value, m_value, kConfTable); }
335  bool ParseVDR(const QString &_value)
336  { return ParseParam(_value, m_value, kVdrTable); }
337  bool Parse(const QString &_value)
338  { return ParseParam(_value, m_value, kParseTable); }
339 
340  QString toString() const { return toString(m_value); }
341 
342  static QString toString(int _value)
343  { return DTVParamHelper::toString(s_dbStr, _value, kDBStrCnt); }
344 };
345 
347 {
348  protected:
352  static const uint kDBStrCnt = 13;
353  static const char *s_dbStr[kDBStrCnt];
354 
355  public:
356  enum Types
357  {
371  kModulationInvalid = 0x100, /* for removed modulations */
372  kModulationAnalog = 0x200, /* for analog channel scanner */
373  };
374 #ifdef USING_DVB
375  static_assert((kModulationQPSK == (Types)QPSK ) &&
376  (kModulationQAM16 == (Types)QAM_16 ) &&
377  (kModulationQAM32 == (Types)QAM_32 ) &&
378  (kModulationQAM64 == (Types)QAM_64 ) &&
379  (kModulationQAM128 == (Types)QAM_128 ) &&
380  (kModulationQAM256 == (Types)QAM_256 ) &&
381  (kModulationQAMAuto == (Types)QAM_AUTO) &&
382  (kModulation8VSB == (Types)VSB_8 ) &&
383  (kModulation16VSB == (Types)VSB_16 ) &&
384  (kModulation8PSK == (Types)PSK_8 ) &&
385  (kModulation16APSK == (Types)APSK_16 ) &&
386  (kModulation32APSK == (Types)APSK_32 ) &&
387  (kModulationDQPSK == (Types)DQPSK ),
388  "Modulation types don't match DVB includes.");
389 #endif
390 
392  : DTVParamHelper(_default) { }
394  { m_value = _value; return *this; }
395 #ifdef USING_DVB
396  DTVModulation& operator=(const fe_modulation_t modulation)
397  { m_value = modulation; return *this; }
398 #endif
399 
400  bool IsCompatible(const DTVModulation &other) const
401  { return m_value == other.m_value || m_value == kModulationQAMAuto ||
402  other.m_value == kModulationQAMAuto;
403  }
404 
405  bool ParseConf(const QString &_value)
406  { return ParseParam(_value, m_value, kConfTable); }
407  bool ParseVDR(const QString &_value)
408  { return ParseParam(_value, m_value, kVdrTable); }
409  bool Parse(const QString &_value)
410  { return ParseParam(_value, m_value, kParseTable); }
411 
412  QString toString() const { return toString(m_value); }
413 
414  static QString toString(int _value)
415  {
416  if (kModulationInvalid == _value)
417  return "invalid";
418  if (kModulationAnalog == _value)
419  return "analog";
420  return DTVParamHelper::toString(s_dbStr, _value, kDBStrCnt);
421  }
422 };
423 
425 {
426  protected:
430  static const uint kDBStrCnt = 7;
431  static const char *s_dbStr[kDBStrCnt];
432 
433  public:
434  enum Types
435  {
443  };
444 #ifdef USING_DVB
445  static_assert((kTransmissionMode2K == (Types)TRANSMISSION_MODE_2K ) &&
446  (kTransmissionMode8K == (Types)TRANSMISSION_MODE_8K ) &&
447  (kTransmissionModeAuto == (Types)TRANSMISSION_MODE_AUTO) &&
448  (kTransmissionMode4K == (Types)TRANSMISSION_MODE_4K ) &&
449  (kTransmissionMode1K == (Types)TRANSMISSION_MODE_1K ) &&
450  (kTransmissionMode16K == (Types)TRANSMISSION_MODE_16K ) &&
451  (kTransmissionMode32K == (Types)TRANSMISSION_MODE_32K ),
452  "Transmission types don't match DVB includes.");
453 #endif
454 
456  : DTVParamHelper(_default) { }
458  { m_value = _value; return *this; }
459 #ifdef USING_DVB
460  DTVTransmitMode& operator=(const fe_transmit_mode_t mode)
461  { m_value = mode; return *this; }
462 #endif
463 
464  bool IsCompatible(const DTVTransmitMode &other) const
465  { return m_value == other.m_value || m_value == kTransmissionModeAuto ||
467  }
468 
469  bool ParseConf(const QString &_value)
470  { return ParseParam(_value, m_value, kConfTable); }
471  bool ParseVDR(const QString &_value)
472  { return ParseParam(_value, m_value, kVdrTable); }
473  bool Parse(const QString &_value)
474  { return ParseParam(_value, m_value, kParseTable); }
475 
476  QString toString() const { return toString(m_value); }
477  QChar toChar() const
478  {
479  if (toString().length() > 0)
480  return toString()[0];
481  return {0};
482  }
483 
484  static QString toString(int _value)
485  { return DTVParamHelper::toString(s_dbStr, _value, kDBStrCnt); }
486 };
487 
489 {
490  protected:
494  static const uint kDBStrCnt = 8;
495  static const char *s_dbStr[kDBStrCnt];
496 
497  public:
498  enum Types
499  {
508  };
509 #ifdef USING_DVB
510  static_assert((kGuardInterval_1_32 == (Types)GUARD_INTERVAL_1_32 ) &&
511  (kGuardInterval_1_16 == (Types)GUARD_INTERVAL_1_16 ) &&
512  (kGuardInterval_1_8 == (Types)GUARD_INTERVAL_1_8 ) &&
513  (kGuardInterval_1_4 == (Types)GUARD_INTERVAL_1_4 ) &&
514  (kGuardIntervalAuto == (Types)GUARD_INTERVAL_AUTO ) &&
515  (kGuardInterval_1_128 == (Types)GUARD_INTERVAL_1_128 ) &&
516  (kGuardInterval_19_128 == (Types)GUARD_INTERVAL_19_128) &&
517  (kGuardInterval_19_256 == (Types)GUARD_INTERVAL_19_256),
518  "Guard Interval types don't match DVB includes.");
519 #endif
520 
522  : DTVParamHelper(_default) { }
524  { m_value = _value; return *this; }
525 #ifdef USING_DVB
526  DTVGuardInterval& operator=(const fe_guard_interval_t interval)
527  { m_value = interval; return *this; }
528 #endif
529 
530  bool IsCompatible(const DTVGuardInterval &other) const
531  { return m_value == other.m_value || m_value == kGuardIntervalAuto ||
532  other.m_value == kGuardIntervalAuto;
533  }
534 
535  bool ParseConf(const QString &_value)
536  { return ParseParam(_value, m_value, kConfTable); }
537  bool ParseVDR(const QString &_value)
538  { return ParseParam(_value, m_value, kVdrTable); }
539  bool Parse(const QString &_value)
540  { return ParseParam(_value, m_value, kParseTable); }
541 
542  QString toString() const { return toString(m_value); }
543 
544  static QString toString(int _value)
545  { return DTVParamHelper::toString(s_dbStr, _value, kDBStrCnt); }
546 };
547 
549 {
550  protected:
554  static const uint kDBStrCnt = 5;
555  static const char *s_dbStr[kDBStrCnt];
556 
557  public:
558  enum Types
559  {
565  };
566 #ifdef USING_DVB
567  static_assert((kHierarchyNone == (Types)HIERARCHY_NONE) &&
568  (kHierarchy1 == (Types)HIERARCHY_1 ) &&
569  (kHierarchy2 == (Types)HIERARCHY_2 ) &&
570  (kHierarchy4 == (Types)HIERARCHY_4 ) &&
571  (kHierarchyAuto == (Types)HIERARCHY_AUTO),
572  "Hierarchy types don't match DVB includes.");
573 #endif
574 
575  explicit DTVHierarchy(Types _default = kHierarchyAuto)
576  : DTVParamHelper(_default) { }
577  DTVHierarchy& operator=(const Types _value)
578  { m_value = _value; return *this; }
579 #ifdef USING_DVB
580  DTVHierarchy& operator=(const fe_hierarchy_t hierarchy)
581  { m_value = hierarchy; return *this; }
582 #endif
583 
584  bool IsCompatible(const DTVHierarchy &other) const
585  { return m_value == other.m_value || m_value == kHierarchyAuto ||
586  other.m_value == kHierarchyAuto;
587  }
588 
589  bool ParseConf(const QString &_value)
590  { return ParseParam(_value, m_value, kConfTable); }
591  bool ParseVDR(const QString &_value)
592  { return ParseParam(_value, m_value, kVdrTable); }
593  bool Parse(const QString &_value)
594  { return ParseParam(_value, m_value, kParseTable); }
595 
596  QString toString() const { return toString(m_value); }
597  QChar toChar() const
598  {
599  if (toString().length() > 0)
600  return toString()[0];
601  return {0};
602  }
603 
604  static QString toString(int _value)
605  { return DTVParamHelper::toString(s_dbStr, _value, kDBStrCnt); }
606 };
607 
609 {
610  protected:
612  static const uint kDBStrCnt = 4;
613  static const char *s_dbStr[kDBStrCnt];
614 
615  public:
617  {
622  };
623 
625  : DTVParamHelper(_default) { }
627  { m_value = _value; return *this; }
628 
629  bool ParseConf(const QString &_value)
630  { return ParseParam(_value, m_value, kParseTable); }
631  bool ParseVDR(const QString &_value)
632  { return ParseParam(_value, m_value, kParseTable); }
633  bool Parse(const QString &_value)
634  { return ParseParam(_value, m_value, kParseTable); }
635 
636  QString toString() const { return toString(m_value); }
637  QChar toChar() const
638  {
639  if (toString().length() > 0)
640  return toString()[0];
641  return {0};
642  }
643 
644  static QString toString(int _value)
645  { return DTVParamHelper::toString(s_dbStr, _value, kDBStrCnt); }
646 };
647 
649 {
650  protected:
654  static const uint kDBStrCnt = 19;
655  static const char *s_dbStr[kDBStrCnt];
656 
657  public:
658  enum Types
659  {
660  // see fe_delivery_system in frontend.h
680  };
681 #ifdef USING_DVB
682  static_assert((kModulationSystem_UNDEFINED == (Types)SYS_UNDEFINED ) &&
683  (kModulationSystem_DVBC_ANNEX_A == (Types)SYS_DVBC_ANNEX_A) &&
684  (kModulationSystem_DVBC_ANNEX_B == (Types)SYS_DVBC_ANNEX_B) &&
685  (kModulationSystem_DVBT == (Types)SYS_DVBT ) &&
686  (kModulationSystem_DSS == (Types)SYS_DSS ) &&
687  (kModulationSystem_DVBS == (Types)SYS_DVBS ) &&
688  (kModulationSystem_DVBS2 == (Types)SYS_DVBS2 ) &&
689  (kModulationSystem_DVBH == (Types)SYS_DVBH ) &&
690  (kModulationSystem_ISDBT == (Types)SYS_ISDBT ) &&
691  (kModulationSystem_ISDBS == (Types)SYS_ISDBS ) &&
692  (kModulationSystem_ISDBC == (Types)SYS_ISDBC ) &&
693  (kModulationSystem_ATSC == (Types)SYS_ATSC ) &&
694  (kModulationSystem_ATSCMH == (Types)SYS_ATSCMH ) &&
695  (kModulationSystem_DTMB == (Types)SYS_DTMB ) &&
696  (kModulationSystem_CMMB == (Types)SYS_CMMB ) &&
697  (kModulationSystem_DAB == (Types)SYS_DAB ) &&
698  (kModulationSystem_DVBT2 == (Types)SYS_DVBT2 ) &&
699  (kModulationSystem_TURBO == (Types)SYS_TURBO ) &&
700  (kModulationSystem_DVBC_ANNEX_C == (Types)SYS_DVBC_ANNEX_C),
701  "Modulation System types don't match DVB includes.");
702 #endif
703 
705  : DTVParamHelper(_default) { }
707  { m_value = _value; return *this; }
708 #ifdef USING_DVB
709  DTVModulationSystem& operator=(fe_delivery_system_t type)
710  { m_value = type; return *this; }
711 #endif
712  bool IsCompatible(const DTVModulationSystem &other) const
713  { return
714  (m_value == other.m_value) ||
717  }
718 
719  bool ParseConf(const QString &_value)
720  { return ParseParam(_value, m_value, kConfTable); }
721  bool ParseVDR(const QString &_value)
722  { return ParseParam(_value, m_value, kVdrTable); }
723  bool Parse(const QString &_value)
724  { return ParseParam(_value, m_value, kParseTable); }
725 
726  QString toString() const { return toString(m_value); }
727 
728  static QString toString(int _value)
729  { return DTVParamHelper::toString(s_dbStr, _value, kDBStrCnt); }
730 };
731 
733 {
734  protected:
738  static const uint kDBStrCnt = 4;
739  static const char *s_dbStr[kDBStrCnt];
740 
741  public:
742  enum Types
743  {
748  };
749 #ifdef USING_DVB
750  static_assert((kRollOff_35 == (Types)ROLLOFF_35)
751  && (kRollOff_Auto == (Types)ROLLOFF_AUTO),
752  "Rolloff types don't match DVB includes.");
753 #endif
754 
755  explicit DTVRollOff(Types _default = kRollOff_35)
756  : DTVParamHelper(_default) { }
757  DTVRollOff& operator=(const Types _value)
758  { m_value = _value; return *this; }
759 #ifdef USING_DVB
760  DTVRollOff& operator=(fe_rolloff_t type)
761  { m_value = type; return *this; }
762 #endif
763 
764  bool IsCompatible(const DTVRollOff &other) const
765  { return m_value == other.m_value || m_value == kRollOff_Auto ||
766  other.m_value == kRollOff_Auto;
767  }
768 
769  bool ParseConf(const QString &_value)
770  { return ParseParam(_value, m_value, kConfTable); }
771  bool ParseVDR(const QString &_value)
772  { return ParseParam(_value, m_value, kVdrTable); }
773  bool Parse(const QString &_value)
774  { return ParseParam(_value, m_value, kParseTable); }
775 
776  QString toString() const { return toString(m_value); }
777 
778  static QString toString(int _value)
779  { return DTVParamHelper::toString(s_dbStr, _value, kDBStrCnt); }
780 };
781 
782 #endif // DTVCONFPARSERHELPERS_H
static const DTVParamHelperStruct kConfTable[]
bool ParseConf(const QString &_value)
bool Parse(const QString &_value)
static QString toString(int _value)
bool IsCompatible(const DTVGuardInterval &other) const
bool Parse(const QString &_value)
bool ParseConf(const QString &_value)
bool Parse(const QString &_value)
DTVHierarchy & operator=(const fe_hierarchy_t hierarchy)
static const DTVParamHelperStruct kConfTable[]
static const int kTunerTypeDVBT
static const uint kDBStrCnt
static const char * s_dbStr[kDBStrCnt]
DTVBandwidth(Types _default=kBandwidthAuto)
static const DTVParamHelperStruct kParseTable[]
static const DTVParamHelperStruct kConfTable[]
static const int kTunerTypeATSC
static QString toString(int _value)
static const uint kDBStrCnt
DTVInversion & operator=(const fe_spectral_inversion_t type)
static const int kTunerTypeUnknown
bool Parse(const QString &_value)
bool ParseVDR(const QString &_value)
DTVModulation(Types _default=kModulationQAMAuto)
static const char * s_dbStr[kDBStrCnt]
bool ParseVDR(const QString &_value)
static const uint kDBStrCnt
bool ParseConf(const QString &_value)
bool ParseVDR(const QString &_value)
bool IsCompatible(const DTVHierarchy &other) const
bool IsCompatible(const DTVTransmitMode &other) const
static const int kTunerTypeOCUR
DTVTunerType(int _default=kTunerTypeUnknown)
static const uint kDBStrCnt
bool ParseConf(const QString &_value)
bool Parse(const QString &_value)
QString toString() const
static QString toString(const char *strings[], int index, uint strings_size)
static const DTVParamHelperStruct kVdrTable[]
static const DTVParamHelperStruct kParseTable[]
DTVTransmitMode & operator=(const Types _value)
static const DTVParamHelperStruct kVdrTable[]
static const int kTunerTypeDVBS1
DTVModulationSystem & operator=(fe_delivery_system_t type)
static const DTVParamHelperStruct kVdrTable[]
bool Parse(const QString &_value)
static const DTVParamHelperStruct kVdrTable[]
QString toString() const
DTVCodeRate & operator=(const Types _value)
static const DTVParamHelperStruct kVdrTable[]
bool operator!=(const int &v) const
QChar toChar() const
static const DTVParamHelperStruct kParseTable[]
static const DTVParamHelperStruct kConfTable[]
QString toString() const
DTVInversion & operator=(const Types _value)
DTVModulationSystem & operator=(const Types _value)
bool IsFECVariable(void) const
static const DTVParamHelperStruct kConfTable[]
static const uint kDBStrCnt
static const DTVParamHelperStruct kVdrTable[]
bool Parse(const QString &_value)
DTVCodeRate & operator=(const fe_code_rate_t rate)
static const int kTunerTypeDVBS2
QString toString() const
DTVPolarity & operator=(const PolarityValues _value)
static const int kTunerTypeDVBT2
static QString toString(int _value)
DTVGuardInterval & operator=(const fe_guard_interval_t interval)
static const int kTunerTypeDVBC
bool Parse(const QString &_value)
static const DTVParamHelperStruct kParseTable[]
DTVHierarchy(Types _default=kHierarchyAuto)
static QString toString(int _value)
DTVInversion(Types _default=kInversionAuto)
static const char * s_dbStr[kDBStrCnt]
bool operator==(const int &v) const
static const DTVParamHelperStruct kVdrTable[]
DTVRollOff(Types _default=kRollOff_35)
QString toString() const
static const DTVParamHelperStruct kParseTable[]
static const uint kDBStrCnt
bool IsCompatible(const DTVCodeRate &other) const
bool ParseConf(const QString &_value)
static const DTVParamHelperStruct kParseTable[]
static const char * s_dbStr[kDBStrCnt]
QString toString() const
static const DTVParamHelperStruct kConfTable[]
static const DTVParamHelperStruct kParseTable[]
static QString toString(int _value)
Helper abstract template to do some of the mundane portions of translating and comparing the paramate...
static const uint kDBStrCnt
static QString toString(int _value)
unsigned int uint
Definition: compat.h:140
bool IsCompatible(const DTVRollOff &other) const
bool ParseVDR(const QString &_value)
QChar toChar() const
DTVTransmitMode(Types _default=kTransmissionModeAuto)
DTVRollOff & operator=(const Types _value)
static const DTVParamHelperStruct kParseTable[]
DTVGuardInterval(Types _default=kGuardIntervalAuto)
QChar toChar() const
DTVParamHelper & operator=(int _value)
bool ParseVDR(const QString &_value)
static const uint kDBStrCnt
static const char * s_dbStr[kDBStrCnt]
static const DTVParamHelperStruct kParseTable[]
DTVHierarchy & operator=(const Types _value)
DTVTransmitMode & operator=(const fe_transmit_mode_t mode)
bool ParseConf(const QString &_value)
static QString toString(int _value)
bool ParseVDR(const QString &_value)
static const DTVParamHelperStruct kVdrTable[]
static const char * s_dbStr[kDBStrCnt]
static bool ParseParam(const QString &symbol, int &value, const DTVParamHelperStruct *table)
QString toString() const
DTVBandwidth & operator=(const fe_bandwidth_t bwidth)
static const int kTunerTypeIPTV
bool IsCompatible(const DTVInversion &other) const
bool IsDiSEqCSupported(void) const
static const int kTunerTypeASI
DTVCodeRate(Types _default=kFECAuto)
bool ParseConf(const QString &_value)
static const DTVParamHelperStruct kParseTable[]
static const DTVParamHelperStruct kConfTable[]
static const DTVParamHelperStruct kVdrTable[]
QString toString() const
DTVModulation & operator=(const fe_modulation_t modulation)
QString toString() const
DTVTunerType & operator=(int type)
DTVGuardInterval & operator=(const Types _value)
DTVParamHelper(int _value)
static const char * s_dbStr[kDBStrCnt]
static const uint kDBStrCnt
static const DTVParamHelperStruct kConfTable[]
DTVRollOff & operator=(fe_rolloff_t type)
bool IsCompatible(const DTVModulation &other) const
DTVModulation & operator=(const Types _value)
static QString toString(int _value)
bool Parse(const QString &_value)
static const char * s_dbStr[kDBStrCnt]
static QString toString(int _value)
DTVPolarity(PolarityValues _default=kPolarityVertical)
bool ParseVDR(const QString &_value)
bool IsCompatible(const DTVBandwidth &other) const
bool ParseVDR(const QString &_value)
static void initStr(void)
static QString toString(int _value)
bool IsCompatible(const DTVModulationSystem &other) const
bool ParseConf(const QString &_value)
QChar toChar() const
bool Parse(const QString &_value)
static const DTVParamHelperStruct kConfTable[]
bool ParseConf(const QString &_value)
static const DTVParamHelperStruct kParseTable[]
bool ParseConf(const QString &_value)
static const char * s_dbStr[kDBStrCnt]
static const char * s_dbStr[kDBStrCnt]
DTVBandwidth & operator=(const Types _value)
DTVModulationSystem(Types _default=kModulationSystem_UNDEFINED)
QString toString() const
bool Parse(const QString &_value)
bool ParseVDR(const QString &_value)
bool IsModulationVariable(void) const
bool ParseVDR(const QString &_value)
static const uint kDBStrCnt