LiveTVChain Class Reference

Keeps track of recordings in a current LiveTV instance. More...

#include <livetvchain.h>

List of all members.

Public Member Functions

 LiveTVChain ()
 ~LiveTVChain ()
QString InitializeNewChain (const QString &seed)
void LoadFromExistingChain (const QString &id)
void SetHostPrefix (const QString &prefix)
void SetCardType (const QString &type)
void DestroyChain (void)
void AppendNewProgram (ProgramInfo *pginfo, QString channum, QString inputname, bool discont)
void FinishedRecording (ProgramInfo *pginfo)
void DeleteProgram (ProgramInfo *pginfo)
void ReloadAll ()
QString GetID (void) const
int GetCurPos (void) const
int ProgramIsAt (uint chanid, const QDateTime &starttime) const
int ProgramIsAt (const ProgramInfo &pginfo) const
int GetLengthAtCurPos (void)
int TotalSize (void) const
bool HasNext (void) const
bool HasPrev (void) const
ProgramInfoGetProgramAt (int at) const
 Returns program at the desired location.
bool NeedsToSwitch (void) const
 Returns true iff a switch is required but no jump is required.
bool NeedsToJump (void) const
 Returns true iff a switch and jump are required.
QString GetChannelName (int pos=-1) const
QString GetInputName (int pos=-1) const
QString GetCardType (int pos=-1) const
void SetProgram (const ProgramInfo &pginfo)
void SwitchTo (int num)
 Sets the recording to switch to.
void SwitchToNext (bool up)
 Sets the recording to switch to.
void ClearSwitch (void)
ProgramInfoGetSwitchProgram (bool &discont, bool &newtype, int &newid)
 Returns the recording we should switch to.
void JumpTo (int num, int pos)
void JumpToNext (bool up, int pos)
int GetJumpPos (void)
 Returns the jump position and clears it.
void SetHostSocket (MythSocket *sock)
bool IsHostSocket (const MythSocket *sock) const
uint HostSocketCount (void) const
void DelHostSocket (MythSocket *sock)
QString toString () const

Private Member Functions

void BroadcastUpdate ()
void GetEntryAt (int at, LiveTVChainEntry &entry) const

Static Private Member Functions

static ProgramInfoEntryToProgram (const LiveTVChainEntry &entry)

Private Attributes

QString m_id
QList< LiveTVChainEntrym_chain
int m_maxpos
QMutex m_lock
QString m_hostprefix
QString m_cardtype
int m_curpos
uint m_cur_chanid
QDateTime m_cur_startts
int m_switchid
LiveTVChainEntry m_switchentry
int m_jumppos
QMutex m_sockLock
QList< MythSocket * > m_inUseSocks

Detailed Description

Keeps track of recordings in a current LiveTV instance.

Definition at line 26 of file livetvchain.h.


Constructor & Destructor Documentation

LiveTVChain::LiveTVChain (  ) 

Definition at line 26 of file livetvchain.cpp.

LiveTVChain::~LiveTVChain (  ) 

Definition at line 34 of file livetvchain.cpp.


Member Function Documentation

QString LiveTVChain::InitializeNewChain ( const QString &  seed  ) 

Definition at line 38 of file livetvchain.cpp.

Referenced by PlayerContext::SetTVChain().

void LiveTVChain::LoadFromExistingChain ( const QString &  id  ) 

Definition at line 55 of file livetvchain.cpp.

Referenced by MainServer::HandleRecorderQuery().

void LiveTVChain::SetHostPrefix ( const QString &  prefix  ) 

Definition at line 45 of file livetvchain.cpp.

Referenced by TVRec::SpawnLiveTV().

void LiveTVChain::SetCardType ( const QString &  type  ) 

Definition at line 50 of file livetvchain.cpp.

Referenced by TVRec::SpawnLiveTV(), and TVRec::TuningFrequency().

void LiveTVChain::DestroyChain ( void   ) 

Definition at line 196 of file livetvchain.cpp.

Referenced by PlayerContext::SetTVChain().

void LiveTVChain::AppendNewProgram ( ProgramInfo pginfo,
QString  channum,
QString  inputname,
bool  discont 
)

Definition at line 61 of file livetvchain.cpp.

Referenced by TVRec::CreateLiveTVRingBuffer(), and TVRec::SwitchLiveTVRingBuffer().

void LiveTVChain::FinishedRecording ( ProgramInfo pginfo  ) 

Definition at line 112 of file livetvchain.cpp.

Referenced by TVRec::FinishedRecording().

void LiveTVChain::DeleteProgram ( ProgramInfo pginfo  ) 

Definition at line 144 of file livetvchain.cpp.

Referenced by MainServer::DoDeleteThread().

void LiveTVChain::ReloadAll ( void   ) 
QString LiveTVChain::GetID ( void   )  const [inline]
int LiveTVChain::GetCurPos ( void   )  const [inline]

Definition at line 49 of file livetvchain.h.

Referenced by MythPlayer::OpenFile().

int LiveTVChain::ProgramIsAt ( uint  chanid,
const QDateTime &  starttime 
) const
Returns:
program location or -1 for not found.

Definition at line 316 of file livetvchain.cpp.

Referenced by ProgramIsAt(), ReloadAll(), and SetProgram().

int LiveTVChain::ProgramIsAt ( const ProgramInfo pginfo  )  const
Returns:
program location or -1 for not found.

Definition at line 337 of file livetvchain.cpp.

int LiveTVChain::GetLengthAtCurPos ( void   ) 
Returns:
length in seocnds of recording at m_curpos

Definition at line 345 of file livetvchain.cpp.

Referenced by MythPlayer::calcSliderPos().

int LiveTVChain::TotalSize ( void   )  const

Definition at line 357 of file livetvchain.cpp.

Referenced by TVRec::CreateLiveTVRingBuffer().

bool LiveTVChain::HasNext ( void   )  const
bool LiveTVChain::HasPrev ( void   )  const [inline]

Definition at line 55 of file livetvchain.h.

Referenced by MythPlayer::CalcRWTime(), MythPlayer::calcSliderPos(), and SwitchToNext().

ProgramInfo * LiveTVChain::GetProgramAt ( int  at  )  const

Returns program at the desired location.

NOTE: The caller must delete the returned program.

Parameters:
at ProgramInfo to return [0..TotalSize()-1] or -1 for last program

Definition at line 305 of file livetvchain.cpp.

Referenced by PlayerContext::ReloadTVChain(), TVRec::SwitchLiveTVRingBuffer(), and TVRec::TuningRestartRecorder().

bool LiveTVChain::NeedsToSwitch ( void   )  const [inline]

Returns true iff a switch is required but no jump is required.

Definition at line 58 of file livetvchain.h.

Referenced by MythPlayer::EventLoop().

bool LiveTVChain::NeedsToJump ( void   )  const [inline]

Returns true iff a switch and jump are required.

Definition at line 61 of file livetvchain.h.

Referenced by MythPlayer::EventLoop().

QString LiveTVChain::GetChannelName ( int  pos = -1  )  const
QString LiveTVChain::GetInputName ( int  pos = -1  )  const

Definition at line 545 of file livetvchain.cpp.

Referenced by TV::UpdateOSDInput().

QString LiveTVChain::GetCardType ( int  pos = -1  )  const
void LiveTVChain::SetProgram ( const ProgramInfo pginfo  ) 
void LiveTVChain::SwitchTo ( int  num  ) 

Sets the recording to switch to.

Parameters:
num Index of recording to switch to, -1 for last recording.

Definition at line 470 of file livetvchain.cpp.

Referenced by JumpTo(), and SwitchToNext().

void LiveTVChain::SwitchToNext ( bool  up  ) 

Sets the recording to switch to.

Parameters:
up Set to true to switch to the next recording, false to switch to the previous recording.

Definition at line 504 of file livetvchain.cpp.

Referenced by JumpToNext(), and RingBuffer::run().

void LiveTVChain::ClearSwitch ( void   ) 

Definition at line 378 of file livetvchain.cpp.

Referenced by GetSwitchProgram().

ProgramInfo * LiveTVChain::GetSwitchProgram ( bool discont,
bool newtype,
int &  newid 
)

Returns the recording we should switch to.

This returns a ProgramInfo* and tells us if this is a discontiuous switch and whether the recording type is changing.

This also clears the NeedsToSwitch()/NeedsToJump() state.

NOTE: The caller is resposible for deleting the ProgramInfo

Definition at line 396 of file livetvchain.cpp.

Referenced by MythPlayer::JumpToProgram(), and MythPlayer::SwitchToProgram().

void LiveTVChain::JumpTo ( int  num,
int  pos 
)

Definition at line 515 of file livetvchain.cpp.

Referenced by TV::UnpauseLiveTV().

void LiveTVChain::JumpToNext ( bool  up,
int  pos 
)
int LiveTVChain::GetJumpPos ( void   ) 

Returns the jump position and clears it.

Definition at line 530 of file livetvchain.cpp.

Referenced by MythPlayer::JumpToProgram().

void LiveTVChain::SetHostSocket ( MythSocket sock  ) 

Definition at line 561 of file livetvchain.cpp.

Referenced by MainServer::HandleRecorderQuery().

bool LiveTVChain::IsHostSocket ( const MythSocket sock  )  const

Definition at line 569 of file livetvchain.cpp.

uint LiveTVChain::HostSocketCount ( void   )  const
void LiveTVChain::DelHostSocket ( MythSocket sock  ) 
QString LiveTVChain::toString ( void   )  const

Definition at line 596 of file livetvchain.cpp.

Referenced by MythPlayer::JumpToProgram(), and MythPlayer::SwitchToProgram().

void LiveTVChain::BroadcastUpdate ( void   )  [private]

Definition at line 189 of file livetvchain.cpp.

Referenced by AppendNewProgram(), DeleteProgram(), and FinishedRecording().

void LiveTVChain::GetEntryAt ( int  at,
LiveTVChainEntry entry 
) const [private]
ProgramInfo * LiveTVChain::EntryToProgram ( const LiveTVChainEntry entry  )  [static, private]

Definition at line 281 of file livetvchain.cpp.

Referenced by GetProgramAt(), and GetSwitchProgram().


Member Data Documentation

QString LiveTVChain::m_id [private]
int LiveTVChain::m_maxpos [private]

Definition at line 94 of file livetvchain.h.

Referenced by AppendNewProgram(), and ReloadAll().

QMutex LiveTVChain::m_lock [mutable, private]
QString LiveTVChain::m_hostprefix [private]

Definition at line 97 of file livetvchain.h.

Referenced by AppendNewProgram(), and SetHostPrefix().

QString LiveTVChain::m_cardtype [private]

Definition at line 98 of file livetvchain.h.

Referenced by AppendNewProgram(), and SetCardType().

int LiveTVChain::m_curpos [private]

Definition at line 101 of file livetvchain.h.

Referenced by ReloadAll(), and SetProgram().

QDateTime LiveTVChain::m_cur_startts [private]

Definition at line 102 of file livetvchain.h.

Referenced by ReloadAll(), and SetProgram().

int LiveTVChain::m_switchid [private]

Definition at line 104 of file livetvchain.h.

Referenced by ClearSwitch(), GetSwitchProgram(), ReloadAll(), SetProgram(), and SwitchTo().

Definition at line 105 of file livetvchain.h.

Referenced by LiveTVChain(), ReloadAll(), and SwitchTo().

int LiveTVChain::m_jumppos [private]

Definition at line 107 of file livetvchain.h.

Referenced by ClearSwitch(), GetJumpPos(), JumpTo(), and JumpToNext().

QMutex LiveTVChain::m_sockLock [mutable, private]

Definition at line 109 of file livetvchain.h.

Referenced by DelHostSocket(), HostSocketCount(), IsHostSocket(), and SetHostSocket().

Definition at line 110 of file livetvchain.h.

Referenced by DelHostSocket(), HostSocketCount(), IsHostSocket(), and SetHostSocket().


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 Feb 10 06:42:03 2012 for MythTV by  doxygen 1.6.3