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