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