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