MythTV  master
videosource.cpp
Go to the documentation of this file.
1 // -*- Mode: c++ -*-
2 
3 // Standard UNIX C headers
4 #include <unistd.h>
5 #include <fcntl.h>
6 #if defined(__FreeBSD__) || defined(__APPLE__) || defined(__OpenBSD__) || defined(_WIN32)
7 #include <sys/types.h>
8 #else
9 #include <sys/sysmacros.h>
10 #endif
11 #include <sys/stat.h>
12 
13 // C++ headers
14 #include <algorithm>
15 
16 // Qt headers
17 #include <QCoreApplication>
18 #include <QCursor>
19 #include <QDateTime>
20 #include <QDir>
21 #include <QFile>
22 #include <QLayout>
23 #include <QMap>
24 #include <QStringList>
25 #include <QTextStream>
26 #include <utility>
27 
28 // MythTV headers
29 #include "mythconfig.h"
30 #include "mythcorecontext.h"
31 #include "videosource.h"
32 #include "scanwizard.h"
33 #include "cardutil.h"
34 #include "sourceutil.h"
35 #include "channelinfo.h"
36 #include "channelutil.h"
37 #include "frequencies.h"
38 #include "diseqcsettings.h"
39 #include "firewiredevice.h"
40 #include "compat.h"
41 #include "mythdb.h"
42 #include "mythdirs.h"
43 #include "mythlogging.h"
44 #include "libmythupnp/httprequest.h" // for TestMimeType()
45 #include "mythsystemlegacy.h"
46 #include "exitcodes.h"
47 #include "v4l2util.h"
48 #include "mythnotification.h"
49 #include "mythterminal.h"
50 
51 #ifdef USING_DVB
52 #include "dvbtypes.h"
53 #endif
54 
55 #ifdef USING_VBOX
56 #include "vboxutils.h"
57 #endif
58 
59 #ifdef USING_HDHOMERUN
60 #include HDHOMERUN_HEADERFILE
61 #endif
62 
64  QString _card_types,
65  bool _must_have_mplexid) :
66  m_initialSourceId(_initial_sourceid),
67  m_cardTypes(std::move(_card_types)),
68  m_mustHaveMplexId(_must_have_mplexid)
69 {
70  setLabel(tr("Video Source"));
72  QObject::tr(
73  "Select a video source that is connected to one "
74  "or more capture cards. Default is the video source "
75  "selected in the Channel Editor page."
76  ));
77 }
78 
80 {
82 
83  QString querystr =
84  "SELECT DISTINCT videosource.name, videosource.sourceid "
85  "FROM capturecard, videosource";
86 
87  querystr += (m_mustHaveMplexId) ? ", channel " : " ";
88 
89  querystr +=
90  "WHERE capturecard.sourceid = videosource.sourceid AND "
91  " capturecard.hostname = :HOSTNAME ";
92 
93  if (!m_cardTypes.isEmpty())
94  {
95  querystr += QString(" AND capturecard.cardtype in %1 ")
96  .arg(m_cardTypes);
97  }
98 
100  {
101  querystr +=
102  " AND channel.sourceid = videosource.sourceid "
103  " AND channel.mplexid != 32767 "
104  " AND channel.mplexid != 0 ";
105  }
106 
107  query.prepare(querystr);
108  query.bindValue(":HOSTNAME", gCoreContext->GetHostName());
109 
110  if (!query.exec() || !query.isActive() || query.size() <= 0)
111  return;
112 
113  uint sel = 0;
114  uint cnt = 0;
115  for (; query.next(); cnt++)
116  {
117  addSelection(query.value(0).toString(),
118  query.value(1).toString());
119 
120  sel = (query.value(1).toUInt() == m_initialSourceId) ? cnt : sel;
121  }
122 
123  if (m_initialSourceId)
124  {
125  if (cnt)
126  setValue(sel);
127  }
128 
130 }
131 
133  m_initialSourceId(_initial_sourceid)
134 {
135  setLabel(tr("Video Source"));
136  setHelpText(
137  QObject::tr(
138  "The video source that is "
139  "selected in the Channel Editor page."
140  ));
141 }
142 
144 {
146 
147  QString querystr =
148  "SELECT DISTINCT videosource.name, videosource.sourceid "
149  "FROM capturecard, videosource "
150  "WHERE capturecard.sourceid = videosource.sourceid AND "
151  " capturecard.hostname = :HOSTNAME AND "
152  " videosource.sourceid = :SOURCEID ";
153 
154  query.prepare(querystr);
155  query.bindValue(":HOSTNAME", gCoreContext->GetHostName());
156  query.bindValue(":SOURCEID", m_initialSourceId);
157 
158  if (!query.exec() || !query.isActive())
159  {
160  MythDB::DBError("VideoSourceShow::Load", query);
161  return;
162  }
163 
164  if (query.next())
165  {
166  setValue(query.value(0).toString());
167  }
168 }
169 
171 {
172  public:
173  explicit InstanceCount(const CardInput &parent) :
174  MythUISpinBoxSetting(new CardInputDBStorage(this, parent, "reclimit"),
175  1, 10, 1)
176  {
177  setLabel(QObject::tr("Max recordings"));
178  setValue(1);
179  setHelpText(
180  QObject::tr(
181  "Maximum number of simultaneous recordings MythTV will "
182  "attempt using this device. If set to a value other than "
183  "1, MythTV can sometimes record multiple programs on "
184  "the same multiplex or overlapping copies of the same "
185  "program on a single channel."
186  ));
187  };
188 };
189 
191 {
192  public:
193  explicit SchedGroup(const CardInput &parent) :
194  MythUICheckBoxSetting(new CardInputDBStorage(this, parent, "schedgroup"))
195  {
196  setLabel(QObject::tr("Schedule as group"));
197  setValue(true);
198  setHelpText(
199  QObject::tr(
200  "Schedule all virtual inputs on this device as a group. "
201  "This is more efficient than scheduling each input "
202  "individually. Additional, virtual inputs will be "
203  "automatically added as needed to fulfill the recording "
204  "load."
205  ));
206  };
207 };
208 
210 {
211  QString sourceidTag(":WHERESOURCEID");
212 
213  QString query("sourceid = " + sourceidTag);
214 
215  bindings.insert(sourceidTag, m_parent.getSourceID());
216 
217  return query;
218 }
219 
221 {
222  QString sourceidTag(":SETSOURCEID");
223  QString colTag(":SET" + GetColumnName().toUpper());
224 
225  QString query("sourceid = " + sourceidTag + ", " +
226  GetColumnName() + " = " + colTag);
227 
228  bindings.insert(sourceidTag, m_parent.getSourceID());
229  bindings.insert(colTag, m_user->GetDBValue());
230 
231  return query;
232 }
233 
235 {
236  QString cardidTag(":WHERECARDID");
237 
238  QString query("cardid = " + cardidTag);
239 
240  bindings.insert(cardidTag, m_parent.getCardID());
241 
242  return query;
243 }
244 
246 {
247  QString cardidTag(":SETCARDID");
248  QString colTag(":SET" + GetColumnName().toUpper());
249 
250  QString query("cardid = " + cardidTag + ", " +
251  GetColumnName() + " = " + colTag);
252 
253  bindings.insert(cardidTag, m_parent.getCardID());
254  bindings.insert(colTag, m_user->GetDBValue());
255 
256  return query;
257 }
258 
260 {
261  public:
262  explicit XMLTVGrabber(const VideoSource &parent) :
264  "xmltvgrabber")),
265  m_parent(parent)
266  {
267  setLabel(QObject::tr("Listings grabber"));
268  };
269 
270  void Load(void) override // StandardSetting
271  {
272  addTargetedChild("eitonly", new EITOnly_config(m_parent, this));
273  addTargetedChild("/bin/true", new NoGrabber_config(m_parent));
274 
275  addSelection(
276  QObject::tr("Transmitted guide only (EIT)"), "eitonly");
277 
278  addSelection(QObject::tr("No grabber"), "/bin/true");
279 
280  QString gname;
281  QString d1;
282  QString d2;
283  QString d3;
285 
286 #ifdef _MSC_VER
287 #pragma message( "tv_find_grabbers is not supported yet on windows." )
288  //-=>TODO:Screen doesn't show up if the call to MythSysemLegacy is executed
289 #else
290 
291  QString loc = "XMLTVGrabber::Load: ";
292 
293  QStringList name_list;
294  QStringList prog_list;
295 
296  QStringList args;
297  args += "baseline";
298 
299  MythSystemLegacy find_grabber_proc("tv_find_grabbers", args,
301  find_grabber_proc.Run(25);
302  LOG(VB_GENERAL, LOG_INFO,
303  loc + "Running 'tv_find_grabbers " + args.join(" ") + "'.");
304  uint status = find_grabber_proc.Wait();
305 
306  if (status == GENERIC_EXIT_OK)
307  {
308  QTextStream ostream(find_grabber_proc.ReadAll());
309  while (!ostream.atEnd())
310  {
311  QString grabber_list(ostream.readLine());
312 #if QT_VERSION < QT_VERSION_CHECK(5,14,0)
313  QStringList grabber_split =
314  grabber_list.split("|", QString::SkipEmptyParts);
315 #else
316  QStringList grabber_split =
317  grabber_list.split("|", Qt::SkipEmptyParts);
318 #endif
319  QString grabber_name = grabber_split[1] + " (xmltv)";
320  QFileInfo grabber_file(grabber_split[0]);
321 
322  name_list.push_back(grabber_name);
323  prog_list.push_back(grabber_file.fileName());
324  LOG(VB_GENERAL, LOG_DEBUG, "Found " + grabber_split[0]);
325  }
326  LOG(VB_GENERAL, LOG_INFO, loc + "Finished running tv_find_grabbers");
327  }
328  else
329  LOG(VB_GENERAL, LOG_ERR, loc + "Failed to run tv_find_grabbers");
330 
331  LoadXMLTVGrabbers(name_list, prog_list);
332 
334 #endif
335  }
336 
337  void Save(void) override // StandardSetting
338  {
340 
342  query.prepare(
343  "UPDATE videosource "
344  "SET userid=NULL, password=NULL "
345  "WHERE xmltvgrabber NOT IN ( 'technovera' )");
346  if (!query.exec())
347  MythDB::DBError("XMLTVGrabber::Save", query);
348  }
349 
350  void LoadXMLTVGrabbers(QStringList name_list, QStringList prog_list)
351  {
352  if (name_list.size() != prog_list.size())
353  return;
354 
355  QString selValue = getValue();
356  int selIndex = getValueIndex(selValue);
357  setValue(0);
358 
359  for (uint i = 0; i < (uint) name_list.size(); i++)
360  {
361  addTargetedChild(prog_list[i],
362  new XMLTV_generic_config(m_parent, prog_list[i],
363  this));
364  addSelection(name_list[i], prog_list[i]);
365  }
366 
367  if (!selValue.isEmpty())
368  selIndex = getValueIndex(selValue);
369  if (selIndex >= 0)
370  setValue(selIndex);
371  }
372 private:
374 };
375 
377 {
378  public:
380  uint min_val, uint max_val, uint step,
381  const QString &setting) :
382  MythUISpinBoxSetting(new CaptureCardDBStorage(this, parent, setting),
383  min_val, max_val, step)
384  {
385  }
386 };
387 
389 {
390  public:
392  const QString &setting) :
393  MythUITextEditSetting(new CaptureCardDBStorage(this, parent, setting))
394  {
395  }
396 };
397 
399 {
400  public:
401  explicit ScanFrequencyStart(const VideoSource &parent) :
402  MythUITextEditSetting(new VideoSourceDBStorage(this, parent, "scanfrequency"))
403  {
404  setLabel(QObject::tr("Scan Frequency"));
405  setHelpText(QObject::tr("The frequency to start scanning this video source. "
406  "This is then default for 'Full Scan (Tuned)' channel scanning. "
407  "Frequency value in Hz for DVB-T/T2/C, in kHz for DVB-S/S2. "
408  "Leave at 0 if not known. "));
409  };
410 };
411 
413 {
414  public:
415  DVBNetID(const VideoSource &parent, signed int value, signed int min_val) :
416  MythUISpinBoxSetting(new VideoSourceDBStorage(this, parent, "dvb_nit_id"),
417  min_val, 0xffff, 1)
418  {
419  setLabel(QObject::tr("Network ID"));
420  //: Network_ID is the name of an identifier in the DVB's Service
421  //: Information standard specification.
422  setHelpText(QObject::tr("If your provider has asked you to configure a "
423  "specific network identifier (Network_ID), "
424  "enter it here. Leave it at -1 otherwise."));
425  setValue(value);
426  };
427 };
428 
430 {
431  public:
432  BouquetID(const VideoSource &parent, signed int value, signed int min_val) :
433  MythUISpinBoxSetting(new VideoSourceDBStorage(this, parent, "bouquet_id"),
434  min_val, 0xffff, 1)
435  {
436  setLabel(QObject::tr("Bouquet ID"));
437  setHelpText(QObject::tr("Bouquet ID for Freesat or Sky on satellite Astra-2 28.2E. "
438  "Leave this at 0 if you do not receive this satellite. "
439  "This is needed to get the Freesat and Sky channel numbers. "
440  "Value 272 selects Freesat bouquet 'England HD'. "
441  "See the MythTV Wiki https://www.mythtv.org/wiki/DVB_UK."));
442  setValue(value);
443  };
444 };
445 
447 {
448  public:
449  RegionID(const VideoSource &parent, signed int value, signed int min_val) :
450  MythUISpinBoxSetting(new VideoSourceDBStorage(this, parent, "region_id"),
451  min_val, 100, 1)
452  {
453  setLabel(QObject::tr("Region ID"));
454  setHelpText(QObject::tr("Region ID for Freesat or Sky on satellite Astra-2 28.2E. "
455  "Leave this at 0 you do not receive this satellite. "
456  "This is needed to get the Freesat and Sky channel numbers. "
457  "Value 1 selects region London. "
458  "See the MythTV Wiki https://www.mythtv.org/wiki/DVB_UK."));
459  setValue(value);
460  };
461 };
462 
464  MythUIComboBoxSetting(new VideoSourceDBStorage(this, parent, "freqtable"))
465 {
466  setLabel(QObject::tr("Channel frequency table"));
467  addSelection("default");
468 
469  for (const auto & chanlist : gChanLists)
470  addSelection(chanlist.name);
471 
472  setHelpText(QObject::tr("Use default unless this source uses a "
473  "different frequency table than the system wide table "
474  "defined in the General settings."));
475 }
476 
478  m_sourceId(_sourceid)
479 {
480  setLabel(QObject::tr("Channel frequency table"));
481 
482  for (const auto & chanlist : gChanLists)
483  addSelection(chanlist.name);
484 }
485 
487 {
488  int idx1 = getValueIndex(gCoreContext->GetSetting("FreqTable"));
489  if (idx1 >= 0)
490  setValue(idx1);
491 
492  if (!m_sourceId)
493  return;
494 
496  query.prepare(
497  "SELECT freqtable "
498  "FROM videosource "
499  "WHERE sourceid = :SOURCEID");
500  query.bindValue(":SOURCEID", m_sourceId);
501 
502  if (!query.exec() || !query.isActive())
503  {
504  MythDB::DBError("TransFreqTableSelector::load", query);
505  return;
506  }
507 
508  m_loadedFreqTable.clear();
509 
510  if (query.next())
511  {
512  m_loadedFreqTable = query.value(0).toString();
513  if (!m_loadedFreqTable.isEmpty() &&
514  (m_loadedFreqTable.toLower() != "default"))
515  {
516  int idx2 = getValueIndex(m_loadedFreqTable);
517  if (idx2 >= 0)
518  setValue(idx2);
519  }
520  }
521 }
522 
524 {
525  LOG(VB_GENERAL, LOG_INFO, "TransFreqTableSelector::Save(void)");
526 
527  if ((m_loadedFreqTable == getValue()) ||
528  ((m_loadedFreqTable.toLower() == "default") &&
529  (getValue() == gCoreContext->GetSetting("FreqTable"))))
530  {
531  return;
532  }
533 
535  query.prepare(
536  "UPDATE videosource "
537  "SET freqtable = :FREQTABLE "
538  "WHERE sourceid = :SOURCEID");
539 
540  query.bindValue(":FREQTABLE", getValue());
541  query.bindValue(":SOURCEID", m_sourceId);
542 
543  if (!query.exec() || !query.isActive())
544  {
545  MythDB::DBError("TransFreqTableSelector::load", query);
546  return;
547  }
548 }
549 
551 {
552  m_sourceId = _sourceid;
553  Load();
554 }
555 
557 {
558  public:
559  explicit UseEIT(const VideoSource &parent) :
560  MythUICheckBoxSetting(new VideoSourceDBStorage(this, parent, "useeit"))
561  {
562  setLabel(QObject::tr("Perform EIT scan"));
563  setHelpText(QObject::tr(
564  "If enabled, program guide data for channels on this "
565  "source will be updated with data provided by the "
566  "channels themselves 'Over-the-Air'."));
567  }
568 };
569 
571  const QString& _grabber,
572  StandardSetting *_setting) :
573  m_parent(_parent), m_grabber(_grabber)
574 {
575  setVisible(false);
576 
577  QString filename = QString("%1/%2.xmltv")
578  .arg(GetConfDir()).arg(m_parent.getSourceName());
579 
580  m_grabberArgs.push_back("--config-file");
581  m_grabberArgs.push_back(filename);
582  m_grabberArgs.push_back("--configure");
583 
584  _setting->addTargetedChild(_grabber, new UseEIT(m_parent));
585 
586  auto *config = new ButtonStandardSetting(tr("Configure"));
587  config->setHelpText(tr("Run XMLTV configure command."));
588 
589  _setting->addTargetedChild(_grabber, config);
590 
592 }
593 
595 {
597 #if 0
598  QString err_msg = QObject::tr(
599  "You MUST run 'mythfilldatabase --manual' the first time,\n"
600  "instead of just 'mythfilldatabase'.\nYour grabber does not provide "
601  "channel numbers, so you have to set them manually.");
602 
604  {
605  LOG(VB_GENERAL, LOG_ERR, err_msg);
606  ShowOkPopup(err_msg);
607  }
608 #endif
609 }
610 
612 {
614  MythScreenType *ssd =
615  new MythTerminal(mainStack, m_grabber, m_grabberArgs);
616 
617  if (ssd->Create())
618  mainStack->AddScreen(ssd);
619  else
620  delete ssd;
621 }
622 
624 {
625  setVisible(false);
626 
627  m_useEit = new UseEIT(_parent);
628  m_useEit->setValue(true);
629  m_useEit->setVisible(false);
631 
632  auto *label=new TransTextEditSetting();
633  label->setValue(QObject::tr("Use only the transmitted guide data."));
634  label->setHelpText(
635  QObject::tr("This will usually only work with ATSC or DVB channels, "
636  "and generally provides data only for the next few days."));
637  _setting->addTargetedChild("eitonly", label);
638 }
639 
641 {
642  // Force this value on
643  m_useEit->setValue(true);
644  m_useEit->Save();
645 }
646 
648 {
649  m_useEit = new UseEIT(_parent);
650  m_useEit->setValue(false);
651  m_useEit->setVisible(false);
653 
654  auto *label = new TransTextEditSetting();
655  label->setValue(QObject::tr("Do not configure a grabber"));
656  addTargetedChild("/bin/true", label);
657 }
658 
660 {
661  m_useEit->setValue(false);
662  m_useEit->Save();
663 }
664 
666 {
667  // must be first
668  m_id = new ID();
669  addChild(m_id = new ID());
670 
671  setLabel(QObject::tr("Video Source Setup"));
672  addChild(m_name = new Name(*this));
673  addChild(new XMLTVGrabber(*this));
674  addChild(new FreqTableSelector(*this));
675  addChild(new ScanFrequencyStart(*this));
676  addChild(new DVBNetID(*this, -1, -1));
677  addChild(new BouquetID(*this, 0, 0));
678  addChild(new RegionID(*this, 0, 0));
679 }
680 
682 {
683  return true;
684 }
685 
687 {
689 }
690 
692  const QString &thecardtype)
693 {
695  query.prepare("SELECT count(cardtype)"
696  " FROM capturecard "
697  " WHERE capturecard.sourceid = :SOURCEID "
698  " AND capturecard.cardtype = :CARDTYPE ;");
699  query.bindValue(":SOURCEID", sourceID);
700  query.bindValue(":CARDTYPE", thecardtype);
701 
702  if (query.exec() && query.next())
703  {
704  int count = query.value(0).toInt();
705 
706  if (count > 0)
707  return true;
708  }
709 
710  return false;
711 }
712 
714 {
715  MSqlQuery result(MSqlQuery::InitCon());
716  result.prepare("SELECT name, sourceid FROM videosource;");
717 
718  if (result.exec() && result.isActive() && result.size() > 0)
719  {
720  while (result.next())
721  {
722  auto* source = new VideoSource();
723  source->setLabel(result.value(0).toString());
724  source->loadByID(result.value(1).toInt());
725  setting->addChild(source);
726  }
727  }
728 }
729 
731 {
732  MSqlQuery result(MSqlQuery::InitCon());
733  result.prepare("SELECT name, sourceid FROM videosource;");
734 
735  if (result.exec() && result.isActive() && result.size() > 0)
736  {
737  while (result.next())
738  {
739  setting->addSelection(result.value(0).toString(),
740  result.value(1).toString());
741  }
742  }
743 }
744 
745 void VideoSource::loadByID(int sourceid)
746 {
747  m_id->setValue(sourceid);
748 }
749 
751 {
752  public:
753  explicit VideoDevice(const CaptureCard &parent,
754  uint minor_min = 0,
755  uint minor_max = UINT_MAX,
756  const QString& card = QString(),
757  const QString& driver = QString()) :
758  CaptureCardComboBoxSetting(parent, true, "videodevice")
759  {
760  setLabel(QObject::tr("Video device"));
761 
762  // /dev/v4l/video*
763  QDir dev("/dev/v4l", "video*", QDir::Name, QDir::System);
764  fillSelectionsFromDir(dev, minor_min, minor_max,
765  card, driver, false);
766 
767  // /dev/video*
768  dev.setPath("/dev");
769  fillSelectionsFromDir(dev, minor_min, minor_max,
770  card, driver, false);
771 
772  // /dev/dtv/video*
773  dev.setPath("/dev/dtv");
774  fillSelectionsFromDir(dev, minor_min, minor_max,
775  card, driver, false);
776 
777  // /dev/dtv*
778  dev.setPath("/dev");
779  dev.setNameFilters(QStringList("dtv*"));
780  fillSelectionsFromDir(dev, minor_min, minor_max,
781  card, driver, false);
782  };
783 
788  void fillSelectionsFromDir(const QDir &dir, bool absPath = true)
789  {
790  // Needed to make both compiler and doxygen happy.
791  (void) absPath;
792 
793  fillSelectionsFromDir(dir, 0, 255, QString(), QString(), false);
794  }
795 
797  uint minor_min, uint minor_max,
798  const QString& card, const QString& driver,
799  bool allow_duplicates)
800  {
801  uint cnt = 0;
802  QRegExp *driverExp = nullptr;
803  if (!driver.isEmpty())
804  driverExp = new QRegExp(driver);
805 
806  QFileInfoList entries = dir.entryInfoList();
807  for (const auto & fi : qAsConst(entries))
808  {
809  struct stat st {};
810  QString filepath = fi.absoluteFilePath();
811  int err = lstat(filepath.toLocal8Bit().constData(), &st);
812 
813  if (err)
814  {
815  LOG(VB_GENERAL, LOG_ERR,
816  QString("Could not stat file: %1").arg(filepath));
817  continue;
818  }
819 
820  // is this is a character device?
821  if (!S_ISCHR(st.st_mode))
822  continue;
823 
824  // is this device is in our minor range?
825  uint minor_num = minor(st.st_rdev);
826  if (minor_min > minor_num || minor_max < minor_num)
827  continue;
828 
829  // ignore duplicates if allow_duplicates not set
830  if (!allow_duplicates && m_minorList[minor_num])
831  continue;
832 
833  // if the driver returns any info add this device to our list
834  QByteArray tmp = filepath.toLatin1();
835  int videofd = open(tmp.constData(), O_RDWR);
836  if (videofd >= 0)
837  {
838  QString card_name;
839  QString driver_name;
840  if (CardUtil::GetV4LInfo(videofd, card_name, driver_name) &&
841  (!driverExp || (driverExp->exactMatch(driver_name))) &&
842  (card.isEmpty() || (card_name == card)))
843  {
844  addSelection(filepath);
845  cnt++;
846  }
847  close(videofd);
848  }
849 
850  // add to list of minors discovered to avoid duplicates
851  m_minorList[minor_num] = 1;
852  }
853  delete driverExp;
854 
855  return cnt;
856  }
857 
858  QString Driver(void) const { return m_driverName; }
859  QString Card(void) const { return m_cardName; }
860 
861  private:
862  QMap<uint, uint> m_minorList;
863  QString m_cardName;
864  QString m_driverName;
865 };
866 
868 {
869  public:
870  explicit VBIDevice(const CaptureCard &parent) :
871  CaptureCardComboBoxSetting(parent, true /*, mustexist true */,
872  "vbidevice")
873  {
874  setLabel(QObject::tr("VBI device"));
875  setFilter(QString(), QString());
876  setHelpText(QObject::tr("Device to read VBI (captions) from."));
877  };
878 
879  uint setFilter(const QString &card, const QString &driver)
880  {
881  uint count = 0;
882  clearSelections();
883  QDir dev("/dev/v4l", "vbi*", QDir::Name, QDir::System);
884  if (!(count = fillSelectionsFromDir(dev, card, driver)))
885  {
886  dev.setPath("/dev");
887  if (((count = fillSelectionsFromDir(dev, card, driver)) == 0U) &&
888  !getValue().isEmpty())
889  {
890  addSelection(getValue(),getValue(),true);
891  }
892  }
893 
894  return count;
895  }
896 
901  void fillSelectionsFromDir(const QDir &dir, bool absPath = true)
902  {
903  // Needed to make both compiler and doxygen happy.
904  (void) absPath;
905 
906  fillSelectionsFromDir(dir, QString(), QString());
907  }
908 
909  uint fillSelectionsFromDir(const QDir &dir, const QString &card,
910  const QString &driver)
911  {
912  QStringList devices;
913  QFileInfoList entries = dir.entryInfoList();
914  for (const auto & fi : qAsConst(entries))
915  {
916  QString device = fi.absoluteFilePath();
917  QByteArray adevice = device.toLatin1();
918  int vbifd = open(adevice.constData(), O_RDWR);
919  if (vbifd < 0)
920  continue;
921 
922  QString cn;
923  QString dn;
924  if (CardUtil::GetV4LInfo(vbifd, cn, dn) &&
925  (driver.isEmpty() || (dn == driver)) &&
926  (card.isEmpty() || (cn == card)))
927  {
928  devices.push_back(device);
929  }
930 
931  close(vbifd);
932  }
933 
934  QString sel = getValue();
935  for (uint i = 0; i < (uint) devices.size(); i++)
936  addSelection(devices[i], devices[i], devices[i] == sel);
937 
938  return (uint) devices.size();
939  }
940 };
941 
943 {
944  public:
945  explicit CommandPath(const CaptureCard &parent) :
947  "videodevice"))
948  {
949  setLabel(QObject::tr(""));
950  setValue("");
951  setHelpText(QObject::tr("Specify the command to run, with any "
952  "needed arguments."));
953  };
954 };
955 
957 {
958  public:
959  explicit FileDevice(const CaptureCard &parent) :
961  new CaptureCardDBStorage(this, parent, "videodevice")
962  /* mustexist, false */)
963  {
964  setLabel(QObject::tr("File path"));
965  };
966 };
967 
969 {
970  public:
971  explicit AudioDevice(const CaptureCard &parent) :
972  CaptureCardComboBoxSetting(parent, true /* mustexist false */,
973  "audiodevice")
974  {
975  setLabel(QObject::tr("Audio device"));
976 #if USING_OSS
977  QDir dev("/dev", "dsp*", QDir::Name, QDir::System);
979  dev.setPath("/dev/sound");
981 #endif
982 #if USING_ALSA
983  addSelection("ALSA:default", "ALSA:default");
984 #endif
985  addSelection(QObject::tr("(None)"), "NULL");
986  setHelpText(QObject::tr("Device to read audio from, "
987  "if audio is separate from the video."));
988  };
989 };
990 
992 {
993  public:
994  SignalTimeout(const CaptureCard &parent, uint value, uint min_val) :
995  CaptureCardSpinBoxSetting(parent, min_val, 60000, 250, "signal_timeout")
996  {
997  setLabel(QObject::tr("Signal timeout (ms)"));
998  setValue(QString::number(value));
999  setHelpText(QObject::tr(
1000  "Maximum time (in milliseconds) MythTV waits for "
1001  "a signal when scanning for channels."));
1002  };
1003 };
1004 
1006 {
1007  public:
1008  ChannelTimeout(const CaptureCard &parent, uint value, uint min_val) :
1009  CaptureCardSpinBoxSetting(parent, min_val, 65000, 250,
1010  "channel_timeout")
1011  {
1012  setLabel(QObject::tr("Tuning timeout (ms)"));
1013  setValue(value);
1014  setHelpText(QObject::tr(
1015  "Maximum time (in milliseconds) MythTV waits for "
1016  "a channel lock. For recordings, if this time is "
1017  "exceeded, the recording will be marked as failed."));
1018  };
1019 };
1020 
1022 {
1023  public:
1024  explicit AudioRateLimit(const CaptureCard &parent) :
1025  CaptureCardComboBoxSetting(parent, false, "audioratelimit")
1026  {
1027  setLabel(QObject::tr("Force audio sampling rate"));
1028  setHelpText(
1029  QObject::tr("If non-zero, override the audio sampling "
1030  "rate in the recording profile when this card is "
1031  "used. Use this if your capture card does not "
1032  "support all of the standard rates."));
1033  addSelection(QObject::tr("(None)"), "0");
1034  addSelection("32000");
1035  addSelection("44100");
1036  addSelection("48000");
1037  };
1038 };
1039 
1041 {
1042  public:
1043  explicit SkipBtAudio(const CaptureCard &parent) :
1045  "skipbtaudio"))
1046  {
1047  setLabel(QObject::tr("Do not adjust volume"));
1048  setHelpText(
1049  QObject::tr("Enable this option for budget BT878 based "
1050  "DVB-T cards such as the AverTV DVB-T which "
1051  "require the audio volume to be left alone."));
1052  };
1053 };
1054 
1056 {
1057  public:
1058  explicit DVBCardNum(const CaptureCard &parent) :
1059  CaptureCardComboBoxSetting(parent, true, "videodevice")
1060  {
1061  setLabel(QObject::tr("DVB device"));
1062  setHelpText(
1063  QObject::tr("When you change this setting, the text below "
1064  "should change to the name and type of your card. "
1065  "If the card cannot be opened, an error message "
1066  "will be displayed."));
1067  fillSelections(QString());
1068  };
1069 
1073  void fillSelections(const QString &current)
1074  {
1075  clearSelections();
1076 
1077  // Get devices from filesystem
1078  QStringList sdevs = CardUtil::ProbeVideoDevices("DVB");
1079 
1080  // Add current if needed
1081  if (!current.isEmpty() &&
1082  (std::find(sdevs.begin(), sdevs.end(), current) == sdevs.end()))
1083  {
1084  std::stable_sort(sdevs.begin(), sdevs.end());
1085  }
1086 
1087  QStringList db = CardUtil::GetVideoDevices("DVB");
1088 
1089  QMap<QString,bool> in_use;
1090  QString sel = current;
1091  for (uint i = 0; i < (uint)sdevs.size(); i++)
1092  {
1093  const QString dev = sdevs[i];
1094  in_use[sdevs[i]] = std::find(db.begin(), db.end(), dev) != db.end();
1095  if (sel.isEmpty() && !in_use[sdevs[i]])
1096  sel = dev;
1097  }
1098 
1099  if (sel.isEmpty() && !sdevs.empty())
1100  sel = sdevs[0];
1101 
1102  QString usestr = QString(" -- ");
1103  usestr += QObject::tr("Warning: already in use");
1104 
1105  for (uint i = 0; i < (uint)sdevs.size(); i++)
1106  {
1107  const QString dev = sdevs[i];
1108  QString desc = dev + (in_use[sdevs[i]] ? usestr : "");
1109  desc = (current == sdevs[i]) ? dev : desc;
1110  addSelection(desc, dev, dev == sel);
1111  }
1112  }
1113 
1114  void Load(void) override // StandardSetting
1115  {
1116  clearSelections();
1117  addSelection(QString());
1118 
1120 
1122  fillSelections(dev);
1123  }
1124 };
1125 
1126 // Use capturecard/inputname to store the delivery system selection of the card
1128 {
1129  public:
1130  explicit DVBCardType(const CaptureCard &parent) :
1131  CaptureCardComboBoxSetting(parent, false, "inputname")
1132  {
1133  setLabel(QObject::tr("Delivery system"));
1134  setHelpText(
1135  QObject::tr("If your card supports more than one delivery system "
1136  "then you can select here the one that you want to use."));
1137  };
1138 };
1139 
1141 {
1142  public:
1144  {
1145  setLabel(QObject::tr("Frontend ID"));
1146  setHelpText(
1147  QObject::tr("Identification string reported by the card. "
1148  "If the message \"Could not get card info...\" appears "
1149  "the card can be in use by another program."));
1150  };
1151 };
1152 
1154 {
1155  public:
1156  explicit DVBNoSeqStart(const CaptureCard &parent) :
1158  new CaptureCardDBStorage(this, parent, "dvb_wait_for_seqstart"))
1159  {
1160  setLabel(QObject::tr("Wait for SEQ start header"));
1161  setValue(true);
1162  setHelpText(
1163  QObject::tr("If enabled, drop packets from the start of a DVB "
1164  "recording until a sequence start header is seen."));
1165  };
1166 };
1167 
1169 {
1170  public:
1171  explicit DVBOnDemand(const CaptureCard &parent) :
1173  new CaptureCardDBStorage(this, parent, "dvb_on_demand"))
1174  {
1175  setLabel(QObject::tr("Open DVB card on demand"));
1176  setValue(true);
1177  setHelpText(
1178  QObject::tr("If enabled, only open the DVB card when required, "
1179  "leaving it free for other programs at other times."));
1180  };
1181 };
1182 
1184 {
1185  public:
1186  explicit DVBEITScan(const CaptureCard &parent) :
1188  new CaptureCardDBStorage(this, parent, "dvb_eitscan"))
1189  {
1190  setLabel(QObject::tr("Use DVB card for active EIT scan"));
1191  setValue(true);
1192  setHelpText(
1193  QObject::tr("If enabled, activate active scanning for "
1194  "program data (EIT). When this option is enabled "
1195  "the DVB card is constantly in use."));
1196  };
1197 };
1198 
1200 {
1201  public:
1202  explicit DVBTuningDelay(const CaptureCard &parent) :
1203  CaptureCardSpinBoxSetting(parent, 0, 2000, 25, "dvb_tuning_delay")
1204  {
1205  setValue("0");
1206  setLabel(QObject::tr("DVB tuning delay (ms)"));
1207  setValue(static_cast<int>(true));
1208  setHelpText(
1209  QObject::tr("Some Linux DVB drivers, in particular for the "
1210  "Hauppauge Nova-T, require that we slow down "
1211  "the tuning process by specifying a delay "
1212  "(in milliseconds)."));
1213  };
1214 };
1215 
1217 {
1218  public:
1219  explicit FirewireGUID(const CaptureCard &parent) :
1220  CaptureCardComboBoxSetting(parent, false, "videodevice")
1221  {
1222  setLabel(QObject::tr("GUID"));
1223 #ifdef USING_FIREWIRE
1224  std::vector<AVCInfo> list = FirewireDevice::GetSTBList();
1225  for (auto & i : list)
1226  {
1227  QString guid = i.GetGUIDString();
1228  m_guidToAvcInfo[guid] = i;
1229  addSelection(guid);
1230  }
1231 #endif // USING_FIREWIRE
1232  }
1233 
1234  AVCInfo GetAVCInfo(const QString &guid) const
1235  { return m_guidToAvcInfo[guid]; }
1236 
1237  private:
1238  QMap<QString,AVCInfo> m_guidToAvcInfo;
1239 };
1240 
1242  const FirewireGUID *_guid) :
1243  CaptureCardComboBoxSetting(parent, false, "firewire_model"),
1244  m_guid(_guid)
1245 {
1246  setLabel(QObject::tr("Cable box model"));
1247  addSelection(QObject::tr("Motorola Generic"), "MOTO GENERIC");
1248  addSelection(QObject::tr("SA/Cisco Generic"), "SA GENERIC");
1249  addSelection("DCH-3200");
1250  addSelection("DCX-3200");
1251  addSelection("DCT-3412");
1252  addSelection("DCT-3416");
1253  addSelection("DCT-6200");
1254  addSelection("DCT-6212");
1255  addSelection("DCT-6216");
1256  addSelection("QIP-6200");
1257  addSelection("QIP-7100");
1258  addSelection("PACE-550");
1259  addSelection("PACE-779");
1260  addSelection("SA3250HD");
1261  addSelection("SA4200HD");
1262  addSelection("SA4250HDC");
1263  addSelection("SA8300HD");
1264  QString help = QObject::tr(
1265  "Choose the model that most closely resembles your set top box. "
1266  "Depending on firmware revision SA4200HD may work better for a "
1267  "SA3250HD box.");
1268  setHelpText(help);
1269 }
1270 
1271 void FirewireModel::SetGUID(const QString &_guid)
1272 {
1273  (void) _guid;
1274 
1275 #ifdef USING_FIREWIRE
1276  AVCInfo info = m_guid->GetAVCInfo(_guid);
1277  QString model = FirewireDevice::GetModelName(info.m_vendorid, info.m_modelid);
1278  setValue(std::max(getValueIndex(model), 0));
1279 #endif // USING_FIREWIRE
1280 }
1281 
1282 void FirewireDesc::SetGUID(const QString &_guid)
1283 {
1284  (void) _guid;
1285 
1286  setLabel(tr("Description"));
1287 
1288 #ifdef USING_FIREWIRE
1289  QString name = m_guid->GetAVCInfo(_guid).m_product_name;
1290  name.replace("Scientific-Atlanta", "SA");
1291  name.replace(", Inc.", "");
1292  name.replace("Explorer(R)", "");
1293  name = name.simplified();
1294  setValue((name.isEmpty()) ? "" : name);
1295 #endif // USING_FIREWIRE
1296 }
1297 
1299 {
1300  public:
1301  explicit FirewireConnection(const CaptureCard &parent) :
1303  "firewire_connection"))
1304  {
1305  setLabel(QObject::tr("Connection Type"));
1306  addSelection(QObject::tr("Point to Point"),"0");
1307  addSelection(QObject::tr("Broadcast"),"1");
1308  }
1309 };
1310 
1312 {
1313  public:
1314  explicit FirewireSpeed(const CaptureCard &parent) :
1316  "firewire_speed"))
1317  {
1318  setLabel(QObject::tr("Speed"));
1319  addSelection(QObject::tr("100Mbps"),"0");
1320  addSelection(QObject::tr("200Mbps"),"1");
1321  addSelection(QObject::tr("400Mbps"),"2");
1322  addSelection(QObject::tr("800Mbps"),"3");
1323  }
1324 };
1325 
1326 #ifdef USING_FIREWIRE
1327 static void FirewireConfigurationGroup(CaptureCard& parent, CardType& cardtype)
1328 {
1329  auto *dev(new FirewireGUID(parent));
1330  auto *desc(new FirewireDesc(dev));
1331  auto *model(new FirewireModel(parent, dev));
1332  cardtype.addTargetedChild("FIREWIRE", dev);
1333  cardtype.addTargetedChild("FIREWIRE", new EmptyAudioDevice(parent));
1334  cardtype.addTargetedChild("FIREWIRE", new EmptyVBIDevice(parent));
1335  cardtype.addTargetedChild("FIREWIRE", desc);
1336  cardtype.addTargetedChild("FIREWIRE", model);
1337 
1338 #ifdef USING_LINUX_FIREWIRE
1339  cardtype.addTargetedChild("FIREWIRE", new FirewireConnection(parent));
1340  cardtype.addTargetedChild("FIREWIRE", new FirewireSpeed(parent));
1341 #endif // USING_LINUX_FIREWIRE
1342 
1343  cardtype.addTargetedChild("FIREWIRE", new SignalTimeout(parent, 2000, 1000));
1344  cardtype.addTargetedChild("FIREWIRE", new ChannelTimeout(parent, 9000, 1750));
1345 
1346  model->SetGUID(dev->getValue());
1347  desc->SetGUID(dev->getValue());
1348  QObject::connect(dev, qOverload<const QString&>(&StandardSetting::valueChanged),
1349  model, &FirewireModel::SetGUID);
1350  QObject::connect(dev, qOverload<const QString&>(&StandardSetting::valueChanged),
1351  desc, &FirewireDesc::SetGUID);
1352 }
1353 #endif
1354 
1355 #if USING_HDHOMERUN
1356 
1357 // -----------------------
1358 // HDHomeRun Configuration
1359 // -----------------------
1360 
1362  HDHomeRunConfigurationGroup &_group) :
1364  new CaptureCardDBStorage(this, parent, "videodevice")),
1365  m_group(_group)
1366 {
1367  setVisible(false);
1368 };
1369 
1371 {
1374 }
1375 
1377 {
1380 }
1381 
1383 {
1384  public:
1385  explicit HDHomeRunEITScan(const CaptureCard &parent) :
1387  new CaptureCardDBStorage(this, parent, "dvb_eitscan"))
1388  {
1389  setLabel(QObject::tr("Use HDHomeRun for active EIT scan"));
1390  setValue(true);
1391  setHelpText(
1392  QObject::tr("If enabled, activate active scanning for "
1393  "program data (EIT). When this option is enabled "
1394  "the HDHomeRun is constantly in use."));
1395  };
1396 };
1397 
1398 
1400 {
1401  public:
1402  explicit UseHDHomeRunDevice(QString &deviceid, QString &model,
1403  QString &ipaddr)
1404  {
1405  setLabel(QObject::tr("Use HDHomeRun %1 (%2 %3)")
1406  .arg(deviceid).arg(model).arg(ipaddr));
1407  setValue(false);
1408  setHelpText(
1409  QObject::tr("If enabled, use tuners from this HDHomeRun "
1410  "device."));
1411  };
1412 };
1413 
1415  (CaptureCard& a_parent, CardType &a_cardtype) :
1416  m_parent(a_parent)
1417 {
1418  setVisible(false);
1419 
1420  // Fill Device list
1421  FillDeviceList();
1422 
1423  m_deviceId = new HDHomeRunDeviceID(m_parent, *this);
1424 
1425  QMap<QString, HDHomeRunDevice>::iterator dit;
1426  for (dit = m_deviceList.begin(); dit != m_deviceList.end(); ++dit)
1427  {
1428  HDHomeRunDevice &dev = *dit;
1429  dev.m_checkbox = new UseHDHomeRunDevice(
1430  dev.m_deviceId, dev.m_model, dev.m_cardIp);
1431  a_cardtype.addTargetedChild("HDHOMERUN", dev.m_checkbox);
1432  }
1433  a_cardtype.addTargetedChild("HDHOMERUN", new EmptyAudioDevice(m_parent));
1434  a_cardtype.addTargetedChild("HDHOMERUN", new EmptyVBIDevice(m_parent));
1435  a_cardtype.addTargetedChild("HDHOMERUN", m_deviceId);
1436 
1437  auto *buttonRecOpt = new GroupSetting();
1438  buttonRecOpt->setLabel(tr("Recording Options"));
1439  buttonRecOpt->addChild(new SignalTimeout(m_parent, 3000, 250));
1440  buttonRecOpt->addChild(new ChannelTimeout(m_parent, 6000, 1750));
1441  buttonRecOpt->addChild(new HDHomeRunEITScan(m_parent));
1442  a_cardtype.addTargetedChild("HDHOMERUN", buttonRecOpt);
1443 };
1444 
1446 {
1447  m_deviceList.clear();
1448 
1449  // Find physical devices first
1450  // ProbeVideoDevices returns "deviceid ip" pairs
1451  QStringList devs = CardUtil::ProbeVideoDevices("HDHOMERUN");
1452 
1453  for (const auto & dev : qAsConst(devs))
1454  {
1455  QStringList devinfo = dev.split(" ");
1456  const QString& devid = devinfo.at(0);
1457  const QString& devip = devinfo.at(1);
1458  const QString& model = devinfo.at(2);
1459 
1460  HDHomeRunDevice tmpdevice;
1461  tmpdevice.m_model = model;
1462  tmpdevice.m_cardIp = devip;
1463  tmpdevice.m_deviceId = devid;
1464  // Fully specify object. Checkboxes will be added later when
1465  // the configuration group is created.
1466  tmpdevice.m_checkbox = nullptr;
1467  m_deviceList[tmpdevice.m_deviceId] = tmpdevice;
1468  }
1469 
1470 #if 0
1471  // Debug dump of cards
1472  QMap<QString, HDHomeRunDevice>::iterator debugit;
1473  for (debugit = m_deviceList.begin(); debugit != m_deviceList.end(); ++debugit)
1474  {
1475  LOG(VB_GENERAL, LOG_DEBUG, QString("%1: %2 %3")
1476  .arg(debugit.key()).arg((*debugit).model)
1477  .arg((*debugit).cardip));
1478  }
1479 #endif
1480 }
1481 
1483 {
1484  QStringList devstrs = devices.split(",");
1485  for (int i = 0; i < devstrs.size(); ++i)
1486  {
1487  // Get the HDHomeRun device ID using libhdhomerun. We need to
1488  // do it this way because legacy configurations could use an
1489  // IP address and a tuner nubmer.
1490  QByteArray ba = devstrs[i].toUtf8();
1491  hdhomerun_device_t *device = hdhomerun_device_create_from_str(
1492  ba.data(), nullptr);
1493  if (!device)
1494  continue;
1495  QString devid = QString("%1").arg(
1496  hdhomerun_device_get_device_id(device), 8, 16).toUpper();
1497  hdhomerun_device_destroy(device);
1498 
1499  // If we know about this device, set its checkbox to on.
1500  QMap<QString, HDHomeRunDevice>::iterator dit;
1501  dit = m_deviceList.find(devid);
1502  if (dit != m_deviceList.end())
1503  (*dit).m_checkbox->setValue(true);
1504  }
1505 }
1506 
1508 {
1509  // Return a string listing each HDHomeRun device with its checbox
1510  // turned on.
1511  QStringList devstrs;
1512  QMap<QString, HDHomeRunDevice>::iterator dit;
1513  for (dit = m_deviceList.begin(); dit != m_deviceList.end(); ++dit)
1514  {
1515  if ((*dit).m_checkbox->boolValue())
1516  devstrs << (*dit).m_deviceId;
1517  }
1518  QString devices = devstrs.join(",");
1519  return devices;
1520 }
1521 
1522 #endif
1523 
1524 // -----------------------
1525 // VBOX Configuration
1526 // -----------------------
1527 
1529 {
1530  setLabel(QObject::tr("IP Address"));
1531  setHelpText(QObject::tr("Device IP or ID of a VBox device. eg. '192.168.1.100' or 'vbox_3718'"));
1532  VBoxIP::setEnabled(false);
1533  connect(this, qOverload<const QString&>(&StandardSetting::valueChanged),
1534  this, &VBoxIP::UpdateDevices);
1535 };
1536 
1538 {
1540  if (e)
1541  {
1542  if (!m_oldValue.isEmpty())
1544  emit NewIP(getValue());
1545  }
1546  else
1547  {
1548  m_oldValue = getValue();
1549  }
1550 }
1551 
1552 void VBoxIP::UpdateDevices(const QString &v)
1553 {
1554  if (isEnabled())
1555  emit NewIP(v);
1556 }
1557 
1559 {
1560  setLabel(QObject::tr("Tuner"));
1561  setHelpText(QObject::tr("Number and type of the tuner to use. eg '1-DVBT/T2'."));
1563  connect(this, qOverload<const QString&>(&StandardSetting::valueChanged),
1565 };
1566 
1568 {
1570  if (e) {
1571  if (!m_oldValue.isEmpty())
1573  emit NewTuner(getValue());
1574  }
1575  else
1576  {
1577  m_oldValue = getValue();
1578  }
1579 }
1580 
1581 void VBoxTunerIndex::UpdateDevices(const QString &v)
1582 {
1583  if (isEnabled())
1584  emit NewTuner(v);
1585 }
1586 
1588  MythUITextEditSetting(new CaptureCardDBStorage(this, parent, "videodevice"))
1589 {
1590  setLabel(tr("Device ID"));
1591  setHelpText(tr("Device ID of VBox device"));
1592  setEnabled(false);
1593 }
1594 
1595 void VBoxDeviceID::SetIP(const QString &ip)
1596 {
1597  m_ip = ip;
1598  setValue(QString("%1-%2").arg(m_ip).arg(m_tuner));
1599 }
1600 
1601 void VBoxDeviceID::SetTuner(const QString &tuner)
1602 {
1603  m_tuner = tuner;
1604  setValue(QString("%1-%2").arg(m_ip).arg(m_tuner));
1605 }
1606 
1607 void VBoxDeviceID::SetOverrideDeviceID(const QString &deviceid)
1608 {
1609  m_overrideDeviceId = deviceid;
1610  setValue(deviceid);
1611 }
1612 
1614 {
1615  GetStorage()->Load();
1616  if (!m_overrideDeviceId.isEmpty())
1617  {
1619  m_overrideDeviceId.clear();
1620  }
1621 }
1622 
1624  VBoxDeviceID *deviceid,
1625  StandardSetting *desc,
1626  VBoxIP *cardip,
1627  VBoxTunerIndex *cardtuner,
1628  VBoxDeviceList *devicelist,
1629  const CaptureCard &parent) :
1630  m_deviceId(deviceid),
1631  m_desc(desc),
1632  m_cardIp(cardip),
1633  m_cardTuner(cardtuner),
1634  m_deviceList(devicelist),
1635  m_parent(parent)
1636 {
1637  setLabel(QObject::tr("Available devices"));
1638  setHelpText(
1639  QObject::tr(
1640  "Device IP or ID, tuner number and tuner type of available VBox devices."));
1641 
1642  connect(this, qOverload<const QString&>(&StandardSetting::valueChanged),
1644 };
1645 
1647 void VBoxDeviceIDList::fillSelections(const QString &cur)
1648 {
1649  clearSelections();
1650 
1651  std::vector<QString> devs;
1652  QMap<QString, bool> in_use;
1653 
1654  const QString& current = cur;
1655 
1656  for (auto it = m_deviceList->begin(); it != m_deviceList->end(); ++it)
1657  {
1658  devs.push_back(it.key());
1659  in_use[it.key()] = (*it).m_inUse;
1660  }
1661 
1662  QString man_addr = VBoxDeviceIDList::tr("Manually Enter IP Address");
1663  QString sel = man_addr;
1664  devs.push_back(sel);
1665 
1666  for (const auto & dev : devs)
1667  sel = (current == dev) ? dev : sel;
1668 
1669  QString usestr = QString(" -- ");
1670  usestr += QObject::tr("Warning: already in use");
1671 
1672  for (const auto & dev : devs)
1673  {
1674  QString desc = dev + (in_use[dev] ? usestr : "");
1675  addSelection(desc, dev, dev == sel);
1676  }
1677 
1678  if (current != cur)
1679  {
1681  }
1682  else if (sel == man_addr && !current.isEmpty())
1683  {
1684  // Populate the proper values for IP address and tuner
1685  QStringList selection = current.split("-");
1686 
1687  m_cardIp->SetOldValue(selection.first());
1688  m_cardTuner->SetOldValue(selection.last());
1689 
1690  m_cardIp->setValue(selection.first());
1691  m_cardTuner->setValue(selection.last());
1692  }
1693 }
1694 
1696 {
1697  clearSelections();
1698 
1699  int cardid = m_parent.getCardID();
1700  QString device = CardUtil::GetVideoDevice(cardid);
1701  fillSelections(device);
1702 }
1703 
1704 void VBoxDeviceIDList::UpdateDevices(const QString &v)
1705 {
1706  if (v == VBoxDeviceIDList::tr("Manually Enter IP Address"))
1707  {
1708  m_cardIp->setEnabled(true);
1709  m_cardTuner->setEnabled(true);
1710  }
1711  else if (!v.isEmpty())
1712  {
1713  if (m_oldValue == VBoxDeviceIDList::tr("Manually Enter IP Address"))
1714  {
1715  m_cardIp->setEnabled(false);
1716  m_cardTuner->setEnabled(false);
1717  }
1718  m_deviceId->setValue(v);
1719 
1720  // Update _cardip and _cardtuner
1722  m_cardTuner->setValue(QString("%1").arg((*m_deviceList)[v].m_tunerNo));
1724  }
1725  m_oldValue = v;
1726 };
1727 
1728 // -----------------------
1729 // IPTV Configuration
1730 // -----------------------
1731 
1733 {
1734  public:
1735  explicit IPTVHost(const CaptureCard &parent) :
1736  CaptureCardTextEditSetting(parent, "videodevice")
1737  {
1738  setValue("http://mafreebox.freebox.fr/freeboxtv/playlist.m3u");
1739  setLabel(QObject::tr("M3U URL"));
1740  setHelpText(
1741  QObject::tr("URL of M3U containing RTSP/RTP/UDP channel URLs."));
1742  }
1743 };
1744 
1745 static void IPTVConfigurationGroup(CaptureCard& parent, CardType& cardType)
1746 {
1747  cardType.addTargetedChild("FREEBOX", new IPTVHost(parent));
1748  cardType.addTargetedChild("FREEBOX", new ChannelTimeout(parent, 30000, 1750));
1749  cardType.addTargetedChild("FREEBOX", new EmptyAudioDevice(parent));
1750  cardType.addTargetedChild("FREEBOX", new EmptyVBIDevice(parent));
1751 }
1752 
1754 {
1755  public:
1756  explicit ASIDevice(const CaptureCard &parent) :
1757  CaptureCardComboBoxSetting(parent, true, "videodevice")
1758  {
1759  setLabel(QObject::tr("ASI device"));
1760  fillSelections(QString());
1761  };
1762 
1766  void fillSelections(const QString &current)
1767  {
1768  clearSelections();
1769 
1770  // Get devices from filesystem
1771  QStringList sdevs = CardUtil::ProbeVideoDevices("ASI");
1772 
1773  // Add current if needed
1774  if (!current.isEmpty() &&
1775  (std::find(sdevs.begin(), sdevs.end(), current) == sdevs.end()))
1776  {
1777  std::stable_sort(sdevs.begin(), sdevs.end());
1778  }
1779 
1780  // Get devices from DB
1781  QStringList db = CardUtil::GetVideoDevices("ASI");
1782 
1783  // Figure out which physical devices are already in use
1784  // by another card defined in the DB, and select a device
1785  // for new configs (preferring non-conflicing devices).
1786  QMap<QString,bool> in_use;
1787  QString sel = current;
1788  for (uint i = 0; i < (uint)sdevs.size(); ++i)
1789  {
1790  const QString dev = sdevs[i];
1791  in_use[sdevs[i]] = std::find(db.begin(), db.end(), dev) != db.end();
1792  if (sel.isEmpty() && !in_use[sdevs[i]])
1793  sel = dev;
1794  }
1795 
1796  // Unfortunately all devices are conflicted, select first device.
1797  if (sel.isEmpty() && !sdevs.empty())
1798  sel = sdevs[0];
1799 
1800  QString usestr = QString(" -- ");
1801  usestr += QObject::tr("Warning: already in use");
1802 
1803  // Add the devices to the UI
1804  bool found = false;
1805  for (uint i = 0; i < (uint)sdevs.size(); ++i)
1806  {
1807  const QString dev = sdevs[i];
1808  QString desc = dev + (in_use[sdevs[i]] ? usestr : "");
1809  desc = (current == sdevs[i]) ? dev : desc;
1810  addSelection(desc, dev, dev == sel);
1811  found |= (dev == sel);
1812  }
1813 
1814  // If a configured device isn't on the list, add it with warning
1815  if (!found && !current.isEmpty())
1816  {
1817  QString desc = current + " -- " +
1818  QObject::tr("Warning: unable to open");
1819  addSelection(desc, current, true);
1820  }
1821  }
1822 
1823  void Load(void) override // StandardSetting
1824  {
1825  clearSelections();
1826  addSelection(QString());
1827  GetStorage()->Load();
1829  }
1830 };
1831 
1833  CardType &cardType):
1834  m_parent(a_parent),
1835  m_device(new ASIDevice(m_parent)),
1836  m_cardInfo(new TransTextEditSetting())
1837 {
1838  setVisible(false);
1839  m_cardInfo->setLabel(tr("Status"));
1840  m_cardInfo->setEnabled(false);
1841 
1842  cardType.addTargetedChild("ASI", m_device);
1843  cardType.addTargetedChild("ASI", new EmptyAudioDevice(m_parent));
1844  cardType.addTargetedChild("ASI", new EmptyVBIDevice(m_parent));
1845  cardType.addTargetedChild("ASI", m_cardInfo);
1846 
1847  connect(m_device, qOverload<const QString&>(&StandardSetting::valueChanged),
1849 
1851 };
1852 
1853 void ASIConfigurationGroup::probeCard(const QString &device)
1854 {
1855 #ifdef USING_ASI
1856  if (device.isEmpty())
1857  {
1858  m_cardInfo->setValue("");
1859  return;
1860  }
1861 
1862  if ((m_parent.getCardID() != 0) && m_parent.GetRawCardType() != "ASI")
1863  {
1864  m_cardInfo->setValue("");
1865  return;
1866  }
1867 
1868  QString error;
1869  int device_num = CardUtil::GetASIDeviceNumber(device, &error);
1870  if (device_num < 0)
1871  {
1872  m_cardInfo->setValue(tr("Not a valid DVEO ASI card"));
1873  LOG(VB_GENERAL, LOG_WARNING,
1874  "ASIConfigurationGroup::probeCard(), Warning: " + error);
1875  return;
1876  }
1877  m_cardInfo->setValue(tr("Valid DVEO ASI card"));
1878 #else
1879  Q_UNUSED(device);
1880  m_cardInfo->setValue(QString("Not compiled with ASI support"));
1881 #endif
1882 }
1883 
1885  CardType& a_cardtype):
1886  m_parent(a_parent),
1887  m_info(new GroupSetting()), m_size(new GroupSetting())
1888 {
1889  setVisible(false);
1890  auto *device = new FileDevice(m_parent);
1891  device->setHelpText(tr("A local file used to simulate a recording."
1892  " Leave empty to use MythEvents to trigger an"
1893  " external program to import recording files."));
1894  a_cardtype.addTargetedChild("IMPORT", device);
1895 
1896  a_cardtype.addTargetedChild("IMPORT", new EmptyAudioDevice(m_parent));
1897  a_cardtype.addTargetedChild("IMPORT", new EmptyVBIDevice(m_parent));
1898 
1899  m_info->setLabel(tr("File info"));
1900  a_cardtype.addTargetedChild("IMPORT", m_info);
1901 
1902  m_size->setLabel(tr("File size"));
1903  a_cardtype.addTargetedChild("IMPORT", m_size);
1904 
1905  connect(device, qOverload<const QString&>(&StandardSetting::valueChanged),
1907 
1908  probeCard(device->getValue());
1909 };
1910 
1911 void ImportConfigurationGroup::probeCard(const QString &device)
1912 {
1913  QString ci;
1914  QString cs;
1915  QFileInfo fileInfo(device);
1916 
1917  // For convenience, ImportRecorder allows both formats:
1918  if (device.startsWith("file:", Qt::CaseInsensitive))
1919  fileInfo.setFile(device.mid(5));
1920 
1921  if (fileInfo.exists())
1922  {
1923  if (fileInfo.isReadable() && (fileInfo.isFile()))
1924  {
1925  ci = HTTPRequest::TestMimeType(fileInfo.absoluteFilePath());
1926  cs = tr("%1 MB").arg(fileInfo.size() / 1024 / 1024);
1927  }
1928  else
1929  ci = tr("File not readable");
1930  }
1931  else
1932  {
1933  ci = tr("File %1 does not exist").arg(device);
1934  }
1935 
1936  m_info->setValue(ci);
1937  m_size->setValue(cs);
1938 }
1939 
1940 // -----------------------
1941 // VBox Configuration
1942 // -----------------------
1943 
1945  (CaptureCard& a_parent, CardType& a_cardtype) :
1946  m_parent(a_parent)
1947 {
1948  setVisible(false);
1949 
1950  // Fill Device list
1951  FillDeviceList();
1952 
1954  m_desc = new GroupSetting();
1955  m_desc->setLabel(tr("Description"));
1956  m_cardIp = new VBoxIP();
1957  m_cardTuner = new VBoxTunerIndex();
1960 
1961  a_cardtype.addTargetedChild("VBOX", m_deviceIdList);
1962  a_cardtype.addTargetedChild("VBOX", new EmptyAudioDevice(m_parent));
1963  a_cardtype.addTargetedChild("VBOX", new EmptyVBIDevice(m_parent));
1964  a_cardtype.addTargetedChild("VBOX", m_deviceId);
1965  a_cardtype.addTargetedChild("VBOX", m_desc);
1966  a_cardtype.addTargetedChild("VBOX", m_cardIp);
1967  a_cardtype.addTargetedChild("VBOX", m_cardTuner);
1968  a_cardtype.addTargetedChild("VBOX", new SignalTimeout(m_parent, 7000, 1000));
1969  a_cardtype.addTargetedChild("VBOX", new ChannelTimeout(m_parent, 10000, 1750));
1970 
1971  connect(m_cardIp, &VBoxIP::NewIP,
1975 };
1976 
1978 {
1979  m_deviceList.clear();
1980 
1981  // Find physical devices first
1982  // ProbeVideoDevices returns "deviceid ip tunerno tunertype"
1983  QStringList devs = CardUtil::ProbeVideoDevices("VBOX");
1984 
1985  for (const auto & dev : qAsConst(devs))
1986  {
1987  QStringList devinfo = dev.split(" ");
1988  const QString& id = devinfo.at(0);
1989  const QString& ip = devinfo.at(1);
1990  const QString& tunerNo = devinfo.at(2);
1991  const QString& tunerType = devinfo.at(3);
1992 
1993  VBoxDevice tmpdevice;
1994  tmpdevice.m_deviceId = id;
1995  tmpdevice.m_desc = CardUtil::GetVBoxdesc(id, ip, tunerNo, tunerType);
1996  tmpdevice.m_cardIp = ip;
1997  tmpdevice.m_inUse = false;
1998  tmpdevice.m_discovered = true;
1999  tmpdevice.m_tunerNo = tunerNo;
2000  tmpdevice.m_tunerType = tunerType;
2001  tmpdevice.m_mythDeviceId = id + "-" + tunerNo + "-" + tunerType;
2002  m_deviceList[tmpdevice.m_mythDeviceId] = tmpdevice;
2003  }
2004 
2005  // Now find configured devices
2006 
2007  // returns "ip.ip.ip.ip-n-type" or deviceid-n-type values
2008  QStringList db = CardUtil::GetVideoDevices("VBOX");
2009 
2010  for (const auto & dev : qAsConst(db))
2011  {
2012  QMap<QString, VBoxDevice>::iterator dit;
2013  dit = m_deviceList.find(dev);
2014 
2015  if (dit != m_deviceList.end())
2016  (*dit).m_inUse = true;
2017  }
2018 }
2019 
2020 // -----------------------
2021 // Ceton Configuration
2022 // -----------------------
2023 #ifdef USING_CETON
2024 CetonSetting::CetonSetting(QString label, const QString& helptext)
2025 {
2026  setLabel(std::move(label));
2027  setHelpText(helptext);
2028  connect(this, qOverload<const QString&>(&StandardSetting::valueChanged),
2030 }
2031 
2032 void CetonSetting::UpdateDevices(const QString &v)
2033 {
2034  if (isEnabled())
2035  emit NewValue(v);
2036 }
2037 
2038 void CetonSetting::LoadValue(const QString &value)
2039 {
2040  setValue(value);
2041 }
2042 
2044  MythUITextEditSetting(new CaptureCardDBStorage(this, parent, "videodevice")),
2045  m_parent(parent)
2046 {
2047  setLabel(tr("Device ID"));
2048  setHelpText(tr("Device ID of Ceton device"));
2049 }
2050 
2051 void CetonDeviceID::SetIP(const QString &ip)
2052 {
2053  QString regexp = "^((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){4}$";
2054  if (QRegExp(regexp).exactMatch(ip + "."))
2055  {
2056  m_ip = ip;
2057  setValue(QString("%1-RTP.%3").arg(m_ip).arg(m_tuner));
2058  }
2059 }
2060 
2061 void CetonDeviceID::SetTuner(const QString &tuner)
2062 {
2063  if (QRegExp("^\\d$").exactMatch(tuner))
2064  {
2065  m_tuner = tuner;
2066  setValue(QString("%1-RTP.%2").arg(m_ip).arg(m_tuner));
2067  }
2068 }
2069 
2071 {
2072  GetStorage()->Load();
2073  UpdateValues();
2074 }
2075 
2077 {
2078  QRegExp newstyle(R"(^([0-9.]+)-(\d|RTP)\.(\d)$)");
2079  if (newstyle.exactMatch(getValue()))
2080  {
2081  emit LoadedIP(newstyle.cap(1));
2082  emit LoadedTuner(newstyle.cap(3));
2083  }
2084 }
2085 
2087 {
2088  auto *deviceid = new CetonDeviceID(parent);
2089  auto *desc = new GroupSetting();
2090  desc->setLabel(tr("CetonConfigurationGroup", "Description"));
2091  auto *ip = new CetonSetting(tr("IP Address"),
2092  tr("IP Address of the Ceton device (192.168.200.1 by default)"));
2093  auto *tuner = new CetonSetting(tr("Tuner"),
2094  tr("Number of the tuner on the Ceton device (first tuner is number 0)"));
2095 
2096  cardtype.addTargetedChild("CETON", ip);
2097  cardtype.addTargetedChild("CETON", tuner);
2098  cardtype.addTargetedChild("CETON", deviceid);
2099  cardtype.addTargetedChild("CETON", desc);
2100  cardtype.addTargetedChild("CETON", new SignalTimeout(parent, 1000, 250));
2101  cardtype.addTargetedChild("CETON", new ChannelTimeout(parent, 3000, 1750));
2102 
2103  QObject::connect(ip, &CetonSetting::NewValue,
2104  deviceid, &CetonDeviceID::SetIP);
2105  QObject::connect(tuner, &CetonSetting::NewValue,
2106  deviceid, &CetonDeviceID::SetTuner);
2107 
2108  QObject::connect(deviceid, &CetonDeviceID::LoadedIP,
2110  QObject::connect(deviceid, &CetonDeviceID::LoadedTuner,
2111  tuner, &CetonSetting::LoadValue);
2112 }
2113 #endif
2114 
2116  CardType& a_cardtype) :
2117  m_parent(a_parent),
2118  m_cardInfo(new TransTextEditSetting()), m_vbiDev(new VBIDevice(m_parent))
2119 {
2120  setVisible(false);
2121  QString drv = "(?!ivtv|hdpvr|(saa7164(.*))).*";
2122  auto *device = new VideoDevice(m_parent, 0, 15, QString(), drv);
2123 
2124  m_cardInfo->setLabel(tr("Probed info"));
2125  m_cardInfo->setEnabled(false);
2126 
2127  a_cardtype.addTargetedChild("V4L", device);
2128  a_cardtype.addTargetedChild("V4L", m_cardInfo);
2129  a_cardtype.addTargetedChild("V4L", m_vbiDev);
2130  a_cardtype.addTargetedChild("V4L", new AudioDevice(m_parent));
2131  a_cardtype.addTargetedChild("V4L", new AudioRateLimit(m_parent));
2132  a_cardtype.addTargetedChild("V4L", new SkipBtAudio(m_parent));
2133 
2134  connect(device, qOverload<const QString&>(&StandardSetting::valueChanged),
2136 
2137  probeCard(device->getValue());
2138 };
2139 
2140 void V4LConfigurationGroup::probeCard(const QString &device)
2141 {
2142  QString cn = tr("Failed to open");
2143  QString ci = cn;
2144  QString dn;
2145 
2146  QByteArray adevice = device.toLatin1();
2147  int videofd = open(adevice.constData(), O_RDWR);
2148  if (videofd >= 0)
2149  {
2150  if (!CardUtil::GetV4LInfo(videofd, cn, dn))
2151  ci = cn = tr("Failed to probe");
2152  else if (!dn.isEmpty())
2153  ci = cn + " [" + dn + "]";
2154  close(videofd);
2155  }
2156 
2157  m_cardInfo->setValue(ci);
2158  m_vbiDev->setFilter(cn, dn);
2159 }
2160 
2162  CardType &a_cardtype) :
2163  m_parent(a_parent),
2164  m_cardInfo(new TransTextEditSetting())
2165 {
2166  setVisible(false);
2167  QString drv = "ivtv|(saa7164(.*))";
2168  m_device = new VideoDevice(m_parent, 0, 15, QString(), drv);
2170  m_vbiDevice->setVisible(false);
2171 
2172  m_cardInfo->setLabel(tr("Probed info"));
2173  m_cardInfo->setEnabled(false);
2174 
2175  a_cardtype.addTargetedChild("MPEG", m_device);
2176  a_cardtype.addTargetedChild("MPEG", m_vbiDevice);
2177  a_cardtype.addTargetedChild("MPEG", m_cardInfo);
2178  a_cardtype.addTargetedChild("MPEG", new ChannelTimeout(m_parent, 12000, 2000));
2179 
2180  connect(m_device, qOverload<const QString&>(&StandardSetting::valueChanged),
2182 
2184 }
2185 
2186 void MPEGConfigurationGroup::probeCard(const QString &device)
2187 {
2188  QString cn = tr("Failed to open");
2189  QString ci = cn;
2190  QString dn;
2191 
2192  QByteArray adevice = device.toLatin1();
2193  int videofd = open(adevice.constData(), O_RDWR);
2194  if (videofd >= 0)
2195  {
2196  if (!CardUtil::GetV4LInfo(videofd, cn, dn))
2197  ci = cn = tr("Failed to probe");
2198  else if (!dn.isEmpty())
2199  ci = cn + " [" + dn + "]";
2200  close(videofd);
2201  }
2202 
2203  m_cardInfo->setValue(ci);
2204  m_vbiDevice->setVisible(dn!="ivtv");
2205  m_vbiDevice->setFilter(cn, dn);
2206 }
2207 
2209  CardType &a_cardtype) :
2210  m_parent(a_parent),
2211  m_info(new GroupSetting()), m_size(new GroupSetting())
2212 {
2213  setVisible(false);
2214  auto *device = new FileDevice(m_parent);
2215  device->setHelpText(tr("A local MPEG file used to simulate a recording."));
2216 
2217  a_cardtype.addTargetedChild("DEMO", device);
2218 
2219  a_cardtype.addTargetedChild("DEMO", new EmptyAudioDevice(m_parent));
2220  a_cardtype.addTargetedChild("DEMO", new EmptyVBIDevice(m_parent));
2221 
2222  m_info->setLabel(tr("File info"));
2223  a_cardtype.addTargetedChild("DEMO", m_info);
2224 
2225  m_size->setLabel(tr("File size"));
2226  a_cardtype.addTargetedChild("DEMO", m_size);
2227 
2228  connect(device, qOverload<const QString&>(&StandardSetting::valueChanged),
2230 
2231  probeCard(device->getValue());
2232 }
2233 
2234 void DemoConfigurationGroup::probeCard(const QString &device)
2235 {
2236  QString ci;
2237  QString cs;
2238  QFileInfo fileInfo(device);
2239  if (fileInfo.exists())
2240  {
2241  if (fileInfo.isReadable() && (fileInfo.isFile()))
2242  {
2243  ci = HTTPRequest::TestMimeType(fileInfo.absoluteFilePath());
2244  cs = tr("%1 MB").arg(fileInfo.size() / 1024 / 1024);
2245  }
2246  else
2247  ci = tr("File not readable");
2248  }
2249  else
2250  {
2251  ci = tr("File does not exist");
2252  }
2253 
2254  m_info->setValue(ci);
2255  m_size->setValue(cs);
2256 }
2257 
2258 #if !defined( USING_MINGW ) && !defined( _MSC_VER )
2259 ExternalConfigurationGroup::ExternalConfigurationGroup(CaptureCard &a_parent,
2260  CardType &a_cardtype) :
2261  m_parent(a_parent),
2262  m_info(new GroupSetting())
2263 {
2264  setVisible(false);
2265  auto *device = new CommandPath(m_parent);
2266  device->setLabel(tr("Command path"));
2267  device->setHelpText(tr("A 'black box' application controlled via stdin, status on "
2268  "stderr and TransportStream read from stdout.\n"
2269  "Use absolute path or path relative to the current directory."));
2270  a_cardtype.addTargetedChild("EXTERNAL", device);
2271 
2272  m_info->setLabel(tr("File info"));
2273  a_cardtype.addTargetedChild("EXTERNAL", m_info);
2274 
2275  a_cardtype.addTargetedChild("EXTERNAL",
2276  new ChannelTimeout(m_parent, 20000, 1750));
2277 
2278  connect(device, qOverload<const QString&>(&StandardSetting::valueChanged),
2279  this, &ExternalConfigurationGroup::probeApp);
2280 
2281  probeApp(device->getValue());
2282 }
2283 
2284 void ExternalConfigurationGroup::probeApp(const QString & path)
2285 {
2286  int idx1 = path.startsWith("file:", Qt::CaseInsensitive) ? 5 : 0;
2287  int idx2 = path.indexOf(' ', idx1);
2288 
2289  QString ci;
2290  QFileInfo fileInfo(path.mid(idx1, idx2 - idx1));
2291 
2292  if (fileInfo.exists())
2293  {
2294  ci = tr("File '%1' is valid.").arg(fileInfo.absoluteFilePath());
2295  if (!fileInfo.isReadable() || !fileInfo.isFile())
2296  ci = tr("WARNING: File '%1' is not readable.")
2297  .arg(fileInfo.absoluteFilePath());
2298  if (!fileInfo.isExecutable())
2299  ci = tr("WARNING: File '%1' is not executable.")
2300  .arg(fileInfo.absoluteFilePath());
2301  }
2302  else
2303  {
2304  ci = tr("WARNING: File '%1' does not exist.")
2305  .arg(fileInfo.absoluteFilePath());
2306  }
2307 
2308  m_info->setValue(ci);
2309  m_info->setHelpText(ci);
2310 }
2311 #endif // !defined( USING_MINGW ) && !defined( _MSC_VER )
2312 
2314  CardType &a_cardtype) :
2315  m_parent(a_parent), m_cardInfo(new GroupSetting()),
2316  m_audioInput(new TunerCardAudioInput(m_parent, QString(), "HDPVR"))
2317 {
2318  setVisible(false);
2319 
2320  auto *device = new VideoDevice(m_parent, 0, 15, QString(), "hdpvr");
2321 
2322  m_cardInfo->setLabel(tr("Probed info"));
2323  m_cardInfo->setEnabled(false);
2324 
2325  a_cardtype.addTargetedChild("HDPVR", device);
2326  a_cardtype.addTargetedChild("HDPVR", new EmptyAudioDevice(m_parent));
2327  a_cardtype.addTargetedChild("HDPVR", new EmptyVBIDevice(m_parent));
2328  a_cardtype.addTargetedChild("HDPVR", m_cardInfo);
2329  a_cardtype.addTargetedChild("HDPVR", m_audioInput);
2330  a_cardtype.addTargetedChild("HDPVR", new ChannelTimeout(m_parent, 15000, 2000));
2331 
2332  connect(device, qOverload<const QString&>(&StandardSetting::valueChanged),
2334 
2335  probeCard(device->getValue());
2336 }
2337 
2338 void HDPVRConfigurationGroup::probeCard(const QString &device)
2339 {
2340  QString cn = tr("Failed to open");
2341  QString ci = cn;
2342  QString dn;
2343 
2344  int videofd = open(device.toLocal8Bit().constData(), O_RDWR);
2345  if (videofd >= 0)
2346  {
2347  if (!CardUtil::GetV4LInfo(videofd, cn, dn))
2348  ci = cn = tr("Failed to probe");
2349  else if (!dn.isEmpty())
2350  ci = cn + " [" + dn + "]";
2351  close(videofd);
2352  }
2353 
2354  m_cardInfo->setValue(ci);
2355  m_audioInput->fillSelections(device);
2356 }
2357 
2359  m_parent(parent),
2360  m_cardInfo(new TransTextEditSetting())
2361 {
2362  setLabel(QObject::tr("V4L2 encoder devices (multirec capable)"));
2363  m_device = new VideoDevice(m_parent, 0, 15);
2364 
2365  cardtype.addTargetedChild("V4L2ENC", m_device);
2366  m_cardInfo->setLabel(tr("Probed info"));
2367  cardtype.addTargetedChild("V4L2ENC", m_cardInfo);
2368 
2369  setVisible(false);
2370 
2371  connect(m_device, qOverload<const QString&>(&StandardSetting::valueChanged),
2372  this, &V4L2encGroup::probeCard);
2373 
2374  const QString &device_name = m_device->getValue();
2375  if (!device_name.isEmpty())
2376  probeCard(device_name);
2377 }
2378 
2379 void V4L2encGroup::probeCard(const QString &device_name)
2380 {
2381 #ifdef USING_V4L2
2382  QString card_name = tr("Failed to open");
2383  QString card_info = card_name;
2384  V4L2util v4l2(device_name);
2385 
2386  if (!v4l2.IsOpen())
2387  {
2388  m_driverName = tr("Failed to probe");
2389  return;
2390  }
2391  m_driverName = v4l2.DriverName();
2392  card_name = v4l2.CardName();
2393 
2394  if (!m_driverName.isEmpty())
2395  card_info = card_name + " [" + m_driverName + "]";
2396 
2397  m_cardInfo->setValue(card_info);
2398 
2399  if (m_device->getSubSettings()->empty())
2400  {
2401  auto* audioinput = new TunerCardAudioInput(m_parent, QString(), "V4L2");
2402  if (audioinput->fillSelections(device_name) > 1)
2403  {
2404  audioinput->setName("AudioInput");
2405  m_device->addTargetedChild(m_driverName, audioinput);
2406  }
2407  else
2408  delete audioinput;
2409 
2410  if (v4l2.HasSlicedVBI())
2411  {
2412  auto* vbidev = new VBIDevice(m_parent);
2413  if (vbidev->setFilter(card_name, m_driverName) > 0)
2414  {
2415  vbidev->setName("VBIDevice");
2417  }
2418  else
2419  delete vbidev;
2420  }
2421 
2424  new ChannelTimeout(m_parent, 15000, 2000));
2425  }
2426 #else
2427  Q_UNUSED(device_name);
2428 #endif // USING_V4L2
2429 }
2430 
2432 {
2433  setLabel(QObject::tr("Capture Card Setup"));
2434 
2435  auto* cardtype = new CardType(parent);
2436  parent.addChild(cardtype);
2437 
2438 #ifdef USING_DVB
2439  cardtype->addTargetedChild("DVB",
2440  new DVBConfigurationGroup(parent, *cardtype));
2441 #endif // USING_DVB
2442 
2443 #ifdef USING_V4L2
2444 # ifdef USING_HDPVR
2445  cardtype->addTargetedChild("HDPVR",
2446  new HDPVRConfigurationGroup(parent, *cardtype));
2447 # endif // USING_HDPVR
2448 #endif // USING_V4L2
2449 
2450 #ifdef USING_HDHOMERUN
2451  cardtype->addTargetedChild("HDHOMERUN",
2452  new HDHomeRunConfigurationGroup(parent, *cardtype));
2453 #endif // USING_HDHOMERUN
2454 
2455 #ifdef USING_VBOX
2456  cardtype->addTargetedChild("VBOX",
2457  new VBoxConfigurationGroup(parent, *cardtype));
2458 #endif // USING_VBOX
2459 
2460 #ifdef USING_SATIP
2461  cardtype->addTargetedChild("SATIP",
2462  new SatIPConfigurationGroup(parent, *cardtype));
2463 #endif // USING_SATIP
2464 
2465 #ifdef USING_FIREWIRE
2466  FirewireConfigurationGroup(parent, *cardtype);
2467 #endif // USING_FIREWIRE
2468 
2469 #ifdef USING_CETON
2470  CetonSetting::CetonConfigurationGroup(parent, *cardtype);
2471 #endif // USING_CETON
2472 
2473 #ifdef USING_IPTV
2474  IPTVConfigurationGroup(parent, *cardtype);
2475 #endif // USING_IPTV
2476 
2477 #ifdef USING_V4L2
2478  cardtype->addTargetedChild("V4L2ENC", new V4L2encGroup(parent, *cardtype));
2479  cardtype->addTargetedChild("V4L",
2480  new V4LConfigurationGroup(parent, *cardtype));
2481  cardtype->addTargetedChild("MJPEG",
2482  new V4LConfigurationGroup(parent, *cardtype));
2483  cardtype->addTargetedChild("GO7007",
2484  new V4LConfigurationGroup(parent, *cardtype));
2485 # ifdef USING_IVTV
2486  cardtype->addTargetedChild("MPEG",
2487  new MPEGConfigurationGroup(parent, *cardtype));
2488 # endif // USING_IVTV
2489 #endif // USING_V4L2
2490 
2491 #ifdef USING_ASI
2492  cardtype->addTargetedChild("ASI",
2493  new ASIConfigurationGroup(parent, *cardtype));
2494 #endif // USING_ASI
2495 
2496  // for testing without any actual tuner hardware:
2497  cardtype->addTargetedChild("IMPORT",
2498  new ImportConfigurationGroup(parent, *cardtype));
2499  cardtype->addTargetedChild("DEMO",
2500  new DemoConfigurationGroup(parent, *cardtype));
2501 #if !defined( USING_MINGW ) && !defined( _MSC_VER )
2502  cardtype->addTargetedChild("EXTERNAL",
2503  new ExternalConfigurationGroup(parent,
2504  *cardtype));
2505 #endif
2506 }
2507 
2508 CaptureCard::CaptureCard(bool use_card_group)
2509  : m_id(new ID)
2510 {
2511  addChild(m_id);
2512  if (use_card_group)
2513  CaptureCardGroup(*this);
2514  addChild(new Hostname(*this));
2515 }
2516 
2517 QString CaptureCard::GetRawCardType(void) const
2518 {
2519  int cardid = getCardID();
2520  if (cardid <= 0)
2521  return QString();
2522  return CardUtil::GetRawInputType(cardid);
2523 }
2524 
2526 {
2528  QString qstr =
2529  "SELECT cardid, videodevice, cardtype "
2530  "FROM capturecard "
2531  "WHERE hostname = :HOSTNAME AND parentid = 0 "
2532  "ORDER BY cardid";
2533 
2534  query.prepare(qstr);
2535  query.bindValue(":HOSTNAME", gCoreContext->GetHostName());
2536 
2537  if (!query.exec())
2538  {
2539  MythDB::DBError("CaptureCard::fillSelections", query);
2540  return;
2541  }
2542 
2544 
2545  while (query.next())
2546  {
2547  uint cardid = query.value(0).toUInt();
2548  QString videodevice = query.value(1).toString();
2549  QString cardtype = query.value(2).toString();
2550 
2551  QString label = CardUtil::GetDeviceLabel(cardtype, videodevice);
2552  auto *card = new CaptureCard();
2553  card->loadByID(cardid);
2554  card->setLabel(label);
2555  setting->addChild(card);
2556  }
2557 }
2558 
2559 void CaptureCard::loadByID(int cardid)
2560 {
2561  m_id->setValue(cardid);
2562  Load();
2563 }
2564 
2566 {
2567  return true;
2568 }
2569 
2571 {
2573 }
2574 
2575 
2577 {
2578  uint init_cardid = getCardID();
2579  QString init_dev = CardUtil::GetVideoDevice(init_cardid);
2580 
2582 
2584 
2586 
2587  uint cardid = getCardID();
2588  QString type = CardUtil::GetRawInputType(cardid);
2589  QString dev = CardUtil::GetVideoDevice(cardid);
2590 
2591  if (dev != init_dev)
2592  {
2593  if (!init_dev.isEmpty())
2594  {
2595  uint init_groupid = CardUtil::GetDeviceInputGroup(init_cardid);
2596  CardUtil::UnlinkInputGroup(init_cardid, init_groupid);
2597  }
2598  if (!dev.isEmpty())
2599  {
2600  uint groupid =
2602  gCoreContext->GetHostName(), dev);
2603  CardUtil::LinkInputGroup(cardid, groupid);
2604  CardUtil::UnlinkInputGroup(0, groupid);
2605  }
2606  }
2607 
2608  // Handle any cloning we may need to do
2610  {
2611  std::vector<uint> clones = CardUtil::GetChildInputIDs(cardid);
2612  for (uint clone : clones)
2613  CardUtil::CloneCard(cardid, clone);
2614  }
2615 }
2616 
2618 {
2619  if (getCardID() == 0)
2620  {
2621  Save();
2622  Load();
2623  }
2624 }
2625 
2627  CaptureCardComboBoxSetting(parent, false, "cardtype")
2628 {
2629  setLabel(QObject::tr("Card type"));
2630  setHelpText(QObject::tr("Change the cardtype to the appropriate type for "
2631  "the capture card you are configuring."));
2632  fillSelections(this);
2633 }
2634 
2636 {
2637 #ifdef USING_DVB
2638  setting->addSelection(
2639  QObject::tr("DVB-T/S/C, ATSC or ISDB-T tuner card"), "DVB");
2640 #endif // USING_DVB
2641 
2642 #ifdef USING_V4L2
2643  setting->addSelection(
2644  QObject::tr("V4L2 encoder"), "V4L2ENC");
2645 #ifdef USING_HDPVR
2646  setting->addSelection(
2647  QObject::tr("HD-PVR H.264 encoder"), "HDPVR");
2648 # endif // USING_HDPVR
2649 #endif // USING_V4L2
2650 
2651 #ifdef USING_HDHOMERUN
2652  setting->addSelection(
2653  QObject::tr("HDHomeRun networked tuner"), "HDHOMERUN");
2654 #endif // USING_HDHOMERUN
2655 
2656 #ifdef USING_SATIP
2657  setting->addSelection(
2658  QObject::tr("Sat>IP networked tuner"), "SATIP");
2659 #endif // USING_SATIP
2660 
2661 #ifdef USING_VBOX
2662  setting->addSelection(
2663  QObject::tr("V@Box TV Gateway networked tuner"), "VBOX");
2664 #endif // USING_VBOX
2665 
2666 #ifdef USING_FIREWIRE
2667  setting->addSelection(
2668  QObject::tr("FireWire cable box"), "FIREWIRE");
2669 #endif // USING_FIREWIRE
2670 
2671 #ifdef USING_CETON
2672  setting->addSelection(
2673  QObject::tr("Ceton Cablecard tuner"), "CETON");
2674 #endif // USING_CETON
2675 
2676 #ifdef USING_IPTV
2677  setting->addSelection(QObject::tr("IPTV recorder"), "FREEBOX");
2678 #endif // USING_IPTV
2679 
2680 #ifdef USING_V4L2
2681 # ifdef USING_IVTV
2682  setting->addSelection(
2683  QObject::tr("Analog to MPEG-2 encoder card (PVR-150/250/350, etc)"), "MPEG");
2684 # endif // USING_IVTV
2685  setting->addSelection(
2686  QObject::tr("Analog to MJPEG encoder card (Matrox G200, DC10, etc)"), "MJPEG");
2687  setting->addSelection(
2688  QObject::tr("Analog to MPEG-4 encoder (Plextor ConvertX USB, etc)"),
2689  "GO7007");
2690  setting->addSelection(
2691  QObject::tr("Analog capture card"), "V4L");
2692 #endif // USING_V4L2
2693 
2694 #ifdef USING_ASI
2695  setting->addSelection(QObject::tr("DVEO ASI recorder"), "ASI");
2696 #endif
2697 
2698  setting->addSelection(QObject::tr("Import test recorder"), "IMPORT");
2699  setting->addSelection(QObject::tr("Demo test recorder"), "DEMO");
2700 #if !defined( USING_MINGW ) && !defined( _MSC_VER )
2701  setting->addSelection(QObject::tr("External (black box) recorder"),
2702  "EXTERNAL");
2703 #endif
2704 }
2705 
2707 {
2708  public:
2709  explicit InputName(const CardInput &parent) :
2710  MythUIComboBoxSetting(new CardInputDBStorage(this, parent, "inputname"))
2711  {
2712  setLabel(QObject::tr("Input name"));
2713  };
2714 
2715  void Load(void) override // StandardSetting
2716  {
2717  fillSelections();
2719  };
2720 
2722  clearSelections();
2723  addSelection(QObject::tr("(None)"), "None");
2724  auto *storage = dynamic_cast<CardInputDBStorage*>(GetStorage());
2725  if (storage == nullptr)
2726  return;
2727  uint cardid = storage->getInputID();
2728  QString type = CardUtil::GetRawInputType(cardid);
2729  QString device = CardUtil::GetVideoDevice(cardid);
2730  QStringList inputs;
2731  CardUtil::GetDeviceInputNames(device, type, inputs);
2732  while (!inputs.isEmpty())
2733  {
2734  addSelection(inputs.front());
2735  inputs.pop_front();
2736  }
2737  };
2738 };
2739 
2741 {
2742  public:
2744  {
2745  setLabel(QObject::tr("Delivery system"));
2746  setHelpText(QObject::tr(
2747  "This shows the delivery system (modulation), for instance DVB-T2, "
2748  "that you have selected when you configured the capture card. "
2749  "This must be the same as the modulation used by the video source. "));
2750  };
2751 };
2752 
2754 {
2755  public:
2756  explicit InputDisplayName(const CardInput &parent) :
2757  MythUITextEditSetting(new CardInputDBStorage(this, parent, "displayname")), m_parent(parent)
2758  {
2759  setLabel(QObject::tr("Display name"));
2760  setHelpText(QObject::tr(
2761  "This name is displayed on screen when Live TV begins "
2762  "and in various other places. Make sure the last two "
2763  "characters are unique for each input."));
2764  };
2765  void Load(void) override {
2767  if (getValue().isEmpty())
2768  setValue(tr("Input %1").arg(m_parent.getInputID()));
2769  }
2770  private:
2772 };
2773 
2775 {
2776  public:
2777  CardInputComboBoxSetting(const CardInput &parent, const QString &setting) :
2778  MythUIComboBoxSetting(new CardInputDBStorage(this, parent, setting))
2779  {
2780  }
2781 };
2782 
2784 {
2785  public:
2786  explicit SourceID(const CardInput &parent) :
2787  CardInputComboBoxSetting(parent, "sourceid")
2788  {
2789  setLabel(QObject::tr("Video source"));
2790  addSelection(QObject::tr("(None)"), "0");
2791  };
2792 
2793  void Load(void) override // StandardSetting
2794  {
2795  fillSelections();
2797  };
2798 
2800  clearSelections();
2801  addSelection(QObject::tr("(None)"), "0");
2803  };
2804 };
2805 
2807 {
2808  public:
2809  InputGroup(const CardInput &parent, uint group_num) :
2810  m_cardInput(parent),
2811  m_groupNum(group_num)
2812  {
2813  setLabel(QObject::tr("Input group") +
2814  QString(" %1").arg(m_groupNum + 1));
2815  setHelpText(QObject::tr(
2816  "Leave as 'Generic' unless this input is shared with "
2817  "another device. Only one of the inputs in an input "
2818  "group will be allowed to record at any given time."));
2819  }
2820 
2821  void Load(void) override; // StandardSetting
2822 
2823  void Save(void) override // StandardSetting
2824  {
2825  uint inputid = m_cardInput.getInputID();
2826  uint new_groupid = getValue().toUInt();
2827 
2828  if (m_groupId)
2830 
2831  if (new_groupid)
2832  {
2833  if (CardUtil::UnlinkInputGroup(inputid, new_groupid))
2834  CardUtil::LinkInputGroup(inputid, new_groupid);
2835  }
2836  }
2837 
2838  virtual void Save(const QString& /*destination*/) { Save(); }
2839 
2840  private:
2844 };
2845 
2847 {
2848 #if 0
2849  LOG(VB_GENERAL, LOG_DEBUG, QString("InputGroup::Load() %1 %2")
2851 #endif
2852 
2853  uint inputid = m_cardInput.getInputID();
2854  QMap<uint, uint> grpcnt;
2855  std::vector<QString> names;
2856  std::vector<uint> grpid;
2857  std::vector<uint> selected_groupids;
2858 
2859  names.push_back(QObject::tr("Generic"));
2860  grpid.push_back(0);
2861  grpcnt[0]++;
2862 
2864  query.prepare(
2865  "SELECT cardinputid, inputgroupid, inputgroupname "
2866  "FROM inputgroup "
2867  "WHERE inputgroupname LIKE 'user:%' "
2868  "ORDER BY inputgroupid, cardinputid, inputgroupname");
2869 
2870  if (!query.exec())
2871  {
2872  MythDB::DBError("InputGroup::Load()", query);
2873  }
2874  else
2875  {
2876  while (query.next())
2877  {
2878  uint groupid = query.value(1).toUInt();
2879  if ((inputid != 0U) && (query.value(0).toUInt() == inputid))
2880  selected_groupids.push_back(groupid);
2881 
2882  grpcnt[groupid]++;
2883 
2884  if (grpcnt[groupid] == 1)
2885  {
2886  names.push_back(query.value(2).toString().mid(5, -1));
2887  grpid.push_back(groupid);
2888  }
2889  }
2890  }
2891 
2892  // makes sure we select something
2893  m_groupId = 0;
2894  if (m_groupNum < selected_groupids.size())
2895  m_groupId = selected_groupids[m_groupNum];
2896 
2897 #if 0
2898  LOG(VB_GENERAL, LOG_DEBUG, QString("Group num: %1 id: %2")
2900  {
2901  QString msg;
2902  for (uint i = 0; i < selected_groupids.size(); i++)
2903  msg += QString("%1 ").arg(selected_groupids[i]);
2904  LOG(VB_GENERAL, LOG_DEBUG, msg);
2905  }
2906 #endif
2907 
2908  // add selections to combobox
2909  clearSelections();
2910  uint index = 0;
2911  for (size_t i = 0; i < names.size(); i++)
2912  {
2913  bool sel = (m_groupId == grpid[i]);
2914  index = (sel) ? i : index;
2915 
2916 #if 0
2917  LOG(VB_GENERAL, LOG_DEBUG, QString("grpid %1, name '%2', i %3, s %4")
2918  .arg(grpid[i]).arg(names[i]) .arg(index).arg(sel ? "T" : "F"));
2919 #endif
2920 
2921  addSelection(names[i], QString::number(grpid[i]), sel);
2922  }
2923 
2924 #if 0
2925  LOG(VB_GENERAL, LOG_DEBUG, QString("Group index: %1").arg(index));
2926 #endif
2927 
2928  if (!names.empty())
2929  setValue(index);
2930 
2932 }
2933 
2935 {
2936  public:
2937  explicit QuickTune(const CardInput &parent) :
2938  CardInputComboBoxSetting(parent, "quicktune")
2939  {
2940  setLabel(QObject::tr("Use quick tuning"));
2941  addSelection(QObject::tr("Never"), "0", true);
2942  addSelection(QObject::tr("Live TV only"), "1", false);
2943  addSelection(QObject::tr("Always"), "2", false);
2944  setHelpText(QObject::tr(
2945  "If enabled, MythTV will tune using only the "
2946  "MPEG program number. The program numbers "
2947  "change more often than DVB or ATSC tuning "
2948  "parameters, so this is slightly less reliable. "
2949  "This will also inhibit EIT gathering during "
2950  "Live TV and recording."));
2951  };
2952 };
2953 
2955 {
2956  public:
2957  explicit ExternalChannelCommand(const CardInput &parent) :
2958  MythUITextEditSetting(new CardInputDBStorage(this, parent, "externalcommand"))
2959  {
2960  setLabel(QObject::tr("External channel change command"));
2961  setValue("");
2962  setHelpText(QObject::tr("If specified, this command will be run to "
2963  "change the channel for inputs which have an external "
2964  "tuner device such as a cable box. The first argument "
2965  "will be the channel number."));
2966  };
2967 };
2968 
2970 {
2971  public:
2972  explicit PresetTuner(const CardInput &parent) :
2973  MythUITextEditSetting(new CardInputDBStorage(this, parent, "tunechan"))
2974  {
2975  setLabel(QObject::tr("Preset tuner to channel"));
2976  setValue("");
2977  setHelpText(QObject::tr("Leave this blank unless you have an external "
2978  "tuner that is connected to the tuner input of your card. "
2979  "If so, you will need to specify the preset channel for "
2980  "the signal (normally 3 or 4)."));
2981  };
2982 };
2983 
2984 void StartingChannel::SetSourceID(const QString &sourceid)
2985 {
2986  clearSelections();
2987  if (sourceid.isEmpty() || !sourceid.toUInt())
2988  return;
2989 
2990  // Get the existing starting channel
2991  auto *storage = dynamic_cast<CardInputDBStorage*>(GetStorage());
2992  if (storage == nullptr)
2993  return;
2994  int inputId = storage->getInputID();
2995  QString startChan = CardUtil::GetStartingChannel(inputId);
2996 
2997  ChannelInfoList channels = ChannelUtil::GetAllChannels(sourceid.toUInt());
2998 
2999  if (channels.empty())
3000  {
3001  addSelection(tr("Please add channels to this source"),
3002  startChan.isEmpty() ? "0" : startChan);
3003  return;
3004  }
3005 
3006  // If there are channels sort them, then add theme
3007  // (selecting the old start channel if it is there).
3008  QString order = gCoreContext->GetSetting("ChannelOrdering", "channum");
3009  ChannelUtil::SortChannels(channels, order);
3010  bool has_visible = false;
3011  for (size_t i = 0; i < channels.size() && !has_visible; i++)
3012  has_visible |= channels[i].m_visible;
3013 
3014  for (auto & channel : channels)
3015  {
3016  const QString channum = channel.m_chanNum;
3017  bool sel = channum == startChan;
3018  if (!has_visible || channel.m_visible || sel)
3019  {
3020  addSelection(channum, channum, sel);
3021  }
3022  }
3023 }
3024 
3026 {
3027  public:
3028  explicit InputPriority(const CardInput &parent) :
3029  MythUISpinBoxSetting(new CardInputDBStorage(this, parent, "recpriority"),
3030  -99, 99, 1)
3031  {
3032  setLabel(QObject::tr("Input priority"));
3033  setValue(0);
3034  setHelpText(QObject::tr("If the input priority is not equal for "
3035  "all inputs, the scheduler may choose to record a show "
3036  "at a later time so that it can record on an input with "
3037  "a higher value."));
3038  };
3039 };
3040 
3042 {
3043  public:
3044  ScheduleOrder(const CardInput &parent, int _value) :
3045  MythUISpinBoxSetting(new CardInputDBStorage(this, parent, "schedorder"),
3046  0, 99, 1)
3047  {
3048  setLabel(QObject::tr("Schedule order"));
3049  setValue(_value);
3050  setHelpText(QObject::tr("If priorities and other factors are equal "
3051  "the scheduler will choose the available "
3052  "input with the lowest, non-zero value. "
3053  "Setting this value to zero will make the "
3054  "input unavailable to the scheduler."));
3055  };
3056 };
3057 
3059 {
3060  public:
3061  LiveTVOrder(const CardInput &parent, int _value) :
3062  MythUISpinBoxSetting(new CardInputDBStorage(this, parent, "livetvorder"),
3063  0, 99, 1)
3064  {
3065  setLabel(QObject::tr("Live TV order"));
3066  setValue(_value);
3067  setHelpText(QObject::tr("When entering Live TV, the available, local "
3068  "input with the lowest, non-zero value will "
3069  "be used. If no local inputs are available, "
3070  "the available, remote input with the lowest, "
3071  "non-zero value will be used. "
3072  "Setting this value to zero will make the "
3073  "input unavailable to live TV."));
3074  };
3075 };
3076 
3078 {
3079  public:
3080  explicit DishNetEIT(const CardInput &parent) :
3081  MythUICheckBoxSetting(new CardInputDBStorage(this, parent,
3082  "dishnet_eit"))
3083  {
3084  setLabel(QObject::tr("Use DishNet long-term EIT data"));
3085  setValue(false);
3086  setHelpText(
3087  QObject::tr(
3088  "If you point your satellite dish toward DishNet's birds, "
3089  "you may wish to enable this feature. For best results, "
3090  "enable general EIT collection as well."));
3091  };
3092 };
3093 
3094 CardInput::CardInput(const QString & cardtype, const QString & device,
3095  int _cardid) :
3096  m_id(new ID()),
3097  m_inputName(new InputName(*this)),
3098  m_sourceId(new SourceID(*this)),
3099  m_startChan(new StartingChannel(*this)),
3100  m_scan(new ButtonStandardSetting(tr("Scan for channels"))),
3101  m_srcFetch(new ButtonStandardSetting(tr("Fetch channels from listings source"))),
3102  m_externalInputSettings(new DiSEqCDevSettings()),
3103  m_inputGrp0(new InputGroup(*this, 0)),
3104  m_inputGrp1(new InputGroup(*this, 1))
3105 {
3106  addChild(m_id);
3107 
3109  {
3111  _cardid, true));
3112  }
3113 
3114  // Delivery system for DVB, input name for other,
3115  // same field capturecard/inputname for both
3116  if ("DVB" == cardtype)
3117  {
3118  auto *ds = new DeliverySystem();
3119  ds->setValue(CardUtil::GetDeliverySystemFromDB(_cardid));
3120  addChild(ds);
3121  }
3122  else
3123  {
3125  }
3126  addChild(new InputDisplayName(*this));
3128 
3129  if (CardUtil::IsEncoder(cardtype) || CardUtil::IsUnscanable(cardtype))
3130  {
3131  addChild(new ExternalChannelCommand(*this));
3132  if (CardUtil::HasTuner(cardtype, device))
3133  addChild(new PresetTuner(*this));
3134  }
3135  else
3136  {
3137  addChild(new QuickTune(*this));
3138  if ("DVB" == cardtype)
3139  addChild(new DishNetEIT(*this));
3140  }
3141 
3143  tr("Use channel scanner to find channels for this input."));
3144 
3146  tr("This uses the listings data source to "
3147  "provide the channels for this input.") + " " +
3148  tr("This can take a long time to run."));
3149 
3150  addChild(m_scan);
3152 
3154 
3155  auto *interact = new GroupSetting();
3156 
3157  interact->setLabel(QObject::tr("Interactions between inputs"));
3158  if (CardUtil::IsTunerSharingCapable(cardtype))
3159  {
3160  m_instanceCount = new InstanceCount(*this);
3161  interact->addChild(m_instanceCount);
3162  m_schedGroup = new SchedGroup(*this);
3163  interact->addChild(m_schedGroup);
3164  }
3165  interact->addChild(new InputPriority(*this));
3166  interact->addChild(new ScheduleOrder(*this, _cardid));
3167  interact->addChild(new LiveTVOrder(*this, _cardid));
3168 
3169  auto *ingrpbtn =
3170  new ButtonStandardSetting(QObject::tr("Create a New Input Group"));
3171  ingrpbtn->setHelpText(
3172  QObject::tr("Input groups are only needed when two or more cards "
3173  "share the same resource such as a FireWire card and "
3174  "an analog card input controlling the same set top box."));
3175  interact->addChild(ingrpbtn);
3176  interact->addChild(m_inputGrp0);
3177  interact->addChild(m_inputGrp1);
3178 
3179  addChild(interact);
3180 
3181  setObjectName("CardInput");
3182  SetSourceID("-1");
3183 
3186  connect(m_sourceId, qOverload<const QString&>(&StandardSetting::valueChanged),
3188  connect(m_sourceId, qOverload<const QString&>(&StandardSetting::valueChanged),
3189  this, &CardInput::SetSourceID);
3190  connect(ingrpbtn, &ButtonStandardSetting::clicked,
3192 }
3193 
3195 {
3197  {
3198  delete m_externalInputSettings;
3199  m_externalInputSettings = nullptr;
3200  }
3201 }
3202 
3203 void CardInput::SetSourceID(const QString &sourceid)
3204 {
3205  uint cid = m_id->getValue().toUInt();
3206  QString raw_card_type = CardUtil::GetRawInputType(cid);
3207  bool enable = (sourceid.toInt() > 0);
3208  m_scan->setEnabled(enable && !raw_card_type.isEmpty() &&
3209  !CardUtil::IsUnscanable(raw_card_type));
3210  m_srcFetch->setEnabled(enable);
3211 }
3212 
3213 QString CardInput::getSourceName(void) const
3214 {
3215  return m_sourceId->getValueLabel();
3216 }
3217 
3219 {
3220  m_inputGrp0->Save();
3221  m_inputGrp1->Save();
3222 
3223  MythScreenStack *popupStack = GetMythMainWindow()->GetStack("popup stack");
3224  auto *settingdialog =
3225  new MythTextInputDialog(popupStack, tr("Enter new group name"));
3226 
3227  if (settingdialog->Create())
3228  {
3229  connect(settingdialog, &MythTextInputDialog::haveResult,
3231  popupStack->AddScreen(settingdialog);
3232  }
3233  else
3234  delete settingdialog;
3235 }
3236 
3237 void CardInput::CreateNewInputGroupSlot(const QString& name)
3238 {
3239  if (name.isEmpty())
3240  {
3241  ShowOkPopup(tr("Sorry, this Input Group name cannot be blank."));
3242  return;
3243  }
3244 
3245  QString new_name = QString("user:") + name;
3246 
3248  query.prepare("SELECT inputgroupname "
3249  "FROM inputgroup "
3250  "WHERE inputgroupname = :GROUPNAME");
3251  query.bindValue(":GROUPNAME", new_name);
3252 
3253  if (!query.exec())
3254  {
3255  MythDB::DBError("CreateNewInputGroup 1", query);
3256  return;
3257  }
3258 
3259  if (query.next())
3260  {
3261  ShowOkPopup(tr("Sorry, this Input Group name is already in use."));
3262  return;
3263  }
3264 
3265  uint inputgroupid = CardUtil::CreateInputGroup(new_name);
3266 
3267  m_inputGrp0->Load();
3268  m_inputGrp1->Load();
3269 
3270  if (m_inputGrp0->getValue().toUInt() == 0U)
3271  {
3273  m_inputGrp0->getValueIndex(QString::number(inputgroupid)));
3274  }
3275  else
3276  {
3278  m_inputGrp1->getValueIndex(QString::number(inputgroupid)));
3279  }
3280 }
3281 
3283 {
3284  uint srcid = m_sourceId->getValue().toUInt();
3285  uint crdid = m_id->getValue().toUInt();
3286  QString in = m_inputName->getValue();
3287 
3288 #ifdef USING_BACKEND
3289  uint num_channels_before = SourceUtil::GetChannelCount(srcid);
3290 
3291  Save(); // save info for scanner.
3292 
3293  QString cardtype = CardUtil::GetRawInputType(crdid);
3294  if (CardUtil::IsUnscanable(cardtype))
3295  {
3296  LOG(VB_GENERAL, LOG_ERR,
3297  QString("Sorry, %1 cards do not yet support scanning.")
3298  .arg(cardtype));
3299  return;
3300  }
3301 
3303  auto *ssd = new StandardSettingDialog(mainStack, "generalsettings",
3304  new ScanWizard(srcid, crdid, in));
3305 
3306  if (ssd->Create())
3307  {
3308  connect(ssd, &StandardSettingDialog::Exiting,
3309  [=]()
3310  {
3311  if (SourceUtil::GetChannelCount(srcid))
3312  m_startChan->SetSourceID(QString::number(srcid));
3313  if (num_channels_before)
3314  {
3315  m_startChan->Load();
3316  m_startChan->Save();
3317  }
3318  });
3319  mainStack->AddScreen(ssd);
3320  }
3321  else
3322  delete ssd;
3323 
3324 #else
3325  LOG(VB_GENERAL, LOG_ERR, "You must compile the backend "
3326  "to be able to scan for channels");
3327 #endif
3328 }
3329 
3331 {
3332  uint srcid = m_sourceId->getValue().toUInt();
3333  uint crdid = m_id->getValue().toUInt();
3334 
3335  uint num_channels_before = SourceUtil::GetChannelCount(srcid);
3336 
3337  if (crdid && srcid)
3338  {
3339  Save(); // save info for fetch..
3340 
3341  QString cardtype = CardUtil::GetRawInputType(crdid);
3342 
3343  if (!CardUtil::IsCableCardPresent(crdid, cardtype) &&
3344  !CardUtil::IsUnscanable(cardtype) &&
3345  !CardUtil::IsEncoder(cardtype) &&
3346  cardtype != "HDHOMERUN" &&
3347  !num_channels_before)
3348  {
3349  LOG(VB_GENERAL, LOG_ERR, "Skipping channel fetch, you need to "
3350  "scan for channels first.");
3351  return;
3352  }
3353 
3354  SourceUtil::UpdateChannelsFromListings(srcid, cardtype);
3355  }
3356 
3357  if (SourceUtil::GetChannelCount(srcid))
3358  m_startChan->SetSourceID(QString::number(srcid));
3359  if (num_channels_before)
3360  {
3361  m_startChan->Load();
3362  m_startChan->Save();
3363  }
3364 }
3365 
3367 {
3368  QString cardinputidTag(":WHERECARDID");
3369 
3370  QString query("cardid = " + cardinputidTag);
3371 
3372  bindings.insert(cardinputidTag, m_parent.getInputID());
3373 
3374  return query;
3375 }
3376 
3378 {
3379  QString cardinputidTag(":SETCARDID");
3380  QString colTag(":SET" + GetColumnName().toUpper());
3381 
3382  QString query("cardid = " + cardinputidTag + ", " +
3383  GetColumnName() + " = " + colTag);
3384 
3385  bindings.insert(cardinputidTag, m_parent.getInputID());
3386  bindings.insert(colTag, m_user->GetDBValue());
3387 
3388  return query;
3389 }
3390 
3391 void CardInput::loadByID(int inputid)
3392 {
3393  m_id->setValue(inputid);
3394  m_externalInputSettings->Load(inputid);
3396 }
3397 
3398 void CardInput::loadByInput(int _cardid, const QString& _inputname)
3399 {
3401  query.prepare("SELECT cardid FROM capturecard "
3402  "WHERE cardid = :CARDID AND inputname = :INPUTNAME");
3403  query.bindValue(":CARDID", _cardid);
3404  query.bindValue(":INPUTNAME", _inputname);
3405 
3406  if (query.exec() && query.isActive() && query.next())
3407  {
3408  loadByID(query.value(0).toInt());
3409  }
3410 }
3411 
3413 {
3414  uint cardid = m_id->getValue().toUInt();
3417 
3418  uint icount = 1;
3419  if (m_instanceCount)
3420  icount = m_instanceCount->getValue().toUInt();
3421  std::vector<uint> cardids = CardUtil::GetChildInputIDs(cardid);
3422 
3423  // Delete old clone cards as required.
3424  for (size_t i = cardids.size() + 1;
3425  (i > icount) && !cardids.empty(); --i)
3426  {
3427  CardUtil::DeleteInput(cardids.back());
3428  cardids.pop_back();
3429  }
3430 
3431  // Clone this config to existing clone cards.
3432  for (uint id : cardids)
3433  CardUtil::CloneCard(cardid, id);
3434 
3435  // Create new clone cards as required.
3436  for (size_t i = cardids.size() + 1; i < icount; i++)
3437  {
3438  CardUtil::CloneCard(cardid, 0);
3439  }
3440 
3441  // Delete any unused input groups
3443 }
3444 
3446 {
3447  return m_parent.getInputID();
3448 }
3449 
3451 {
3452  return m_parent.getCardID();
3453 }
3454 
3456 {
3457  emit Clicked(m_value);
3458 }
3459 
3460 void CaptureCardEditor::AddSelection(const QString &label, const CCESlot slot)
3461 {
3462  auto *button = new ButtonStandardSetting(label);
3463  connect(button, &ButtonStandardSetting::clicked, this, slot);
3464  addChild(button);
3465 }
3466 
3467 void CaptureCardEditor::AddSelection(const QString &label, const CCESlotConst slot)
3468 {
3469  auto *button = new ButtonStandardSetting(label);
3470  connect(button, &ButtonStandardSetting::clicked, this, slot);
3471  addChild(button);
3472 }
3473 
3475 {
3476  ShowOkPopup(
3477  tr("Are you sure you want to delete "
3478  "ALL capture cards on %1?").arg(gCoreContext->GetHostName()),
3480  true);
3481 }
3482 
3484 {
3485  ShowOkPopup(
3486  tr("Are you sure you want to delete "
3487  "ALL capture cards?"),
3489  true);
3490 }
3491 
3493 {
3494  auto *card = new CaptureCard();
3495  card->setLabel(tr("New capture card"));
3496  card->Load();
3497  addChild(card);
3498  emit settingsChanged(this);
3499 }
3500 
3502 {
3503  if (!doDelete)
3504  return;
3505 
3507  Load();
3508  emit settingsChanged(this);
3509 }
3510 
3512 {
3513  if (!doDelete)
3514  return;
3515 
3516  MSqlQuery cards(MSqlQuery::InitCon());
3517 
3518  cards.prepare(
3519  "SELECT cardid "
3520  "FROM capturecard "
3521  "WHERE hostname = :HOSTNAME");
3522  cards.bindValue(":HOSTNAME", gCoreContext->GetHostName());
3523 
3524  if (!cards.exec() || !cards.isActive())
3525  {
3526  ShowOkPopup(
3527  tr("Error getting list of cards for this host. "
3528  "Unable to delete capturecards for %1")
3530 
3531  MythDB::DBError("Selecting cardids for deletion", cards);
3532  return;
3533  }
3534 
3535  while (cards.next())
3536  CardUtil::DeleteInput(cards.value(0).toUInt());
3537 
3538  Load();
3539  emit settingsChanged(this);
3540 }
3541 
3543 {
3544  setLabel(tr("Capture cards"));
3545 }
3546 
3548 {
3549  clearSettings();
3550  AddSelection(QObject::tr("(New capture card)"), &CaptureCardEditor::AddNewCard);
3551  AddSelection(QObject::tr("(Delete all capture cards on %1)")
3554  AddSelection(QObject::tr("(Delete all capture cards)"),
3557 }
3558 
3560 {
3561  setLabel(tr("Video sources"));
3562 }
3563 
3565 {
3566  clearSettings();
3567  AddSelection(QObject::tr("(New video source)"), &VideoSourceEditor::NewSource);
3568  AddSelection(QObject::tr("(Delete all video sources)"),
3572 }
3573 
3574 void VideoSourceEditor::AddSelection(const QString &label, const VSESlot slot)
3575 {
3576  auto *button = new ButtonStandardSetting(label);
3577  connect(button, &ButtonStandardSetting::clicked, this, slot);
3578  addChild(button);
3579 }
3580 
3581 void VideoSourceEditor::AddSelection(const QString &label, const VSESlotConst slot)
3582 {
3583  auto *button = new ButtonStandardSetting(label);
3584  connect(button, &ButtonStandardSetting::clicked, this, slot);
3585  addChild(button);
3586 }
3587 
3589 {
3590  ShowOkPopup(
3591  tr("Are you sure you want to delete "
3592  "ALL video sources?"),
3594  true);
3595 }
3596 
3598 {
3599  if (!doDelete)
3600  return;
3601 
3603  Load();
3604  emit settingsChanged(this);
3605 }
3606 
3608 {
3609  auto *source = new VideoSource();
3610  source->setLabel(tr("New video source"));
3611  source->Load();
3612  addChild(source);
3613  emit settingsChanged(this);
3614 }
3615 
3617 {
3618  setLabel(tr("Input connections"));
3619 }
3620 
3622 {
3623  m_cardInputs.clear();
3624  clearSettings();
3625 
3626  // We do this manually because we want custom labels. If
3627  // SelectSetting provided a facility to edit the labels, we
3628  // could use CaptureCard::fillSelections
3629 
3631  query.prepare(
3632  "SELECT cardid, videodevice, cardtype, inputname "
3633  "FROM capturecard "
3634  "WHERE hostname = :HOSTNAME "
3635  " AND parentid = 0 "
3636  "ORDER BY cardid");
3637  query.bindValue(":HOSTNAME", gCoreContext->GetHostName());
3638 
3639  if (!query.exec())
3640  {
3641  MythDB::DBError("CardInputEditor::load", query);
3642  return;
3643  }
3644 
3645  while (query.next())
3646  {
3647  uint cardid = query.value(0).toUInt();
3648  QString videodevice = query.value(1).toString();
3649  QString cardtype = query.value(2).toString();
3650  QString inputname = query.value(3).toString();
3651 
3652  auto *cardinput = new CardInput(cardtype, videodevice, cardid);
3653  cardinput->loadByID(cardid);
3654  QString inputlabel = QString("%1 (%2) -> %3")
3655  .arg(CardUtil::GetDeviceLabel(cardtype, videodevice))
3656  .arg(inputname).arg(cardinput->getSourceName());
3657  m_cardInputs.push_back(cardinput);
3658  cardinput->setLabel(inputlabel);
3659  addChild(cardinput);
3660  }
3661 
3663 }
3664 
3665 #ifdef USING_DVB
3666 static QString remove_chaff(const QString &name)
3667 {
3668  // Trim off some of the chaff.
3669  QString short_name = name;
3670  if (short_name.startsWith("LG Electronics"))
3671  short_name = short_name.right(short_name.length() - 15);
3672  if (short_name.startsWith("Oren"))
3673  short_name = short_name.right(short_name.length() - 5);
3674  if (short_name.startsWith("Nextwave"))
3675  short_name = short_name.right(short_name.length() - 9);
3676  if (short_name.startsWith("frontend", Qt::CaseInsensitive))
3677  short_name = short_name.left(short_name.length() - 9);
3678  if (short_name.endsWith("VSB/QAM"))
3679  short_name = short_name.left(short_name.length() - 8);
3680  if (short_name.endsWith("VSB"))
3681  short_name = short_name.left(short_name.length() - 4);
3682  if (short_name.endsWith("DVB-T"))
3683  short_name = short_name.left(short_name.length() - 6);
3684 
3685  // It would be infinitely better if DVB allowed us to query
3686  // the vendor ID. But instead we have to guess based on the
3687  // demodulator name. This means cards like the Air2PC HD5000
3688  // and DViCO Fusion HDTV cards are not identified correctly.
3689  short_name = short_name.simplified();
3690  if (short_name.startsWith("or51211", Qt::CaseInsensitive))
3691  short_name = "pcHDTV HD-2000";
3692  else if (short_name.startsWith("or51132", Qt::CaseInsensitive))
3693  short_name = "pcHDTV HD-3000";
3694  else if (short_name.startsWith("bcm3510", Qt::CaseInsensitive))
3695  short_name = "Air2PC v1";
3696  else if (short_name.startsWith("nxt2002", Qt::CaseInsensitive) ||
3697  short_name.startsWith("nxt200x", Qt::CaseInsensitive))
3698  short_name = "Air2PC v2";
3699  else if (short_name.startsWith("lgdt3302", Qt::CaseInsensitive))
3700  short_name = "DViCO HDTV3";
3701  else if (short_name.startsWith("lgdt3303", Qt::CaseInsensitive))
3702  short_name = "DViCO v2 or Air2PC v3 or pcHDTV HD-5500";
3703 
3704  return short_name;
3705 }
3706 #endif // USING_DVB
3707 
3708 void DVBConfigurationGroup::reloadDiseqcTree(const QString &videodevice)
3709 {
3710  if (m_diseqcTree)
3711  m_diseqcTree->Load(videodevice);
3712 
3713  if (m_cardType->getValue() == "DVB-S" ||
3714  m_cardType->getValue() == "DVB-S2" )
3715  {
3716  m_diseqcBtn->setVisible(true);
3717  }
3718  else
3719  {
3720  m_diseqcBtn->setVisible(false);
3721  }
3722  emit getParent()->settingsChanged(this);
3723 }
3724 
3725 void DVBConfigurationGroup::probeCard(const QString &videodevice)
3726 {
3727  if (videodevice.isEmpty())
3728  {
3729  m_cardName->setValue("");
3730  m_cardType->setValue("");
3731  return;
3732  }
3733 
3734  if ((m_parent.getCardID() != 0) && m_parent.GetRawCardType() != "DVB")
3735  {
3736  m_cardName->setValue("");
3737  m_cardType->setValue("");
3738  return;
3739  }
3740 
3741 #ifdef USING_DVB
3742  QString frontend_name = CardUtil::ProbeDVBFrontendName(videodevice);
3743  QString subtype = CardUtil::ProbeDVBType(videodevice);
3744 
3745  QString err_open = tr("Could not open card %1").arg(videodevice);
3746  QString err_other = tr("Could not get card info for card %1").arg(videodevice);
3747 
3748  switch (CardUtil::toInputType(subtype))
3749  {
3750  case CardUtil::ERROR_OPEN:
3751  m_cardName->setValue(err_open);
3752  m_cardType->setValue(strerror(errno));
3753  break;
3755  m_cardName->setValue(err_other);
3756  m_cardType->setValue("Unknown error");
3757  break;
3758  case CardUtil::ERROR_PROBE:
3759  m_cardName->setValue(err_other);
3760  m_cardType->setValue(strerror(errno));
3761  break;
3762  case CardUtil::QPSK:
3763  m_cardType->setValue("DVB-S");
3764  m_cardName->setValue(frontend_name);
3765  m_signalTimeout->setValue(7000);
3766  m_channelTimeout->setValue(10000);
3767  break;
3768  case CardUtil::DVBS2:
3769  m_cardType->setValue("DVB-S2");
3770  m_cardName->setValue(frontend_name);
3771  m_signalTimeout->setValue(7000);
3772  m_channelTimeout->setValue(10000);
3773  break;
3774  case CardUtil::QAM:
3775  m_cardType->setValue("DVB-C");
3776  m_cardName->setValue(frontend_name);
3777  m_signalTimeout->setValue(3000);
3778  m_channelTimeout->setValue(6000);
3779  break;
3780  case CardUtil::DVBT2:
3781  m_cardType->setValue("DVB-T2");
3782  m_cardName->setValue(frontend_name);
3783  m_signalTimeout->setValue(3000);
3784  m_channelTimeout->setValue(6000);
3785  break;
3786  case CardUtil::OFDM:
3787  {
3788  m_cardType->setValue("DVB-T");
3789  m_cardName->setValue(frontend_name);
3790  m_signalTimeout->setValue(3000);
3791  m_channelTimeout->setValue(6000);
3792  if (frontend_name.toLower().indexOf("usb") >= 0)
3793  {
3794  m_signalTimeout->setValue(40000);
3795  m_channelTimeout->setValue(42500);
3796  }
3797 
3798  // slow down tuning for buggy drivers
3799  if ((frontend_name == "DiBcom 3000P/M-C DVB-T") ||
3800  (frontend_name ==
3801  "TerraTec/qanu USB2.0 Highspeed DVB-T Receiver"))
3802  {
3803  m_tuningDelay->setValue(200);
3804  }
3805 
3806 #if 0 // frontends on hybrid DVB-T/Analog cards
3807  QString short_name = remove_chaff(frontend_name);
3808  m_buttonAnalog->setVisible(
3809  short_name.startsWith("zarlink zl10353",
3810  Qt::CaseInsensitive) ||
3811  short_name.startsWith("wintv hvr 900 m/r: 65008/a1c0",
3812  Qt::CaseInsensitive) ||
3813  short_name.startsWith("philips tda10046h",
3814  Qt::CaseInsensitive));
3815 #endif
3816  }
3817  break;
3818  case CardUtil::ATSC:
3819  {
3820  QString short_name = remove_chaff(frontend_name);
3821  m_cardType->setValue("ATSC");
3822  m_cardName->setValue(short_name);
3823  m_signalTimeout->setValue(2000);
3824  m_channelTimeout->setValue(4000);
3825 
3826  // According to #1779 and #1935 the AverMedia 180 needs
3827  // a 3000 ms signal timeout, at least for QAM tuning.
3828  if (frontend_name == "Nextwave NXT200X VSB/QAM frontend")
3829  {
3830  m_signalTimeout->setValue(3000);
3831  m_channelTimeout->setValue(5500);
3832  }
3833 
3834 #if 0 // frontends on hybrid DVB-T/Analog cards
3835  if (frontend_name.toLower().indexOf("usb") < 0)
3836  {
3837  m_buttonAnalog->setVisible(
3838  short_name.startsWith("pchdtv", Qt::CaseInsensitive) ||
3839  short_name.startsWith("dvico", Qt::CaseInsensitive) ||
3840  short_name.startsWith("nextwave", Qt::CaseInsensitive));
3841  }
3842 #endif
3843  }
3844  break;
3845  default:
3846  break;
3847  }
3848 
3849  // Create selection list of all delivery systems of this card
3850  {
3852  QStringList delsyslist = CardUtil::ProbeDeliverySystems(videodevice);
3853  for (const auto & item : qAsConst(delsyslist))
3854  {
3855  LOG(VB_GENERAL, LOG_DEBUG, QString("DVBCardType: add deliverysystem:%1")
3856  .arg(item));
3857 
3858  m_cardType->addSelection(item, item);
3859  }
3860 
3861  // Default value, used if not already defined in capturecard/inputname
3862  QString delsys = CardUtil::ProbeDefaultDeliverySystem(videodevice);
3863  if (!delsys.isEmpty())
3864  {
3865  m_cardType->setValue(delsys);
3866  }
3867  }
3868 #
3869 #else
3870  m_cardType->setValue(QString("Recompile with DVB-Support!"));
3871 #endif
3872 }
3873 
3875  QString dev, QString type) :
3876  CaptureCardComboBoxSetting(parent, false, "audiodevice"),
3877  m_lastDevice(std::move(dev)), m_lastCardType(std::move(type))
3878 {
3879  setLabel(QObject::tr("Audio input"));
3880  setHelpText(QObject::tr("If there is more than one audio input, "
3881  "select which one to use."));
3882  int cardid = parent.getCardID();
3883  if (cardid <= 0)
3884  return;
3885 
3888 }
3889 
3890 int TunerCardAudioInput::fillSelections(const QString &device)
3891 {
3892  clearSelections();
3893 
3894  if (device.isEmpty())
3895  return 0;
3896 
3897  m_lastDevice = device;
3898  QStringList inputs =
3900 
3901  for (uint i = 0; i < (uint)inputs.size(); i++)
3902  {
3903  addSelection(inputs[i], QString::number(i),
3904  m_lastDevice == QString::number(i));
3905  }
3906  return inputs.size();
3907 }
3908 
3910  CardType& cardType) :
3911  m_parent(a_parent),
3912  m_diseqcTree(new DiSEqCDevTree())
3913 {
3914  setVisible(false);
3915 
3916  m_cardNum = new DVBCardNum(m_parent);
3917  m_cardName = new DVBCardName();
3919 
3920  m_signalTimeout = new SignalTimeout(m_parent, 500, 250);
3921  m_channelTimeout = new ChannelTimeout(m_parent, 3000, 1750);
3922 
3923  cardType.addTargetedChild("DVB", m_cardNum);
3924 
3925  cardType.addTargetedChild("DVB", m_cardName);
3926  cardType.addTargetedChild("DVB", m_cardType);
3927 
3928  cardType.addTargetedChild("DVB", m_signalTimeout);
3929  cardType.addTargetedChild("DVB", m_channelTimeout);
3930 
3931  cardType.addTargetedChild("DVB", new EmptyAudioDevice(m_parent));
3932  cardType.addTargetedChild("DVB", new EmptyVBIDevice(m_parent));
3933 
3934  cardType.addTargetedChild("DVB", new DVBNoSeqStart(m_parent));
3935  cardType.addTargetedChild("DVB", new DVBOnDemand(m_parent));
3936  cardType.addTargetedChild("DVB", new DVBEITScan(m_parent));
3937 
3939  m_diseqcBtn->setLabel(tr("DiSEqC (Switch, LNB and Rotor Configuration)"));
3940  m_diseqcBtn->setHelpText(tr("Input and satellite settings."));
3941 
3943  cardType.addTargetedChild("DVB", m_tuningDelay);
3944  cardType.addTargetedChild("DVB", m_diseqcBtn);
3945  m_tuningDelay->setVisible(false);
3946 
3947  connect(m_cardNum, qOverload<const QString&>(&StandardSetting::valueChanged),
3949  connect(m_cardNum, qOverload<const QString&>(&StandardSetting::valueChanged),
3951 }
3952 
3954 {
3955  if (m_diseqcTree)
3956  {
3957  delete m_diseqcTree;
3958  m_diseqcTree = nullptr;
3959  }
3960 }
3961 
3963 {
3965  m_diseqcBtn->Load();
3967  if (m_cardType->getValue() == "DVB-S" ||
3968  m_cardType->getValue() == "DVB-S2" ||
3970  {
3971  m_diseqcBtn->setVisible(true);
3972  }
3973 }
3974 
3976 {
3980 }
3981 
3982 // -----------------------
3983 // SAT>IP configuration
3984 // -----------------------
3985 #ifdef USING_SATIP
3986 SatIPConfigurationGroup::SatIPConfigurationGroup
3987  (CaptureCard& a_parent, CardType &a_cardtype) :
3988  m_parent(a_parent)
3989 {
3990  setVisible(false);
3991 
3992  FillDeviceList();
3993 
3994  m_friendlyName = new SatIPDeviceAttribute(tr("Friendly name"), tr("Friendly name of the Sat>IP server"));
3995  m_tunerType = new SatIPDeviceAttribute(tr("Tuner type"), tr("Type of the selected tuner"));
3996  m_tunerIndex = new SatIPDeviceAttribute(tr("Tuner index"), tr("Index of the tuner on the Sat>IP server"));
3997  m_deviceId = new SatIPDeviceID(m_parent);
3998 
3999  m_deviceIdList = new SatIPDeviceIDList(
4000  m_deviceId, m_friendlyName, m_tunerType, m_tunerIndex, &m_deviceList, m_parent);
4001 
4002  a_cardtype.addTargetedChild("SATIP", m_deviceIdList);
4003  a_cardtype.addTargetedChild("SATIP", m_friendlyName);
4004  a_cardtype.addTargetedChild("SATIP", m_tunerType);
4005  a_cardtype.addTargetedChild("SATIP", m_tunerIndex);
4006  a_cardtype.addTargetedChild("SATIP", m_deviceId);
4007  a_cardtype.addTargetedChild("SATIP", new SignalTimeout(m_parent, 7000, 1000));
4008  a_cardtype.addTargetedChild("SATIP", new ChannelTimeout(m_parent, 10000, 2000));
4009  a_cardtype.addTargetedChild("SATIP", new DVBEITScan(m_parent));
4010 
4011  connect(m_deviceIdList, &SatIPDeviceIDList::NewTuner,
4012  m_deviceId, &SatIPDeviceID::SetTuner);
4013 };
4014 
4015 void SatIPConfigurationGroup::FillDeviceList(void)
4016 {
4017  m_deviceList.clear();
4018 
4019  // Find devices on the network
4020  // Returns each devices as "deviceid friendlyname ip tunerno tunertype"
4021  QStringList devs = CardUtil::ProbeVideoDevices("SATIP");
4022 
4023  for (const auto & dev : qAsConst(devs))
4024  {
4025  QStringList devparts = dev.split(" ");
4026  const QString& id = devparts.value(0);
4027  const QString& name = devparts.value(1);
4028  const QString& ip = devparts.value(2);
4029  const QString& tunerno = devparts.value(3);
4030  const QString& tunertype = devparts.value(4);
4031 
4032  SatIPDevice device;
4033  device.m_deviceId = id;
4034  device.m_cardIP = ip;
4035  device.m_inUse = false;
4036  device.m_friendlyName = name;
4037  device.m_tunerNo = tunerno;
4038  device.m_tunerType = tunertype;
4039  device.m_mythDeviceId = QString("%1:%2:%3").arg(id).arg(tunertype).arg(tunerno);
4040 
4041  QString friendlyIdentifier = QString("%1, %2, Tuner #%3").arg(name).arg(tunertype).arg(tunerno);
4042 
4043  m_deviceList[device.m_mythDeviceId] = device;
4044 
4045  LOG(VB_CHANNEL, LOG_DEBUG, QString("SatIP: Add %1 '%2' '%3'")
4046  .arg(device.m_mythDeviceId).arg(device.m_friendlyName).arg(friendlyIdentifier));
4047  }
4048 
4049  // Now find configured devices
4050  // Returns each devices as "deviceid friendlyname ip tunerno tunertype"
4051  QStringList db = CardUtil::GetVideoDevices("SATIP");
4052  for (const auto& dev : db)
4053  {
4054  auto dit = m_deviceList.find(dev);
4055  if (dit != m_deviceList.end())
4056  {
4057  (*dit).m_inUse = true;
4058  }
4059  }
4060 };
4061 
4062 SatIPDeviceIDList::SatIPDeviceIDList(
4063  SatIPDeviceID *deviceId,
4064  SatIPDeviceAttribute *friendlyName,
4065  SatIPDeviceAttribute *tunerType,
4066  SatIPDeviceAttribute *tunerIndex,
4067  SatIPDeviceList *deviceList,
4068  const CaptureCard &parent) :
4069  m_deviceId(deviceId),
4070  m_friendlyName(friendlyName),
4071  m_tunerType(tunerType),
4072  m_tunerIndex(tunerIndex),
4073  m_deviceList(deviceList),
4074  m_parent(parent)
4075 {
4076  setLabel(tr("Available devices"));
4077  setHelpText(tr("Device IP or ID, tuner number and tuner type of available Sat>IP device"));
4078 
4079  connect(this, qOverload<const QString&>(&StandardSetting::valueChanged),
4080  this, &SatIPDeviceIDList::UpdateDevices);
4081 };
4082 
4083 void SatIPDeviceIDList::Load(void)
4084 {
4085  clearSelections();
4086 
4087  int cardid = m_parent.getCardID();
4088  QString device = CardUtil::GetVideoDevice(cardid);
4089 
4090  fillSelections(device);
4091 };
4092 
4093 void SatIPDeviceIDList::UpdateDevices(const QString &v)
4094 {
4095  SatIPDevice dev = (*m_deviceList)[v];
4096  m_deviceId->setValue(dev.m_mythDeviceId);
4097  m_friendlyName->setValue(dev.m_friendlyName);
4098  m_tunerType->setValue(dev.m_tunerType);
4099  m_tunerIndex->setValue(dev.m_tunerNo);
4100 };
4101 
4102 void SatIPDeviceIDList::fillSelections(const QString &cur)
4103 {
4104  clearSelections();
4105 
4106  std::vector<QString> names;
4107  std::vector<QString> devs;
4108  QMap<QString, bool> in_use;
4109 
4110  const QString& current = cur;
4111  QString sel;
4112 
4113  SatIPDeviceList::iterator it = m_deviceList->begin();
4114  for(; it != m_deviceList->end(); ++it)
4115  {
4116  QString friendlyIdentifier = QString("%1, %2, Tuner #%3")
4117  .arg((*it).m_friendlyName).arg((*it).m_tunerType).arg((*it).m_tunerNo);
4118  names.push_back(friendlyIdentifier);
4119 
4120  devs.push_back(it.key());
4121  in_use[it.key()] = (*it).m_inUse;
4122  }
4123 
4124  for (const auto& it2s : devs)
4125  {
4126  sel = (current == it2s) ? it2s : sel;
4127  }
4128 
4129  QString usestr = QString(" -- ");
4130  usestr += tr("Warning: already in use");
4131 
4132  for (uint i = 0; i < devs.size(); ++i)
4133  {
4134  const QString dev = devs[i];
4135  const QString name = names[i];
4136  bool dev_in_use = (dev == sel) ? false : in_use[devs[i]];
4137  QString desc = name + (dev_in_use ? usestr : "");
4138  addSelection(desc, dev, dev == sel);
4139  }
4140 };
4141 
4142 SatIPDeviceID::SatIPDeviceID(const CaptureCard &parent) :
4143  MythUITextEditSetting(new CaptureCardDBStorage(this, parent, "videodevice")),
4144  m_parent(parent)
4145 {
4146  setLabel(tr("Device ID"));
4147  setHelpText(tr("Device ID of the Sat>IP tuner"));
4148  setEnabled(true);
4149  setReadOnly(true);
4150 };
4151 
4152 void SatIPDeviceID::Load(void)
4153 {
4155 };
4156 
4157 void SatIPDeviceID::SetTuner(const QString &tuner)
4158 {
4159  setValue(tuner);
4160 };
4161 
4162 SatIPDeviceAttribute::SatIPDeviceAttribute(const QString& label, const QString& helptext)
4163 {
4164  setLabel(label);
4165  setHelpText(helptext);
4166 };
4167 #endif // USING_SATIP
HDPVRConfigurationGroup
Definition: videosource.h:556
DVBConfigurationGroup::m_diseqcBtn
DeviceTree * m_diseqcBtn
Definition: videosource.h:690
NoGrabber_config::NoGrabber_config
NoGrabber_config(const VideoSource &_parent)
Definition: videosource.cpp:647
DeviceTree
Definition: diseqcsettings.h:133
VBoxTunerIndex
Definition: videosource.h:966
VideoSourceShow::VideoSourceShow
VideoSourceShow(uint _initial_sourceid)
Definition: videosource.cpp:132
MSqlBindings
QMap< QString, QVariant > MSqlBindings
typedef for a map of string -> string bindings for generic queries.
Definition: mythdbcon.h:98
ASIConfigurationGroup::m_parent
CaptureCard & m_parent
Definition: videosource.h:603
MSqlQuery::isActive
bool isActive(void) const
Definition: mythdbcon.h:204
InputName
Definition: videosource.cpp:2707
HDHomeRunDeviceID::Save
void Save(void) override
Definition: videosource.cpp:1376
SourceID::fillSelections
void fillSelections()
Definition: videosource.cpp:2799
CardInput::m_inputName
InputName * m_inputName
Definition: videosource.h:928
MSqlQuery::next
bool next(void)
Wrap QSqlQuery::next() so we can display the query results.
Definition: mythdbcon.cpp:783
CardInput::m_inputGrp1
InputGroup * m_inputGrp1
Definition: videosource.h:935
HDHomeRunConfigurationGroup::m_deviceId
HDHomeRunDeviceID * m_deviceId
Definition: videosource.h:364
V4L2encGroup::m_parent
CaptureCard & m_parent
Definition: videosource.h:582
MSqlQuery
QSqlQuery wrapper that fetches a DB connection from the connection pool.
Definition: mythdbcon.h:126
build_compdb.args
args
Definition: build_compdb.py:11
FirewireConfigurationGroup
static void FirewireConfigurationGroup(CaptureCard &parent, CardType &cardtype)
Definition: videosource.cpp:1327
MythMainWindow::GetMainStack
MythScreenStack * GetMainStack()
Definition: mythmainwindow.cpp:324
CardInputEditor::m_cardInputs
std::vector< CardInput * > m_cardInputs
Definition: videosource.h:874
MythUIComboBoxSetting::clearSelections
void clearSelections()
Definition: standardsettings.cpp:509
e
QDomElement e
Definition: mythplugins/mytharchive/mytharchivehelper/main.cpp:1420
channel
QDomElement channel
Definition: mythplugins/mytharchive/mytharchivehelper/main.cpp:501
FirewireModel::SetGUID
void SetGUID(const QString &_guid)
Definition: videosource.cpp:1271
CardUtil::GetVBoxdesc
static QString GetVBoxdesc(const QString &id, const QString &ip, const QString &tunerNo, const QString &tunerType)
Get a nicely formatted string describing the device.
Definition: cardutil.cpp:2987
CardUtil::IsInNeedOfExternalInputConf
static bool IsInNeedOfExternalInputConf(uint inputid)
Definition: cardutil.cpp:2114
DVBConfigurationGroup::m_tuningDelay
DVBTuningDelay * m_tuningDelay
Definition: videosource.h:688
SchedGroup::SchedGroup
SchedGroup(const CardInput &parent)
Definition: videosource.cpp:193
HDHomeRunConfigurationGroup::HDHomeRunConfigurationGroup
HDHomeRunConfigurationGroup(CaptureCard &parent, CardType &cardtype)
Definition: videosource.cpp:1415
MSqlQuery::size
int size(void) const
Definition: mythdbcon.h:203
fileInfo
QFileInfo fileInfo(filename)
doDelete
bool doDelete
Definition: mythplugins/mytharchive/mytharchivehelper/main.cpp:638
SourceUtil::DeleteSource
static bool DeleteSource(uint sourceid)
Definition: sourceutil.cpp:523
XMLTVGrabber::Save
void Save(void) override
Definition: videosource.cpp:337
CaptureCardEditor::CCESlot
void(CaptureCardEditor::*)(void) CCESlot
Definition: videosource.h:829
FirewireModel::FirewireModel
FirewireModel(const CaptureCard &parent, const FirewireGUID *_guid)
Definition: videosource.cpp:1241
CardInputComboBoxSetting::CardInputComboBoxSetting
CardInputComboBoxSetting(const CardInput &parent, const QString &setting)
Definition: videosource.cpp:2777
SourceID::SourceID
SourceID(const CardInput &parent)
Definition: videosource.cpp:2786
GENERIC_EXIT_OK
#define GENERIC_EXIT_OK
Exited with no error.
Definition: exitcodes.h:10
CetonSetting::UpdateDevices
void UpdateDevices(const QString &v)
Definition: videosource.cpp:2032
FreqTableSelector::FreqTableSelector
FreqTableSelector(const VideoSource &parent)
Definition: videosource.cpp:463
V4LConfigurationGroup::m_cardInfo
TransTextEditSetting * m_cardInfo
Definition: videosource.h:531
TransMythUICheckBoxSetting
Definition: standardsettings.h:412
remove_chaff
static QString remove_chaff(const QString &name)
Definition: videosource.cpp:3666
V4L2encGroup::m_driverName
QString m_driverName
Definition: videosource.h:586
TransFreqTableSelector::SetSourceID
void SetSourceID(uint _sourceid)
Definition: videosource.cpp:550
CetonDeviceID::m_tuner
QString m_tuner
Definition: videosource.h:1075
DVBNetID
Definition: videosource.cpp:413
MythUIComboBoxSetting::fillSelectionsFromDir
void fillSelectionsFromDir(const QDir &dir, bool absPath=true)
Definition: standardsettings.cpp:604
HDHomeRunConfigurationGroup::GetDeviceCheckBoxes
QString GetDeviceCheckBoxes(void)
Definition: videosource.cpp:1507
CardUtil::GetDeviceLabel
static QString GetDeviceLabel(const QString &inputtype, const QString &videodevice)
Definition: cardutil.cpp:2487
StandardSetting::setValue
virtual void setValue(const QString &newValue)
Definition: standardsettings.cpp:169
VideoSourceEditor::Load
void Load(void) override
Definition: videosource.cpp:3564
VBoxDeviceID::m_tuner
QString m_tuner
Definition: videosource.h:1032
VBoxDevice::m_deviceId
QString m_deviceId
Definition: videosource.h:484
error
static void error(const char *str,...)
Definition: vbi.cpp:42
V4LConfigurationGroup
Definition: videosource.h:520
FirewireDesc::m_guid
const FirewireGUID * m_guid
Definition: videosource.h:720
CardInputEditor::CardInputEditor
CardInputEditor()
Definition: videosource.cpp:3616
HDHomeRunEITScan::HDHomeRunEITScan
HDHomeRunEITScan(const CaptureCard &parent)
Definition: videosource.cpp:1385
CardUtil::ProbeDeliverySystems
static QStringList ProbeDeliverySystems(const QString &device)
Definition: cardutil.cpp:574
QuickTune::QuickTune
QuickTune(const CardInput &parent)
Definition: videosource.cpp:2937
MPEGConfigurationGroup
Definition: videosource.h:539
mythdb.h
MythSystemLegacy
Definition: mythsystemlegacy.h:68
CardUtil::GetVideoDevices
static QStringList GetVideoDevices(const QString &rawtype, QString hostname=QString())
Returns the videodevices of the matching inputs, duplicates removed.
Definition: cardutil.cpp:404
CaptureCard::getCardID
int getCardID(void) const
Definition: videosource.h:736
false
VERBOSE_PREAMBLE false
Definition: verbosedefs.h:85
CardType::CardType
CardType(const CaptureCard &parent)
Definition: videosource.cpp:2626
CardUtil::ClearVideoDeviceCache
static void ClearVideoDeviceCache()
Definition: cardutil.cpp:449
CetonDeviceID::UpdateValues
void UpdateValues()
Definition: videosource.cpp:2076
VBoxConfigurationGroup::m_cardIp
VBoxIP * m_cardIp
Definition: videosource.h:514
XMLTVGrabber
Definition: videosource.cpp:260
VBoxDeviceIDList::m_deviceList
VBoxDeviceList * m_deviceList
Definition: videosource.h:1010
VideoSourceEditor::VSESlot
void(VideoSourceEditor::*)(void) VSESlot
Definition: videosource.h:853
InputDisplayName::InputDisplayName
InputDisplayName(const CardInput &parent)
Definition: videosource.cpp:2756
VideoSource
Definition: videosource.h:176
SourceUtil::GetChannelCount
static uint GetChannelCount(uint sourceid)
Definition: sourceutil.cpp:135
CardUtil::toInputType
static enum INPUT_TYPES toInputType(const QString &name)
Definition: cardutil.h:72
DTVDeviceConfigGroup
Definition: diseqcsettings.h:167
DBStorage::m_user
StorageUser * m_user
Definition: mythstorage.h:50
CetonSetting::LoadValue
void LoadValue(const QString &value)
Definition: videosource.cpp:2038
HDHomeRunConfigurationGroup::m_parent
CaptureCard & m_parent
Definition: videosource.h:363
FirewireModel::m_guid
const FirewireGUID * m_guid
Definition: videosource.h:705
MythUICheckBoxSetting::setValue
virtual void setValue(const QString &newValue)
Definition: standardsettings.cpp:169
CardUtil::ERROR_UNKNOWN
@ ERROR_UNKNOWN
Definition: cardutil.h:48
CardUtil::DVBT2
@ DVBT2
Definition: cardutil.h:67
TransMythUIComboBoxSetting
Definition: standardsettings.h:273
UseEIT
Definition: videosource.cpp:557
UseHDHomeRunDevice::UseHDHomeRunDevice
UseHDHomeRunDevice(QString &deviceid, QString &model, QString &ipaddr)
Definition: videosource.cpp:1402
ScanFrequencyStart::ScanFrequencyStart
ScanFrequencyStart(const VideoSource &parent)
Definition: videosource.cpp:401
TransTextEditSetting
Definition: standardsettings.h:162
DishNetEIT
Definition: videosource.cpp:3078
CardUtil::GetASIDeviceNumber
static int GetASIDeviceNumber(const QString &device, QString *error=nullptr)
Definition: cardutil.cpp:3059
V4L2util::DriverName
QString DriverName(void) const
Definition: v4l2util.h:48
CardUtil::DeleteAllInputs
static bool DeleteAllInputs(void)
Definition: cardutil.cpp:2687
VBoxConfigurationGroup::m_deviceId
VBoxDeviceID * m_deviceId
Definition: videosource.h:513
CommandPath
Definition: videosource.cpp:943
XMLTV_generic_config::m_grabber
QString m_grabber
Definition: videosource.h:134
VideoSource::canDelete
bool canDelete(void) override
Definition: videosource.cpp:681
ButtonStandardSetting
Definition: standardsettings.h:451
CetonDeviceID::SetTuner
void SetTuner(const QString &tuner)
Definition: videosource.cpp:2061
VideoSourceEditor::VideoSourceEditor
VideoSourceEditor()
Definition: videosource.cpp:3559
FirewireDevice::GetModelName
static QString GetModelName(uint vendor_id, uint model_id)
Definition: firewiredevice.cpp:352
FirewireDesc
Definition: videosource.h:709
VBoxDeviceIDList::m_parent
const CaptureCard & m_parent
Definition: videosource.h:1011
DVBConfigurationGroup::m_signalTimeout
SignalTimeout * m_signalTimeout
Definition: videosource.h:686
CaptureCardEditor::CCESlotConst
void(CaptureCardEditor::*)(void) const CCESlotConst
Definition: videosource.h:830
EITOnly_config
Definition: videosource.h:139
CardInput::CreateNewInputGroup
void CreateNewInputGroup()
Definition: videosource.cpp:3218
VideoSourceShow::Load
void Load(void) override
Definition: videosource.cpp:143
VideoSourceDBStorage
Definition: videosource.h:41
HDHomeRunConfigurationGroup::SetDeviceCheckBoxes
void SetDeviceCheckBoxes(const QString &devices)
Definition: videosource.cpp:1482
DVBConfigurationGroup::m_diseqcTree
DiSEqCDevTree * m_diseqcTree
Definition: videosource.h:689
XMLTVGrabber::LoadXMLTVGrabbers
void LoadXMLTVGrabbers(QStringList name_list, QStringList prog_list)
Definition: videosource.cpp:350
HDHomeRunConfigurationGroup::m_deviceList
HDHomeRunDeviceList m_deviceList
Definition: videosource.h:365
XMLTV_generic_config::Save
void Save(void) override
Definition: videosource.cpp:594
CetonSetting::CetonConfigurationGroup
static void CetonConfigurationGroup(CaptureCard &parent, CardType &cardtype)
Definition: videosource.cpp:2086
frequencies.h
CaptureCardDBStorage::GetSetClause
QString GetSetClause(MSqlBindings &bindings) const override
Definition: videosource.cpp:245
ExternalChannelCommand::ExternalChannelCommand
ExternalChannelCommand(const CardInput &parent)
Definition: videosource.cpp:2957
VideoSourceEditor::VSESlotConst
void(VideoSourceEditor::*)(void) const VSESlotConst
Definition: videosource.h:854
VBoxDeviceID
Definition: videosource.h:1017
DVBCardName::DVBCardName
DVBCardName()
Definition: videosource.cpp:1143
VideoDevice
Definition: videosource.cpp:751
VBoxDeviceIDList
Definition: videosource.h:987
DeviceTree::Load
void Load(void) override
Definition: diseqcsettings.cpp:1016
MSqlQuery::value
QVariant value(int i) const
Definition: mythdbcon.h:198
MythScreenStack
Definition: mythscreenstack.h:16
MythScreenType::Create
virtual bool Create(void)
Definition: mythscreentype.cpp:282
arg
arg(title).arg(filename).arg(doDelete))
DVBConfigurationGroup::DVBConfigurationGroup
DVBConfigurationGroup(CaptureCard &a_parent, CardType &cardType)
Definition: videosource.cpp:3909
InstanceCount
Definition: videosource.cpp:171
VBIDevice
Definition: videosource.cpp:868
VBoxDevice::m_tunerType
QString m_tunerType
Definition: videosource.h:488
VideoSourceSelector::VideoSourceSelector
VideoSourceSelector(uint _initial_sourceid, QString _card_types, bool _must_have_mplexid)
Definition: videosource.cpp:63
CaptureCard::m_id
ID * m_id
Definition: videosource.h:774
TransFreqTableSelector::m_loadedFreqTable
QString m_loadedFreqTable
Definition: videosource.h:115
VBoxDevice::m_cardIp
QString m_cardIp
Definition: videosource.h:486
ASIDevice::fillSelections
void fillSelections(const QString &current)
Adds all available cards to list If current is >= 0 it will be considered available even if no device...
Definition: videosource.cpp:1766
DBStorage::GetColumnName
QString GetColumnName(void) const
Definition: mythstorage.h:47
XMLTV_generic_config::XMLTV_generic_config
XMLTV_generic_config(const VideoSource &_parent, const QString &_grabber, StandardSetting *_setting)
Definition: videosource.cpp:570
MSqlQuery::exec
bool exec(void)
Wrap QSqlQuery::exec() so we can display SQL.
Definition: mythdbcon.cpp:603
MPEGConfigurationGroup::m_cardInfo
TransTextEditSetting * m_cardInfo
Definition: videosource.h:552
XMLTV_generic_config::m_grabberArgs
QStringList m_grabberArgs
Definition: videosource.h:135
ScanFrequencyStart
Definition: videosource.cpp:399
StartingChannel::SetSourceID
void SetSourceID(const QString &sourceid)
Definition: videosource.cpp:2984
StandardSetting::clearSettings
virtual void clearSettings()
Definition: standardsettings.cpp:159
DVBCardType::DVBCardType
DVBCardType(const CaptureCard &parent)
Definition: videosource.cpp:1130
VBoxDeviceID::Load
void Load(void) override
Definition: videosource.cpp:1613
StorageUser::GetDBValue
virtual QString GetDBValue(void) const =0
InputDisplayName::Load
void Load(void) override
Definition: videosource.cpp:2765
LOG
#define LOG(_MASK_, _LEVEL_, _QSTRING_)
Definition: mythlogging.h:23
ASIConfigurationGroup::probeCard
void probeCard(const QString &device)
Definition: videosource.cpp:1853
SourceID
Definition: videosource.cpp:2784
StandardSetting::addTargetedChild
void addTargetedChild(const QString &value, StandardSetting *setting)
Definition: standardsettings.cpp:116
MythSystemLegacy::ReadAll
QByteArray & ReadAll()
Definition: mythsystemlegacy.cpp:397
MythScreenType
Screen in which all other widgets are contained and rendered.
Definition: mythscreentype.h:45
EmptyAudioDevice
Definition: videosource.h:277
firewiredevice.h
CaptureCardEditor::AddSelection
void AddSelection(const QString &label, CCESlot slot)
Definition: videosource.cpp:3460
AudioRateLimit::AudioRateLimit
AudioRateLimit(const CaptureCard &parent)
Definition: videosource.cpp:1024
GroupSetting::GroupSetting
GroupSetting()=default
CaptureCardEditor::Load
void Load(void) override
Definition: videosource.cpp:3547
ASIDevice::ASIDevice
ASIDevice(const CaptureCard &parent)
Definition: videosource.cpp:1756
MythSystemLegacy::Run
void Run(time_t timeout=0)
Runs a command inside the /bin/sh shell. Returns immediately.
Definition: mythsystemlegacy.cpp:212
mythdirs.h
CaptureCardButton::Clicked
void Clicked(const QString &choice)
VBoxDeviceID::SetTuner
void SetTuner(const QString &tuner)
Definition: videosource.cpp:1601
TunerCardAudioInput
Definition: videosource.h:261
DiSEqCDevSettings::Load
bool Load(uint card_input_id)
Loads configuration chain from DB for specified card input id.
Definition: diseqc.cpp:123
ASIConfigurationGroup::m_cardInfo
TransTextEditSetting * m_cardInfo
Definition: videosource.h:605
DVBConfigurationGroup::m_cardName
DVBCardName * m_cardName
Definition: videosource.h:684
ExternalChannelCommand
Definition: videosource.cpp:2955
HTTPRequest::TestMimeType
static QString TestMimeType(const QString &sFileName)
Definition: httprequest.cpp:1081
DVBNoSeqStart::DVBNoSeqStart
DVBNoSeqStart(const CaptureCard &parent)
Definition: videosource.cpp:1156
FileDevice
Definition: videosource.cpp:957
CaptureCardTextEditSetting
Definition: videosource.cpp:389
VBoxDevice
Definition: videosource.h:481
ASIDevice::Load
void Load(void) override
Definition: videosource.cpp:1823
VBoxTunerIndex::setEnabled
void setEnabled(bool e) override
Definition: videosource.cpp:1567
CardUtil::CloneCard
static uint CloneCard(uint src_inputid, uint dst_inputid)
Definition: cardutil.cpp:1516
HDHomeRunDevice::m_deviceId
QString m_deviceId
Definition: videosource.h:339
VBIDevice::setFilter
uint setFilter(const QString &card, const QString &driver)
Definition: videosource.cpp:879
VideoSourceEditor::DeleteAllSources
void DeleteAllSources(bool doDelete)
Definition: videosource.cpp:3597
CardType::fillSelections
static void fillSelections(MythUIComboBoxSetting *setting)
Definition: videosource.cpp:2635
MythTextInputDialog::haveResult
void haveResult(QString)
ASIConfigurationGroup
Definition: videosource.h:593
InputGroup::m_cardInput
const CardInput & m_cardInput
Definition: videosource.cpp:2841
DVBConfigurationGroup::probeCard
void probeCard(const QString &videodevice)
Definition: videosource.cpp:3725
CaptureCardDBStorage::m_parent
const CaptureCard & m_parent
Definition: videosource.h:245
MythMainWindow::GetStack
MythScreenStack * GetStack(const QString &stackname)
Definition: mythmainwindow.cpp:329
FirewireDevice::GetSTBList
static std::vector< AVCInfo > GetSTBList(void)
Definition: firewiredevice.cpp:365
XMLTVGrabber::m_parent
const VideoSource & m_parent
Definition: videosource.cpp:373
FirewireGUID::GetAVCInfo
AVCInfo GetAVCInfo(const QString &guid) const
Definition: videosource.cpp:1234
CardInput::loadByID
void loadByID(int id)
Definition: videosource.cpp:3391
VBoxIP
Definition: videosource.h:945
ScanWizard
Definition: scanwizard.h:45
IPTVHost::IPTVHost
IPTVHost(const CaptureCard &parent)
Definition: videosource.cpp:1735
HDHomeRunDeviceID
Definition: videosource.h:369
NoGrabber_config
Definition: videosource.h:151
VBoxDeviceList
QMap< QString, VBoxDevice > VBoxDeviceList
Definition: videosource.h:493
MythDate::current
QDateTime current(bool stripped)
Returns current Date and Time in UTC.
Definition: mythdate.cpp:10
VideoDevice::fillSelectionsFromDir
uint fillSelectionsFromDir(const QDir &dir, uint minor_min, uint minor_max, const QString &card, const QString &driver, bool allow_duplicates)
Definition: videosource.cpp:796
TransFreqTableSelector::Load
void Load(void) override
Definition: videosource.cpp:486
DiSEqCDevTree::Exists
static bool Exists(int cardid)
Check if a Diseqc device tree exists.
Definition: diseqc.cpp:388
CaptureCardEditor::DeleteAllCaptureCards
void DeleteAllCaptureCards(bool doDelete)
Definition: videosource.cpp:3501
AVCInfo
Definition: avcinfo.h:23
true
VERBOSE_PREAMBLE Most true
Definition: verbosedefs.h:91
VideoDevice::VideoDevice
VideoDevice(const CaptureCard &parent, uint minor_min=0, uint minor_max=UINT_MAX, const QString &card=QString(), const QString &driver=QString())
Definition: videosource.cpp:753
DemoConfigurationGroup
Definition: videosource.h:625
scanwizard.h
VBoxConfigurationGroup::FillDeviceList
void FillDeviceList(void)
Definition: videosource.cpp:1977
XMLTV_generic_config::RunConfig
void RunConfig(void)
Definition: videosource.cpp:611
AudioRateLimit
Definition: videosource.cpp:1022
QuickTune
Definition: videosource.cpp:2935
HDHomeRunEITScan
Definition: videosource.cpp:1383
CaptureCard::loadByID
void loadByID(int id)
Definition: videosource.cpp:2559
VBoxDevice::m_discovered
bool m_discovered
Definition: videosource.h:490
close
#define close
Definition: compat.h:17
tmp
static guint32 * tmp
Definition: goom_core.cpp:31
VideoSourceDBStorage::m_parent
const VideoSource & m_parent
Definition: videosource.h:54
EITOnly_config::Save
void Save(void) override
Definition: videosource.cpp:640
DVBEITScan
Definition: videosource.cpp:1184
CardInputDBStorage::GetWhereClause
QString GetWhereClause(MSqlBindings &bindings) const override
Definition: videosource.cpp:3366
VBoxConfigurationGroup::m_parent
CaptureCard & m_parent
Definition: videosource.h:510
mythsystemlegacy.h
CardInput::m_srcFetch
ButtonStandardSetting * m_srcFetch
Definition: videosource.h:932
CaptureCardDBStorage::getCardID
int getCardID(void) const
Definition: videosource.cpp:3450
CardUtil::ProbeDefaultDeliverySystem
static QString ProbeDefaultDeliverySystem(const QString &device)
Definition: cardutil.cpp:653
ButtonStandardSetting::clicked
void clicked()
V4LConfigurationGroup::m_parent
CaptureCard & m_parent
Definition: videosource.h:530
MPEGConfigurationGroup::m_parent
CaptureCard & m_parent
Definition: videosource.h:549
CardUtil::ProbeDVBType
static QString ProbeDVBType(const QString &device)
Definition: cardutil.cpp:671
ChannelUtil::SortChannels
static void SortChannels(ChannelInfoList &list, const QString &order, bool eliminate_duplicates=false)
Definition: channelutil.cpp:2280
ImportConfigurationGroup::m_size
GroupSetting * m_size
Definition: videosource.h:621
DemoConfigurationGroup::m_size
GroupSetting * m_size
Definition: videosource.h:637
TunerCardAudioInput::TunerCardAudioInput
TunerCardAudioInput(const CaptureCard &parent, QString dev=QString(), QString type=QString())
Definition: videosource.cpp:3874
DVBNetID::DVBNetID
DVBNetID(const VideoSource &parent, signed int value, signed int min_val)
Definition: videosource.cpp:415
CardUtil::ProbeVideoDevices
static QStringList ProbeVideoDevices(const QString &rawtype)
Definition: cardutil.cpp:455
DiSEqCDevSettings
DVB-S device settings class.
Definition: diseqc.h:37
DVBTuningDelay::DVBTuningDelay
DVBTuningDelay(const CaptureCard &parent)
Definition: videosource.cpp:1202
CetonDeviceID::SetIP
void SetIP(const QString &ip)
Definition: videosource.cpp:2051
CardUtil::ProbeDVBFrontendName
static QString ProbeDVBFrontendName(const QString &device)
Returns the input type from the video device.
Definition: cardutil.cpp:692
VideoDevice::Driver
QString Driver(void) const
Definition: videosource.cpp:858
VBoxDevice::m_inUse
bool m_inUse
Definition: videosource.h:489
VBoxDeviceIDList::m_cardIp
VBoxIP * m_cardIp
Definition: videosource.h:1008
InputName::fillSelections
void fillSelections()
Definition: videosource.cpp:2721
HDHomeRunDevice
Definition: videosource.h:337
StandardSetting::settingsChanged
void settingsChanged(StandardSetting *selectedSetting=nullptr)
StandardSettingDialog
Definition: standardsettings.h:469
StandardSetting::addChild
virtual void addChild(StandardSetting *child)
Definition: standardsettings.cpp:70
V4L2encGroup
Definition: videosource.h:575
CardUtil::DVBS2
@ DVBS2
Definition: cardutil.h:60
VideoSourceDBStorage::GetSetClause
QString GetSetClause(MSqlBindings &bindings) const override
Definition: videosource.cpp:220
if
if(query.exec() &&query.next())
Definition: mythplugins/mytharchive/mytharchivehelper/main.cpp:461
StandardSetting::GetStorage
Storage * GetStorage(void) const
Definition: standardsettings.h:79
sourceutil.h
InputName::Load
void Load(void) override
Definition: videosource.cpp:2715
SourceUtil::UpdateChannelsFromListings
static bool UpdateChannelsFromListings(uint sourceid, const QString &inputtype=QString(), bool wait=false)
Definition: sourceutil.cpp:395
CardInputDBStorage::getInputID
int getInputID(void) const
Definition: videosource.cpp:3445
CardUtil::UnlinkInputGroup
static bool UnlinkInputGroup(uint inputid, uint inputgroupid)
Definition: cardutil.cpp:1967
ImportConfigurationGroup::probeCard
void probeCard(const QString &device)
Definition: videosource.cpp:1911
minor
#define minor(X)
Definition: compat.h:139
XMLTV_generic_config
Definition: videosource.h:119
CardUtil::QPSK
@ QPSK
Definition: cardutil.h:50
VBoxDeviceID::VBoxDeviceID
VBoxDeviceID(const CaptureCard &parent)
Definition: videosource.cpp:1587
VBoxTunerIndex::VBoxTunerIndex
VBoxTunerIndex()
Definition: videosource.cpp:1558
dvbtypes.h
MPEGConfigurationGroup::m_vbiDevice
VBIDevice * m_vbiDevice
Definition: videosource.h:551
mythlogging.h
RegionID
Definition: videosource.cpp:447
GetConfDir
QString GetConfDir(void)
Definition: mythdirs.cpp:224
StandardSetting::getSubSettings
virtual QList< StandardSetting * > * getSubSettings()
Definition: standardsettings.cpp:145
ScheduleOrder::ScheduleOrder
ScheduleOrder(const CardInput &parent, int _value)
Definition: videosource.cpp:3044
DVBCardName
Definition: videosource.cpp:1141
MythUIComboBoxSetting
Definition: standardsettings.h:219
CardUtil::IsEncoder
static bool IsEncoder(const QString &rawtype)
Definition: cardutil.h:129
FreqTableSelector
Definition: videosource.h:93
ImportConfigurationGroup::ImportConfigurationGroup
ImportConfigurationGroup(CaptureCard &parent, CardType &cardtype)
Definition: videosource.cpp:1884
CardUtil::GetV4LInfo
static bool GetV4LInfo(int videofd, QString &input, QString &driver, uint32_t &version, uint32_t &capabilities)
Definition: cardutil.cpp:2159
InputGroup::Save
void Save(void) override
Definition: videosource.cpp:2823
CardInput::Save
void Save(void) override
Definition: videosource.cpp:3412
AudioDevice::AudioDevice
AudioDevice(const CaptureCard &parent)
Definition: videosource.cpp:971
HDPVRConfigurationGroup::HDPVRConfigurationGroup
HDPVRConfigurationGroup(CaptureCard &parent, CardType &cardtype)
Definition: videosource.cpp:2313
CardInput::CreateNewInputGroupSlot
void CreateNewInputGroupSlot(const QString &name)
Definition: videosource.cpp:3237
DemoConfigurationGroup::m_parent
CaptureCard & m_parent
Definition: videosource.h:635
v4l2util.h
V4LConfigurationGroup::m_vbiDev
VBIDevice * m_vbiDev
Definition: videosource.h:532
CaptureCardButton::edit
void edit(MythScreenType *screen) override
Definition: videosource.cpp:3455
ASIConfigurationGroup::ASIConfigurationGroup
ASIConfigurationGroup(CaptureCard &parent, CardType &cardType)
Definition: videosource.cpp:1832
V4L2util::HasSlicedVBI
bool HasSlicedVBI(void) const
Definition: v4l2util.cpp:115
CardUtil::CreateDeviceInputGroup
static uint CreateDeviceInputGroup(uint inputid, const QString &type, const QString &host, const QString &device)
Definition: cardutil.cpp:1890
HDHomeRunDeviceID::HDHomeRunDeviceID
HDHomeRunDeviceID(const CaptureCard &parent, HDHomeRunConfigurationGroup &_group)
Definition: videosource.cpp:1361
VBoxConfigurationGroup::m_deviceIdList
VBoxDeviceIDList * m_deviceIdList
Definition: videosource.h:512
BouquetID
Definition: videosource.cpp:430
CaptureCardSpinBoxSetting::CaptureCardSpinBoxSetting
CaptureCardSpinBoxSetting(const CaptureCard &parent, uint min_val, uint max_val, uint step, const QString &setting)
Definition: videosource.cpp:379
Storage::Load
virtual void Load(void)=0
CardUtil::GetChildInputIDs
static std::vector< uint > GetChildInputIDs(uint inputid)
Definition: cardutil.cpp:1339
MSqlQuery::InitCon
static MSqlQueryInfo InitCon(ConnectionReuse _reuse=kNormalConnection)
Only use this in combination with MSqlQuery constructor.
Definition: mythdbcon.cpp:535
compat.h
StandardSetting::getParent
StandardSetting * getParent() const
Definition: standardsettings.h:49
HDPVRConfigurationGroup::probeCard
void probeCard(const QString &device)
Definition: videosource.cpp:2338
VBoxIP::setEnabled
void setEnabled(bool e) override
Definition: videosource.cpp:1537
MythDB::DBError
static void DBError(const QString &where, const MSqlQuery &query)
Definition: mythdb.cpp:178
VideoSource::m_name
Name * m_name
Definition: videosource.h:226
CardUtil::QAM
@ QAM
Definition: cardutil.h:51
PresetTuner
Definition: videosource.cpp:2970
HDHomeRunDevice::m_checkbox
UseHDHomeRunDevice * m_checkbox
Definition: videosource.h:342
VBoxDeviceIDList::fillSelections
void fillSelections(const QString &current)
Adds all available device-tuner combinations to list.
Definition: videosource.cpp:1647
StandardSetting::Load
virtual void Load(void)
Definition: standardsettings.cpp:214
CaptureCard::Save
void Save(void) override
Definition: videosource.cpp:2576
SourceID::Load
void Load(void) override
Definition: videosource.cpp:2793
CardInput::m_inputGrp0
InputGroup * m_inputGrp0
Definition: videosource.h:934
VideoSourceSelector::m_mustHaveMplexId
bool m_mustHaveMplexId
Definition: videosource.h:73
FirewireGUID::m_guidToAvcInfo
QMap< QString, AVCInfo > m_guidToAvcInfo
Definition: videosource.cpp:1238
VBoxConfigurationGroup
Definition: videosource.h:500
AudioDevice
Definition: videosource.cpp:969
HDHomeRunDeviceID::Load
void Load(void) override
Definition: videosource.cpp:1370
NoGrabber_config::m_useEit
UseEIT * m_useEit
Definition: videosource.h:159
StandardSetting::setHelpText
virtual void setHelpText(const QString &str)
Definition: standardsettings.h:37
V4LConfigurationGroup::probeCard
void probeCard(const QString &device)
Definition: videosource.cpp:2140
CaptureCardEditor::ShowDeleteAllCaptureCardsDialogOnHost
void ShowDeleteAllCaptureCardsDialogOnHost(void) const
Definition: videosource.cpp:3474
is_grabber_external
static bool is_grabber_external(const QString &grabber)
Definition: videosource.h:28
CardUtil::GetAudioDevice
static QString GetAudioDevice(uint inputid)
Definition: cardutil.h:285
vboxutils.h
CaptureCard
Definition: videosource.h:731
EmptyVBIDevice
Definition: videosource.h:302
FirewireConnection
Definition: videosource.cpp:1299
DiSEqCDevTree::Load
bool Load(const QString &device)
Loads the device tree from the database.
Definition: diseqc.cpp:306
CaptureCard::ID
Definition: videosource.h:752
HDHomeRunDevice::m_model
QString m_model
Definition: videosource.h:340
filename
QString filename
Definition: mythplugins/mytharchive/mytharchivehelper/main.cpp:637
CardInputComboBoxSetting
Definition: videosource.cpp:2775
MythUIComboBoxSetting::getValueIndex
int getValueIndex(const QString &value) const
Definition: standardsettings.cpp:483
CaptureCardGroup
Definition: videosource.h:724
StandardSetting::Save
virtual void Save(void)
Definition: standardsettings.cpp:233
VBoxDevice::m_mythDeviceId
QString m_mythDeviceId
Definition: videosource.h:483
HDPVRConfigurationGroup::m_parent
CaptureCard & m_parent
Definition: videosource.h:566
CardUtil::GetDeliverySystemFromDB
static QString GetDeliverySystemFromDB(uint inputid)
Definition: cardutil.h:289
CaptureCardButton::m_value
QString m_value
Definition: videosource.h:816
VideoSource::VideoSource
VideoSource()
Definition: videosource.cpp:665
VBoxIP::UpdateDevices
void UpdateDevices(const QString &v)
Definition: videosource.cpp:1552
CardUtil::HasTuner
static bool HasTuner(const QString &rawtype, const QString &device)
Definition: cardutil.cpp:222
CaptureCardEditor::CaptureCardEditor
CaptureCardEditor()
Definition: videosource.cpp:3542
XMLTVGrabber::XMLTVGrabber
XMLTVGrabber(const VideoSource &parent)
Definition: videosource.cpp:262
mythnotification.h
CaptureCard::CaptureCard
CaptureCard(bool use_card_group=true)
Definition: videosource.cpp:2508
AVCInfo::m_vendorid
uint m_vendorid
Definition: avcinfo.h:49
CardUtil::GetDeviceInputGroup
static uint GetDeviceInputGroup(uint inputid)
Definition: cardutil.cpp:1903
DishNetEIT::DishNetEIT
DishNetEIT(const CardInput &parent)
Definition: videosource.cpp:3080
VBoxDeviceID::SetIP
void SetIP(const QString &ip)
Definition: videosource.cpp:1595
CardInput::ID
Definition: videosource.h:920
StandardSetting::setReadOnly
virtual void setReadOnly(bool readonly)
Definition: standardsettings.cpp:53
StandardSetting::getValue
virtual QString getValue(void) const
Definition: standardsettings.h:52
IPTVHost
Definition: videosource.cpp:1733
AVCInfo::m_product_name
QString m_product_name
Definition: avcinfo.h:52
CaptureCardEditor::ShowDeleteAllCaptureCardsDialog
void ShowDeleteAllCaptureCardsDialog(void) const
Definition: videosource.cpp:3483
DemoConfigurationGroup::probeCard
void probeCard(const QString &device)
Definition: videosource.cpp:2234
LiveTVOrder
Definition: videosource.cpp:3059
InputGroup::InputGroup
InputGroup(const CardInput &parent, uint group_num)
Definition: videosource.cpp:2809
CardInput::m_sourceId
SourceID * m_sourceId
Definition: videosource.h:929
CardInput::m_startChan
StartingChannel * m_startChan
Definition: videosource.h:930
FirewireSpeed
Definition: videosource.cpp:1312
uint
unsigned int uint
Definition: compat.h:141
gCoreContext
MythCoreContext * gCoreContext
This global variable contains the MythCoreContext instance for the app.
Definition: mythcorecontext.cpp:60
VBoxTunerIndex::UpdateDevices
void UpdateDevices(const QString &v)
Definition: videosource.cpp:1581
InputGroup
Definition: videosource.cpp:2807
V4L2encGroup::probeCard
void probeCard(const QString &device)
Definition: videosource.cpp:2379
CardInputDBStorage::m_parent
const CardInput & m_parent
Definition: videosource.h:796
IPTVConfigurationGroup
static void IPTVConfigurationGroup(CaptureCard &parent, CardType &cardType)
Definition: videosource.cpp:1745
DVBConfigurationGroup::Save
void Save(void) override
Definition: videosource.cpp:3975
CaptureCard::fillSelections
static void fillSelections(GroupSetting *setting)
Definition: videosource.cpp:2525
V4L2encGroup::m_cardInfo
TransTextEditSetting * m_cardInfo
Definition: videosource.h:583
InstanceCount::InstanceCount
InstanceCount(const CardInput &parent)
Definition: videosource.cpp:173
DVBCardNum::Load
void Load(void) override
Definition: videosource.cpp:1114
DemoConfigurationGroup::m_info
GroupSetting * m_info
Definition: videosource.h:636
FirewireGUID
Definition: videosource.cpp:1217
VideoSourceSelector::m_cardTypes
QString m_cardTypes
Definition: videosource.h:72
CardInput::m_instanceCount
MythUISpinBoxSetting * m_instanceCount
Definition: videosource.h:936
VBoxConfigurationGroup::VBoxConfigurationGroup
VBoxConfigurationGroup(CaptureCard &parent, CardType &cardtype)
Definition: videosource.cpp:1945
kMSRunShell
@ kMSRunShell
run process through shell
Definition: mythsystem.h:41
VBIDevice::fillSelectionsFromDir
uint fillSelectionsFromDir(const QDir &dir, const QString &card, const QString &driver)
Definition: videosource.cpp:909
DVBConfigurationGroup::Load
void Load(void) override
Definition: videosource.cpp:3962
StandardSetting::setLabel
virtual void setLabel(QString str)
Definition: standardsettings.h:34
channelutil.h
CardInputDBStorage::GetSetClause
QString GetSetClause(MSqlBindings &bindings) const override
Definition: videosource.cpp:3377
VBoxIP::SetOldValue
void SetOldValue(const QString &s)
Definition: videosource.h:952
DVBConfigurationGroup::~DVBConfigurationGroup
~DVBConfigurationGroup() override
Definition: videosource.cpp:3953
CaptureCardSpinBoxSetting
Definition: videosource.cpp:377
VBoxDeviceIDList::Load
void Load(void) override
Definition: videosource.cpp:1695
DVBTuningDelay
Definition: videosource.cpp:1200
CardInput::SetSourceID
void SetSourceID(const QString &sourceid)
Definition: videosource.cpp:3203
StartingChannel
Definition: videosource.h:878
CardInput::~CardInput
~CardInput() override
Definition: videosource.cpp:3194
FirewireModel
Definition: videosource.h:695
CardInput
Definition: videosource.h:896
VBoxDevice::m_desc
QString m_desc
Definition: videosource.h:485
AVCInfo::m_modelid
uint m_modelid
Definition: avcinfo.h:50
CardType
Definition: videosource.h:327
SignalTimeout::SignalTimeout
SignalTimeout(const CaptureCard &parent, uint value, uint min_val)
Definition: videosource.cpp:994
CaptureCardDBStorage::GetWhereClause
QString GetWhereClause(MSqlBindings &bindings) const override
Definition: videosource.cpp:234
InputGroup::Load
void Load(void) override
Definition: videosource.cpp:2846
HDHomeRunConfigurationGroup::FillDeviceList
void FillDeviceList(void)
Definition: videosource.cpp:1445
VBoxDeviceIDList::m_cardTuner
VBoxTunerIndex * m_cardTuner
Definition: videosource.h:1009
CardUtil::GetDeviceName
static QString GetDeviceName(dvb_dev_type_t type, const QString &device)
Definition: cardutil.cpp:2762
ASIDevice
Definition: videosource.cpp:1754
gChanLists
const CHANLISTS_vec gChanLists
Definition: frequencies.cpp:2230
channelinfo.h
VBoxDeviceIDList::VBoxDeviceIDList
VBoxDeviceIDList(VBoxDeviceID *deviceid, StandardSetting *desc, VBoxIP *cardip, VBoxTunerIndex *cardtuner, VBoxDeviceList *devicelist, const CaptureCard &parent)
Definition: videosource.cpp:1623
DVBConfigurationGroup::m_cardNum
DVBCardNum * m_cardNum
Definition: videosource.h:683
CardUtil::GetRawInputType
static QString GetRawInputType(uint inputid)
Definition: cardutil.h:281
VideoSource::deleteEntry
void deleteEntry(void) override
Definition: videosource.cpp:686
CaptureCardTextEditSetting::CaptureCardTextEditSetting
CaptureCardTextEditSetting(const CaptureCard &parent, const QString &setting)
Definition: videosource.cpp:391
StandardSetting::valueChanged
void valueChanged(const QString &newValue)
ImportConfigurationGroup
Definition: videosource.h:609
VideoDevice::m_driverName
QString m_driverName
Definition: videosource.cpp:864
CetonSetting::CetonSetting
CetonSetting(QString label, const QString &helptext)
Definition: videosource.cpp:2024
lstat
#define lstat
Definition: compat.h:196
TransFreqTableSelector::TransFreqTableSelector
TransFreqTableSelector(uint _sourceid)
Definition: videosource.cpp:477
CaptureCardGroup::CaptureCardGroup
CaptureCardGroup(CaptureCard &parent)
Definition: videosource.cpp:2431
DVBOnDemand
Definition: videosource.cpp:1169
V4LConfigurationGroup::V4LConfigurationGroup
V4LConfigurationGroup(CaptureCard &parent, CardType &cardtype)
Definition: videosource.cpp:2115
V4L2util::IsOpen
bool IsOpen(void) const
Definition: v4l2util.h:29
StandardSetting::setEnabled
virtual void setEnabled(bool enabled)
Definition: standardsettings.cpp:47
SkipBtAudio::SkipBtAudio
SkipBtAudio(const CaptureCard &parent)
Definition: videosource.cpp:1043
CardUtil::IsCableCardPresent
static bool IsCableCardPresent(uint inputid, const QString &inputType)
Definition: cardutil.cpp:111
MythUIComboBoxSetting::addSelection
void addSelection(const QString &label, QString value=QString(), bool select=false)
Definition: standardsettings.cpp:494
DiSEqCDevSettings::Store
bool Store(uint card_input_id) const
Stores configuration chain to DB for specified card input id.
Definition: diseqc.cpp:157
VideoDevice::fillSelectionsFromDir
void fillSelectionsFromDir(const QDir &dir, bool absPath=true)
Definition: videosource.cpp:788
DiSEqCDev::InvalidateTrees
static void InvalidateTrees(void)
Invalidate cached trees.
Definition: diseqc.cpp:240
ScheduleOrder
Definition: videosource.cpp:3042
MythUITextEditSetting
Definition: standardsettings.h:147
CardInput::sourceFetch
void sourceFetch()
Definition: videosource.cpp:3330
MythUIFileBrowserSetting
Definition: standardsettings.h:188
VideoSource::getSourceID
int getSourceID(void) const
Definition: videosource.h:182
V4L2util
Definition: v4l2util.h:17
CardInput::channelScanner
void channelScanner()
Definition: videosource.cpp:3282
VBoxIP::m_oldValue
QString m_oldValue
Definition: videosource.h:962
DVBCardNum::fillSelections
void fillSelections(const QString &current)
Adds all available cards to list If current is >= 0 it will be considered available even if no device...
Definition: videosource.cpp:1073
mythcorecontext.h
MPEGConfigurationGroup::m_device
VideoDevice * m_device
Definition: videosource.h:550
VideoSource::ID
Definition: videosource.h:207
cardutil.h
CardInput::m_externalInputSettings
DiSEqCDevSettings * m_externalInputSettings
Definition: videosource.h:933
dir
QDir dir
Definition: mythplugins/mytharchive/mytharchivehelper/main.cpp:1174
InputGroup::m_groupId
uint m_groupId
Definition: videosource.cpp:2843
InputName::InputName
InputName(const CardInput &parent)
Definition: videosource.cpp:2709
EITOnly_config::m_useEit
UseEIT * m_useEit
Definition: videosource.h:147
MPEGConfigurationGroup::MPEGConfigurationGroup
MPEGConfigurationGroup(CaptureCard &parent, CardType &cardtype)
Definition: videosource.cpp:2161
CetonDeviceID::m_ip
QString m_ip
Definition: videosource.h:1073
MPEGConfigurationGroup::probeCard
void probeCard(const QString &device)
Definition: videosource.cpp:2186
VideoSourceSelector::Load
void Load(void) override
Definition: videosource.cpp:79
V4L2encGroup::m_device
VideoDevice * m_device
Definition: videosource.h:584
VideoSource::fillSelections
static void fillSelections(GroupSetting *setting)
Definition: videosource.cpp:713
ASIConfigurationGroup::m_device
ASIDevice * m_device
Definition: videosource.h:604
VideoSourceEditor::ShowDeleteAllSourcesDialog
void ShowDeleteAllSourcesDialog(void) const
Definition: videosource.cpp:3588
VideoSource::loadByID
void loadByID(int id)
Definition: videosource.cpp:745
MSqlQuery::bindValue
void bindValue(const QString &placeholder, const QVariant &val)
Add a single binding.
Definition: mythdbcon.cpp:864
InputDisplayName::m_parent
const CardInput & m_parent
Definition: videosource.cpp:2771
DVBConfigurationGroup::m_channelTimeout
ChannelTimeout * m_channelTimeout
Definition: videosource.h:687
VBoxConfigurationGroup::m_deviceList
VBoxDeviceList m_deviceList
Definition: videosource.h:516
CommandPath::CommandPath
CommandPath(const CaptureCard &parent)
Definition: videosource.cpp:945
V4L2encGroup::V4L2encGroup
V4L2encGroup(CaptureCard &parent, CardType &cardType)
Definition: videosource.cpp:2358
StandardSetting::isEnabled
bool isEnabled() const
Definition: standardsettings.h:45
FirewireSpeed::FirewireSpeed
FirewireSpeed(const CaptureCard &parent)
Definition: videosource.cpp:1314
VideoSource::m_id
ID * m_id
Definition: videosource.h:225
HDPVRConfigurationGroup::m_cardInfo
GroupSetting * m_cardInfo
Definition: videosource.h:567
CardInput::getSourceName
QString getSourceName(void) const
Definition: videosource.cpp:3213
SkipBtAudio
Definition: videosource.cpp:1041
DeliverySystem
Definition: videosource.cpp:2741
VBoxIP::VBoxIP
VBoxIP()
Definition: videosource.cpp:1528
VBoxDeviceID::SetOverrideDeviceID
void SetOverrideDeviceID(const QString &deviceid)
Definition: videosource.cpp:1607
CaptureCard::deleteEntry
void deleteEntry(void) override
Definition: videosource.cpp:2570
DVBConfigurationGroup::m_parent
CaptureCard & m_parent
Definition: videosource.h:681
CaptureCard::reload
void reload(void)
Definition: videosource.cpp:2617
CardUtil::ProbeAudioInputs
static QStringList ProbeAudioInputs(const QString &device, const QString &inputtype=QString())
Definition: cardutil.cpp:2390
CetonDeviceID::Load
void Load(void) override
Definition: videosource.cpp:2070
HDHomeRunConfigurationGroup
Definition: videosource.h:349
CardInputEditor::Load
void Load(void) override
Definition: videosource.cpp:3621
DVBOnDemand::DVBOnDemand
DVBOnDemand(const CaptureCard &parent)
Definition: videosource.cpp:1171
VBoxConfigurationGroup::m_cardTuner
VBoxTunerIndex * m_cardTuner
Definition: videosource.h:515
HDHomeRunDeviceID::m_group
HDHomeRunConfigurationGroup & m_group
Definition: videosource.h:379
VBoxTunerIndex::NewTuner
void NewTuner(const QString &)
InputDisplayName
Definition: videosource.cpp:2754
FirewireDesc::SetGUID
void SetGUID(const QString &_guid)
Definition: videosource.cpp:1282
IdSetting::setValue
void setValue(int value) override
Definition: videosource.h:171
CaptureCardEditor::AddNewCard
void AddNewCard(void)
Definition: videosource.cpp:3492
MythUISpinBoxSetting
Definition: standardsettings.h:329
GetMythMainWindow
MythMainWindow * GetMythMainWindow(void)
Definition: mythmainwindow.cpp:108
DVBCardNum
Definition: videosource.cpp:1056
mythterminal.h
FileDevice::FileDevice
FileDevice(const CaptureCard &parent)
Definition: videosource.cpp:959
SourceUtil::DeleteAllSources
static bool DeleteAllSources(void)
Definition: sourceutil.cpp:579
DVBConfigurationGroup
Definition: videosource.h:663
VBoxIP::NewIP
void NewIP(const QString &)
CardUtil::IsTunerSharingCapable
static bool IsTunerSharingCapable(const QString &rawtype)
Definition: cardutil.h:171
CetonDeviceID::LoadedTuner
void LoadedTuner(const QString &)
InputGroup::Save
virtual void Save(const QString &)
Definition: videosource.cpp:2838
DiSEqCDevTree
DVB-S device tree class.
Definition: diseqc.h:75
CardInput::m_schedGroup
MythUICheckBoxSetting * m_schedGroup
Definition: videosource.h:937
VBoxDeviceID::m_ip
QString m_ip
Definition: videosource.h:1031
BouquetID::BouquetID
BouquetID(const VideoSource &parent, signed int value, signed int min_val)
Definition: videosource.cpp:432
build_compdb.help
help
Definition: build_compdb.py:10
VBoxTunerIndex::m_oldValue
QString m_oldValue
Definition: videosource.h:983
TransFreqTableSelector::m_sourceId
uint m_sourceId
Definition: videosource.h:114
MythScreenType::Exiting
void Exiting()
CardUtil::OFDM
@ OFDM
Definition: cardutil.h:52
StandardSetting::m_visible
bool m_visible
Definition: standardsettings.h:117
VBIDevice::fillSelectionsFromDir
void fillSelectionsFromDir(const QDir &dir, bool absPath=true)
Definition: videosource.cpp:901
UseEIT::UseEIT
UseEIT(const VideoSource &parent)
Definition: videosource.cpp:559
VideoSourceEditor::AddSelection
void AddSelection(const QString &label, VSESlot slot)
Definition: videosource.cpp:3574
CaptureCardComboBoxSetting
Definition: videosource.h:249
VideoSourceEditor::cardTypesInclude
static bool cardTypesInclude(int SourceID, const QString &thecardtype)
Definition: videosource.cpp:691
VBoxDevice::m_tunerNo
QString m_tunerNo
Definition: videosource.h:487
CetonDeviceID::CetonDeviceID
CetonDeviceID(const CaptureCard &parent)
Definition: videosource.cpp:2043
CaptureCardDBStorage
Definition: videosource.h:230
StandardSetting::setVisible
void setVisible(bool visible)
Definition: standardsettings.cpp:59
StandardSetting
Definition: standardsettings.h:30
DemoConfigurationGroup::DemoConfigurationGroup
DemoConfigurationGroup(CaptureCard &parent, CardType &cardtype)
Definition: videosource.cpp:2208
SourceUtil::GetListingsLoginData
static bool GetListingsLoginData(uint sourceid, QString &grabber, QString &userid, QString &passwd, QString &lineupid)
Definition: sourceutil.cpp:171
SchedGroup
Definition: videosource.cpp:191
MythCoreContext::GetHostName
QString GetHostName(void)
Definition: mythcorecontext.cpp:859
TransFreqTableSelector::Save
void Save(void) override
Definition: videosource.cpp:523
CardInput::m_scan
ButtonStandardSetting * m_scan
Definition: videosource.h:931
HDPVRConfigurationGroup::m_audioInput
TunerCardAudioInput * m_audioInput
Definition: videosource.h:568
TunerCardAudioInput::m_lastCardType
QString m_lastCardType
Definition: videosource.h:273
DVB_DEV_FRONTEND
@ DVB_DEV_FRONTEND
Definition: cardutil.h:28
DiSEqCDevTree::Store
bool Store(uint cardid, const QString &device="")
Stores the device tree to the database.
Definition: diseqc.cpp:417
TunerCardAudioInput::fillSelections
int fillSelections(const QString &device)
Definition: videosource.cpp:3890
DVBEITScan::DVBEITScan
DVBEITScan(const CaptureCard &parent)
Definition: videosource.cpp:1186
MythTerminal
Definition: mythterminal.h:22
HDHomeRunDevice::m_cardIp
QString m_cardIp
Definition: videosource.h:341
RegionID::RegionID
RegionID(const VideoSource &parent, signed int value, signed int min_val)
Definition: videosource.cpp:449
VideoDevice::m_minorList
QMap< uint, uint > m_minorList
Definition: videosource.cpp:862
SignalTimeout
Definition: videosource.cpp:992
CardInput::getInputID
int getInputID(void) const
Definition: videosource.h:903
FirewireGUID::FirewireGUID
FirewireGUID(const CaptureCard &parent)
Definition: videosource.cpp:1219
CetonSetting::NewValue
void NewValue(const QString &)
CaptureCard::canDelete
bool canDelete(void) override
Definition: videosource.cpp:2565
MythUICheckBoxSetting
Definition: standardsettings.h:391
VBoxDeviceIDList::m_deviceId
VBoxDeviceID * m_deviceId
Definition: videosource.h:1006
EITOnly_config::EITOnly_config
EITOnly_config(const VideoSource &_parent, StandardSetting *_setting)
Definition: videosource.cpp:623
InputGroup::m_groupNum
uint m_groupNum
Definition: videosource.cpp:2842
CardInput::CardInput
CardInput(const QString &cardtype, const QString &device, int cardid)
Definition: videosource.cpp:3094
MythTextInputDialog
Dialog prompting the user to enter a text string.
Definition: mythdialogbox.h:313
CardUtil::ATSC
@ ATSC
Definition: cardutil.h:53
VBoxDeviceIDList::UpdateDevices
void UpdateDevices(const QString &v)
Definition: videosource.cpp:1704
NoGrabber_config::Save
void Save(void) override
Definition: videosource.cpp:659
VideoSource::Name
Definition: videosource.h:215
VBoxTunerIndex::SetOldValue
void SetOldValue(const QString &s)
Definition: videosource.h:973
VBIDevice::VBIDevice
VBIDevice(const CaptureCard &parent)
Definition: videosource.cpp:870
exitcodes.h
CardUtil::IsUnscanable
static bool IsUnscanable(const QString &rawtype)
Definition: cardutil.h:152
DVBCardNum::DVBCardNum
DVBCardNum(const CaptureCard &parent)
Definition: videosource.cpp:1058
CardUtil::GetDeviceInputNames
static void GetDeviceInputNames(const QString &device, const QString &inputtype, QStringList &inputs)
Definition: cardutil.cpp:2509
VBoxConfigurationGroup::m_desc
StandardSetting * m_desc
Definition: videosource.h:511
VideoSource::getSourceName
QString getSourceName(void) const
Definition: videosource.h:190
ChannelUtil::GetAllChannels
static ChannelInfoList GetAllChannels(uint sourceid)
Returns channels that are not connected to an input and channels that are not marked as visible.
Definition: channelutil.h:253
PresetTuner::PresetTuner
PresetTuner(const CardInput &parent)
Definition: videosource.cpp:2972
CardInput::m_id
ID * m_id
Definition: videosource.h:927
V4L2util::CardName
QString CardName(void) const
Definition: v4l2util.h:49
VBoxDeviceID::m_overrideDeviceId
QString m_overrideDeviceId
Definition: videosource.h:1033
XMLTV_generic_config::m_parent
const VideoSource & m_parent
Definition: videosource.h:133
ChannelTimeout
Definition: videosource.cpp:1006
MythUIComboBoxSetting::getValueLabel
QString getValueLabel(void) const
Definition: standardsettings.cpp:488
MythUICheckBoxSetting::setValue
void setValue(const QString &newValue) override
Definition: standardsettings.cpp:716
VideoSourceEditor::NewSource
void NewSource(void)
Definition: videosource.cpp:3607
UseHDHomeRunDevice
Definition: videosource.cpp:1400
httprequest.h
XMLTVGrabber::Load
void Load(void) override
Definition: videosource.cpp:270
VideoDevice::Card
QString Card(void) const
Definition: videosource.cpp:859
MythScreenStack::AddScreen
virtual void AddScreen(MythScreenType *screen, bool allowFade=true)
Definition: mythscreenstack.cpp:52
CardUtil::GetStartingChannel
static QString GetStartingChannel(uint inputid)
Definition: cardutil.cpp:1707
VideoSourceSelector::m_initialSourceId
uint m_initialSourceId
Definition: videosource.h:71
LiveTVOrder::LiveTVOrder
LiveTVOrder(const CardInput &parent, int _value)
Definition: videosource.cpp:3061
query
MSqlQuery query(MSqlQuery::InitCon())
DeliverySystem::DeliverySystem
DeliverySystem()
Definition: videosource.cpp:2743
ShowOkPopup
MythConfirmationDialog * ShowOkPopup(const QString &message, bool showCancel)
Non-blocking version of MythPopupBox::showOkPopup()
Definition: mythdialogbox.cpp:557
kMSStdOut
@ kMSStdOut
allow access to stdout
Definition: mythsystem.h:39
CetonDeviceID::LoadedIP
void LoadedIP(const QString &)
ImportConfigurationGroup::m_parent
CaptureCard & m_parent
Definition: videosource.h:619
VBoxDeviceIDList::m_desc
StandardSetting * m_desc
Definition: videosource.h:1007
VideoSourceShow::m_initialSourceId
uint m_initialSourceId
Definition: videosource.h:88
CardUtil::CreateInputGroup
static uint CreateInputGroup(const QString &name)
Definition: cardutil.cpp:1848
DVBCardType
Definition: videosource.cpp:1128
CardUtil::LinkInputGroup
static bool LinkInputGroup(uint inputid, uint inputgroupid)
Definition: cardutil.cpp:1927
videosource.h
ImportConfigurationGroup::m_info
GroupSetting * m_info
Definition: videosource.h:620
MythUIComboBoxSetting::setValue
void setValue(int value) override
Definition: standardsettings.cpp:474
CardInputDBStorage
Definition: videosource.h:778
CaptureCard::GetRawCardType
QString GetRawCardType(void) const
Definition: videosource.cpp:2517
VideoSourceDBStorage::GetWhereClause
QString GetWhereClause(MSqlBindings &bindings) const override
Definition: videosource.cpp:209
VBoxDeviceIDList::m_oldValue
QString m_oldValue
Definition: videosource.h:1013
TunerCardAudioInput::m_lastDevice
QString m_lastDevice
Definition: videosource.h:272
InputPriority::InputPriority
InputPriority(const CardInput &parent)
Definition: videosource.cpp:3028
GroupSetting
Definition: standardsettings.h:436
find
static pid_list_t::iterator find(const PIDInfoMap &map, pid_list_t &list, pid_list_t::iterator begin, pid_list_t::iterator end, bool find_open)
Definition: dvbstreamhandler.cpp:356
diseqcsettings.h
CardUtil::ERROR_OPEN
@ ERROR_OPEN
Definition: cardutil.h:47
FirewireConnection::FirewireConnection
FirewireConnection(const CaptureCard &parent)
Definition: videosource.cpp:1301
DVBNoSeqStart
Definition: videosource.cpp:1154
CardUtil::GetVideoDevice
static QString GetVideoDevice(uint inputid)
Definition: cardutil.h:283
CetonDeviceID
Definition: videosource.h:1054
CaptureCard::Hostname
Definition: videosource.h:761
MythCoreContext::GetSetting
QString GetSetting(const QString &key, const QString &defaultval="")
Definition: mythcorecontext.cpp:919
MythSystemLegacy::Wait
uint Wait(time_t timeout=0)
Definition: mythsystemlegacy.cpp:242
InputPriority
Definition: videosource.cpp:3026
ChannelTimeout::ChannelTimeout
ChannelTimeout(const CaptureCard &parent, uint value, uint min_val)
Definition: videosource.cpp:1008
DVBConfigurationGroup::m_cardType
DVBCardType * m_cardType
Definition: videosource.h:685
MSqlQuery::prepare
bool prepare(const QString &query)
QSqlQuery::prepare() is not thread safe in Qt <= 3.3.2.
Definition: mythdbcon.cpp:808
VideoDevice::m_cardName
QString m_cardName
Definition: videosource.cpp:863
CardUtil::ERROR_PROBE
@ ERROR_PROBE
Definition: cardutil.h:49
DVBConfigurationGroup::reloadDiseqcTree
void reloadDiseqcTree(const QString &device)
Definition: videosource.cpp:3708
CaptureCardEditor::DeleteAllCaptureCardsOnHost
void DeleteAllCaptureCardsOnHost(bool doDelete)
Definition: videosource.cpp:3511
ChannelInfoList
std::vector< ChannelInfo > ChannelInfoList
Definition: channelinfo.h:131
CardUtil::DeleteInput
static bool DeleteInput(uint inputid)
Definition: cardutil.cpp:2617
CardInput::loadByInput
void loadByInput(int cardid, const QString &inputname)
Definition: videosource.cpp:3398