Keeps track of recordings in a current LiveTV instance. More...
#include <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 (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 |
| ProgramInfo * | GetProgramAt (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) |
| ProgramInfo * | GetSwitchProgram (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 ProgramInfo * | EntryToProgram (const LiveTVChainEntry &entry) |
Private Attributes | |
| QString | m_id |
| QList< LiveTVChainEntry > | m_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 |
Keeps track of recordings in a current LiveTV instance.
Definition at line 26 of file livetvchain.h.
| LiveTVChain::LiveTVChain | ( | ) |
Definition at line 26 of file livetvchain.cpp.
| LiveTVChain::~LiveTVChain | ( | ) |
Definition at line 34 of file livetvchain.cpp.
| 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 | ) |
Definition at line 210 of file livetvchain.cpp.
Referenced by LoadFromExistingChain(), PlayerContext::ReloadTVChain(), TVRec::SpawnLiveTV(), PlayerContext::UpdateTVChain(), and RingBuffer::WaitForAvail().
| QString LiveTVChain::GetID | ( | void | ) | const [inline] |
Definition at line 48 of file livetvchain.h.
Referenced by MainServer::connectionClosed(), TV::customEvent(), TVRec::GetChainID(), TV::HandleStateChange(), TVRec::StartRecording(), and TV::SwitchCards().
| 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 |
Definition at line 316 of file livetvchain.cpp.
Referenced by ProgramIsAt(), ReloadAll(), and SetProgram().
| int LiveTVChain::ProgramIsAt | ( | const ProgramInfo & | pginfo | ) | const |
Definition at line 337 of file livetvchain.cpp.
| int LiveTVChain::GetLengthAtCurPos | ( | void | ) |
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 |
Definition at line 373 of file livetvchain.cpp.
Referenced by MythPlayer::CalcMaxFFTime(), MythPlayer::calcSliderPos(), MythPlayer::CheckTVChain(), TV::customEvent(), MythPlayer::EventLoop(), MythPlayer::HasTVChainNext(), MythPlayer::IsNearEnd(), RingBuffer::run(), SwitchToNext(), and MythPlayer::WaitForSeek().
| 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.
| 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 |
Definition at line 537 of file livetvchain.cpp.
Referenced by TV::FillOSDMenuNavigate(), PlayerContext::GetPreviousChannel(), TV::OSDDialogEvent(), TV::PopPreviousChannel(), PlayerContext::PopPreviousChannel(), and PlayerContext::PushPreviousChannel().
| 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 |
Definition at line 553 of file livetvchain.cpp.
Referenced by TV::HandleStateChange(), MythPlayer::JumpToProgram(), MythPlayer::OpenFile(), TV::SwitchCards(), and MythPlayer::SwitchToProgram().
| void LiveTVChain::SetProgram | ( | const ProgramInfo & | pginfo | ) |
Definition at line 362 of file livetvchain.cpp.
Referenced by MythPlayer::FileChangedCallback(), MythPlayer::JumpToProgram(), TV::SwitchCards(), and MythPlayer::SwitchToProgram().
| void LiveTVChain::SwitchTo | ( | int | num | ) |
Sets the recording to switch to.
| 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.
| 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 | |||
| ) |
Definition at line 521 of file livetvchain.cpp.
Referenced by MythPlayer::CalcMaxFFTime(), MythPlayer::CalcRWTime(), and MythPlayer::EventLoop().
| 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 |
Definition at line 575 of file livetvchain.cpp.
Referenced by MainServer::connectionClosed(), and MainServer::HandleRecorderQuery().
| void LiveTVChain::DelHostSocket | ( | MythSocket * | sock | ) |
Definition at line 581 of file livetvchain.cpp.
Referenced by MainServer::connectionClosed(), and MainServer::HandleRecorderQuery().
| 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] |
Definition at line 258 of file livetvchain.cpp.
Referenced by GetCardType(), GetChannelName(), GetInputName(), GetProgramAt(), GetSwitchProgram(), and SwitchTo().
| ProgramInfo * LiveTVChain::EntryToProgram | ( | const LiveTVChainEntry & | entry | ) | [static, private] |
Definition at line 281 of file livetvchain.cpp.
Referenced by GetProgramAt(), and GetSwitchProgram().
QString LiveTVChain::m_id [private] |
Definition at line 92 of file livetvchain.h.
Referenced by AppendNewProgram(), BroadcastUpdate(), DeleteProgram(), DestroyChain(), InitializeNewChain(), LoadFromExistingChain(), and ReloadAll().
QList<LiveTVChainEntry> LiveTVChain::m_chain [private] |
Definition at line 93 of file livetvchain.h.
Referenced by AppendNewProgram(), DeleteProgram(), DestroyChain(), FinishedRecording(), GetEntryAt(), GetLengthAtCurPos(), GetSwitchProgram(), HasNext(), ProgramIsAt(), ReloadAll(), SwitchTo(), toString(), and TotalSize().
int LiveTVChain::m_maxpos [private] |
Definition at line 94 of file livetvchain.h.
Referenced by AppendNewProgram(), and ReloadAll().
QMutex LiveTVChain::m_lock [mutable, private] |
Definition at line 95 of file livetvchain.h.
Referenced by AppendNewProgram(), ClearSwitch(), DeleteProgram(), DestroyChain(), FinishedRecording(), GetEntryAt(), GetLengthAtCurPos(), GetSwitchProgram(), ProgramIsAt(), ReloadAll(), SetProgram(), SwitchTo(), and toString().
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 100 of file livetvchain.h.
Referenced by GetLengthAtCurPos(), GetSwitchProgram(), HasNext(), ReloadAll(), SetProgram(), SwitchTo(), SwitchToNext(), and toString().
uint LiveTVChain::m_cur_chanid [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().
LiveTVChainEntry LiveTVChain::m_switchentry [private] |
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().
QList<MythSocket*> LiveTVChain::m_inUseSocks [private] |
Definition at line 110 of file livetvchain.h.
Referenced by DelHostSocket(), HostSocketCount(), IsHostSocket(), and SetHostSocket().
1.6.3