MythTV  master
Public Member Functions | Protected Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes | Static Private Attributes | List of all members
EITScanner Class Reference

Acts as glue between ChannelBase, EITSource, and EITHelper. More...

#include <eitscanner.h>

Inheritance diagram for EITScanner:
Inheritance graph
[legend]
Collaboration diagram for EITScanner:
Collaboration graph
[legend]

Public Member Functions

 EITScanner (uint cardnum)
 
 ~EITScanner ()
 
void StartPassiveScan (ChannelBase *, EITSource *)
 Start inserting Event Information Tables from the multiplex we happen to be tuned to into the database. More...
 
void StopPassiveScan (void)
 Stops inserting Event Information Tables into DB. More...
 
void StartActiveScan (TVRec *, uint max_seconds_per_source)
 
void StopActiveScan (void)
 

Protected Member Functions

void run (void) override
 This runs the event loop for EITScanner until 'exitThread' is true. More...
 

Private Member Functions

void TeardownAll (void)
 
void RescheduleRecordings (void)
 Tells scheduler about programming changes. More...
 

Static Private Member Functions

static void * SpawnEventLoop (void *)
 

Private Attributes

QMutex m_lock
 
ChannelBasem_channel {nullptr}
 
EITSourcem_eitSource {nullptr}
 
EITHelperm_eitHelper {nullptr}
 
MThreadm_eventThread {nullptr}
 
volatile bool m_exitThread {false}
 
QWaitCondition m_exitThreadCond
 
TVRecm_rec {nullptr}
 
volatile bool m_activeScan {false}
 
volatile bool m_activeScanStopped {true}
 
QWaitCondition m_activeScanCond
 
QDateTime m_activeScanNextTrig
 
uint m_activeScanTrigTime {0}
 
QStringList m_activeScanChannels
 
QStringList::iterator m_activeScanNextChan
 
uint m_activeScanNextChanIndex {(uint)random()}
 
uint m_cardnum
 

Static Private Attributes

static QMutex s_resched_lock
 
static QDateTime s_resched_next_time
 
static const uint kMinRescheduleInterval
 Minumum number of seconds between reschedules. More...
 

Detailed Description

Acts as glue between ChannelBase, EITSource, and EITHelper.

This is the class where the "EIT Crawl" is implemented.

Definition at line 30 of file eitscanner.h.

Constructor & Destructor Documentation

◆ EITScanner()

EITScanner::EITScanner ( uint  cardnum)
explicit

Definition at line 32 of file eitscanner.cpp.

◆ ~EITScanner()

EITScanner::~EITScanner ( )
inline

Definition at line 34 of file eitscanner.h.

Member Function Documentation

◆ StartPassiveScan()

void EITScanner::StartPassiveScan ( ChannelBase channel,
EITSource eitSource 
)

Start inserting Event Information Tables from the multiplex we happen to be tuned to into the database.

Definition at line 199 of file eitscanner.cpp.

Referenced by TVRec::TuningSignalCheck().

◆ StopPassiveScan()

void EITScanner::StopPassiveScan ( void  )

Stops inserting Event Information Tables into DB.

Definition at line 218 of file eitscanner.cpp.

Referenced by StopActiveScan(), and TVRec::TuningShutdowns().

◆ StartActiveScan()

void EITScanner::StartActiveScan ( TVRec _rec,
uint  max_seconds_per_source 
)

Definition at line 234 of file eitscanner.cpp.

Referenced by TVRec::run().

◆ StopActiveScan()

void EITScanner::StopActiveScan ( void  )

Definition at line 299 of file eitscanner.cpp.

Referenced by TVRec::HandleStateChange(), TeardownAll(), and TVRec::TuningShutdowns().

◆ run()

void EITScanner::run ( void  )
overrideprotected

This runs the event loop for EITScanner until 'exitThread' is true.

Definition at line 66 of file eitscanner.cpp.

◆ TeardownAll()

void EITScanner::TeardownAll ( void  )
private

Definition at line 42 of file eitscanner.cpp.

Referenced by ~EITScanner().

◆ SpawnEventLoop()

static void* EITScanner::SpawnEventLoop ( void *  )
staticprivate

◆ RescheduleRecordings()

void EITScanner::RescheduleRecordings ( void  )
private

Tells scheduler about programming changes.

This implements some very basic rate limiting. If a call is made to this within kMinRescheduleInterval of the last call it is ignored.

Definition at line 190 of file eitscanner.cpp.

Referenced by run().

Member Data Documentation

◆ m_lock

QMutex EITScanner::m_lock
private

Definition at line 51 of file eitscanner.h.

Referenced by run(), StartPassiveScan(), StopActiveScan(), StopPassiveScan(), and TeardownAll().

◆ m_channel

ChannelBase* EITScanner::m_channel {nullptr}
private

Definition at line 52 of file eitscanner.h.

Referenced by StartPassiveScan(), and StopPassiveScan().

◆ m_eitSource

EITSource* EITScanner::m_eitSource {nullptr}
private

Definition at line 53 of file eitscanner.h.

Referenced by run(), StartPassiveScan(), and StopPassiveScan().

◆ m_eitHelper

EITHelper* EITScanner::m_eitHelper {nullptr}
private

◆ m_eventThread

MThread* EITScanner::m_eventThread {nullptr}
private

Definition at line 56 of file eitscanner.h.

Referenced by EITScanner(), and TeardownAll().

◆ m_exitThread

volatile bool EITScanner::m_exitThread {false}
private

Definition at line 57 of file eitscanner.h.

Referenced by run(), and TeardownAll().

◆ m_exitThreadCond

QWaitCondition EITScanner::m_exitThreadCond
private

Definition at line 58 of file eitscanner.h.

Referenced by run(), StopActiveScan(), and TeardownAll().

◆ m_rec

TVRec* EITScanner::m_rec {nullptr}
private

Definition at line 60 of file eitscanner.h.

Referenced by run(), StartActiveScan(), and StopActiveScan().

◆ m_activeScan

volatile bool EITScanner::m_activeScan {false}
private

Definition at line 61 of file eitscanner.h.

Referenced by run(), StartActiveScan(), and StopActiveScan().

◆ m_activeScanStopped

volatile bool EITScanner::m_activeScanStopped {true}
private

Definition at line 62 of file eitscanner.h.

Referenced by run(), StartActiveScan(), and StopActiveScan().

◆ m_activeScanCond

QWaitCondition EITScanner::m_activeScanCond
private

Definition at line 63 of file eitscanner.h.

Referenced by run(), and StopActiveScan().

◆ m_activeScanNextTrig

QDateTime EITScanner::m_activeScanNextTrig
private

Definition at line 64 of file eitscanner.h.

Referenced by run(), and StartActiveScan().

◆ m_activeScanTrigTime

uint EITScanner::m_activeScanTrigTime {0}
private

Definition at line 65 of file eitscanner.h.

Referenced by run(), and StartActiveScan().

◆ m_activeScanChannels

QStringList EITScanner::m_activeScanChannels
private

Definition at line 66 of file eitscanner.h.

Referenced by run(), and StartActiveScan().

◆ m_activeScanNextChan

QStringList::iterator EITScanner::m_activeScanNextChan
private

Definition at line 67 of file eitscanner.h.

Referenced by run(), and StartActiveScan().

◆ m_activeScanNextChanIndex

uint EITScanner::m_activeScanNextChanIndex {(uint)random()}
private

Definition at line 68 of file eitscanner.h.

Referenced by run(), and StartActiveScan().

◆ m_cardnum

uint EITScanner::m_cardnum
private

Definition at line 70 of file eitscanner.h.

◆ s_resched_lock

QMutex EITScanner::s_resched_lock
staticprivate

Definition at line 72 of file eitscanner.h.

◆ s_resched_next_time

QDateTime EITScanner::s_resched_next_time
staticprivate

Definition at line 73 of file eitscanner.h.

◆ kMinRescheduleInterval

const uint EITScanner::kMinRescheduleInterval
staticprivate

Minumum number of seconds between reschedules.

Definition at line 76 of file eitscanner.h.


The documentation for this class was generated from the following files: