MythTV  0.28pre
transporteditor.cpp
Go to the documentation of this file.
1 /*
2  * $Id$
3  * vim: set expandtab tabstop=4 shiftwidth=4:
4  *
5  * Original Project
6  * MythTV http://www.mythtv.org
7  *
8  * Author(s):
9  * John Pullan <john@pullan.org>
10  * Taylor Jacob <rtjacob@earthlink.net>
11  * Daniel Kristjansson <danielk@cuymedia.net>
12  *
13  * Description:
14  * Collection of classes to provide dvb a transport editor
15  *
16  * This program is free software; you can redistribute it and/or
17  * modify it under the terms of the GNU General Public License
18  * as published by the Free Software Foundation; either version 2
19  * of the License, or (at your option) any later version.
20  *
21  * This program is distributed in the hope that it will be useful,
22  * but WITHOUT ANY WARRANTY; without even the implied warranty of
23  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24  * GNU General Public License for more details.
25  *
26  * You should have received a copy of the GNU General Public License
27  * along with this program; if not, write to the Free Software
28  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
29  * Or, point your browser to http://www.gnu.org/copyleft/gpl.html
30  *
31  */
32 
33 #include <vector>
34 using namespace std;
35 
36 #include "transporteditor.h"
37 #include "videosource.h"
38 #include "cardutil.h"
39 #include "mythcorecontext.h"
40 #include "mythdb.h"
41 
42 #define LOC QString("DTVMux: ")
43 
45 {
46  public:
47  MultiplexID() : AutoIncrementDBSetting("dtv_multiplex", "mplexid")
48  {
49  setVisible(false);
50  setName("MPLEXID");
51  }
52 
53  public:
54  QString GetColumnName(void) const { return DBStorage::GetColumnName(); }
55 };
56 
58 {
59  public:
61  uint mplexid, uint sourceid, CardUtil::INPUT_TYPES _cardtype);
62 
63  private:
65 };
66 
67 static QString pp_modulation(QString mod)
68 {
69  if (mod.endsWith("vsb"))
70  return mod.left(mod.length() - 3) + "-VSB";
71 
72  if (mod.startsWith("qam_"))
73  return "QAM-" + mod.mid(4, mod.length());
74 
75  if (mod == "analog")
76  return QObject::tr("Analog");
77 
78  return mod.toUpper();
79 }
80 
82 {
83 #if 0
84  LOG(VB_GENERAL, LOG_DEBUG, QString("TransportList::fillSelections() %1")
85  .arg(sourceid));
86 #endif
87 
88  clearSelections();
89  addSelection("(" + tr("New Transport") + ")", "0");
90 
91  setHelpText(QObject::tr(
92  "This section lists each transport that MythTV "
93  "currently knows about. The display fields are "
94  "video source, modulation, frequency, and when "
95  "relevant symbol rate, network id, and transport id."));
96 
97  if (!sourceid)
98  return;
99 
100  MSqlQuery query(MSqlQuery::InitCon());
101  query.prepare(
102  "SELECT mplexid, modulation, frequency, "
103  " symbolrate, networkid, transportid, "
104  " constellation, mod_sys "
105  "FROM dtv_multiplex, videosource "
106  "WHERE dtv_multiplex.sourceid = :SOURCEID AND "
107  " dtv_multiplex.sourceid = videosource.sourceid "
108  "ORDER by networkid, transportid, frequency, mplexid");
109  query.bindValue(":SOURCEID", sourceid);
110 
111  if (!query.exec() || !query.isActive())
112  {
113  MythDB::DBError("TransportList::fillSelections", query);
114  return;
115  }
116 
117  while (query.next())
118  {
119  QString rawmod = ((CardUtil::OFDM == cardtype) ||
120  (CardUtil::DVBT2 == cardtype)) ?
121  query.value(6).toString() : query.value(1).toString();
122 
123  QString mod = pp_modulation(rawmod);
124  while (mod.length() < 7)
125  mod += " ";
126 
127  QString rate = query.value(3).toString();
128  rate = (rate == "0") ? "" : QString("rate %1").arg(rate);
129 
130  QString netid = query.value(4).toUInt() ?
131  QString("netid %1").arg(query.value(4).toUInt(), 5) : "";
132 
133  QString tid = query.value(5).toUInt() ?
134  QString("tid %1").arg(query.value(5).toUInt(), 5) : "";
135 
136  QString hz = (CardUtil::QPSK == cardtype) ? "kHz" : "Hz";
137 
138  QString type = "";
139  if (CardUtil::OFDM == cardtype)
140  type = "(DVB-T)";
141  if (CardUtil::DVBT2 == cardtype)
142  type = QString("(%1)").arg(query.value(7).toString());
143  if (CardUtil::QPSK == cardtype)
144  type = "(DVB-S)";
145  if (CardUtil::QAM == cardtype)
146  type = "(DVB-C)";
147 
148  QString txt = QString("%1 %2 %3 %4 %5 %6 %7")
149  .arg(mod).arg(query.value(2).toString())
150  .arg(hz).arg(rate).arg(netid).arg(tid).arg(type);
151 
152  addSelection(txt, query.value(0).toString());
153  }
154 }
155 
157 {
158  vector<uint> cardids;
159 
160  // Work out what card we have.. (doesn't always work well)
161  MSqlQuery query(MSqlQuery::InitCon());
162  query.prepare(
163  "SELECT capturecard.cardid "
164  "FROM capturecard "
165  "WHERE capturecard.sourceid = :SOURCEID AND "
166  " capturecard.hostname = :HOSTNAME");
167  query.bindValue(":SOURCEID", sourceid);
168  query.bindValue(":HOSTNAME", gCoreContext->GetHostName());
169 
170  if (!query.exec() || !query.isActive())
171  {
172  MythDB::DBError("TransportWizard()", query);
173  return CardUtil::ERROR_PROBE;
174  }
175  else
176  {
177  while (query.next())
178  cardids.push_back(query.value(0).toUInt());
179  }
180 
181  if (cardids.empty())
182  {
185  QObject::tr("Transport Editor"),
186  QObject::tr(
187  "Sorry, the Transport Editor can only be used to "
188  "edit transports which are connected to a card input."));
189 
190  return CardUtil::ERROR_PROBE;
191  }
192 
193  vector<CardUtil::INPUT_TYPES> cardtypes;
194 
195  vector<uint>::const_iterator it = cardids.begin();
196  for (; it != cardids.end(); ++it)
197  {
199  QString cardtype = CardUtil::GetRawInputType(*it);
200  if (cardtype == "DVB")
201  cardtype = CardUtil::ProbeSubTypeName(*it);
202  nType = CardUtil::toInputType(cardtype);
203 
204  if ((CardUtil::ERROR_OPEN == nType) ||
205  (CardUtil::ERROR_UNKNOWN == nType) ||
206  (CardUtil::ERROR_PROBE == nType))
207  {
210  QObject::tr("Transport Editor"),
211  QObject::tr(
212  "Failed to probe a capture card connected to this "
213  "transport's video source. Please make sure the "
214  "backend is not running."));
215 
216  return CardUtil::ERROR_PROBE;
217  }
218 
219  cardtypes.push_back(nType);
220  }
221 
222  // This should never happen... (unless DB has changed under us)
223  if (cardtypes.empty())
224  return CardUtil::ERROR_PROBE;
225 
226  for (uint i = 1; i < cardtypes.size(); i++)
227  {
228  CardUtil::INPUT_TYPES typeA = cardtypes[i - 1];
229  typeA = (CardUtil::HDHOMERUN == typeA) ? CardUtil::ATSC : typeA;
230  typeA = (CardUtil::MPEG == typeA) ? CardUtil::V4L : typeA;
231 
232  CardUtil::INPUT_TYPES typeB = cardtypes[i + 0];
233  typeB = (CardUtil::HDHOMERUN == typeB) ? CardUtil::ATSC : typeB;
234  typeB = (CardUtil::MPEG == typeB) ? CardUtil::V4L : typeB;
235 
236  if (typeA == typeB)
237  continue;
238 
241  QObject::tr("Transport Editor"),
242  QObject::tr(
243  "The Video Sources to which this Transport is connected "
244  "are incompatible, please create separate video sources "
245  "for these cards. "));
246 
247  return CardUtil::ERROR_PROBE;
248  }
249 
250  return cardtypes[0];
251 }
252 
254 {
255 #if 0
256  LOG(VB_GENERAL, LOG_DEBUG, QString("TransportList::SetSourceID(%1)")
257  .arg(_sourceid));
258 #endif
259 
260  if (!_sourceid)
261  {
262  sourceid = 0;
263  }
264  else
265  {
266  cardtype = get_cardtype(_sourceid);
267  sourceid = ((CardUtil::ERROR_OPEN == cardtype) ||
268  (CardUtil::ERROR_UNKNOWN == cardtype) ||
269  (CardUtil::ERROR_PROBE == cardtype)) ? 0 : _sourceid;
270  }
271 
272  fillSelections();
273 }
274 
276  m_videosource(new VideoSourceSelector(sourceid, QString::null, false)),
277  m_list(new TransportList())
278 {
279  setLabel(tr("Multiplex Editor"));
280 
282 
284  addChild(m_list);
285 
286  connect(m_videosource, SIGNAL(valueChanged(const QString&)),
287  m_list, SLOT( SetSourceID( const QString&)));
288 
289  connect(m_list, SIGNAL(accepted(int)), this, SLOT(Edit()));
290  connect(m_list, SIGNAL(menuButtonPressed(int)), this, SLOT(Menu()));
291  connect(m_list, SIGNAL(editButtonPressed(int)), this, SLOT(Edit()));
292  connect(m_list, SIGNAL(deleteButtonPressed(int)), this, SLOT(Delete()));
293 }
294 
296 {
298 
299  return kDialogCodeRejected;
300 }
301 
303 {
304  uint sourceid = m_videosource->getValue().toUInt();
305  CardUtil::INPUT_TYPES cardtype = get_cardtype(sourceid);
306 
307  if ((CardUtil::ERROR_OPEN != cardtype) &&
308  (CardUtil::ERROR_UNKNOWN != cardtype) &&
309  (CardUtil::ERROR_PROBE != cardtype))
310  {
311  uint mplexid = m_list->getValue().toUInt();
312  TransportWizard wiz(mplexid, sourceid, cardtype);
313  wiz.exec();
315  }
316 }
317 
319 {
320  uint mplexid = m_list->getValue().toInt();
321 
323  GetMythMainWindow(), "",
324  tr("Are you sure you would like to delete this transport?"),
325  tr("Yes, delete the transport"),
326  tr("No, don't"), kDialogCodeButton1);
327 
328  if (kDialogCodeButton0 != val)
329  return;
330 
331  MSqlQuery query(MSqlQuery::InitCon());
332  query.prepare("DELETE FROM dtv_multiplex WHERE mplexid = :MPLEXID");
333  query.bindValue(":MPLEXID", mplexid);
334 
335  if (!query.exec() || !query.isActive())
336  MythDB::DBError("TransportEditor -- delete multiplex", query);
337 
338  query.prepare("DELETE FROM channel WHERE mplexid = :MPLEXID");
339  query.bindValue(":MPLEXID", mplexid);
340 
341  if (!query.exec() || !query.isActive())
342  MythDB::DBError("TransportEditor -- delete channels", query);
343 
345 }
346 
348 {
349  uint mplexid = m_list->getValue().toInt();
350 
351  if (!mplexid)
352  {
353  Edit();
354  return;
355  }
356 
359  "",
360  tr("Transport Menu"),
361  tr("Edit..."),
362  tr("Delete..."), kDialogCodeButton0);
363 
364  if (kDialogCodeButton0 == val)
365  emit Edit();
366  else if (kDialogCodeButton1 == val)
367  emit Delete();
368  else
369  m_list->setFocus();
370 }
371 
373 {
374  protected:
375  MuxDBStorage(Setting *_setting, const MultiplexID *_id, QString _name) :
376  SimpleDBStorage(_setting, "dtv_multiplex", _name), mplexid(_id)
377  {
378  }
379 
380  virtual QString GetSetClause(MSqlBindings &bindings) const;
381  virtual QString GetWhereClause(MSqlBindings &bindings) const;
382 
384 };
385 
387 {
388  QString muxTag = ":WHERE" + mplexid->GetColumnName().toUpper();
389 
390  bindings.insert(muxTag, mplexid->getValue());
391 
392  // return query
393  return mplexid->GetColumnName() + " = " + muxTag;
394 }
395 
396 QString MuxDBStorage::GetSetClause(MSqlBindings &bindings) const
397 {
398  QString muxTag = ":SET" + mplexid->GetColumnName().toUpper();
399  QString nameTag = ":SET" + GetColumnName().toUpper();
400 
401  bindings.insert(muxTag, mplexid->getValue());
402  bindings.insert(nameTag, user->GetDBValue());
403 
404  // return query
405  return (mplexid->GetColumnName() + " = " + muxTag + ", " +
406  GetColumnName() + " = " + nameTag);
407 }
408 
409 
411 {
412  public:
413  VideoSourceID(const MultiplexID *id, uint _sourceid) :
414  IntegerSetting(this),
415  MuxDBStorage(this, id, "sourceid")
416  {
417  setVisible(false);
418  setValue(_sourceid);
419  }
420 };
421 
423 {
424  public:
426  bool is_dvb_country,
427  bool is_atsc_country) :
428  ComboBoxSetting(this), MuxDBStorage(this, id, "sistandard")
429  {
430  setLabel(QObject::tr("Digital TV Standard"));
431  setHelpText(QObject::tr(
432  "Guiding standard to use for making sense of the "
433  "data streams after they have been demodulated, "
434  "error corrected and demultiplexed."));
435  if (is_dvb_country)
436  addSelection(QObject::tr("DVB"), "dvb");
437 
438  if (is_atsc_country)
439  {
440  addSelection(QObject::tr("ATSC"), "atsc");
441  addSelection(QObject::tr("OpenCable"), "opencable");
442  }
443 
444  addSelection(QObject::tr("MPEG"), "mpeg");
445  };
446 };
447 
448 class Frequency : public LineEditSetting, public MuxDBStorage
449 {
450  public:
451  Frequency(const MultiplexID *id, bool in_kHz = false) :
452  LineEditSetting(this), MuxDBStorage(this, id, "frequency")
453  {
454  QString hz = (in_kHz) ? "kHz" : "Hz";
455  setLabel(QObject::tr("Frequency") + " (" + hz + ")");
456  setHelpText(QObject::tr(
457  "Frequency (Option has no default).\n"
458  "The frequency for this channel in") + " " + hz + ".");
459  };
460 };
461 
463 {
464  public:
466  ComboBoxSetting(this, true), MuxDBStorage(this, id, "symbolrate")
467  {
468  setLabel(QObject::tr("Symbol Rate"));
469  setHelpText(
470  QObject::tr(
471  "Symbol Rate (symbols/sec).\n"
472  "Most DVB-S transponders transmit at 27.5 "
473  "million symbols per second."));
474  addSelection("3333000");
475  addSelection("22000000");
476  addSelection("23000000");
477  addSelection("27500000", "27500000", true);
478  addSelection("28000000");
479  addSelection("28500000");
480  addSelection("29500000");
481  addSelection("29900000");
482  };
483 };
484 
486 {
487  public:
489  ComboBoxSetting(this), MuxDBStorage(this, id, "polarity")
490  {
491  setLabel(QObject::tr("Polarity"));
492  setHelpText(QObject::tr("Polarity (Option has no default)"));
493  addSelection(QObject::tr("Horizontal"), "h");
494  addSelection(QObject::tr("Vertical"), "v");
495  addSelection(QObject::tr("Right Circular"), "r");
496  addSelection(QObject::tr("Left Circular"), "l");
497  };
498 };
499 
501 {
502  public:
503  Modulation(const MultiplexID *id, uint nType);
504 };
505 
507  ComboBoxSetting(this),
508  MuxDBStorage(this, id, ((CardUtil::OFDM == nType) ||
509  (CardUtil::DVBT2 == nType)) ?
510  "constellation" : "modulation")
511 {
512  setLabel(QObject::tr("Modulation"));
513  setHelpText(QObject::tr("Modulation, aka Constellation"));
514 
515  if (CardUtil::QPSK == nType)
516  {
517  // no modulation options
518  setVisible(false);
519  }
520  else if ((CardUtil::QAM == nType) || (CardUtil::OFDM == nType) ||
521  (CardUtil::DVBT2 == nType))
522  {
523  addSelection(QObject::tr("QAM Auto"), "auto");
524  addSelection("QAM-16", "qam_16");
525  addSelection("QAM-32", "qam_32");
526  addSelection("QAM-64", "qam_64");
527  addSelection("QAM-128", "qam_128");
528  addSelection("QAM-256", "qam_256");
529 
530  if ((CardUtil::OFDM == nType) || (CardUtil::DVBT2 == nType))
531  {
532  addSelection("QPSK", "qpsk");
533  }
534  }
535  else if ((CardUtil::ATSC == nType) ||
536  (CardUtil::HDHOMERUN == nType))
537  {
538  addSelection("8-VSB", "8vsb");
539  addSelection("QAM-64", "qam_64");
540  addSelection("QAM-256", "qam_256");
541  }
542  else
543  {
544  addSelection(QObject::tr("Analog"), "analog");
545  setVisible(false);
546  }
547 };
548 
550 {
551  public:
553  ComboBoxSetting(this), MuxDBStorage(this, id, "inversion")
554  {
555  setLabel(QObject::tr("Inversion"));
556  setHelpText(QObject::tr("Inversion (Default: Auto):\n"
557  "Most cards can autodetect this now, so leave it at Auto"
558  " unless it won't work."));
559  addSelection(QObject::tr("Auto"), "a");
560  addSelection(QObject::tr("On"), "1");
561  addSelection(QObject::tr("Off"), "0");
562  };
563 };
564 
566 {
567  public:
569  ComboBoxSetting(this), MuxDBStorage(this, id, "bandwidth")
570  {
571  setLabel(QObject::tr("Bandwidth"));
572  setHelpText(QObject::tr("Bandwidth (Default: Auto)"));
573  addSelection(QObject::tr("Auto"), "a");
574  addSelection(QObject::tr("6 MHz"), "6");
575  addSelection(QObject::tr("7 MHz"), "7");
576  addSelection(QObject::tr("8 MHz"), "8");
577  };
578 };
579 
581 {
582  public:
584  ComboBoxSetting(_storage)
585  {
586  addSelection(QObject::tr("Auto"), "auto");
587  addSelection(QObject::tr("None"), "none");
588  addSelection("1/2");
589  addSelection("2/3");
590  addSelection("3/4");
591  addSelection("4/5");
592  addSelection("5/6");
593  addSelection("6/7");
594  addSelection("7/8");
595  addSelection("8/9");
596  };
597 };
598 
601 {
602  public:
605  MuxDBStorage(this, id, "fec")
606  {
607  setLabel(QObject::tr("FEC"));
608  setHelpText(QObject::tr("Forward Error Correction (Default: Auto)"));
609  };
610 };
611 
614 {
615  public:
618  MuxDBStorage(this, id, "lp_code_rate")
619  {
620  setLabel(QObject::tr("LP Coderate"));
621  setHelpText(QObject::tr("Low Priority Code Rate (Default: Auto)"));
622  };
623 };
624 
627 {
628  public:
631  MuxDBStorage(this, id, "hp_code_rate")
632  {
633  setLabel(QObject::tr("HP Coderate"));
634  setHelpText(QObject::tr("High Priority Code Rate (Default: Auto)"));
635  };
636 };
637 
639 {
640  public:
642  ComboBoxSetting(this), MuxDBStorage(this, id, "guard_interval")
643  {
644  setLabel(QObject::tr("Guard Interval"));
645  setHelpText(QObject::tr("Guard Interval (Default: Auto)"));
646  addSelection(QObject::tr("Auto"), "auto");
647  addSelection("1/4");
648  addSelection("1/8");
649  addSelection("1/16");
650  addSelection("1/32");
651  };
652 };
653 
655 {
656  public:
658  ComboBoxSetting(this), MuxDBStorage(this, id, "transmission_mode")
659  {
660  setLabel(QObject::tr("Trans. Mode"));
661  setHelpText(QObject::tr("Transmission Mode (Default: Auto)"));
662  addSelection(QObject::tr("Auto"), "a");
663  addSelection("2K", "2");
664  addSelection("8K", "8");
665  };
666 };
667 
669 {
670  public:
672  ComboBoxSetting(this), MuxDBStorage(this, id, "hierarchy")
673  {
674  setLabel(QObject::tr("Hierarchy"));
675  setHelpText(QObject::tr("Hierarchy (Default: Auto)"));
676  addSelection(QObject::tr("Auto"), "a");
677  addSelection(QObject::tr("None"), "n");
678  addSelection("1");
679  addSelection("2");
680  addSelection("4");
681  }
682 };
683 
685 {
686  public:
688  ComboBoxSetting(this), MuxDBStorage(this, id, "mod_sys")
689  {
690  setLabel(QObject::tr("Modulation System"));
691  setHelpText(QObject::tr("Modulation System (Default: DVB-T)"));
692  addSelection(QObject::tr("DVB-T"), "DVB-T");
693  addSelection(QObject::tr("DVB-T2"), "DVB-T2");
694  };
695 };
696 
697 
699 {
700  public:
701  TransportPage(const MultiplexID *id, uint nType);
702 
703  protected:
704  const MultiplexID *id;
705 };
706 
709 {
710  setLabel(QObject::tr("Transport Options"));
711  setUseLabel(false);
712 
713  VerticalConfigurationGroup *left = NULL, *right = NULL;
714 
715  left = new VerticalConfigurationGroup(false, true, false, false);
716 
717  if (CardUtil::OFDM == nType)
718  {
719  left->addChild(new DTVStandard(id, true, false));
720  left->addChild(new Frequency(id));
721  left->addChild(new DVBTBandwidth(id));
722  left->addChild(new DVBInversion(id));
723  left->addChild(new Modulation(id, nType));
724 
725  right = new VerticalConfigurationGroup(false, true, false, false);
726  right->addChild(new DVBTCoderateLP(id));
727  right->addChild(new DVBTCoderateHP(id));
728  right->addChild(new DVBTTransmissionMode(id));
729  right->addChild(new DVBTGuardInterval(id));
730  right->addChild(new DVBTHierarchy(id));
731  }
732  else if (CardUtil::DVBT2 == nType)
733  {
734  left->addChild(new DTVStandard(id, true, false));
735  left->addChild(new Frequency(id));
736  left->addChild(new DVBTBandwidth(id));
737  left->addChild(new DVBInversion(id));
738  left->addChild(new Modulation(id, nType));
739  left->addChild(new DVBTModulationSystem(id));
740 
741  right = new VerticalConfigurationGroup(false, true, false, false);
742  right->addChild(new DVBTCoderateLP(id));
743  right->addChild(new DVBTCoderateHP(id));
744  right->addChild(new DVBTTransmissionMode(id));
745  right->addChild(new DVBTGuardInterval(id));
746  right->addChild(new DVBTHierarchy(id));
747  }
748  else if (CardUtil::QPSK == nType)
749  {
750  left->addChild(new DTVStandard(id, true, false));
751  left->addChild(new Frequency(id, true));
752  left->addChild(new DVBSymbolRate(id));
753 
754  right = new VerticalConfigurationGroup(false, true, false, false);
755  right->addChild(new DVBInversion(id));
756  right->addChild(new DVBForwardErrorCorrection(id));
757  right->addChild(new SignalPolarity(id));
758  }
759  else if (CardUtil::QAM == nType)
760  {
761  left->addChild(new DTVStandard(id, true, false));
762  left->addChild(new Frequency(id));
763  left->addChild(new DVBSymbolRate(id));
764 
765  right = new VerticalConfigurationGroup(false, true, false, false);
766  right->addChild(new Modulation(id, nType));
767  right->addChild(new DVBInversion(id));
768  right->addChild(new DVBForwardErrorCorrection(id));
769  }
770  else if (CardUtil::ATSC == nType ||
771  CardUtil::HDHOMERUN == nType)
772  {
773  left->addChild(new DTVStandard(id, false, true));
774  left->addChild(new Frequency(id));
775  left->addChild(new Modulation(id, nType));
776  }
777  else if ((CardUtil::FIREWIRE == nType) ||
778  (CardUtil::FREEBOX == nType))
779  {
780  left->addChild(new DTVStandard(id, true, true));
781  }
782  else if ((CardUtil::V4L == nType) ||
783  (CardUtil::MPEG == nType))
784  {
785  left->addChild(new Frequency(id));
786  left->addChild(new Modulation(id, nType));
787  }
788 
789  addChild(left);
790 
791  if (right)
792  addChild(right);
793 };
794 
796  uint _mplexid, uint _sourceid, CardUtil::INPUT_TYPES _cardtype) :
797  mplexid(new MultiplexID())
798 {
799  setLabel(QObject::tr("DVB Transport"));
800 
801  // Must be first.
802  mplexid->setValue(_mplexid);
803  addChild(mplexid);
804  addChild(new VideoSourceID(mplexid, _sourceid));
805  addChild(new TransportPage(mplexid, _cardtype));
806 }
Collection of helper utilities for input DB use.
Definition: cardutil.h:42
bool next(void)
Wrap QSqlQuery::next() so we can display the query results.
Definition: mythdbcon.cpp:785
TransportList * m_list
virtual QString GetSetClause(MSqlBindings &bindings) const
void bindValue(const QString &placeholder, const QVariant &val)
Definition: mythdbcon.cpp:884
VERBOSE_PREAMBLE false
Definition: verbosedefs.h:83
DVBForwardErrorCorrectionSelector(Storage *_storage)
static DialogCode Show2ButtonPopup(MythMainWindow *parent, const QString &title, const QString &message, const QString &button1msg, const QString &button2msg, DialogCode default_button)
QVariant value(int i) const
Definition: mythdbcon.h:182
static QString ProbeSubTypeName(uint inputid)
Definition: cardutil.cpp:570
virtual void setVisible(bool b)
Definition: settings.cpp:695
static enum INPUT_TYPES toInputType(const QString &name)
Definition: cardutil.h:74
QSqlQuery wrapper that fetches a DB connection from the connection pool.
Definition: mythdbcon.h:125
TransportListEditor(uint initial_sourceid)
uint GetSourceID(void) const
Definition: videosource.h:80
DVBTHierarchy(const MultiplexID *id)
DVBForwardErrorCorrection(const MultiplexID *id)
virtual DialogCode exec(void)
unsigned int uint
Definition: compat.h:136
MythCoreContext * gCoreContext
This global variable contains the MythCoreContext instance for the app.
virtual void addChild(Configurable *child)
DVBTBandwidth(const MultiplexID *id)
const MultiplexID * id
SignalPolarity(const MultiplexID *id)
MuxDBStorage(Setting *_setting, const MultiplexID *_id, QString _name)
void setLabel(const QString &label)
VideoSourceID(const MultiplexID *id, uint _sourceid)
virtual QString GetWhereClause(MSqlBindings &bindings) const
DialogCode
Definition: mythdialogs.h:21
DVBTTransmissionMode(const MultiplexID *id)
DVBInversion(const MultiplexID *id)
__u64 val
Definition: videodev2.h:1041
DVBTModulationSystem(const MultiplexID *id)
static MSqlQueryInfo InitCon(ConnectionReuse=kNormalConnection)
Only use this in combination with MSqlQuery constructor.
Definition: mythdbcon.cpp:542
QString GetColumnName(void) const
Definition: mythstorage.h:43
bool isActive(void) const
Definition: mythdbcon.h:188
void addSelection(const QString &label, QString value=QString::null, bool select=false)
Definition: settings.cpp:733
MultiplexID * mplexid
A ConfigurationDialog that uses a ConfigurationGroup with one child per page.
DVBTCoderateHP(const MultiplexID *id)
DVBTGuardInterval(const MultiplexID *id)
MythMainWindow * GetMythMainWindow(void)
VideoSourceSelector * m_videosource
QString GetColumnName(void) const
DTVStandard(const MultiplexID *id, bool is_dvb_country, bool is_atsc_country)
static bool showOkPopup(MythMainWindow *parent, const QString &title, const QString &message, QString button_msg=QString())
VERBOSE_PREAMBLE Most Errors or other very important messages true
Definition: verbosedefs.h:91
__u32 id
Definition: videodev2.h:1038
bool prepare(const QString &query)
QSqlQuery::prepare() is not thread safe in Qt <= 3.3.2.
Definition: mythdbcon.cpp:810
void SetSourceID(uint _sourceid)
TransportWizard(uint mplexid, uint sourceid, CardUtil::INPUT_TYPES _cardtype)
virtual void setHelpText(const QString &str)
Definition: settings.cpp:793
virtual void setLabel(QString str)
Definition: settings.h:57
virtual DialogCode exec(bool saveOnExec=true, bool doLoad=true)
GLint GLenum GLsizei GLint GLenum GLenum type
virtual void fillSelections(void)
void setUseLabel(bool useit)
Modulation(const MultiplexID *id, uint nType)
Frequency(const MultiplexID *id, bool in_kHz=false)
virtual QString getValue(void) const
Definition: settings.cpp:91
static QString GetRawInputType(uint inputid)
Definition: cardutil.h:270
QMap< QString, QVariant > MSqlBindings
typedef for a map of string -> string bindings for generic queries.
Definition: mythdbcon.h:98
bool exec(void)
Wrap QSqlQuery::exec() so we can display SQL.
Definition: mythdbcon.cpp:610
static CardUtil::INPUT_TYPES get_cardtype(uint sourceid)
static void DBError(const QString &where, const MSqlQuery &query)
Definition: mythdb.cpp:181
TransportPage(const MultiplexID *id, uint nType)
const MultiplexID * mplexid
QString GetHostName(void)
virtual void setValue(int newValue)
Definition: settings.h:185
INPUT_TYPES
all the different inputs
Definition: cardutil.h:48
void setFocus(void)
Definition: settings.h:384
static QString pp_modulation(QString mod)
void addChild(Configurable *child)
DVBSymbolRate(const MultiplexID *id)
DVBTCoderateLP(const MultiplexID *id)