LiveTVChain Class Reference

#include <livetvchain.h>

List of all members.


Detailed Description

Keeps track of recordings in a current LiveTV instance.

Definition at line 27 of file livetvchain.h.


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 (const QString &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 (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 (MythSocket *sock)
int HostSocketCount (void)
void DelHostSocket (MythSocket *sock)

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
QValueList< LiveTVChainEntrym_chain
int m_maxpos
QMutex m_lock
QString m_hostprefix
QString m_cardtype
int m_curpos
QString m_cur_chanid
QDateTime m_cur_startts
int m_switchid
LiveTVChainEntry m_switchentry
int m_jumppos
QMutex m_sockLock
QPtrList< MythSocketm_inUseSocks

Constructor & Destructor Documentation

LiveTVChain::LiveTVChain (  ) 

Definition at line 12 of file livetvchain.cpp.

LiveTVChain::~LiveTVChain (  ) 

Definition at line 18 of file livetvchain.cpp.


Member Function Documentation

QString LiveTVChain::InitializeNewChain ( const QString &  seed  ) 

Definition at line 22 of file livetvchain.cpp.

Referenced by TV::LiveTV(), and TV::TogglePIPView().

void LiveTVChain::LoadFromExistingChain ( const QString &  id  ) 

Definition at line 39 of file livetvchain.cpp.

Referenced by MainServer::HandleRecorderQuery().

void LiveTVChain::SetHostPrefix ( const QString &  prefix  ) 

Definition at line 29 of file livetvchain.cpp.

Referenced by TVRec::SpawnLiveTV().

void LiveTVChain::SetCardType ( const QString &  type  ) 

Definition at line 34 of file livetvchain.cpp.

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

void LiveTVChain::DestroyChain ( void   ) 

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

Definition at line 45 of file livetvchain.cpp.

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

void LiveTVChain::FinishedRecording ( ProgramInfo pginfo  ) 

Definition at line 96 of file livetvchain.cpp.

Referenced by TVRec::FinishedRecording().

void LiveTVChain::DeleteProgram ( ProgramInfo pginfo  ) 

Definition at line 127 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 50 of file livetvchain.h.

Referenced by NuppelVideoPlayer::OpenFile().

int LiveTVChain::ProgramIsAt ( const QString &  chanid,
const QDateTime &  starttime 
) const

Returns:
program location or -1 for not found.

Definition at line 290 of file livetvchain.cpp.

Referenced by MainServer::GetChainWithRecording(), ProgramIsAt(), ReloadAll(), and SetProgram().

int LiveTVChain::ProgramIsAt ( const ProgramInfo pginfo  )  const

Returns:
program location or -1 for not found.

Definition at line 312 of file livetvchain.cpp.

int LiveTVChain::GetLengthAtCurPos ( void   ) 

Returns:
length in seocnds of recording at m_curpos

Definition at line 320 of file livetvchain.cpp.

Referenced by NuppelVideoPlayer::calcSliderPos().

int LiveTVChain::TotalSize ( void   )  const

Definition at line 332 of file livetvchain.cpp.

Referenced by TVRec::CreateLiveTVRingBuffer().

bool LiveTVChain::HasNext ( void   )  const

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

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 279 of file livetvchain.cpp.

Referenced by TV::HandleStateChange(), TV::SwapPIP(), TV::SwitchCards(), TVRec::SwitchLiveTVRingBuffer(), TV::ToggleActiveWindow(), TV::TogglePIPView(), TVRec::TuningNewRecorder(), TVRec::TuningRestartRecorder(), and TV::UnpauseLiveTV().

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

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

Definition at line 59 of file livetvchain.h.

Referenced by RingBuffer::ReadFromBuf(), and NuppelVideoPlayer::StartPlaying().

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

Returns true iff a switch and jump are required.

Definition at line 62 of file livetvchain.h.

Referenced by RingBuffer::ReadFromBuf(), and NuppelVideoPlayer::StartPlaying().

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

Definition at line 509 of file livetvchain.cpp.

Referenced by TV::AddPreviousChannel(), and TV::SetPreviousChannel().

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

Definition at line 517 of file livetvchain.cpp.

Referenced by TV::UpdateOSDInput().

QString LiveTVChain::GetCardType ( int  pos = -1  )  const

void LiveTVChain::SetProgram ( 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 445 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 478 of file livetvchain.cpp.

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

void LiveTVChain::ClearSwitch ( void   ) 

Definition at line 356 of file livetvchain.cpp.

Referenced by NuppelVideoPlayer::ClearAfterSeek().

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 374 of file livetvchain.cpp.

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

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

Definition at line 487 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 502 of file livetvchain.cpp.

Referenced by NuppelVideoPlayer::JumpToProgram().

void LiveTVChain::SetHostSocket ( MythSocket sock  ) 

Definition at line 533 of file livetvchain.cpp.

Referenced by MainServer::HandleRecorderQuery().

bool LiveTVChain::IsHostSocket ( MythSocket sock  ) 

Definition at line 541 of file livetvchain.cpp.

Referenced by MainServer::GetExistingChain().

int LiveTVChain::HostSocketCount ( void   ) 

void LiveTVChain::DelHostSocket ( MythSocket sock  ) 

void LiveTVChain::BroadcastUpdate ( void   )  [private]

Definition at line 169 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 255 of file livetvchain.cpp.

Referenced by GetProgramAt(), and GetSwitchProgram().


Member Data Documentation

QString LiveTVChain::m_id [private]

QValueList<LiveTVChainEntry> LiveTVChain::m_chain [private]

int LiveTVChain::m_maxpos [private]

Definition at line 93 of file livetvchain.h.

Referenced by AppendNewProgram(), and ReloadAll().

QMutex LiveTVChain::m_lock [mutable, private]

QString LiveTVChain::m_hostprefix [private]

Definition at line 96 of file livetvchain.h.

Referenced by AppendNewProgram(), and SetHostPrefix().

QString LiveTVChain::m_cardtype [private]

Definition at line 97 of file livetvchain.h.

Referenced by AppendNewProgram(), and SetCardType().

int LiveTVChain::m_curpos [private]

QString LiveTVChain::m_cur_chanid [private]

Definition at line 100 of file livetvchain.h.

Referenced by ReloadAll(), and SetProgram().

QDateTime LiveTVChain::m_cur_startts [private]

Definition at line 101 of file livetvchain.h.

Referenced by ReloadAll(), and SetProgram().

int LiveTVChain::m_switchid [private]

Definition at line 103 of file livetvchain.h.

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

Definition at line 104 of file livetvchain.h.

Referenced by ReloadAll(), and SwitchTo().

int LiveTVChain::m_jumppos [private]

Definition at line 106 of file livetvchain.h.

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

QMutex LiveTVChain::m_sockLock [private]

Definition at line 108 of file livetvchain.h.

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

Definition at line 109 of file livetvchain.h.

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


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

Generated on Sat Dec 18 05:16:04 2010 for MythTV by  doxygen 1.5.5