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