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