Go to the documentation of this file.
24 #define LOC QString("EITScanner: ")
25 #define LOC_ID QString("EITScanner[%1]: ").arg(m_cardnum)
35 m_eventThread(new
MThread(
"EIT", this)),
41 LOG(VB_EIT, LOG_INFO,
LOC_ID +
"Start EIT scanner thread");
98 LOC_ID + QString(
"Added %1 EIT events in passive scan").
arg(eitCount));
109 LOG(VB_EIT, LOG_INFO,
110 LOC_ID + QString(
"Added %1 EIT events in active scan").
arg(eitCount));
121 if (!(*m_activeScanNextChan).isEmpty())
129 QString(
"Now looking for EIT data on multiplex of channel %1 of source %2")
183 QMutexLocker locker(&
m_lock);
194 LOG(VB_EIT, LOG_INFO,
LOC_ID +
"Started passive scan");
202 QMutexLocker locker(&
m_lock);
214 LOG(VB_EIT, LOG_INFO,
LOC_ID +
"Stopped passive scan");
226 "SELECT channum, MIN(chanid) "
227 "FROM channel, capturecard, videosource "
228 "WHERE deleted IS NULL AND "
229 " capturecard.sourceid = channel.sourceid AND "
230 " videosource.sourceid = channel.sourceid AND "
231 " channel.mplexid IS NOT NULL AND "
233 " useonairguide = 1 AND "
235 " channum != '' AND "
236 " capturecard.cardid = :CARDID "
238 "ORDER BY capturecard.sourceid, mplexid, "
239 " atsc_major_chan, atsc_minor_chan ");
255 QString(
"StartActiveScan called with %1 multiplexes")
284 QMutexLocker locker(&
m_lock);
294 LOG(VB_EIT, LOG_INFO,
LOC_ID +
"Stopped active scan");
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.
volatile bool m_exitThread
void StopPassiveScan(void)
Stops inserting Event Information Tables into DB.
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.
QDateTime m_activeScanNextTrig
QWaitCondition m_activeScanCond
uint GetSourceID(void) const
Returns current source id.
void StartPassiveScan(ChannelBase *channel, EITSource *eitSource)
Start inserting Event Information Tables from the multiplex we happen to be tuned to into the databas...
QVariant value(int i) const
arg(title).arg(filename).arg(doDelete))
bool exec(void)
Wrap QSqlQuery::exec() so we can display SQL.
#define LOG(_MASK_, _LEVEL_, _QSTRING_)
QDateTime current(bool stripped)
Returns current Date and Time in UTC.
void StartActiveScan(TVRec *_rec, std::chrono::seconds max_seconds_per_source)
virtual void SetEITRate(float rate)=0
uint m_activeScanNextChanIndex
void StopActiveScan(void)
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
MBASE_PUBLIC uint32_t MythRandom()
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.
static uint GetSourceIDForChannel(uint chanid)
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 '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)
QStringList m_activeScanChannels
volatile bool m_activeScanStopped
MSqlQuery query(MSqlQuery::InitCon())
bool prepare(const QString &query)
QSqlQuery::prepare() is not thread safe in Qt <= 3.3.2.
virtual int GetChanID(void) const