TVBrowseHelper Class Reference

#include <tvbrowsehelper.h>

Inheritance diagram for TVBrowseHelper:
MThread

List of all members.

Public Member Functions

 TVBrowseHelper (TV *tv, QString time_format, QString short_date_format, uint browse_max_forward, bool browse_all_tuners, bool use_channel_groups, QString db_channel_ordering)
virtual ~TVBrowseHelper ()
void Stop ()
void Wait ()
bool BrowseStart (PlayerContext *ctx, bool skip_browse=false)
 Begins channel browsing.
void BrowseEnd (PlayerContext *ctx, bool change_channel)
 Ends channel browsing.
void BrowseDispInfo (PlayerContext *ctx, BrowseInfo &bi)
void BrowseDispInfo (PlayerContext *ctx, BrowseDirection direction)
void BrowseChannel (PlayerContext *ctx, const QString &channum)
BrowseInfo GetBrowsedInfo (void) const
bool IsBrowsing (void) const
uint GetChanId (const QString &channum, uint pref_cardid, uint pref_sourceid) const
 Returns a chanid for the channum, or 0 if none is available.

Protected Member Functions

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

Protected Attributes

TVm_tv
DBChanList db_all_channels
DBChanList db_all_visible_channels
QString db_time_format
QString db_short_date_format
uint db_browse_max_forward
bool db_browse_all_tuners
bool db_use_channel_groups
QHash< uint, QString > db_chanid_to_channum
QHash< uint, uintdb_chanid_to_sourceid
QMultiMap< QString, uintdb_channum_to_chanids
QMutex m_lock
PlayerContextm_ctx
QString m_channum
uint m_chanid
QString m_starttime
bool m_run
QWaitCondition m_wait
QList< BrowseInfom_list

Detailed Description

Definition at line 64 of file tvbrowsehelper.h.


Constructor & Destructor Documentation

TVBrowseHelper::TVBrowseHelper ( TV tv,
QString  time_format,
QString  short_date_format,
uint  browse_max_forward,
bool  browse_all_tuners,
bool  use_channel_groups,
QString  db_channel_ordering 
)

Definition at line 32 of file tvbrowsehelper.cpp.

virtual TVBrowseHelper::~TVBrowseHelper (  )  [inline, virtual]

Definition at line 75 of file tvbrowsehelper.h.


Member Function Documentation

void TVBrowseHelper::Stop ( void   )  [inline]

Definition at line 81 of file tvbrowsehelper.h.

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

void TVBrowseHelper::Wait (  )  [inline]

Definition at line 89 of file tvbrowsehelper.h.

Referenced by ~TVBrowseHelper().

bool TVBrowseHelper::BrowseStart ( PlayerContext ctx,
bool  skip_browse = false 
)

Begins channel browsing.

Note:
This may only be called from the UI thread.

Definition at line 75 of file tvbrowsehelper.cpp.

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

void TVBrowseHelper::BrowseEnd ( PlayerContext ctx,
bool  change_channel 
)

Ends channel browsing.

Changing the channel if change_channel is true.

Note:
This may only be called from the UI thread.
Parameters:
ctx PlayerContext to end browsing on
change_channel iff true we call ChangeChannel()

Definition at line 117 of file tvbrowsehelper.cpp.

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

void TVBrowseHelper::BrowseDispInfo ( PlayerContext ctx,
BrowseInfo bi 
)
void TVBrowseHelper::BrowseDispInfo ( PlayerContext ctx,
BrowseDirection  direction 
) [inline]

Definition at line 95 of file tvbrowsehelper.h.

void TVBrowseHelper::BrowseChannel ( PlayerContext ctx,
const QString &  channum 
)

Definition at line 178 of file tvbrowsehelper.cpp.

Referenced by TV::CommitQueuedInput().

BrowseInfo TVBrowseHelper::GetBrowsedInfo ( void   )  const

Definition at line 203 of file tvbrowsehelper.cpp.

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

bool TVBrowseHelper::IsBrowsing ( void   )  const
uint TVBrowseHelper::GetChanId ( const QString &  channum,
uint  pref_cardid,
uint  pref_sourceid 
) const

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 db_browse_all_tuners is set then it will look to see if the chanid is available on any tuner.

Definition at line 234 of file tvbrowsehelper.cpp.

Referenced by TV::CommitQueuedInput().

void TVBrowseHelper::GetNextProgram ( BrowseDirection  direction,
InfoMap infoMap 
) const [protected]

Fetches information on the desired program from the backend.

Parameters:
enc RemoteEncoder to query, if null query the actx->recorder.
direction BrowseDirection to get information on.
infoMap InfoMap to fill in with returned data

Definition at line 276 of file tvbrowsehelper.cpp.

Referenced by run().

void TVBrowseHelper::GetNextProgramDB ( BrowseDirection  direction,
InfoMap infoMap 
) const [protected]

Definition at line 337 of file tvbrowsehelper.cpp.

Referenced by run().

void TVBrowseHelper::run ( void   )  [protected, virtual]

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 419 of file tvbrowsehelper.cpp.


Member Data Documentation

TV* TVBrowseHelper::m_tv [protected]

Definition at line 115 of file tvbrowsehelper.h.

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

Definition at line 116 of file tvbrowsehelper.h.

Referenced by GetChanId(), and TVBrowseHelper().

Definition at line 117 of file tvbrowsehelper.h.

Referenced by GetNextProgramDB(), and TVBrowseHelper().

QString TVBrowseHelper::db_time_format [protected]

Definition at line 118 of file tvbrowsehelper.h.

Referenced by GetNextProgram().

Definition at line 119 of file tvbrowsehelper.h.

Referenced by GetNextProgram().

Definition at line 120 of file tvbrowsehelper.h.

Referenced by run().

Definition at line 121 of file tvbrowsehelper.h.

Referenced by BrowseChannel(), GetChanId(), and run().

Definition at line 122 of file tvbrowsehelper.h.

Referenced by run().

QHash<uint,QString> TVBrowseHelper::db_chanid_to_channum [protected]

Definition at line 123 of file tvbrowsehelper.h.

Referenced by GetNextProgramDB(), and TVBrowseHelper().

Definition at line 124 of file tvbrowsehelper.h.

Referenced by run(), and TVBrowseHelper().

QMultiMap<QString,uint> TVBrowseHelper::db_channum_to_chanids [protected]

Definition at line 125 of file tvbrowsehelper.h.

Referenced by run(), and TVBrowseHelper().

QMutex TVBrowseHelper::m_lock [mutable, protected]

Definition at line 127 of file tvbrowsehelper.h.

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

QString TVBrowseHelper::m_channum [protected]

Definition at line 129 of file tvbrowsehelper.h.

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

Definition at line 130 of file tvbrowsehelper.h.

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

QString TVBrowseHelper::m_starttime [protected]

Definition at line 131 of file tvbrowsehelper.h.

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

Definition at line 132 of file tvbrowsehelper.h.

Referenced by run(), and Stop().

QWaitCondition TVBrowseHelper::m_wait [protected]

Definition at line 133 of file tvbrowsehelper.h.

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

QList<BrowseInfo> TVBrowseHelper::m_list [protected]

Definition at line 134 of file tvbrowsehelper.h.

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


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends
Generated on Fri May 25 06:42:29 2012 for MythTV by  doxygen 1.6.3