Go to the documentation of this file.
28 #define LOC QString("EITScanner[%1]: ").arg(m_cardnum)
37 m_eventThread(new
MThread(
"EIT", this)),
43 LOG(VB_EIT, LOG_INFO,
LOC +
"Start EIT scanner thread");
98 LOC + QString(
"Added %1 EIT events in passive scan").arg(eitCount));
109 LOG(VB_EIT, LOG_INFO,
110 LOC + QString(
"Added %1 EIT events in active scan").arg(eitCount));
120 if (!(*m_activeScanNextChan).isEmpty())
131 LOG(VB_EIT, LOG_INFO,
LOC +
132 QString(
"Next EIT active scan source %1 '%2' multiplex %3 chanid %4 channel %5")
180 QMutexLocker locker(&
m_lock);
196 LOG(VB_EIT, LOG_INFO,
LOC +
197 QString(
"Start EIT %1 scan source %2 '%3' multiplex %4 chanid %5 channel %6")
198 .arg(
m_activeScan ?
"active" :
"passive").arg(sourceid).arg(sourcename)
199 .arg(mplexid).arg(chanid).arg(channum));
203 LOG(VB_EIT, LOG_INFO,
LOC +
204 QString(
"Failed to start EIT scan, invalid chanid %1 channum %2")
205 .arg(chanid).arg(channum));
214 QMutexLocker locker(&
m_lock);
226 LOG(VB_EIT, LOG_INFO,
LOC +
227 QString(
"Stop EIT %1 scan")
246 "SELECT channum, MIN(chanid) "
247 "FROM channel, capturecard, videosource "
248 "WHERE capturecard.sourceid = channel.sourceid AND "
249 " videosource.sourceid = channel.sourceid AND "
250 " channel.deleted IS NULL AND "
251 " channel.mplexid IS NOT NULL AND "
252 " channel.visible > 0 AND "
253 " channel.useonairguide = 1 AND "
254 " channel.channum != '' AND "
255 " videosource.useeit = 1 AND "
256 " capturecard.cardid = :CARDID "
258 "ORDER BY capturecard.sourceid, mplexid, "
259 " atsc_major_chan, atsc_minor_chan ");
277 LOG(VB_EIT, LOG_INFO,
LOC +
278 QString(
"StartActiveScan for source %1 '%2' with %3 multiplexes")
312 QMutexLocker locker(&
m_lock);
bool isActive(void) const
bool next(void)
Wrap QSqlQuery::next() so we can display the query results.
QSqlQuery wrapper that fetches a DB connection from the connection pool.
static void WriteEITCache(void)
void RescheduleRecordings(void)
Tells scheduler about programming changes.
void start(QThread::Priority p=QThread::InheritPriority)
Tell MThread to start running the thread in the near future.
void StopEITEventProcessing(void)
Stops inserting Event Information Tables into DB.
static QString GetSourceName(uint sourceid)
volatile bool m_exitThread
A QElapsedTimer based timer to replace use of QTime as a timer.
void SetSourceID(uint sourceid)
bool wait(std::chrono::milliseconds time=std::chrono::milliseconds::max())
Wait for the MThread to exit, with a maximum timeout.
void StartEITEventProcessing(ChannelBase *channel, EITSource *eitSource)
Start inserting Event Information Tables from the multiplex we happen to be tuned to into the databas...
QDateTime m_activeScanNextTrig
QWaitCondition m_activeScanCond
uint GetSourceID(void) const
Returns current source id.
QVariant value(int i) const
bool exec(void)
Wrap QSqlQuery::exec() so we can display SQL.
#define LOG(_MASK_, _LEVEL_, _QSTRING_)
static uint GetMplexID(uint sourceid, const QString &channum)
virtual QString GetChannelName(void) const
QDateTime current(bool stripped)
Returns current Date and Time in UTC.
virtual void SetEITRate(float rate)=0
void StopActiveScan(void)
Stop active EIT scan.
void RescheduleRecordings(void)
Tells scheduler about programming changes.
uint GetInputId(void) const
Returns the inputid.
static int GetChanID(int db_mplexid, int service_transport_id, int major_channel, int minor_channel, int program_number)
Abstract class providing a generic interface to tuning hardware.
static MSqlQueryInfo InitCon(ConnectionReuse _reuse=kNormalConnection)
Only use this in combination with MSqlQuery constructor.
static void DBError(const QString &where, const MSqlQuery &query)
void SetChannelID(uint channelid)
virtual void SetEITHelper(EITHelper *)=0
QWaitCondition m_exitThreadCond
std::chrono::seconds m_activeScanTrigTime
bool QueueEITChannelChange(const QString &name)
Queues up a channel change for the EITScanner.
volatile bool m_activeScan
void SetLanguagePreferences(const QStringList &langPref)
QStringList::iterator m_activeScanNextChan
uint ProcessEvents(void)
Get events from queue and insert into DB after processing.
void bindValue(const QString &placeholder, const QVariant &val)
Add a single binding.
QStringList iso639_get_language_list(void)
Returns list of three character ISO-639 language descriptors, starting with the most preferred.
void run(void) override
This runs the event loop for EITScanner until 'm_exitThread' is true.
This is the coordinating class of the Recorder Subsystem.
This is a wrapper around QThread that does several additional things.
ISO 639-1 and ISO 639-2 support functions.
uint GetListSize(void) const
static void PruneEITCache(uint timestamp)
virtual uint GetSourceID(void) const
QStringList m_activeScanChannels
volatile bool m_activeScanStopped
uint32_t MythRandom()
generate 32 random bits
void StartActiveScan(TVRec *rec, std::chrono::seconds max_seconds_per_source)
Start active EIT scan.
void TeardownAll(void)
Stop active scan, delete thread and delete eithelper.
bool prepare(const QString &query)
QSqlQuery::prepare() is not thread safe in Qt <= 3.3.2.
virtual int GetChanID(void) const