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