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