MythTV  master
channel.cpp
Go to the documentation of this file.
1 // Program Name: channel.cpp
3 // Created : Apr. 8, 2011
4 //
5 // Copyright (c) 2011 Robert McNamara <rmcnamara@mythtv.org>
6 // Copyright (c) 2013 MythTV Developers
7 //
8 // This program is free software; you can redistribute it and/or modify
9 // it under the terms of the GNU General Public License as published by
10 // the Free Software Foundation; either version 2 of the License, or
11 // (at your option) any later version.
12 //
13 // This program is distributed in the hope that it will be useful,
14 // but WITHOUT ANY WARRANTY; without even the implied warranty of
15 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 // GNU General Public License for more details.
17 //
18 // You should have received a copy of the GNU General Public License
19 // along with this program; if not, write to the Free Software
20 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21 //
22 // You should have received a copy of the GNU General Public License
23 // along with this program. If not, see <http://www.gnu.org/licenses/>.
24 //
26 
27 #include <QList>
28 
29 #include <cmath>
30 
31 #include "channel.h"
32 
33 #include "compat.h"
34 #include "mythdbcon.h"
35 #include "mythdirs.h"
36 #include "mythversion.h"
37 #include "mythcorecontext.h"
38 #include "channelutil.h"
39 #include "sourceutil.h"
40 #include "cardutil.h"
41 #include "mythdate.h"
42 
43 #include "serviceUtil.h"
44 
46 //
48 
50  uint nChannelGroupID,
51  uint nStartIndex,
52  uint nCount,
53  bool bOnlyVisible,
54  bool bDetails,
55  bool bOrderByName,
56  bool bGroupByCallsign )
57 {
58  ChannelInfoList chanList;
59 
60  uint nTotalAvailable = 0;
61 
62  chanList = ChannelUtil::LoadChannels( 0, 0, nTotalAvailable, bOnlyVisible,
65  nSourceID, nChannelGroupID);
66 
67  // ----------------------------------------------------------------------
68  // Build Response
69  // ----------------------------------------------------------------------
70 
71  DTC::ChannelInfoList *pChannelInfos = new DTC::ChannelInfoList();
72 
73  nStartIndex = (nStartIndex > 0) ? min( nStartIndex, nTotalAvailable ) : 0;
74  nCount = (nCount > 0) ? min(nCount, (nTotalAvailable - nStartIndex)) :
75  (nTotalAvailable - nStartIndex);
76 
77  ChannelInfoList::iterator chanIt;
78  ChannelInfoList::iterator chanItBegin = chanList.begin() + nStartIndex;
79  ChannelInfoList::iterator chanItEnd = chanItBegin + nCount;
80 
81  for( chanIt = chanItBegin; chanIt < chanItEnd; ++chanIt )
82  {
83  DTC::ChannelInfo *pChannelInfo = pChannelInfos->AddNewChannelInfo();
84 
85  ChannelInfo channelInfo = (*chanIt);
86 
87  if (!FillChannelInfo(pChannelInfo, channelInfo, bDetails))
88  {
89  delete pChannelInfo;
90  delete pChannelInfos;
91  throw( QString("Channel ID appears invalid."));
92  }
93  }
94 
95  int nCurPage = 0, nTotalPages = 0;
96  if (nCount == 0)
97  nTotalPages = 1;
98  else
99  nTotalPages = (int)ceil((float)nTotalAvailable / nCount);
100 
101  if (nTotalPages == 1)
102  nCurPage = 1;
103  else
104  {
105  nCurPage = (int)ceil((float)nStartIndex / nCount) + 1;
106  }
107 
108  pChannelInfos->setStartIndex ( nStartIndex );
109  pChannelInfos->setCount ( nCount );
110  pChannelInfos->setCurrentPage ( nCurPage );
111  pChannelInfos->setTotalPages ( nTotalPages );
112  pChannelInfos->setTotalAvailable( nTotalAvailable );
113  pChannelInfos->setAsOf ( MythDate::current() );
114  pChannelInfos->setVersion ( MYTH_BINARY_VERSION );
115  pChannelInfos->setProtoVer ( MYTH_PROTO_VERSION );
116 
117  return pChannelInfos;
118 }
119 
121 //
123 
125 {
126  if (nChanID == 0)
127  throw( QString("Channel ID appears invalid."));
128 
129  DTC::ChannelInfo *pChannelInfo = new DTC::ChannelInfo();
130 
131  if (!FillChannelInfo(pChannelInfo, nChanID, true))
132  {
133  // throw causes a crash on linux and we can't know in advance
134  // that a channel id from an old recording rule is invalid
135  //throw( QString("Channel ID appears invalid."));
136  }
137 
138  return pChannelInfo;
139 }
140 
142  uint SourceID,
143  uint ChannelID,
144  const QString &CallSign,
145  const QString &ChannelName,
146  const QString &ChannelNumber,
147  uint ServiceID,
148  uint ATSCMajorChannel,
149  uint ATSCMinorChannel,
150  bool UseEIT,
151  bool visible,
152  const QString &FrequencyID,
153  const QString &Icon,
154  const QString &Format,
155  const QString &XMLTVID,
156  const QString &DefaultAuthority )
157 {
158  bool bResult = ChannelUtil::UpdateChannel( MplexID, SourceID, ChannelID,
159  CallSign, ChannelName, ChannelNumber,
160  ServiceID, ATSCMajorChannel, ATSCMinorChannel,
161  UseEIT, !visible, false, FrequencyID,
162  Icon, Format, XMLTVID, DefaultAuthority );
163 
164  return bResult;
165 }
166 
168  uint SourceID,
169  uint ChannelID,
170  const QString &CallSign,
171  const QString &ChannelName,
172  const QString &ChannelNumber,
173  uint ServiceID,
174  uint ATSCMajorChannel,
175  uint ATSCMinorChannel,
176  bool UseEIT,
177  bool visible,
178  const QString &FrequencyID,
179  const QString &Icon,
180  const QString &Format,
181  const QString &XMLTVID,
182  const QString &DefaultAuthority )
183 {
184  bool bResult = ChannelUtil::CreateChannel( MplexID, SourceID, ChannelID,
185  CallSign, ChannelName, ChannelNumber,
186  ServiceID, ATSCMajorChannel, ATSCMinorChannel,
187  UseEIT, !visible, false, FrequencyID,
188  Icon, Format, XMLTVID, DefaultAuthority );
189 
190  return bResult;
191 }
192 
193 bool Channel::RemoveDBChannel( uint nChannelID )
194 {
195  bool bResult = ChannelUtil::DeleteChannel( nChannelID );
196 
197  return bResult;
198 }
199 
201 //
203 
205 {
206  MSqlQuery query(MSqlQuery::InitCon());
207 
208  if (!query.isConnected())
209  throw( QString("Database not open while trying to list "
210  "Video Sources."));
211 
212  query.prepare("SELECT sourceid, name, xmltvgrabber, userid, "
213  "freqtable, lineupid, password, useeit, configpath, "
214  "dvb_nit_id FROM videosource "
215  "ORDER BY sourceid" );
216 
217  if (!query.exec())
218  {
219  MythDB::DBError("MythAPI::GetVideoSourceList()", query);
220 
221  throw( QString( "Database Error executing query." ));
222  }
223 
224  // ----------------------------------------------------------------------
225  // return the results of the query
226  // ----------------------------------------------------------------------
227 
229 
230  while (query.next())
231  {
232 
233  DTC::VideoSource *pVideoSource = pList->AddNewVideoSource();
234 
235  pVideoSource->setId ( query.value(0).toInt() );
236  pVideoSource->setSourceName ( query.value(1).toString() );
237  pVideoSource->setGrabber ( query.value(2).toString() );
238  pVideoSource->setUserId ( query.value(3).toString() );
239  pVideoSource->setFreqTable ( query.value(4).toString() );
240  pVideoSource->setLineupId ( query.value(5).toString() );
241  pVideoSource->setPassword ( query.value(6).toString() );
242  pVideoSource->setUseEIT ( query.value(7).toBool() );
243  pVideoSource->setConfigPath ( query.value(8).toString() );
244  pVideoSource->setNITId ( query.value(9).toInt() );
245  }
246 
247  pList->setAsOf ( MythDate::current() );
248  pList->setVersion ( MYTH_BINARY_VERSION );
249  pList->setProtoVer ( MYTH_PROTO_VERSION );
250 
251  return pList;
252 }
253 
255 //
257 
259 {
260  MSqlQuery query(MSqlQuery::InitCon());
261 
262  if (!query.isConnected())
263  throw( QString("Database not open while trying to list "
264  "Video Sources."));
265 
266  query.prepare("SELECT name, xmltvgrabber, userid, "
267  "freqtable, lineupid, password, useeit, configpath, "
268  "dvb_nit_id FROM videosource WHERE sourceid = :SOURCEID "
269  "ORDER BY sourceid" );
270  query.bindValue(":SOURCEID", nSourceID);
271 
272  if (!query.exec())
273  {
274  MythDB::DBError("MythAPI::GetVideoSource()", query);
275 
276  throw( QString( "Database Error executing query." ));
277  }
278 
279  // ----------------------------------------------------------------------
280  // return the results of the query
281  // ----------------------------------------------------------------------
282 
283  DTC::VideoSource *pVideoSource = new DTC::VideoSource();
284 
285  if (query.next())
286  {
287  pVideoSource->setId ( nSourceID );
288  pVideoSource->setSourceName ( query.value(0).toString() );
289  pVideoSource->setGrabber ( query.value(1).toString() );
290  pVideoSource->setUserId ( query.value(2).toString() );
291  pVideoSource->setFreqTable ( query.value(3).toString() );
292  pVideoSource->setLineupId ( query.value(4).toString() );
293  pVideoSource->setPassword ( query.value(5).toString() );
294  pVideoSource->setUseEIT ( query.value(6).toBool() );
295  pVideoSource->setConfigPath ( query.value(7).toString() );
296  pVideoSource->setNITId ( query.value(8).toInt() );
297  }
298 
299  return pVideoSource;
300 }
301 
303 //
305 
307  const QString &sSourceName,
308  const QString &sGrabber,
309  const QString &sUserId,
310  const QString &sFreqTable,
311  const QString &sLineupId,
312  const QString &sPassword,
313  bool bUseEIT,
314  const QString &sConfigPath,
315  int nNITId )
316 {
317  bool bResult = SourceUtil::UpdateSource(nSourceId, sSourceName, sGrabber, sUserId, sFreqTable,
318  sLineupId, sPassword, bUseEIT, sConfigPath,
319  nNITId);
320 
321  return bResult;
322 }
323 
325 //
327 
328 int Channel::AddVideoSource( const QString &sSourceName,
329  const QString &sGrabber,
330  const QString &sUserId,
331  const QString &sFreqTable,
332  const QString &sLineupId,
333  const QString &sPassword,
334  bool bUseEIT,
335  const QString &sConfigPath,
336  int nNITId )
337 {
338  int nResult = SourceUtil::CreateSource(sSourceName, sGrabber, sUserId, sFreqTable,
339  sLineupId, sPassword, bUseEIT, sConfigPath,
340  nNITId);
341 
342  return nResult;
343 }
344 
346 //
348 
350 {
351  bool bResult = SourceUtil::DeleteSource( nSourceID );
352 
353  return bResult;
354 }
355 
357 //
359 
360 DTC::LineupList* Channel::GetDDLineupList( const QString &/*sSource*/,
361  const QString &/*sUserId*/,
362  const QString &/*sPassword*/ )
363 {
364  DTC::LineupList *pLineups = new DTC::LineupList();
365  return pLineups;
366 }
367 
369 //
371 
373  const uint nCardId,
374  bool bWaitForFinish )
375 {
376  if ( nSourceId < 1 || nCardId < 1)
377  throw( QString("A source ID and card ID are both required."));
378 
379  int nResult = 0;
380 
381  QString cardtype = CardUtil::GetRawInputType(nCardId);
382 
383  if (!CardUtil::IsUnscanable(cardtype) &&
384  !CardUtil::IsEncoder(cardtype))
385  {
386  throw( QString("This device is incompatible with channel fetching.") );
387  }
388 
389  SourceUtil::UpdateChannelsFromListings(nSourceId, cardtype, bWaitForFinish);
390 
391  if (bWaitForFinish)
392  nResult = SourceUtil::GetChannelCount(nSourceId);
393 
394  return nResult;
395 }
396 
398 //
400 
402  uint nStartIndex,
403  uint nCount )
404 {
405  MSqlQuery query(MSqlQuery::InitCon());
406 
407  if (!query.isConnected())
408  throw( QString("Database not open while trying to list "
409  "Video Sources."));
410 
411  query.prepare("SELECT mplexid, sourceid, transportid, networkid, "
412  "frequency, inversion, symbolrate, fec, polarity, "
413  "modulation, bandwidth, lp_code_rate, transmission_mode, "
414  "guard_interval, visible, constellation, hierarchy, hp_code_rate, "
415  "mod_sys, rolloff, sistandard, serviceversion, updatetimestamp, "
416  "default_authority FROM dtv_multiplex WHERE sourceid = :SOURCEID "
417  "ORDER BY mplexid" );
418  query.bindValue(":SOURCEID", nSourceID);
419 
420  if (!query.exec())
421  {
422  MythDB::DBError("MythAPI::GetVideoMultiplexList()", query);
423 
424  throw( QString( "Database Error executing query." ));
425  }
426 
427  uint muxCount = (uint)query.size();
428 
429  // ----------------------------------------------------------------------
430  // Build Response
431  // ----------------------------------------------------------------------
432 
433  DTC::VideoMultiplexList *pVideoMultiplexes = new DTC::VideoMultiplexList();
434 
435  nStartIndex = (nStartIndex > 0) ? min( nStartIndex, muxCount ) : 0;
436  nCount = (nCount > 0) ? min( nCount, muxCount ) : muxCount;
437  int nEndIndex = min((nStartIndex + nCount), muxCount );
438 
439  for( int n = nStartIndex; n < nEndIndex; n++)
440  {
441  if (query.seek(n))
442  {
443  DTC::VideoMultiplex *pVideoMultiplex = pVideoMultiplexes->AddNewVideoMultiplex();
444 
445  pVideoMultiplex->setMplexId( query.value(0).toInt() );
446  pVideoMultiplex->setSourceId( query.value(1).toInt() );
447  pVideoMultiplex->setTransportId( query.value(2).toInt() );
448  pVideoMultiplex->setNetworkId( query.value(3).toInt() );
449  pVideoMultiplex->setFrequency( query.value(4).toLongLong() );
450  pVideoMultiplex->setInversion( query.value(5).toString() );
451  pVideoMultiplex->setSymbolRate( query.value(6).toLongLong() );
452  pVideoMultiplex->setFEC( query.value(7).toString() );
453  pVideoMultiplex->setPolarity( query.value(8).toString() );
454  pVideoMultiplex->setModulation( query.value(9).toString() );
455  pVideoMultiplex->setBandwidth( query.value(10).toString() );
456  pVideoMultiplex->setLPCodeRate( query.value(11).toString() );
457  pVideoMultiplex->setTransmissionMode( query.value(12).toString() );
458  pVideoMultiplex->setGuardInterval( query.value(13).toString() );
459  pVideoMultiplex->setVisible( query.value(14).toBool() );
460  pVideoMultiplex->setConstellation( query.value(15).toString() );
461  pVideoMultiplex->setHierarchy( query.value(16).toString() );
462  pVideoMultiplex->setHPCodeRate( query.value(17).toString() );
463  pVideoMultiplex->setModulationSystem( query.value(18).toString() );
464  pVideoMultiplex->setRollOff( query.value(19).toString() );
465  pVideoMultiplex->setSIStandard( query.value(20).toString() );
466  pVideoMultiplex->setServiceVersion( query.value(21).toInt() );
467  pVideoMultiplex->setUpdateTimeStamp(
468  MythDate::as_utc(query.value(22).toDateTime()));
469  pVideoMultiplex->setDefaultAuthority( query.value(23).toString() );
470  }
471  }
472 
473  int curPage = 0, totalPages = 0;
474  if (nCount == 0)
475  totalPages = 1;
476  else
477  totalPages = (int)ceil((float)muxCount / nCount);
478 
479  if (totalPages == 1)
480  curPage = 1;
481  else
482  {
483  curPage = (int)ceil((float)nStartIndex / nCount) + 1;
484  }
485 
486  pVideoMultiplexes->setStartIndex ( nStartIndex );
487  pVideoMultiplexes->setCount ( nCount );
488  pVideoMultiplexes->setCurrentPage ( curPage );
489  pVideoMultiplexes->setTotalPages ( totalPages );
490  pVideoMultiplexes->setTotalAvailable( muxCount );
491  pVideoMultiplexes->setAsOf ( MythDate::current() );
492  pVideoMultiplexes->setVersion ( MYTH_BINARY_VERSION );
493  pVideoMultiplexes->setProtoVer ( MYTH_PROTO_VERSION );
494 
495  return pVideoMultiplexes;
496 }
497 
499 {
500  MSqlQuery query(MSqlQuery::InitCon());
501 
502  if (!query.isConnected())
503  throw( QString("Database not open while trying to list "
504  "Video Multiplex."));
505 
506  query.prepare("SELECT sourceid, transportid, networkid, "
507  "frequency, inversion, symbolrate, fec, polarity, "
508  "modulation, bandwidth, lp_code_rate, transmission_mode, "
509  "guard_interval, visible, constellation, hierarchy, hp_code_rate, "
510  "mod_sys, rolloff, sistandard, serviceversion, updatetimestamp, "
511  "default_authority FROM dtv_multiplex WHERE mplexid = :MPLEXID "
512  "ORDER BY mplexid" );
513  query.bindValue(":MPLEXID", nMplexID);
514 
515  if (!query.exec())
516  {
517  MythDB::DBError("MythAPI::GetVideoMultiplex()", query);
518 
519  throw( QString( "Database Error executing query." ));
520  }
521 
522  DTC::VideoMultiplex *pVideoMultiplex = new DTC::VideoMultiplex();
523 
524  if (query.next())
525  {
526  pVideoMultiplex->setMplexId( nMplexID );
527  pVideoMultiplex->setSourceId( query.value(0).toInt() );
528  pVideoMultiplex->setTransportId( query.value(1).toInt() );
529  pVideoMultiplex->setNetworkId( query.value(2).toInt() );
530  pVideoMultiplex->setFrequency( query.value(3).toLongLong() );
531  pVideoMultiplex->setInversion( query.value(4).toString() );
532  pVideoMultiplex->setSymbolRate( query.value(5).toLongLong() );
533  pVideoMultiplex->setFEC( query.value(6).toString() );
534  pVideoMultiplex->setPolarity( query.value(7).toString() );
535  pVideoMultiplex->setModulation( query.value(8).toString() );
536  pVideoMultiplex->setBandwidth( query.value(9).toString() );
537  pVideoMultiplex->setLPCodeRate( query.value(10).toString() );
538  pVideoMultiplex->setTransmissionMode( query.value(11).toString() );
539  pVideoMultiplex->setGuardInterval( query.value(12).toString() );
540  pVideoMultiplex->setVisible( query.value(13).toBool() );
541  pVideoMultiplex->setConstellation( query.value(14).toString() );
542  pVideoMultiplex->setHierarchy( query.value(15).toString() );
543  pVideoMultiplex->setHPCodeRate( query.value(16).toString() );
544  pVideoMultiplex->setModulationSystem( query.value(17).toString() );
545  pVideoMultiplex->setRollOff( query.value(18).toString() );
546  pVideoMultiplex->setSIStandard( query.value(19).toString() );
547  pVideoMultiplex->setServiceVersion( query.value(20).toInt() );
548  pVideoMultiplex->setUpdateTimeStamp(
549  MythDate::as_utc(query.value(21).toDateTime()));
550  pVideoMultiplex->setDefaultAuthority( query.value(22).toString() );
551  }
552 
553  return pVideoMultiplex;
554 }
555 
557 //
559 
561 {
562  MSqlQuery query(MSqlQuery::InitCon());
563 
564  if (!query.isConnected())
565  throw( QString("Database not open while trying to get source name."));
566 
567  query.prepare("SELECT name FROM videosource WHERE sourceid = :SOURCEID ");
568  query.bindValue(":SOURCEID", SourceID);
569 
570  if (!query.exec())
571  {
572  MythDB::DBError("MythAPI::GetXMLTVIdList()", query);
573 
574  throw( QString( "Database Error executing query." ));
575  }
576 
577  QStringList idList;
578 
579  if (query.next())
580  {
581  QString sourceName = query.value(0).toString();
582 
583  QString xmltvFile = GetConfDir() + '/' + sourceName + ".xmltv";
584 
585  if (QFile::exists(xmltvFile))
586  {
587  QFile file(xmltvFile);
588  if (!file.open(QIODevice::ReadOnly | QIODevice::Text))
589  return idList;
590 
591  while (!file.atEnd())
592  {
593  QByteArray line = file.readLine();
594 
595  if (line.startsWith("channel="))
596  {
597  QString id = line.mid(8, -1).trimmed();
598  idList.append(id);
599  }
600  }
601 
602  idList.sort();
603  }
604  }
605  else
606  throw(QString("SourceID (%1) not found").arg(SourceID));
607 
608  return idList;
609 }
bool next(void)
Wrap QSqlQuery::next() so we can display the query results.
Definition: mythdbcon.cpp:782
static bool CreateChannel(uint db_mplexid, uint db_sourceid, uint new_channel_id, const QString &callsign, const QString &service_name, const QString &chan_num, uint service_id, uint atsc_major_channel, uint atsc_minor_channel, bool use_on_air_guide, bool hidden, bool hidden_in_guide, const QString &freqid, QString icon=QString(), QString format="Default", QString xmltvid=QString(), QString default_authority=QString())
void bindValue(const QString &placeholder, const QVariant &val)
Add a single binding.
Definition: mythdbcon.cpp:863
static ChannelInfoList LoadChannels(uint startIndex, uint count, uint &totalAvailable, bool ignoreHidden=true, OrderBy orderBy=kChanOrderByChanNum, GroupBy groupBy=kChanGroupByChanid, uint sourceID=0, uint channelGroupID=0, bool liveTVOnly=false, const QString &callsign="", const QString &channum="")
Load channels from database into a list of ChannelInfo objects.
static uint GetChannelCount(uint sourceid)
Definition: sourceutil.cpp:109
static bool DeleteSource(uint sourceid)
Definition: sourceutil.cpp:480
QSqlQuery wrapper that fetches a DB connection from the connection pool.
Definition: mythdbcon.h:125
DTC::VideoSourceList * GetVideoSourceList(void) override
Definition: channel.cpp:204
int size(void) const
Definition: mythdbcon.h:203
bool isConnected(void)
Only updated once during object creation.
Definition: mythdbcon.h:135
static bool IsUnscanable(const QString &rawtype)
Definition: cardutil.h:144
unsigned int uint
Definition: compat.h:140
bool RemoveDBChannel(uint ChannelID) override
Definition: channel.cpp:193
DTC::ChannelInfoList * GetChannelInfoList(uint SourceID, uint ChannelGroupID, uint StartIndex, uint Count, bool OnlyVisible, bool Details, bool OrderByName, bool GroupByCallsign) override
Definition: channel.cpp:49
QDateTime as_utc(const QDateTime &old_dt)
Returns copy of QDateTime with TimeSpec set to UTC.
Definition: mythdate.cpp:23
bool UpdateVideoSource(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) override
Definition: channel.cpp:306
static bool IsEncoder(const QString &rawtype)
Definition: cardutil.h:121
QString GetConfDir(void)
Definition: mythdirs.cpp:224
QVariant value(int i) const
Definition: mythdbcon.h:198
bool FillChannelInfo(DTC::ChannelInfo *pChannel, uint nChanID, bool bDetails)
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)
Definition: sourceutil.cpp:403
bool RemoveVideoSource(uint SourceID) override
Definition: channel.cpp:349
VideoSource * AddNewVideoSource()
bool UpdateDBChannel(uint MplexID, uint SourceID, uint ChannelID, const QString &CallSign, const QString &ChannelName, const QString &ChannelNumber, uint ServiceID, uint ATSCMajorChannel, uint ATSCMinorChannel, bool UseEIT, bool visible, const QString &FrequencyID, const QString &Icon, const QString &Format, const QString &XMLTVID, const QString &DefaultAuthority) override
Definition: channel.cpp:141
DTC::VideoMultiplex * GetVideoMultiplex(uint MplexID) override
Definition: channel.cpp:498
QDateTime current(bool stripped)
Returns current Date and Time in UTC.
Definition: mythdate.cpp:10
static bool UpdateChannelsFromListings(uint sourceid, const QString &inputtype=QString(), bool wait=false)
Definition: sourceutil.cpp:363
int FetchChannelsFromSource(uint SourceId, uint CardId, bool WaitForFinish) override
Definition: channel.cpp:372
#define MYTH_PROTO_VERSION
Increment this whenever the MythTV network protocol changes.
Definition: mythversion.h:48
VideoMultiplex * AddNewVideoMultiplex()
static MSqlQueryInfo InitCon(ConnectionReuse=kNormalConnection)
Only use this in combination with MSqlQuery constructor.
Definition: mythdbcon.cpp:535
static bool UpdateChannel(uint db_mplexid, uint source_id, uint channel_id, const QString &callsign, const QString &service_name, const QString &chan_num, uint service_id, uint atsc_major_channel, uint atsc_minor_channel, bool use_on_air_guide, bool hidden, bool hidden_in_guide, const QString &freqid=QString(), const QString &icon=QString(), QString format=QString(), const QString &xmltvid=QString(), const QString &default_authority=QString())
int AddVideoSource(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) override
Definition: channel.cpp:328
vector< ChannelInfo > ChannelInfoList
Definition: channelinfo.h:120
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)
Definition: sourceutil.cpp:436
bool prepare(const QString &query)
QSqlQuery::prepare() is not thread safe in Qt <= 3.3.2.
Definition: mythdbcon.cpp:807
DTC::LineupList * GetDDLineupList(const QString &, const QString &, const QString &) override
Definition: channel.cpp:360
bool seek(int, bool relative=false)
Wrap QSqlQuery::seek(int,bool)
Definition: mythdbcon.cpp:802
#define MYTH_BINARY_VERSION
Update this whenever the plug-in ABI changes.
Definition: mythversion.h:16
static QString GetRawInputType(uint inputid)
Definition: cardutil.h:271
ChannelInfo * AddNewChannelInfo()
bool exec(void)
Wrap QSqlQuery::exec() so we can display SQL.
Definition: mythdbcon.cpp:603
DTC::VideoSource * GetVideoSource(uint SourceID) override
Definition: channel.cpp:258
static void DBError(const QString &where, const MSqlQuery &query)
Definition: mythdb.cpp:179
QStringList GetXMLTVIdList(uint SourceID) override
Definition: channel.cpp:560
DTC::VideoMultiplexList * GetVideoMultiplexList(uint SourceID, uint StartIndex, uint Count) override
Definition: channel.cpp:401
DTC::ChannelInfo * GetChannelInfo(uint ChanID) override
Definition: channel.cpp:124
enum MythDate::Formats Format
static bool DeleteChannel(uint channel_id)
bool AddDBChannel(uint MplexID, uint SourceID, uint ChannelID, const QString &CallSign, const QString &ChannelName, const QString &ChannelNumber, uint ServiceID, uint ATSCMajorChannel, uint ATSCMinorChannel, bool UseEIT, bool visible, const QString &FrequencyID, const QString &Icon, const QString &Format, const QString &XMLTVID, const QString &DefaultAuthority) override
Definition: channel.cpp:167