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