MythTV  master
sourceutil.cpp
Go to the documentation of this file.
1 // -*- Mode: c++ -*-
2 
3 // MythTV headers
4 #include "sourceutil.h"
5 #include "cardutil.h"
6 #include "scaninfo.h"
7 #include "mythdb.h"
8 #include "mythdirs.h"
9 #include "mythlogging.h"
10 #include "mythsystemlegacy.h"
11 
13 {
15 
16  query.prepare(
17  "SELECT mplexid, atsc_minor_chan, serviceid "
18  "FROM channel "
19  "WHERE deleted IS NULL AND "
20  " sourceid = :SOURCEID");
21  query.bindValue(":SOURCEID", sourceid);
22 
23  if (!query.exec())
24  {
25  MythDB::DBError("SourceUtil::HasDigitalChannel()", query);
26  return false;
27  }
28 
29  while (query.next())
30  {
31  uint mplexid = query.value(0).toUInt();
32  uint minor = query.value(1).toUInt();
33  uint prognum = query.value(2).toUInt();
34  mplexid = (32767 == mplexid) ? 0 : mplexid;
35 
36  if (mplexid && (minor || prognum))
37  return true;
38  }
39 
40  return false;
41 }
42 
44 {
46 
47  query.prepare(
48  "SELECT name "
49  "FROM videosource "
50  "WHERE sourceid = :SOURCEID");
51  query.bindValue(":SOURCEID", sourceid);
52 
53  if (!query.exec())
54  {
55  MythDB::DBError("SourceUtil::GetSourceName()", query);
56  return QString();
57  }
58  if (!query.next())
59  {
60  return QString();
61  }
62 
63  return query.value(0).toString();
64 }
65 
66 uint SourceUtil::GetSourceID(const QString &name)
67 {
69 
70  query.prepare(
71  "SELECT sourceid "
72  "FROM videosource "
73  "WHERE name = :NAME");
74  query.bindValue(":NAME", name);
75 
76  if (!query.exec())
77  {
78  MythDB::DBError("SourceUtil::GetSourceID()", query);
79  return 0;
80  }
81  if (!query.next())
82  {
83  return 0;
84  }
85 
86  return query.value(0).toUInt();
87 }
88 
90 {
92  query.prepare("SELECT channum "
93  "FROM channel "
94  "WHERE deleted IS NULL AND "
95  " sourceid = :SOURCEID");
96  query.bindValue(":SOURCEID", sourceid);
97 
98  if (query.exec() && query.isActive() && query.size() > 0)
99  {
100  QMap<QString,uint> counts;
101  const QRegularExpression sepExpr(R"((_|-|#|\.))");
102  while (query.next())
103  {
104  const QString channum = query.value(0).toString();
105  const int where = channum.indexOf(sepExpr);
106  if (channum.rightRef(2).startsWith("0"))
107  counts["0"]++;
108  else
109  counts[(where < 0) ? "" : QString(channum.at(where))]++;
110  }
111  QString sep = "_";
112  uint max = counts["_"];
113  static const std::array<const QString,5> s_spacers { "", "-", "#", ".", "0" };
114  for (const auto & spacer : s_spacers)
115  {
116  if (counts[spacer] > max)
117  {
118  max = counts[spacer];
119  sep = spacer;
120  }
121  }
122  return sep;
123  }
124  return "_"; // default on failure
125 }
126 
128 {
129  return QString("%1") + GetChannelSeparator(sourceid) + QString("%2");
130 }
131 
133 {
135  query.prepare("SELECT sum(1) "
136  "FROM channel "
137  "WHERE deleted IS NULL AND "
138  " sourceid = :SOURCEID");
139  query.bindValue(":SOURCEID", sourceid);
140  if (query.exec() && query.isActive() && query.next())
141  return query.value(0).toUInt();
142  return 0;
143 }
144 
145 std::vector<uint> SourceUtil::GetMplexIDs(uint sourceid)
146 {
148 
149  query.prepare(
150  "SELECT mplexid "
151  "FROM dtv_multiplex "
152  "WHERE sourceid = :SOURCEID");
153  query.bindValue(":SOURCEID", sourceid);
154 
155  std::vector<uint> list;
156  if (!query.exec())
157  {
158  MythDB::DBError("SourceUtil::GetMplexIDs()", query);
159  return list;
160  }
161 
162  while (query.next())
163  list.push_back(query.value(0).toUInt());
164 
165  return list;
166 }
167 
169  QString &grabber, QString &userid,
170  QString &passwd, QString &lineupid)
171 {
173  query.prepare(
174  "SELECT xmltvgrabber, userid, password, lineupid "
175  "FROM videosource "
176  "WHERE sourceid = :SOURCEID");
177  query.bindValue(":SOURCEID", sourceid);
178 
179  if (!query.exec() || !query.isActive())
180  {
181  MythDB::DBError("SourceUtil::GetListingsLoginData()", query);
182  return false;
183  }
184 
185  if (!query.next())
186  return false;
187 
188  grabber = query.value(0).toString();
189  userid = query.value(1).toString();
190  passwd = query.value(2).toString();
191  lineupid = query.value(3).toString();
192 
193  return true;
194 }
195 
196 static QStringList get_inputtypes(uint sourceid)
197 {
198  QStringList list;
199 
201  query.prepare(
202  "SELECT cardtype, inputname "
203  "FROM capturecard "
204  "WHERE capturecard.sourceid = :SOURCEID");
205  query.bindValue(":SOURCEID", sourceid);
206 
207  if (!query.exec() || !query.isActive())
208  MythDB::DBError("get_inputtypes()", query);
209  else
210  {
211  while (query.next())
212  {
214  QString inputtype = query.value(0).toString().toUpper();
215  QString inputname = query.value(1).toString().toUpper();
216  inputtype = ((inputtype == "DVB") && (!inputname.startsWith("DVB"))) ?
217  "V4L" : inputtype;
219  list += inputtype;
220  }
221  }
222 
223  return list;
224 }
225 
227 {
228  QStringList types = get_inputtypes(sourceid);
229  return types.size();
230 }
231 
232 bool SourceUtil::IsProperlyConnected(uint sourceid, bool strict)
233 {
234  QStringList types = get_inputtypes(sourceid);
235  QMap<QString,uint> counts;
236  for (const auto & type : qAsConst(types))
237  {
238  counts[type]++;
239 
240  counts[CardUtil::IsEncoder(type) ? "ENCODER" : "NOT_ENCODER"]++;
241  counts[CardUtil::IsUnscanable(type) ? "NO_SCAN" : "SCAN"]++;
242 
244  counts["ANALOG_TUNING"]++;
246  counts["DIGITAL_TUNING"]++;
248  counts["VIRTUAL_TUNING"]++;
249  }
250 
251  bool tune_mismatch =
252  ((counts["ANALOG_TUNING"] != 0U) && (counts["DIGITAL_TUNING"] != 0U)) ||
253  ((counts["VIRTUAL_TUNING"] != 0U) && (counts["DIGITAL_TUNING"] != 0U));
254  bool enc_mismatch = (counts["ENCODER"] != 0U) && (counts["NOT_ENCODER"] != 0U);
255  bool scan_mismatch = (counts["SCAN"] != 0U) && (counts["NO_SCAN"] != 0U);
256 
257  if (tune_mismatch)
258  {
259  uint a = counts["ANALOG_TUNERS"];
260  uint d = counts["DIGITAL_TUNERS"];
261  uint v = counts["VIRTUAL_TUNERS"];
262  LOG(VB_GENERAL, LOG_NOTICE,
263  QString("SourceUtil::IsProperlyConnected(): ") +
264  QString("Connected to %1 analog, %2 digital and %3 virtual "
265  "tuners\n\t\t\t").arg(a).arg(d).arg(v) +
266  QString("Can not mix digital with other tuning information."));
267  }
268 
269  if (enc_mismatch)
270  {
271  uint a = counts["ENCODER"];
272  uint d = counts["NOT_ENCODER"];
273  LOG(VB_GENERAL, LOG_NOTICE,
274  QString("SourceUtil::IsProperlyConnected(): ") +
275  QString("Source ID %1 ").arg(sourceid) +
276  QString("appears to be connected\n\t\t\tto %1 encoder%2, ")
277  .arg(a).arg((1 == a) ? "":"s") +
278  QString("and %1 non-encoder%2. ")
279  .arg(d).arg((1 == d) ? "":"s") +
280  QString("This is probably a bad idea."));
281  }
282 
283  if (scan_mismatch)
284  {
285  uint a = counts["SCAN"];
286  uint d = counts["NO_SCAN"];
287  LOG(VB_GENERAL, LOG_NOTICE,
288  QString("SourceUtil::IsProperlyConnected(): ") +
289  QString("Source ID %1 ").arg(sourceid) +
290  QString("appears to be connected\n\t\t\t"
291  "to %1 scanable input%2, ")
292  .arg(a).arg((1 == a) ? "":"s") +
293  QString("and %1 non-scanable input%2. ")
294  .arg(d).arg((1 == d) ? "":"s") +
295  QString("This may be a problem."));
296  }
297 
298  if (!strict)
299  return !tune_mismatch;
300 
301  return !tune_mismatch && !enc_mismatch && !scan_mismatch;
302 }
303 
304 bool SourceUtil::IsEncoder(uint sourceid, bool strict)
305 {
306  QStringList types = get_inputtypes(sourceid);
307  auto isencoder = [](const auto & type){ return CardUtil::IsEncoder(type); };
308  bool encoder = std::all_of(types.cbegin(), types.cend(), isencoder);
309 
310  // Source is connected, go by input types for type determination
311  if (!types.empty())
312  return encoder;
313 
314  // Try looking at channels if source is not connected,
316  query.prepare(
317  "SELECT atsc_minor_chan, serviceid "
318  "FROM channel "
319  "WHERE deleted IS NULL AND "
320  " sourceid = :SOURCEID");
321  query.bindValue(":SOURCEID", sourceid);
322 
323  bool has_any_chan = false;
324  if (!query.exec() || !query.isActive())
325  MythDB::DBError("SourceUtil::IsEncoder", query);
326  else
327  {
328  while (query.next())
329  {
330  encoder &= !query.value(0).toBool() && !query.value(1).toBool();
331  has_any_chan = true;
332  }
333  }
334 
335  return (strict && !has_any_chan) ? false: encoder;
336 }
337 
339 {
340  QStringList types = get_inputtypes(sourceid);
341  if (types.empty())
342  return true;
343  auto unscannable = [](const auto & type) { return CardUtil::IsUnscanable(type); };
344  return std::all_of(types.cbegin(), types.cend(), unscannable);
345 }
346 
348 {
349  std::vector<uint> inputs = CardUtil::GetInputIDs(sourceid);
350  auto ccpresent = [](uint input)
352  CardUtil::GetRawInputType(input) == "HDHOMERUN"; };
353  return std::any_of(inputs.cbegin(), inputs.cend(), ccpresent);
354 }
355 
357 {
359  query.prepare("SELECT sourceid FROM videosource");
360 
361  if (!query.exec() || !query.isActive())
362  {
363  MythDB::DBError("SourceUtil::IsAnySourceScanable", query);
364  return false;
365  }
366 
367  while (query.next())
368  {
369  if (!IsUnscanable(query.value(0).toUInt()))
370  return true;
371  }
372 
373  return false;
374 }
375 
377 {
379  query.prepare(
380  "SELECT sourceid FROM videosource WHERE sourceid = :SOURCEID");
381  query.bindValue(":SOURCEID", sourceid);
382 
383  if (!query.exec() || !query.isActive())
384  {
385  MythDB::DBError("SourceUtil::IsSourceIDValid", query);
386  return false;
387  }
388 
389  return query.next();
390 }
391 
392 bool SourceUtil::UpdateChannelsFromListings(uint sourceid, const QString& inputtype, bool wait)
393 {
394  if (wait)
395  {
396  QString cmd = GetAppBinDir() +
397  "mythfilldatabase";
398  QStringList args;
399  args.append("--only-update-channels");
400 
401  if (sourceid)
402  {
403  args.append(QString("--sourceid"));
404  args.append(QString::number(sourceid));
405  }
406  if (!inputtype.isEmpty())
407  {
408  args.append(QString("--cardtype"));
409  args.append(inputtype);
410  }
411 
413  getchan.Run();
414  getchan.Wait();
415  }
416  else
417  {
418  QString cmd = GetAppBinDir() +
419  "mythfilldatabase --only-update-channels";
420  if (sourceid)
421  cmd += QString(" --sourceid %1").arg(sourceid);
422  if (!inputtype.isEmpty())
423  cmd += QString(" --cardtype %1").arg(inputtype);
424  cmd += logPropagateArgs;
425 
426  myth_system(cmd);
427  }
428 
429  return true;
430 }
431 
432 bool SourceUtil::UpdateSource( uint sourceid, const QString& sourcename,
433  const QString& grabber, const QString& userid,
434  const QString& freqtable, const QString& lineupid,
435  const QString& password, bool useeit,
436  const QString& configpath, int nitid,
437  uint bouquetid, uint regionid, uint scanfrequency)
438 {
440 
441  query.prepare("UPDATE videosource SET name = :NAME, xmltvgrabber = :XMLTVGRABBER, "
442  "userid = :USERID, freqtable = :FREQTABLE, lineupid = :LINEUPID,"
443  "password = :PASSWORD, useeit = :USEEIT, configpath = :CONFIGPATH, "
444  "dvb_nit_id = :NITID, bouquet_id = :BOUQUETID, region_id = :REGIONID, "
445  "scanfrequency = :SCANFREQUENCY "
446  "WHERE sourceid = :SOURCEID");
447 
448  query.bindValue(":NAME", sourcename);
449  query.bindValue(":XMLTVGRABBER", grabber);
450  query.bindValue(":USERID", userid);
451  query.bindValue(":FREQTABLE", freqtable);
452  query.bindValue(":LINEUPID", lineupid);
453  query.bindValue(":PASSWORD", password);
454  query.bindValue(":USEEIT", useeit);
455  query.bindValue(":CONFIGPATH", configpath.isEmpty() ? nullptr : configpath);
456  query.bindValue(":NITID", nitid);
457  query.bindValue(":BOUQUETID", bouquetid);
458  query.bindValue(":REGIONID", regionid);
459  query.bindValue(":SOURCEID", sourceid);
460  query.bindValue(":SCANFREQUENCY", scanfrequency);
461 
462  if (!query.exec() || !query.isActive())
463  {
464  MythDB::DBError("Updating Video Source", query);
465  return false;
466  }
467 
468  return true;
469 }
470 
471 int SourceUtil::CreateSource( const QString& sourcename,
472  const QString& grabber, const QString& userid,
473  const QString& freqtable, const QString& lineupid,
474  const QString& password, bool useeit,
475  const QString& configpath, int nitid,
476  uint bouquetid, uint regionid, uint scanfrequency)
477 {
479 
480  query.prepare("INSERT INTO videosource (name,xmltvgrabber,userid,freqtable,lineupid,"
481  "password,useeit,configpath,dvb_nit_id,bouquet_id,region_id, scanfrequency) "
482  "VALUES (:NAME, :XMLTVGRABBER, :USERID, :FREQTABLE, :LINEUPID, :PASSWORD, "
483  ":USEEIT, :CONFIGPATH, :NITID, :BOUQUETID, :REGIONID, :SCANFREQUENCY)");
484 
485  query.bindValue(":NAME", sourcename);
486  query.bindValue(":XMLTVGRABBER", grabber);
487  query.bindValue(":USERID", userid);
488  query.bindValue(":FREQTABLE", freqtable);
489  query.bindValue(":LINEUPID", lineupid);
490  query.bindValue(":PASSWORD", password);
491  query.bindValue(":USEEIT", useeit);
492  query.bindValue(":CONFIGPATH", configpath.isEmpty() ? nullptr : configpath);
493  query.bindValue(":NITID", nitid);
494  query.bindValue(":BOUQUETID", bouquetid);
495  query.bindValue(":REGIONID", regionid);
496  query.bindValue(":SCANFREQUENCY", scanfrequency);
497 
498  if (!query.exec() || !query.isActive())
499  {
500  MythDB::DBError("Adding Video Source", query);
501  return -1;
502  }
503 
504  query.prepare("SELECT MAX(sourceid) FROM videosource");
505 
506  if (!query.exec())
507  {
508  MythDB::DBError("CreateSource maxsource", query);
509  return -1;
510  }
511 
512  int sourceid = -1; /* must be int not uint because of return type. */
513 
514  if (query.next())
515  sourceid = query.value(0).toInt();
516 
517  return sourceid;
518 }
519 
521 {
523 
524  // Delete the transports associated with the source
525  query.prepare("DELETE FROM dtv_multiplex "
526  "WHERE sourceid = :SOURCEID");
527  query.bindValue(":SOURCEID", sourceid);
528 
529  if (!query.exec() || !query.isActive())
530  {
531  MythDB::DBError("Deleting transports", query);
532  return false;
533  }
534 
535  // Delete the channels associated with the source
536  query.prepare("UPDATE channel "
537  "SET deleted = NOW(), mplexid = 0, sourceid = 0 "
538  "WHERE deleted IS NULL AND sourceid = :SOURCEID");
539  query.bindValue(":SOURCEID", sourceid);
540 
541  if (!query.exec() || !query.isActive())
542  {
543  MythDB::DBError("Deleting Channels", query);
544  return false;
545  }
546 
547  // Detach the inputs associated with the source
548  query.prepare("UPDATE capturecard "
549  "SET sourceid = 0 "
550  "WHERE sourceid = :SOURCEID");
551  query.bindValue(":SOURCEID", sourceid);
552 
553  if (!query.exec() || !query.isActive())
554  {
555  MythDB::DBError("Deleting inputs", query);
556  return false;
557  }
558 
559  // Delete all the saved channel scans for this source
561 
562  // Delete the source itself
563  query.prepare("DELETE FROM videosource "
564  "WHERE sourceid = :SOURCEID");
565  query.bindValue(":SOURCEID", sourceid);
566 
567  if (!query.exec() || !query.isActive())
568  {
569  MythDB::DBError("Deleting VideoSource", query);
570  return false;
571  }
572 
573  return true;
574 }
575 
577 {
579 
580  // Detach all inputs from any source
581  query.prepare("UPDATE capturecard "
582  "SET sourceid = 0");
583  if (!query.exec() || !query.isActive())
584  {
585  MythDB::DBError("Deleting sources", query);
586  return false;
587  }
588 
589  // Delete all channels
590  query.prepare("UPDATE channel "
591  "SET deleted = NOW(), mplexid = 0, sourceid = 0 "
592  "WHERE deleted IS NULL");
593 
594  if (!query.exec() || !query.isActive())
595  {
596  MythDB::DBError("Deleting all Channels", query);
597  return false;
598  }
599 
600  return (query.exec("TRUNCATE TABLE program") &&
601  query.exec("TRUNCATE TABLE videosource") &&
602  query.exec("TRUNCATE TABLE credits") &&
603  query.exec("TRUNCATE TABLE programrating") &&
604  query.exec("TRUNCATE TABLE programgenres") &&
605  query.exec("TRUNCATE TABLE dtv_multiplex") &&
606  query.exec("TRUNCATE TABLE diseqc_config") &&
607  query.exec("TRUNCATE TABLE diseqc_tree") &&
608  query.exec("TRUNCATE TABLE eit_cache") &&
609  query.exec("TRUNCATE TABLE channelgroup") &&
610  query.exec("TRUNCATE TABLE channelgroupnames"));
611 }
MSqlQuery::isActive
bool isActive(void) const
Definition: mythdbcon.h:203
MSqlQuery::next
bool next(void)
Wrap QSqlQuery::next() so we can display the query results.
Definition: mythdbcon.cpp:783
MSqlQuery
QSqlQuery wrapper that fetches a DB connection from the connection pool.
Definition: mythdbcon.h:124
build_compdb.args
args
Definition: build_compdb.py:11
CardUtil::GetInputIDs
static std::vector< uint > GetInputIDs(const QString &videodevice=QString(), const QString &rawtype=QString(), const QString &inputname=QString(), QString hostname=QString())
Returns all inputids of inputs that uses the specified videodevice if specified, and optionally rawty...
Definition: cardutil.cpp:1271
CardUtil::IsTuningVirtual
static bool IsTuningVirtual(const QString &rawtype)
Definition: cardutil.h:200
MSqlQuery::size
int size(void) const
Definition: mythdbcon.h:202
SourceUtil::DeleteSource
static bool DeleteSource(uint sourceid)
Definition: sourceutil.cpp:520
mythdb.h
MythSystemLegacy
Definition: mythsystemlegacy.h:67
SourceUtil::GetSourceName
static QString GetSourceName(uint sourceid)
Definition: sourceutil.cpp:43
SourceUtil::IsCableCardPresent
static bool IsCableCardPresent(uint sourceid)
Definition: sourceutil.cpp:347
SourceUtil::GetChannelCount
static uint GetChannelCount(uint sourceid)
Definition: sourceutil.cpp:132
SourceUtil::IsProperlyConnected
static bool IsProperlyConnected(uint sourceid, bool strict=false)
Definition: sourceutil.cpp:232
SourceUtil::GetMplexIDs
static std::vector< uint > GetMplexIDs(uint sourceid)
Definition: sourceutil.cpp:145
MSqlQuery::value
QVariant value(int i) const
Definition: mythdbcon.h:197
arg
arg(title).arg(filename).arg(doDelete))
MSqlQuery::exec
bool exec(void)
Wrap QSqlQuery::exec() so we can display SQL.
Definition: mythdbcon.cpp:603
SourceUtil::GetChannelSeparator
static QString GetChannelSeparator(uint sourceid)
Definition: sourceutil.cpp:89
types
static const struct wl_interface * types[]
Definition: idle_inhibit_unstable_v1.c:39
LOG
#define LOG(_MASK_, _LEVEL_, _QSTRING_)
Definition: mythlogging.h:23
mythdirs.h
SourceUtil::GetChannelFormat
static QString GetChannelFormat(uint sourceid)
Definition: sourceutil.cpp:127
myth_system
uint myth_system(const QString &command, uint flags, std::chrono::seconds timeout)
Definition: mythsystemlegacy.cpp:502
mythsystemlegacy.h
SourceUtil::IsAnySourceScanable
static bool IsAnySourceScanable(void)
Definition: sourceutil.cpp:356
SourceUtil::IsSourceIDValid
static bool IsSourceIDValid(uint sourceid)
Definition: sourceutil.cpp:376
sourceutil.h
SourceUtil::UpdateChannelsFromListings
static bool UpdateChannelsFromListings(uint sourceid, const QString &inputtype=QString(), bool wait=false)
Definition: sourceutil.cpp:392
CardUtil::IsTuningDigital
static bool IsTuningDigital(const QString &rawtype)
Definition: cardutil.h:185
minor
#define minor(X)
Definition: compat.h:138
mythlogging.h
CardUtil::IsEncoder
static bool IsEncoder(const QString &rawtype)
Definition: cardutil.h:130
MSqlQuery::InitCon
static MSqlQueryInfo InitCon(ConnectionReuse _reuse=kNormalConnection)
Only use this in combination with MSqlQuery constructor.
Definition: mythdbcon.cpp:535
MythDB::DBError
static void DBError(const QString &where, const MSqlQuery &query)
Definition: mythdb.cpp:178
SourceUtil::UpdateSource
static bool UpdateSource(uint sourceid, const QString &sourcename, const QString &grabber, const QString &userid, const QString &freqtable, const QString &lineupid, const QString &password, bool useeit, const QString &configpath, int nitid, uint bouquetid, uint regionid, uint scanfrequency)
Definition: sourceutil.cpp:432
MythSystemLegacy::Wait
uint Wait(std::chrono::seconds timeout=0s)
Definition: mythsystemlegacy.cpp:242
scaninfo.h
SourceUtil::IsUnscanable
static bool IsUnscanable(uint sourceid)
Definition: sourceutil.cpp:338
uint
unsigned int uint
Definition: compat.h:140
SourceUtil::HasDigitalChannel
static bool HasDigitalChannel(uint sourceid)
Definition: sourceutil.cpp:12
ScanInfo::DeleteScansFromSource
static void DeleteScansFromSource(uint sourceid)
Definition: scaninfo.cpp:257
kMSRunShell
@ kMSRunShell
run process through shell
Definition: mythsystem.h:42
kMSAutoCleanup
@ kMSAutoCleanup
automatically delete if backgrounded
Definition: mythsystem.h:44
CardUtil::GetRawInputType
static QString GetRawInputType(uint inputid)
Definition: cardutil.h:282
CardUtil::IsCableCardPresent
static bool IsCableCardPresent(uint inputid, const QString &inputType)
Definition: cardutil.cpp:111
cardutil.h
MSqlQuery::bindValue
void bindValue(const QString &placeholder, const QVariant &val)
Add a single binding.
Definition: mythdbcon.cpp:864
GetAppBinDir
QString GetAppBinDir(void)
Definition: mythdirs.cpp:221
SourceUtil::DeleteAllSources
static bool DeleteAllSources(void)
Definition: sourceutil.cpp:576
SourceUtil::IsEncoder
static bool IsEncoder(uint sourceid, bool strict=false)
Definition: sourceutil.cpp:304
SourceUtil::GetListingsLoginData
static bool GetListingsLoginData(uint sourceid, QString &grabber, QString &userid, QString &passwd, QString &lineupid)
Definition: sourceutil.cpp:168
logPropagateArgs
QString logPropagateArgs
Definition: logging.cpp:85
MythSystemLegacy::Run
void Run(std::chrono::seconds timeout=0s)
Runs a command inside the /bin/sh shell. Returns immediately.
Definition: mythsystemlegacy.cpp:212
d
static const iso6937table * d
Definition: iso6937tables.cpp:1025
SourceUtil::GetConnectionCount
static uint GetConnectionCount(uint sourceid)
Definition: sourceutil.cpp:226
SourceUtil::CreateSource
static int CreateSource(const QString &sourcename, const QString &grabber, const QString &userid, const QString &freqtable, const QString &lineupid, const QString &password, bool useeit, const QString &configpath, int nitid, uint bouquetid, uint regionid, uint scanfrequency)
Definition: sourceutil.cpp:471
get_inputtypes
static QStringList get_inputtypes(uint sourceid)
Definition: sourceutil.cpp:196
CardUtil::IsTuningAnalog
static bool IsTuningAnalog(const QString &rawtype)
Definition: cardutil.h:193
CardUtil::IsUnscanable
static bool IsUnscanable(const QString &rawtype)
Definition: cardutil.h:153
SourceUtil::GetSourceID
static uint GetSourceID(const QString &name)
Definition: sourceutil.cpp:66
query
MSqlQuery query(MSqlQuery::InitCon())
MSqlQuery::prepare
bool prepare(const QString &query)
QSqlQuery::prepare() is not thread safe in Qt <= 3.3.2.
Definition: mythdbcon.cpp:808