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.rightRef(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 std::array<const QString,5> s_spacers { "", "-", "#", ".", "0" };
117  for (const auto & spacer : s_spacers)
118  {
119  if (counts[spacer] > max)
120  {
121  max = counts[spacer];
122  sep = spacer;
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 std::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  std::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  QStringList types = get_inputtypes(sourceid);
310  auto isencoder = [](const auto & type){ return CardUtil::IsEncoder(type); };
311  bool encoder = std::all_of(types.cbegin(), types.cend(), isencoder);
312 
313  // Source is connected, go by input types for type determination
314  if (!types.empty())
315  return encoder;
316 
317  // Try looking at channels if source is not connected,
319  query.prepare(
320  "SELECT atsc_minor_chan, serviceid "
321  "FROM channel "
322  "WHERE deleted IS NULL AND "
323  " sourceid = :SOURCEID");
324  query.bindValue(":SOURCEID", sourceid);
325 
326  bool has_any_chan = false;
327  if (!query.exec() || !query.isActive())
328  MythDB::DBError("SourceUtil::IsEncoder", query);
329  else
330  {
331  while (query.next())
332  {
333  encoder &= !query.value(0).toBool() && !query.value(1).toBool();
334  has_any_chan = true;
335  }
336  }
337 
338  return (strict && !has_any_chan) ? false: encoder;
339 }
340 
342 {
343  QStringList types = get_inputtypes(sourceid);
344  if (types.empty())
345  return true;
346  auto unscannable = [](const auto & type) { return CardUtil::IsUnscanable(type); };
347  return std::all_of(types.cbegin(), types.cend(), unscannable);
348 }
349 
351 {
352  std::vector<uint> inputs = CardUtil::GetInputIDs(sourceid);
353  auto ccpresent = [](uint input)
355  CardUtil::GetRawInputType(input) == "HDHOMERUN"; };
356  return std::any_of(inputs.cbegin(), inputs.cend(), ccpresent);
357 }
358 
360 {
362  query.prepare("SELECT sourceid FROM videosource");
363 
364  if (!query.exec() || !query.isActive())
365  {
366  MythDB::DBError("SourceUtil::IsAnySourceScanable", query);
367  return false;
368  }
369 
370  while (query.next())
371  {
372  if (!IsUnscanable(query.value(0).toUInt()))
373  return true;
374  }
375 
376  return false;
377 }
378 
380 {
382  query.prepare(
383  "SELECT sourceid FROM videosource WHERE sourceid = :SOURCEID");
384  query.bindValue(":SOURCEID", sourceid);
385 
386  if (!query.exec() || !query.isActive())
387  {
388  MythDB::DBError("SourceUtil::IsSourceIDValid", query);
389  return false;
390  }
391 
392  return query.next();
393 }
394 
395 bool SourceUtil::UpdateChannelsFromListings(uint sourceid, const QString& inputtype, bool wait)
396 {
397  if (wait)
398  {
399  QString cmd = GetAppBinDir() +
400  "mythfilldatabase";
401  QStringList args;
402  args.append("--only-update-channels");
403 
404  if (sourceid)
405  {
406  args.append(QString("--sourceid"));
407  args.append(QString::number(sourceid));
408  }
409  if (!inputtype.isEmpty())
410  {
411  args.append(QString("--cardtype"));
412  args.append(inputtype);
413  }
414 
416  getchan.Run();
417  getchan.Wait();
418  }
419  else
420  {
421  QString cmd = GetAppBinDir() +
422  "mythfilldatabase --only-update-channels";
423  if (sourceid)
424  cmd += QString(" --sourceid %1").arg(sourceid);
425  if (!inputtype.isEmpty())
426  cmd += QString(" --cardtype %1").arg(inputtype);
427  cmd += logPropagateArgs;
428 
429  myth_system(cmd);
430  }
431 
432  return true;
433 }
434 
435 bool SourceUtil::UpdateSource( uint sourceid, const QString& sourcename,
436  const QString& grabber, const QString& userid,
437  const QString& freqtable, const QString& lineupid,
438  const QString& password, bool useeit,
439  const QString& configpath, int nitid,
440  uint bouquetid, uint regionid, uint scanfrequency)
441 {
443 
444  query.prepare("UPDATE videosource SET name = :NAME, xmltvgrabber = :XMLTVGRABBER, "
445  "userid = :USERID, freqtable = :FREQTABLE, lineupid = :LINEUPID,"
446  "password = :PASSWORD, useeit = :USEEIT, configpath = :CONFIGPATH, "
447  "dvb_nit_id = :NITID, bouquet_id = :BOUQUETID, region_id = :REGIONID, "
448  "scanfrequency = :SCANFREQUENCY "
449  "WHERE sourceid = :SOURCEID");
450 
451  query.bindValue(":NAME", sourcename);
452  query.bindValue(":XMLTVGRABBER", grabber);
453  query.bindValue(":USERID", userid);
454  query.bindValue(":FREQTABLE", freqtable);
455  query.bindValue(":LINEUPID", lineupid);
456  query.bindValue(":PASSWORD", password);
457  query.bindValue(":USEEIT", useeit);
458  query.bindValue(":CONFIGPATH", configpath.isEmpty() ? nullptr : configpath);
459  query.bindValue(":NITID", nitid);
460  query.bindValue(":BOUQUETID", bouquetid);
461  query.bindValue(":REGIONID", regionid);
462  query.bindValue(":SOURCEID", sourceid);
463  query.bindValue(":SCANFREQUENCY", scanfrequency);
464 
465  if (!query.exec() || !query.isActive())
466  {
467  MythDB::DBError("Updating Video Source", query);
468  return false;
469  }
470 
471  return true;
472 }
473 
474 int SourceUtil::CreateSource( const QString& sourcename,
475  const QString& grabber, const QString& userid,
476  const QString& freqtable, const QString& lineupid,
477  const QString& password, bool useeit,
478  const QString& configpath, int nitid,
479  uint bouquetid, uint regionid, uint scanfrequency)
480 {
482 
483  query.prepare("INSERT INTO videosource (name,xmltvgrabber,userid,freqtable,lineupid,"
484  "password,useeit,configpath,dvb_nit_id,bouquet_id,region_id, scanfrequency) "
485  "VALUES (:NAME, :XMLTVGRABBER, :USERID, :FREQTABLE, :LINEUPID, :PASSWORD, "
486  ":USEEIT, :CONFIGPATH, :NITID, :BOUQUETID, :REGIONID, :SCANFREQUENCY)");
487 
488  query.bindValue(":NAME", sourcename);
489  query.bindValue(":XMLTVGRABBER", grabber);
490  query.bindValue(":USERID", userid);
491  query.bindValue(":FREQTABLE", freqtable);
492  query.bindValue(":LINEUPID", lineupid);
493  query.bindValue(":PASSWORD", password);
494  query.bindValue(":USEEIT", useeit);
495  query.bindValue(":CONFIGPATH", configpath.isEmpty() ? nullptr : configpath);
496  query.bindValue(":NITID", nitid);
497  query.bindValue(":BOUQUETID", bouquetid);
498  query.bindValue(":REGIONID", regionid);
499  query.bindValue(":SCANFREQUENCY", scanfrequency);
500 
501  if (!query.exec() || !query.isActive())
502  {
503  MythDB::DBError("Adding Video Source", query);
504  return -1;
505  }
506 
507  query.prepare("SELECT MAX(sourceid) FROM videosource");
508 
509  if (!query.exec())
510  {
511  MythDB::DBError("CreateSource maxsource", query);
512  return -1;
513  }
514 
515  int sourceid = -1; /* must be int not uint because of return type. */
516 
517  if (query.next())
518  sourceid = query.value(0).toInt();
519 
520  return sourceid;
521 }
522 
524 {
526 
527  // Delete the transports associated with the source
528  query.prepare("DELETE FROM dtv_multiplex "
529  "WHERE sourceid = :SOURCEID");
530  query.bindValue(":SOURCEID", sourceid);
531 
532  if (!query.exec() || !query.isActive())
533  {
534  MythDB::DBError("Deleting transports", query);
535  return false;
536  }
537 
538  // Delete the channels associated with the source
539  query.prepare("UPDATE channel "
540  "SET deleted = NOW(), mplexid = 0, sourceid = 0 "
541  "WHERE deleted IS NULL AND sourceid = :SOURCEID");
542  query.bindValue(":SOURCEID", sourceid);
543 
544  if (!query.exec() || !query.isActive())
545  {
546  MythDB::DBError("Deleting Channels", query);
547  return false;
548  }
549 
550  // Detach the inputs associated with the source
551  query.prepare("UPDATE capturecard "
552  "SET sourceid = 0 "
553  "WHERE sourceid = :SOURCEID");
554  query.bindValue(":SOURCEID", sourceid);
555 
556  if (!query.exec() || !query.isActive())
557  {
558  MythDB::DBError("Deleting inputs", query);
559  return false;
560  }
561 
562  // Delete all the saved channel scans for this source
564 
565  // Delete the source itself
566  query.prepare("DELETE FROM videosource "
567  "WHERE sourceid = :SOURCEID");
568  query.bindValue(":SOURCEID", sourceid);
569 
570  if (!query.exec() || !query.isActive())
571  {
572  MythDB::DBError("Deleting VideoSource", query);
573  return false;
574  }
575 
576  return true;
577 }
578 
580 {
582 
583  // Detach all inputs from any source
584  query.prepare("UPDATE capturecard "
585  "SET sourceid = 0");
586  if (!query.exec() || !query.isActive())
587  {
588  MythDB::DBError("Deleting sources", query);
589  return false;
590  }
591 
592  // Delete all channels
593  query.prepare("UPDATE channel "
594  "SET deleted = NOW(), mplexid = 0, sourceid = 0 "
595  "WHERE deleted IS NULL");
596 
597  if (!query.exec() || !query.isActive())
598  {
599  MythDB::DBError("Deleting all Channels", query);
600  return false;
601  }
602 
603  return (query.exec("TRUNCATE TABLE program") &&
604  query.exec("TRUNCATE TABLE videosource") &&
605  query.exec("TRUNCATE TABLE credits") &&
606  query.exec("TRUNCATE TABLE programrating") &&
607  query.exec("TRUNCATE TABLE programgenres") &&
608  query.exec("TRUNCATE TABLE dtv_multiplex") &&
609  query.exec("TRUNCATE TABLE diseqc_config") &&
610  query.exec("TRUNCATE TABLE diseqc_tree") &&
611  query.exec("TRUNCATE TABLE eit_cache") &&
612  query.exec("TRUNCATE TABLE channelgroup") &&
613  query.exec("TRUNCATE TABLE channelgroupnames"));
614 }
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::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:1275
CardUtil::IsTuningVirtual
static bool IsTuningVirtual(const QString &rawtype)
Definition: cardutil.h:199
MSqlQuery::size
int size(void) const
Definition: mythdbcon.h:203
SourceUtil::DeleteSource
static bool DeleteSource(uint sourceid)
Definition: sourceutil.cpp:523
myth_system
uint myth_system(const QString &command, uint flags, uint timeout)
Definition: mythsystemlegacy.cpp:501
mythdb.h
MythSystemLegacy
Definition: mythsystemlegacy.h:68
SourceUtil::GetSourceName
static QString GetSourceName(uint sourceid)
Definition: sourceutil.cpp:46
SourceUtil::IsCableCardPresent
static bool IsCableCardPresent(uint sourceid)
Definition: sourceutil.cpp:350
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
SourceUtil::GetMplexIDs
static std::vector< uint > GetMplexIDs(uint sourceid)
Definition: sourceutil.cpp:148
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
mythsystemlegacy.h
SourceUtil::IsAnySourceScanable
static bool IsAnySourceScanable(void)
Definition: sourceutil.cpp:359
SourceUtil::IsSourceIDValid
static bool IsSourceIDValid(uint sourceid)
Definition: sourceutil.cpp:379
sourceutil.h
SourceUtil::UpdateChannelsFromListings
static bool UpdateChannelsFromListings(uint sourceid, const QString &inputtype=QString(), bool wait=false)
Definition: sourceutil.cpp:395
CardUtil::IsTuningDigital
static bool IsTuningDigital(const QString &rawtype)
Definition: cardutil.h:184
minor
#define minor(X)
Definition: compat.h:138
mythlogging.h
CardUtil::IsEncoder
static bool IsEncoder(const QString &rawtype)
Definition: cardutil.h:129
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:435
scaninfo.h
SourceUtil::IsUnscanable
static bool IsUnscanable(uint sourceid)
Definition: sourceutil.cpp:341
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:257
kMSRunShell
@ kMSRunShell
run process through shell
Definition: mythsystem.h:41
kMSAutoCleanup
@ kMSAutoCleanup
automatically delete if backgrounded
Definition: mythsystem.h:43
CardUtil::GetRawInputType
static QString GetRawInputType(uint inputid)
Definition: cardutil.h:281
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:579
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:87
d
static const iso6937table * d
Definition: iso6937tables.cpp:1025
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:474
get_inputtypes
static QStringList get_inputtypes(uint sourceid)
Definition: sourceutil.cpp:199
CardUtil::IsTuningAnalog
static bool IsTuningAnalog(const QString &rawtype)
Definition: cardutil.h:192
CardUtil::IsUnscanable
static bool IsUnscanable(const QString &rawtype)
Definition: cardutil.h:152
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