MythTV  master
channelgroup.cpp
Go to the documentation of this file.
1 // c++
2 #include <algorithm>
3 
4 // mythtv
5 #include "libmythbase/mythdb.h"
7 
8 #include "channelgroup.h"
9 #include "channelutil.h"
10 #include "sourceutil.h"
11 
12 #define LOC QString("Channel Group: ")
13 
14 inline bool lt_group(const ChannelGroupItem &a, const ChannelGroupItem &b)
15 {
16  return QString::localeAwareCompare(a.m_name, b.m_name) < 0;
17 }
18 
19 bool ChannelGroup::ToggleChannel(uint chanid, int changrpid, bool delete_chan)
20 {
21  // Check if it already exists for that chanid...
23  query.prepare(
24  "SELECT channelgroup.id "
25  "FROM channelgroup "
26  "WHERE channelgroup.chanid = :CHANID AND "
27  "channelgroup.grpid = :GRPID "
28  "LIMIT 1");
29  query.bindValue(":CHANID", chanid);
30  query.bindValue(":GRPID", changrpid);
31 
32  if (!query.exec())
33  {
34  MythDB::DBError("ChannelGroup::ToggleChannel", query);
35  return false;
36  }
37  if (query.next() && delete_chan)
38  {
39  // We have a record...Remove it to toggle...
40  QString id = query.value(0).toString();
41  query.prepare("DELETE FROM channelgroup WHERE id = :CHANID");
42  query.bindValue(":CHANID", id);
43  if (!query.exec())
44  MythDB::DBError("ChannelGroup::ToggleChannel -- delete", query);
45  LOG(VB_GENERAL, LOG_INFO, LOC +
46  QString("Removing channel %1 from group %2.").arg(id).arg(changrpid));
47  }
48  else if (query.size() == 0)
49  {
50  // We have no record...Add one to toggle...
51  query.prepare("INSERT INTO channelgroup (chanid,grpid) "
52  "VALUES (:CHANID, :GRPID)");
53  query.bindValue(":CHANID", chanid);
54  query.bindValue(":GRPID", changrpid);
55  if (!query.exec())
56  MythDB::DBError("ChannelGroup::ToggleChannel -- insert", query);
57  LOG(VB_GENERAL, LOG_INFO, LOC +
58  QString("Adding channel %1 to group %2.")
59  .arg(chanid).arg(changrpid));
60  }
61  else
62  {
63  LOG(VB_GENERAL, LOG_INFO, LOC +
64  QString("Channel %1 already present in group %2.")
65  .arg(chanid).arg(changrpid));
66  }
67 
68  return true;
69 }
70 
71 bool ChannelGroup::AddChannel(uint chanid, int changrpid)
72 {
73  // Make sure the channel group exists
75  query.prepare(
76  "SELECT grpid, name FROM channelgroupnames "
77  "WHERE grpid = :GRPID");
78  query.bindValue(":GRPID", changrpid);
79 
80  if (!query.exec())
81  {
82  MythDB::DBError("ChannelGroup::AddChannel", query);
83  return false;
84  }
85  if (query.size() == 0)
86  {
87  LOG(VB_GENERAL, LOG_INFO, LOC +
88  QString("AddChannel failed to find channel group %1.").arg(changrpid));
89  return false;
90  }
91 
92  query.first();
93  QString groupName = query.value(1).toString();
94 
95  // Make sure the channel exists and is visible
96  query.prepare(
97  "SELECT chanid, name FROM channel "
98  "WHERE chanid = :CHANID "
99  "AND visible > 0 "
100  "AND deleted IS NULL");
101  query.bindValue(":CHANID", chanid);
102 
103  if (!query.exec())
104  {
105  MythDB::DBError("ChannelGroup::AddChannel", query);
106  return false;
107  }
108  if (query.size() == 0)
109  {
110  LOG(VB_GENERAL, LOG_INFO, LOC +
111  QString("AddChannel failed to find channel %1.").arg(chanid));
112  return false;
113  }
114 
115  query.first();
116  QString chanName = query.value(1).toString();
117 
118  // Check if it already exists for that chanid...
119  query.prepare(
120  "SELECT channelgroup.id "
121  "FROM channelgroup "
122  "WHERE channelgroup.chanid = :CHANID AND "
123  "channelgroup.grpid = :GRPID "
124  "LIMIT 1");
125  query.bindValue(":CHANID", chanid);
126  query.bindValue(":GRPID", changrpid);
127 
128  if (!query.exec())
129  {
130  MythDB::DBError("ChannelGroup::AddChannel", query);
131  return false;
132  }
133  if (query.size() == 0)
134  {
135  // We have no record...Add one to toggle...
136  query.prepare("INSERT INTO channelgroup (chanid,grpid) "
137  "VALUES (:CHANID, :GRPID)");
138  query.bindValue(":CHANID", chanid);
139  query.bindValue(":GRPID", changrpid);
140  if (!query.exec())
141  MythDB::DBError("ChannelGroup::AddChannel -- insert", query);
142  LOG(VB_GENERAL, LOG_INFO, LOC +
143  QString("Adding channel %1 to group %2.")
144  .arg(chanName, groupName));
145  }
146 
147  return true;
148 }
149 
150 bool ChannelGroup::DeleteChannel(uint chanid, int changrpid)
151 {
152  // Check if it already exists for that chanid...
153  MSqlQuery query(MSqlQuery::InitCon());
154  query.prepare(
155  "SELECT channelgroup.id "
156  "FROM channelgroup "
157  "WHERE channelgroup.chanid = :CHANID AND "
158  "channelgroup.grpid = :GRPID "
159  "LIMIT 1");
160  query.bindValue(":CHANID", chanid);
161  query.bindValue(":GRPID", changrpid);
162 
163  if (!query.exec())
164  {
165  MythDB::DBError("ChannelGroup::DeleteChannel", query);
166  return false;
167  }
168  if (query.next())
169  {
170  // We have a record...Remove it to toggle...
171  QString id = query.value(0).toString();
172  query.prepare("DELETE FROM channelgroup WHERE id = :CHANID");
173  query.bindValue(":CHANID", id);
174  if (!query.exec())
175  MythDB::DBError("ChannelGroup::DeleteChannel -- delete", query);
176  LOG(VB_GENERAL, LOG_INFO, LOC +
177  QString("Removing channel with id=%1.").arg(id));
178  }
179 
180  return true;
181 }
182 
183 // Create a list of all channel groups that are manually configured
184 //
185 // The channel groups are returned in the following order:
186 // - Favorites
187 // - Manually created channel groups, sorted by name.
188 //
190 {
191  ChannelGroupList list;
192  QString qstr;
193  MSqlQuery query(MSqlQuery::InitCon());
194 
195  // Always the Favorites with group id 1
196  if (includeEmpty)
197  {
198  qstr = "SELECT grpid, name FROM channelgroupnames"
199  " WHERE grpid = 1";
200  }
201  else
202  {
203  qstr = "SELECT DISTINCT t1.grpid, name FROM channelgroupnames t1, channelgroup t2"
204  " WHERE t1.grpid = t2.grpid"
205  " AND t1.grpid = 1";
206  }
207  query.prepare(qstr);
208  if (!query.exec())
209  MythDB::DBError("ChannelGroup::GetChannelGroups Favorites", query);
210  else
211  {
212  if (query.next())
213  {
214  ChannelGroupItem group(query.value(0).toUInt(),
215  query.value(1).toString());
216  list.push_back(group);
217  }
218  }
219 
220  // Then the channel groups that are manually created
221  if (includeEmpty)
222  {
223  qstr = "SELECT grpid, name FROM channelgroupnames"
224  " WHERE name NOT IN (SELECT name FROM videosource)"
225  " AND name <> 'Priority' "
226  " AND grpid <> 1"
227  " ORDER BY NAME";
228  }
229  else
230  {
231  qstr = "SELECT DISTINCT t1.grpid, name FROM channelgroupnames t1, channelgroup t2"
232  " WHERE t1.grpid = t2.grpid"
233  " AND name NOT IN (SELECT name FROM videosource)"
234  " AND name <> 'Priority' "
235  " AND t1.grpid <> 1"
236  " ORDER BY NAME";
237  }
238  query.prepare(qstr);
239  if (!query.exec())
240  MythDB::DBError("ChannelGroup::GetChannelGroups manual", query);
241  else
242  {
243  while (query.next())
244  {
245  ChannelGroupItem group(query.value(0).toUInt(),
246  query.value(1).toString());
247  list.push_back(group);
248  }
249  }
250 
251  return list;
252 }
253 
254 // Create a list of all channel groups that are automatically created
255 //
256 // The channel groups are returned in the following order:
257 // - Priority channels
258 // - Channel groups created automatically from videosources, sorted by name.
259 //
261 {
262  ChannelGroupList list;
263  QString qstr;
264  MSqlQuery query(MSqlQuery::InitCon());
265 
266  // The Priority channel group if it exists
267  if (includeEmpty)
268  {
269  qstr = "SELECT grpid, name FROM channelgroupnames"
270  " WHERE name = 'Priority'";
271  }
272  else
273  {
274  qstr = "SELECT DISTINCT t1.grpid, name FROM channelgroupnames t1, channelgroup t2"
275  " WHERE t1.grpid = t2.grpid "
276  " AND name = 'Priority'";
277  }
278  query.prepare(qstr);
279  if (!query.exec())
280  MythDB::DBError("ChannelGroup::GetChannelGroups Priority", query);
281  else
282  {
283  if (query.next())
284  {
285  ChannelGroupItem group(query.value(0).toUInt(),
286  query.value(1).toString());
287  list.push_back(group);
288  }
289  }
290 
291  // The channel groups that are automatically created from videosources
292  if (includeEmpty)
293  {
294  qstr = "SELECT grpid, name FROM channelgroupnames"
295  " WHERE name IN (SELECT name FROM videosource)"
296  " ORDER BY NAME";
297  }
298  else
299  {
300  qstr = "SELECT DISTINCT t1.grpid, name FROM channelgroupnames t1, channelgroup t2"
301  " WHERE t1.grpid = t2.grpid"
302  " AND name IN (SELECT name FROM videosource)"
303  " ORDER BY NAME";
304  }
305  query.prepare(qstr);
306  if (!query.exec())
307  MythDB::DBError("ChannelGroup::GetChannelGroups videosources", query);
308  else
309  {
310  while (query.next())
311  {
312  ChannelGroupItem group(query.value(0).toUInt(),
313  query.value(1).toString());
314  list.push_back(group);
315  }
316  }
317  return list;
318 }
319 
320 // Create a list of all channel groups
321 //
322 // The channel groups are returned in the following order:
323 // - Favorites
324 // - Manually created channel groups, sorted by name.
325 // - Priority channels
326 // - Channel groups created automatically from videosources, sorted by name.
327 //
329 {
330  ChannelGroupList list = GetManualChannelGroups(includeEmpty);
331  ChannelGroupList more = GetAutomaticChannelGroups(includeEmpty);
332  list.insert(list.end(), more.begin(), more.end());
333  return list;
334 }
335 
336 // Cycle through the available channel groups.
337 // At the end return -1 to select "All Channels".
339 {
340  // If no groups return -1 for "All Channels"
341  if (sorted.empty())
342  return -1;
343 
344  // If grpid is "All Channels" (-1), then return the first grpid
345  if (grpid == -1)
346  return sorted[0].m_grpId;
347 
348  auto it = std::find(sorted.cbegin(), sorted.cend(), grpid);
349 
350  // If grpid is not in the list, return -1 for "All Channels"
351  if (it == sorted.end())
352  return -1;
353 
354  ++it;
355 
356  // If we reached the end, the next option is "All Channels" (-1)
357  if (it == sorted.end())
358  return -1;
359 
360  return it->m_grpId;
361 }
362 
363 bool ChannelGroup::InChannelGroupList(const ChannelGroupList &groupList, int grpid)
364 {
365  auto it = std::find(groupList.cbegin(), groupList.cend(), grpid);
366  return it != groupList.end();
367 }
368 
369 bool ChannelGroup::NotInChannelGroupList(const ChannelGroupList &groupList, int grpid)
370 {
371  return !InChannelGroupList(groupList, grpid);
372 }
373 
375 {
376  // All Channels
377  if (grpid == -1)
378  return tr("All Channels");
379 
380  // No group
381  if (grpid == 0)
382  return "";
383 
384  MSqlQuery query(MSqlQuery::InitCon());
385  query.prepare("SELECT name FROM channelgroupnames WHERE grpid = :GROUPID");
386  query.bindValue(":GROUPID", grpid);
387 
388  if (!query.exec())
389  MythDB::DBError("ChannelGroup::GetChannelGroups", query);
390  else if (query.next())
391  return query.value(0).toString();
392 
393  return "";
394 }
395 
396 int ChannelGroup::GetChannelGroupId(const QString& changroupname)
397 {
398  // All Channels
399  if (changroupname == "All Channels")
400  return -1;
401 
402  MSqlQuery query(MSqlQuery::InitCon());
403 
404  query.prepare("SELECT grpid FROM channelgroupnames "
405  "WHERE name = :GROUPNAME");
406  query.bindValue(":GROUPNAME", changroupname);
407 
408  if (!query.exec())
409  MythDB::DBError("ChannelGroup::GetChannelGroups", query);
410  else if (query.next())
411  return query.value(0).toUInt();
412 
413  return 0;
414 }
415 
416 static void AddChannelGroup(const QString &groupName)
417 {
418  int groupId = ChannelGroup::GetChannelGroupId(groupName);
419  if (groupId == 0)
420  {
421  LOG(VB_GENERAL, LOG_INFO, QString("Add channelgroup %1").arg(groupName));
422 
423  MSqlQuery query(MSqlQuery::InitCon());
424  query.prepare("INSERT INTO channelgroupnames (name) VALUE (:NEWNAME);");
425  query.bindValue(":NEWNAME", groupName);
426 
427  if (!query.exec())
428  MythDB::DBError("AddChannelGroup", query);
429  }
430 }
431 
432 static void RemoveChannelGroup(const QString &groupName)
433 {
434  int groupId = ChannelGroup::GetChannelGroupId(groupName);
435  if (groupId > 0)
436  {
437  // Yes, channelgroup does exist. Remove all existing channels.
438  LOG(VB_GENERAL, LOG_INFO, QString("Remove channels of channelgroup %1").arg(groupName));
439 
440  MSqlQuery query(MSqlQuery::InitCon());
441  query.prepare("DELETE FROM channelgroup WHERE grpid = :GRPID;");
442  query.bindValue(":GRPID", groupId);
443 
444  if (!query.exec())
445  MythDB::DBError("RemoveChannelGroup 1", query);
446 
447  // And also the channelgroupname
448  LOG(VB_GENERAL, LOG_INFO, QString("Remove channelgroup %1").arg(groupName));
449  query.prepare("DELETE FROM channelgroupnames WHERE grpid = :GRPID;");
450  query.bindValue(":GRPID", groupId);
451 
452  if (!query.exec())
453  MythDB::DBError("RemoveChannelGroup 2", query);
454  }
455  else
456  {
457  LOG(VB_GENERAL, LOG_DEBUG, QString("Channelgroup %1 not found").arg(groupName));
458  }
459 }
460 
461 // UpdateChannelGroups
462 //
463 // Create and maintain a channel group for each connected video source
464 // with the name of the video source.
465 // Create and maintain a channel group Priority for
466 // all channels that have a recording priority bigger than 0.
467 //
469 {
470  QMap<int, QString> allSources;
471  QMap<int, QString> connectedSources;
472  QMap<int, QString> disconnectedSources;
473 
474  LOG(VB_GENERAL, LOG_INFO, QString("Running UpdateChannelGroups"));
475 
476  // Get list of all video sources
477  {
478  MSqlQuery query(MSqlQuery::InitCon());
479  query.prepare("SELECT sourceid,name FROM videosource;");
480  if (query.exec())
481  {
482  while (query.next())
483  allSources[query.value(0).toInt()] = query.value(1).toString();
484  }
485  else
486  MythDB::DBError("UpdateChannelGroups videosource 1", query);
487  }
488 
489  // Split all video sources into a list of video sources that are connected to one
490  // or more capture cards and a list of video sources that are not connected.
491  for (auto it = allSources.cbegin(); it != allSources.cend(); ++it)
492  {
493  uint sourceId = it.key();
494  int count = SourceUtil::GetConnectionCount(sourceId);
495  if (count > 0)
496  connectedSources[sourceId] = allSources[sourceId];
497  else
498  disconnectedSources[sourceId] = allSources[sourceId];
499  }
500 
501  // If there is only one connected video source then we do not need a special
502  // channel group for that video source; it is then the same as "All Channels".
503  QMap<int, QString> removeSources = disconnectedSources;
504  if (connectedSources.size() == 1)
505  {
506  auto it = connectedSources.cbegin();
507  uint sourceid = it.key();
508  removeSources[sourceid] = *it;
509  }
510 
511  // Remove channelgroup channels and the channelgroupname for disconnected video sources.
512  for (const auto &sourceName : std::as_const(removeSources))
513  {
514  RemoveChannelGroup(sourceName);
515  }
516 
517  // Remove all channels that do not exist anymore or that are not visible.
518  // This is done only for the automatic channel groups.
519  {
521  MSqlQuery query(MSqlQuery::InitCon());
522  for (const auto &chgrp : list)
523  {
524  query.prepare(
525  "DELETE from channelgroup WHERE grpid = :GRPID"
526  " AND chanid NOT IN "
527  " (SELECT chanid FROM channel WHERE deleted IS NULL AND visible > 0)");
528  query.bindValue(":GRPID", chgrp.m_grpId);
529  if (!query.exec())
530  {
531  MythDB::DBError("ChannelGroup::UpdateChannelGroups", query);
532  return;
533  }
534  if (query.numRowsAffected() > 0)
535  {
536  LOG(VB_GENERAL, LOG_INFO, QString("Removed %1 channels from channelgroup %2")
537  .arg(query.numRowsAffected()).arg(chgrp.m_grpId));
538  }
539  }
540  }
541 
542  // Create a channel group for each connected video source only if there is
543  // more than one video source configured with a capture card.
544  if (connectedSources.size() > 1)
545  {
546  // Add channelgroupname entry if it does not exist yet
547  for (const auto &sourceName : std::as_const(connectedSources))
548  {
549  AddChannelGroup(sourceName);
550  }
551 
552  // Add all visible channels to the channelgroups
553  for (auto it = connectedSources.cbegin(); it != connectedSources.cend(); ++it)
554  {
555  uint sourceId = it.key();
556  QString sourceName = connectedSources[sourceId];
557  int groupId = ChannelGroup::GetChannelGroupId(sourceName);
558 
559  if (groupId > 0)
560  {
561  LOG(VB_GENERAL, LOG_INFO, QString("Update channelgroup %1").arg(sourceName));
562  MSqlQuery query(MSqlQuery::InitCon());
563  query.prepare(
564  "SELECT chanid FROM channel "
565  "WHERE sourceid = :SOURCEID "
566  "AND deleted IS NULL "
567  "AND visible > 0 ");
568  query.bindValue(":SOURCEID", sourceId);
569  if (!query.exec())
570  {
571  MythDB::DBError("ChannelGroup::UpdateChannelGroups", query);
572  return;
573  }
574  while (query.next())
575  {
576  uint chanId = query.value(0).toUInt();
577  ChannelGroup::AddChannel(chanId, groupId);
578  }
579  }
580  }
581  }
582 
583  // Channelgroup Priority
584 
585  // Find the number of priority channels in all connected video sources
586  uint numPrioChannels = 0;
587  for (auto it = connectedSources.cbegin(); it != connectedSources.cend(); ++it)
588  {
589  uint sourceId = it.key();
590  MSqlQuery query(MSqlQuery::InitCon());
591  query.prepare(
592  "SELECT count(*) FROM channel "
593  "WHERE sourceid = :SOURCEID "
594  "AND deleted IS NULL "
595  "AND visible > 0 "
596  "AND recpriority > 0");
597  query.bindValue(":SOURCEID", sourceId);
598  if (!query.exec())
599  {
600  MythDB::DBError("UpdateChannelGroups Priority select channels", query);
601  return;
602  }
603  if (query.next())
604  {
605  numPrioChannels += query.value(0).toUInt();
606  }
607  }
608  LOG(VB_GENERAL, LOG_INFO, QString("Found %1 priority channels").arg(numPrioChannels));
609 
610  if (numPrioChannels > 0)
611  {
612  // Add channel group for Priority channels
613  QString groupName = "Priority";
614  AddChannelGroup(groupName);
615  LOG(VB_GENERAL, LOG_INFO, QString("Update channelgroup %1").arg(groupName));
616 
617  // Update all channels in channel group Priority
618  int groupId = ChannelGroup::GetChannelGroupId(groupName);
619  if (groupId > 0)
620  {
621  // Remove all channels from channelgroup Priority that do not have priority anymore.
622  MSqlQuery query(MSqlQuery::InitCon());
623  query.prepare(
624  "DELETE from channelgroup WHERE grpid = :GRPID "
625  " AND chanid NOT IN "
626  " (SELECT chanid FROM channel "
627  " WHERE deleted IS NULL "
628  " AND visible > 0 "
629  " AND recpriority > 0)");
630  query.bindValue(":GRPID", groupId);
631  if (!query.exec())
632  {
633  MythDB::DBError("ChannelGroup::UpdateChannelGroups", query);
634  return;
635  }
636  if (query.numRowsAffected() > 0)
637  {
638  LOG(VB_GENERAL, LOG_INFO, QString("Removed %1 channels from channelgroup Priority")
639  .arg(query.numRowsAffected()));
640  }
641 
642  // Add all channels from all connected video groups if they have priority
643  for (auto it = connectedSources.cbegin(); it != connectedSources.cend(); ++it)
644  {
645  uint sourceId = it.key();
646  query.prepare(
647  "SELECT chanid FROM channel "
648  "WHERE sourceid = :SOURCEID "
649  "AND deleted IS NULL "
650  "AND visible > 0 "
651  "AND recpriority > 0");
652  query.bindValue(":SOURCEID", sourceId);
653  if (!query.exec())
654  {
655  MythDB::DBError("UpdateChannelGroups Priority select channels", query);
656  return;
657  }
658  while (query.next())
659  {
660  uint chanId = query.value(0).toUInt();
661  ChannelGroup::AddChannel(chanId, groupId);
662  }
663  }
664  }
665  }
666  else
667  {
668  // No priority channels in connected video sources, so no Priority channel group
669  RemoveChannelGroup("Priority");
670  }
671 }
MSqlQuery::next
bool next(void)
Wrap QSqlQuery::next() so we can display the query results.
Definition: mythdbcon.cpp:813
MSqlQuery
QSqlQuery wrapper that fetches a DB connection from the connection pool.
Definition: mythdbcon.h:127
MSqlQuery::size
int size(void) const
Definition: mythdbcon.h:214
lt_group
bool lt_group(const ChannelGroupItem &a, const ChannelGroupItem &b)
Definition: channelgroup.cpp:14
ChannelGroup::GetChannelGroupName
static QString GetChannelGroupName(int grpid)
Definition: channelgroup.cpp:374
mythdb.h
ChannelGroupItem
Definition: channelgroup.h:15
ChannelGroup::InChannelGroupList
static bool InChannelGroupList(const ChannelGroupList &groupList, int grpid)
Definition: channelgroup.cpp:363
ChannelGroup::AddChannel
static bool AddChannel(uint chanid, int changrpid)
Definition: channelgroup.cpp:71
MSqlQuery::value
QVariant value(int i) const
Definition: mythdbcon.h:204
ChannelGroup::GetManualChannelGroups
static ChannelGroupList GetManualChannelGroups(bool includeEmpty=true)
Definition: channelgroup.cpp:189
MSqlQuery::exec
bool exec(void)
Wrap QSqlQuery::exec() so we can display SQL.
Definition: mythdbcon.cpp:619
LOG
#define LOG(_MASK_, _LEVEL_, _QSTRING_)
Definition: mythlogging.h:39
ChannelGroup::GetChannelGroups
static ChannelGroupList GetChannelGroups(bool includeEmpty=true)
Definition: channelgroup.cpp:328
sourceutil.h
mythlogging.h
AddChannelGroup
static void AddChannelGroup(const QString &groupName)
Definition: channelgroup.cpp:416
MSqlQuery::first
bool first(void)
Wrap QSqlQuery::first() so we can display the query results.
Definition: mythdbcon.cpp:823
MSqlQuery::InitCon
static MSqlQueryInfo InitCon(ConnectionReuse _reuse=kNormalConnection)
Only use this in combination with MSqlQuery constructor.
Definition: mythdbcon.cpp:551
MythDB::DBError
static void DBError(const QString &where, const MSqlQuery &query)
Definition: mythdb.cpp:226
ChannelGroupList
std::vector< ChannelGroupItem > ChannelGroupList
Definition: channelgroup.h:31
uint
unsigned int uint
Definition: compat.h:81
LOC
#define LOC
Definition: channelgroup.cpp:12
ChannelGroupItem::m_name
QString m_name
Definition: channelgroup.h:29
ChannelGroup::NotInChannelGroupList
static bool NotInChannelGroupList(const ChannelGroupList &groupList, int grpid)
Definition: channelgroup.cpp:369
channelutil.h
ChannelGroup::ToggleChannel
static bool ToggleChannel(uint chanid, int changrpid, bool delete_chan)
Definition: channelgroup.cpp:19
ChannelGroup::GetNextChannelGroup
static int GetNextChannelGroup(const ChannelGroupList &sorted, int grpid)
Definition: channelgroup.cpp:338
channelgroup.h
ChannelGroup::GetChannelGroupId
static int GetChannelGroupId(const QString &changroupname)
Definition: channelgroup.cpp:396
MSqlQuery::bindValue
void bindValue(const QString &placeholder, const QVariant &val)
Add a single binding.
Definition: mythdbcon.cpp:889
ChannelGroup::UpdateChannelGroups
static void UpdateChannelGroups(void)
Definition: channelgroup.cpp:468
RemoveChannelGroup
static void RemoveChannelGroup(const QString &groupName)
Definition: channelgroup.cpp:432
MSqlQuery::numRowsAffected
int numRowsAffected() const
Definition: mythdbcon.h:217
SourceUtil::GetConnectionCount
static uint GetConnectionCount(uint sourceid)
Definition: sourceutil.cpp:230
ChannelGroup::GetAutomaticChannelGroups
static ChannelGroupList GetAutomaticChannelGroups(bool includeEmpty=true)
Definition: channelgroup.cpp:260
find
static pid_list_t::iterator find(const PIDInfoMap &map, pid_list_t &list, pid_list_t::iterator begin, pid_list_t::iterator end, bool find_open)
Definition: dvbstreamhandler.cpp:363
MSqlQuery::prepare
bool prepare(const QString &query)
QSqlQuery::prepare() is not thread safe in Qt <= 3.3.2.
Definition: mythdbcon.cpp:838
ChannelGroup::DeleteChannel
static bool DeleteChannel(uint chanid, int changrpid)
Definition: channelgroup.cpp:150