MythTV  master
Protected Member Functions | Protected Attributes | Private Member Functions | Private Attributes | Friends | List of all members
TVBrowseHelper Class Reference

#include <tvbrowsehelper.h>

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

Protected Member Functions

 TVBrowseHelper (TV *Parent)
 
 ~TVBrowseHelper () override
 
void BrowseInit (std::chrono::seconds BrowseMaxForward, bool BrowseAllTuners, bool UseChannelGroups, const QString &DBChannelOrdering)
 
void BrowseStop ()
 
void BrowseWait ()
 
bool BrowseStart (bool SkipBrowse=false)
 Begins channel browsing. More...
 
void BrowseEnd (bool ChangeChannel)
 Ends channel browsing. More...
 
void BrowseDispInfo (const BrowseInfo &Browseinfo)
 
void BrowseDispInfo (BrowseDirection Direction)
 
void BrowseChannel (const QString &Channum)
 
BrowseInfo GetBrowsedInfo () const
 
uint GetBrowseChanId (const QString &Channum, uint PrefCardid, uint PrefSourceid) const
 Returns a chanid for the channum, or 0 if none is available. More...
 
- Protected Member Functions inherited from MThread
int exec (void)
 Enters the qt event loop. call exit or quit to exit thread. More...
 

Protected Attributes

int m_browseTimerId { 0 }
 
- Protected Attributes inherited from MThread
MThreadInternalm_thread {nullptr}
 
QRunnable * m_runnable {nullptr}
 
bool m_prologExecuted {true}
 
bool m_epilogExecuted {true}
 

Private Member Functions

void GetNextProgram (BrowseDirection Direction, InfoMap &Infomap) const
 Fetches information on the desired program from the backend. More...
 
void GetNextProgramDB (BrowseDirection Direction, InfoMap &Infomap) const
 
void run () override
 Runs the Qt event loop unless we have a QRunnable, in which case we run the runnable run instead. More...
 

Private Attributes

TVm_parent { nullptr }
 
ChannelInfoList m_dbAllChannels
 
ChannelInfoList m_dbAllVisibleChannels
 
std::chrono::seconds m_dbBrowseMaxForward { 0s }
 
bool m_dbBrowseAllTuners { false }
 
bool m_dbUseChannelGroups { false }
 
QHash< uint, QString > m_dbChanidToChannum
 
QHash< uint, uintm_dbChanidToSourceid
 
QMultiMap< QString, uintm_dbChannumToChanids
 
QMutex m_browseLock
 
QString m_browseChanNum
 
uint m_browseChanId { 0 }
 
QString m_browseStartTime
 
bool m_browseRun { true }
 
QWaitCondition m_browseWait
 
QList< BrowseInfom_browseList
 

Friends

class TV
 

Additional Inherited Members

- Public Member Functions inherited from MThread
 MThread (const QString &objectName)
 Standard constructor. More...
 
 MThread (const QString &objectName, QRunnable *runnable)
 Use this constructor if you want the default run() method to run the QRunnable's run() method instead of entering the Qt event loop. More...
 
virtual ~MThread ()
 
 MThread (const MThread &)=delete
 
MThreadoperator= (const MThread &)=delete
 
void RunProlog (void)
 Sets up a thread, call this if you reimplement run(). More...
 
void RunEpilog (void)
 Cleans up a thread's resources, call this if you reimplement run(). More...
 
QThread * qthread (void)
 Returns the thread, this will always return the same pointer no matter how often you restart the thread. More...
 
void setObjectName (const QString &name)
 
QString objectName (void) const
 
void setPriority (QThread::Priority priority)
 
QThread::Priority priority (void) const
 
bool isFinished (void) const
 
bool isRunning (void) const
 
void setStackSize (uint stackSize)
 
uint stackSize (void) const
 
void exit (int retcode=0)
 Use this to exit from the thread if you are using a Qt event loop. More...
 
void start (QThread::Priority p=QThread::InheritPriority)
 Tell MThread to start running the thread in the near future. More...
 
void terminate (void)
 Kill a thread unsafely. More...
 
void quit (void)
 calls exit(0) More...
 
bool wait (std::chrono::milliseconds time=std::chrono::milliseconds::max())
 Wait for the MThread to exit, with a maximum timeout. More...
 
- Static Public Member Functions inherited from MThread
static void ThreadSetup (const QString &name)
 This is to be called on startup in those few threads that haven't been ported to MThread. More...
 
static void ThreadCleanup (void)
 This is to be called on exit in those few threads that haven't been ported to MThread. More...
 
static void Cleanup (void)
 This will print out all the running threads, call exit(1) on each and then wait up to 5 seconds total for all the threads to exit. More...
 
static void GetAllThreadNames (QStringList &list)
 
static void GetAllRunningThreadNames (QStringList &list)
 
- Static Protected Member Functions inherited from MThread
static void setTerminationEnabled (bool enabled=true)
 
static void usleep (std::chrono::microseconds time)
 
template<typename R , typename P >
static std::enable_if_t< std::chrono::treat_as_floating_point< R >::value, void > usleep (std::chrono::duration< R, P > time)
 

Detailed Description

Definition at line 45 of file tvbrowsehelper.h.

Constructor & Destructor Documentation

◆ TVBrowseHelper()

TVBrowseHelper::TVBrowseHelper ( TV Parent)
explicitprotected

Definition at line 28 of file tvbrowsehelper.cpp.

◆ ~TVBrowseHelper()

TVBrowseHelper::~TVBrowseHelper ( )
overrideprotected

Definition at line 34 of file tvbrowsehelper.cpp.

Member Function Documentation

◆ BrowseInit()

void TVBrowseHelper::BrowseInit ( std::chrono::seconds  BrowseMaxForward,
bool  BrowseAllTuners,
bool  UseChannelGroups,
const QString &  DBChannelOrdering 
)
protected

Definition at line 40 of file tvbrowsehelper.cpp.

Referenced by TV::InitFromDB().

◆ BrowseStop()

void TVBrowseHelper::BrowseStop ( )
protected

Definition at line 62 of file tvbrowsehelper.cpp.

Referenced by TV::~TV(), and ~TVBrowseHelper().

◆ BrowseWait()

void TVBrowseHelper::BrowseWait ( )
protected

Definition at line 70 of file tvbrowsehelper.cpp.

Referenced by TV::~TV(), and ~TVBrowseHelper().

◆ BrowseStart()

bool TVBrowseHelper::BrowseStart ( bool  SkipBrowse = false)
protected

Begins channel browsing.

Note
This may only be called from the UI thread.

Definition at line 77 of file tvbrowsehelper.cpp.

Referenced by BrowseDispInfo(), TV::OSDDialogEvent(), and TV::ToggleHandleAction().

◆ BrowseEnd()

void TVBrowseHelper::BrowseEnd ( bool  ChangeChannel)
protected

Ends channel browsing.

Changing the channel if change_channel is true.

Note
This may only be called from the UI thread.
Parameters
change_channeliff true we call ChangeChannel()

Definition at line 117 of file tvbrowsehelper.cpp.

Referenced by TV::BrowseHandleAction(), TV::ClearOSD(), TV::ShowOSDAskAllow(), and TV::timerEvent().

◆ BrowseDispInfo() [1/2]

void TVBrowseHelper::BrowseDispInfo ( const BrowseInfo Browseinfo)
protected

◆ BrowseDispInfo() [2/2]

void TVBrowseHelper::BrowseDispInfo ( BrowseDirection  Direction)
protected

Definition at line 160 of file tvbrowsehelper.cpp.

◆ BrowseChannel()

void TVBrowseHelper::BrowseChannel ( const QString &  Channum)
protected

Definition at line 167 of file tvbrowsehelper.cpp.

Referenced by TV::CommitQueuedInput().

◆ GetBrowsedInfo()

BrowseInfo TVBrowseHelper::GetBrowsedInfo ( ) const
protected

Definition at line 197 of file tvbrowsehelper.cpp.

Referenced by TV::CommitQueuedInput(), and TV::QuickRecord().

◆ GetBrowseChanId()

uint TVBrowseHelper::GetBrowseChanId ( const QString &  Channum,
uint  PrefCardid,
uint  PrefSourceid 
) const
protected

Returns a chanid for the channum, or 0 if none is available.

This will prefer a given sourceid first, and then a given card id, but if one or the other can not be satisfied but m_dbBrowseAllTuners is set then it will look to see if the chanid is available on any tuner.

Definition at line 214 of file tvbrowsehelper.cpp.

Referenced by TV::CommitQueuedInput().

◆ GetNextProgram()

void TVBrowseHelper::GetNextProgram ( BrowseDirection  Direction,
InfoMap Infomap 
) const
private

Fetches information on the desired program from the backend.

Parameters
directionBrowseDirection to get information on.
infoMapInfoMap to fill in with returned data

Definition at line 250 of file tvbrowsehelper.cpp.

Referenced by run().

◆ GetNextProgramDB()

void TVBrowseHelper::GetNextProgramDB ( BrowseDirection  Direction,
InfoMap Infomap 
) const
private

Definition at line 322 of file tvbrowsehelper.cpp.

Referenced by run().

◆ run()

void TVBrowseHelper::run ( )
overrideprivatevirtual

Runs the Qt event loop unless we have a QRunnable, in which case we run the runnable run instead.

Note
If you override this method you must call RunProlog before you do any work and RunEpilog before you exit the run method.

Reimplemented from MThread.

Definition at line 398 of file tvbrowsehelper.cpp.

Friends And Related Function Documentation

◆ TV

friend class TV
friend

Definition at line 47 of file tvbrowsehelper.h.

Referenced by TV::AcquireRelease().

Member Data Documentation

◆ m_browseTimerId

int TVBrowseHelper::m_browseTimerId { 0 }
protected

Definition at line 65 of file tvbrowsehelper.h.

Referenced by BrowseDispInfo(), BrowseEnd(), BrowseStart(), and TV::timerEvent().

◆ m_parent

TV* TVBrowseHelper::m_parent { nullptr }
private

◆ m_dbAllChannels

ChannelInfoList TVBrowseHelper::m_dbAllChannels
private

Definition at line 74 of file tvbrowsehelper.h.

Referenced by BrowseInit(), and GetBrowseChanId().

◆ m_dbAllVisibleChannels

ChannelInfoList TVBrowseHelper::m_dbAllVisibleChannels
private

Definition at line 75 of file tvbrowsehelper.h.

Referenced by BrowseInit(), and GetNextProgramDB().

◆ m_dbBrowseMaxForward

std::chrono::seconds TVBrowseHelper::m_dbBrowseMaxForward { 0s }
private

Definition at line 76 of file tvbrowsehelper.h.

Referenced by BrowseInit(), and run().

◆ m_dbBrowseAllTuners

bool TVBrowseHelper::m_dbBrowseAllTuners { false }
private

Definition at line 77 of file tvbrowsehelper.h.

Referenced by BrowseChannel(), BrowseInit(), GetBrowseChanId(), and run().

◆ m_dbUseChannelGroups

bool TVBrowseHelper::m_dbUseChannelGroups { false }
private

Definition at line 78 of file tvbrowsehelper.h.

Referenced by BrowseInit(), and run().

◆ m_dbChanidToChannum

QHash<uint,QString> TVBrowseHelper::m_dbChanidToChannum
private

Definition at line 79 of file tvbrowsehelper.h.

Referenced by BrowseInit(), and GetNextProgramDB().

◆ m_dbChanidToSourceid

QHash<uint,uint> TVBrowseHelper::m_dbChanidToSourceid
private

Definition at line 80 of file tvbrowsehelper.h.

Referenced by BrowseInit(), and run().

◆ m_dbChannumToChanids

QMultiMap<QString,uint> TVBrowseHelper::m_dbChannumToChanids
private

Definition at line 81 of file tvbrowsehelper.h.

Referenced by BrowseInit(), and run().

◆ m_browseLock

QMutex TVBrowseHelper::m_browseLock
mutableprivate

Definition at line 83 of file tvbrowsehelper.h.

Referenced by BrowseDispInfo(), BrowseEnd(), BrowseStart(), BrowseStop(), GetBrowsedInfo(), and run().

◆ m_browseChanNum

QString TVBrowseHelper::m_browseChanNum
private

Definition at line 84 of file tvbrowsehelper.h.

Referenced by BrowseEnd(), BrowseStart(), GetBrowsedInfo(), and run().

◆ m_browseChanId

uint TVBrowseHelper::m_browseChanId { 0 }
private

Definition at line 85 of file tvbrowsehelper.h.

Referenced by BrowseStart(), GetBrowsedInfo(), and run().

◆ m_browseStartTime

QString TVBrowseHelper::m_browseStartTime
private

Definition at line 86 of file tvbrowsehelper.h.

Referenced by BrowseStart(), GetBrowsedInfo(), and run().

◆ m_browseRun

bool TVBrowseHelper::m_browseRun { true }
private

Definition at line 87 of file tvbrowsehelper.h.

Referenced by BrowseStop(), and run().

◆ m_browseWait

QWaitCondition TVBrowseHelper::m_browseWait
private

Definition at line 88 of file tvbrowsehelper.h.

Referenced by BrowseDispInfo(), BrowseEnd(), BrowseStop(), and run().

◆ m_browseList

QList<BrowseInfo> TVBrowseHelper::m_browseList
private

Definition at line 89 of file tvbrowsehelper.h.

Referenced by BrowseDispInfo(), BrowseEnd(), BrowseStop(), and run().


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