|
MythTV master
|
Keeps track of recordings in a current LiveTV instance. More...
#include <libmythtv/livetvchain.h>
Public Member Functions | |
| LiveTVChain () | |
| ~LiveTVChain () override | |
| QString | InitializeNewChain (const QString &seed) |
| void | LoadFromExistingChain (const QString &id) |
| void | SetHostPrefix (const QString &prefix) |
| void | SetInputType (const QString &type) |
| void | DestroyChain (void) |
| void | AppendNewProgram (ProgramInfo *pginfo, const QString &channum, const QString &inputname, bool discont) |
| void | FinishedRecording (ProgramInfo *pginfo) |
| void | DeleteProgram (ProgramInfo *pginfo) |
| void | ReloadAll (const QStringList &data=QStringList()) |
| QString | GetID (void) const |
| int | GetCurPos (void) const |
| int | ProgramIsAt (uint chanid, const QDateTime &starttime) const |
| int | ProgramIsAt (const ProgramInfo &pginfo) const |
| std::chrono::seconds | GetLengthAtCurPos (void) |
| std::chrono::seconds | GetLengthAtPos (int pos) |
| int | TotalSize (void) const |
| bool | HasNext (void) const |
| bool | HasPrev (void) const |
| ProgramInfo * | GetProgramAt (int at) const |
| Returns program at the desired location. More... | |
| bool | NeedsToSwitch (void) const |
| Returns true iff a switch is required but no jump is required m_jumppos sets to INT_MAX means not set. More... | |
| bool | NeedsToJump (void) const |
| Returns true iff a switch and jump are required. More... | |
| QString | GetChannelName (int pos=-1) const |
| QString | GetInputName (int pos=-1) const |
| QString | GetInputType (int pos=-1) const |
| void | SetProgram (const ProgramInfo &pginfo) |
| void | SwitchTo (int num) |
| Sets the recording to switch to. More... | |
| void | SwitchToNext (bool up) |
| Sets the recording to switch to. More... | |
| void | ClearSwitch (void) |
| ProgramInfo * | GetSwitchProgram (bool &discont, bool &newtype, int &newid) |
| Returns the recording we should switch to. More... | |
| void | JumpTo (int num, std::chrono::seconds pos) |
| void | JumpToNext (bool up, std::chrono::seconds pos) |
| jump to the next (up == true) or previous (up == false) liveTV program If pos > 0: indicate the absolute position where to start the next program If pos < 0: indicate offset position; in which case the right liveTV program will be found accordingly. More... | |
| std::chrono::seconds | GetJumpPos (void) |
| Returns the jump position in seconds and clears it. More... | |
| void | SetHostSocket (MythSocket *sock) |
| bool | IsHostSocket (MythSocket *sock) |
| uint | HostSocketCount (void) const |
| void | DelHostSocket (MythSocket *sock) |
| QString | toString () const |
| QStringList | entriesToStringList () const |
| bool | entriesFromStringList (const QStringList &items) |
Public Member Functions inherited from ReferenceCounter | |
| ReferenceCounter (const QString &debugName, bool logDebug=true) | |
| Creates reference counter with an initial value of 1. More... | |
| virtual int | IncrRef (void) |
| Increments reference count. More... | |
| virtual int | DecrRef (void) |
| Decrements reference count and deletes on 0. More... | |
Protected Member Functions | |
| void | BroadcastUpdate () |
| void | GetEntryAt (int at, LiveTVChainEntry &entry) const |
| virtual ProgramInfo * | EntryToProgram (const LiveTVChainEntry &entry) const |
| ProgramInfo * | DoGetNextProgram (bool up, int curpos, int &newid, bool &discont, bool &newtype) |
Protected Member Functions inherited from ReferenceCounter | |
| virtual | ~ReferenceCounter (void) |
| Called on destruction, will warn if object deleted with references in place. More... | |
Protected Attributes | |
| QString | m_id |
| QList< LiveTVChainEntry > | m_chain |
| int | m_maxPos {0} |
| QRecursiveMutex | m_lock |
| QString | m_hostPrefix |
| QString | m_inputType |
| int | m_curPos {0} |
| uint | m_curChanId {0} |
| QDateTime | m_curStartTs |
| int | m_switchId {-1} |
| LiveTVChainEntry | m_switchEntry |
| std::chrono::seconds | m_jumpPos {std::chrono::seconds::max()} |
| QMutex | m_sockLock |
| QList< MythSocket * > | m_inUseSocks |
Protected Attributes inherited from ReferenceCounter | |
| bool | m_logDebug |
| This is used to suppress creating LoggingItem classes for LoggingItem reference count changes. More... | |
| QAtomicInt | m_referenceCount {1} |
Additional Inherited Members | |
Static Public Member Functions inherited from ReferenceCounter | |
| static void | PrintDebug (void) |
| Print out any leaks if that level of debugging is enabled. More... | |
Keeps track of recordings in a current LiveTV instance.
Definition at line 32 of file livetvchain.h.
| LiveTVChain::LiveTVChain | ( | ) |
Definition at line 29 of file livetvchain.cpp.
|
override |
Definition at line 35 of file livetvchain.cpp.
| void LiveTVChain::AppendNewProgram | ( | ProgramInfo * | pginfo, |
| const QString & | channum, | ||
| const QString & | inputname, | ||
| bool | discont | ||
| ) |
Definition at line 63 of file livetvchain.cpp.
Referenced by TVRec::CreateLiveTVRingBuffer(), and TVRec::SwitchLiveTVRingBuffer().
|
protected |
Definition at line 195 of file livetvchain.cpp.
Referenced by AppendNewProgram(), DeleteProgram(), and FinishedRecording().
| void LiveTVChain::ClearSwitch | ( | void | ) |
Definition at line 417 of file livetvchain.cpp.
Referenced by GetSwitchProgram().
| void LiveTVChain::DeleteProgram | ( | ProgramInfo * | pginfo | ) |
Definition at line 151 of file livetvchain.cpp.
Referenced by MainServer::DoDeleteThread().
| void LiveTVChain::DelHostSocket | ( | MythSocket * | sock | ) |
Definition at line 735 of file livetvchain.cpp.
Referenced by MainServer::connectionClosed(), and MainServer::HandleRecorderQuery().
| void LiveTVChain::DestroyChain | ( | void | ) |
Definition at line 202 of file livetvchain.cpp.
Referenced by PlayerContext::SetTVChain().
|
protected |
Definition at line 453 of file livetvchain.cpp.
Referenced by GetSwitchProgram(), and JumpToNext().
| bool LiveTVChain::entriesFromStringList | ( | const QStringList & | items | ) |
Definition at line 781 of file livetvchain.cpp.
Referenced by ReloadAll().
| QStringList LiveTVChain::entriesToStringList | ( | ) | const |
Definition at line 762 of file livetvchain.cpp.
Referenced by BroadcastUpdate().
|
protectedvirtual |
Definition at line 304 of file livetvchain.cpp.
Referenced by DoGetNextProgram(), and GetProgramAt().
| void LiveTVChain::FinishedRecording | ( | ProgramInfo * | pginfo | ) |
Definition at line 115 of file livetvchain.cpp.
Referenced by TVRec::FinishedRecording().
| QString LiveTVChain::GetChannelName | ( | int | pos = -1 | ) | const |
Definition at line 691 of file livetvchain.cpp.
Referenced by PlayerContext::GetPreviousChannel(), TV::OSDDialogEvent(), TV::PlaybackMenuInit(), TV::PopPreviousChannel(), PlayerContext::PopPreviousChannel(), and PlayerContext::PushPreviousChannel().
|
inline |
Definition at line 55 of file livetvchain.h.
Referenced by MythPlayer::OpenFile().
|
protected |
Definition at line 277 of file livetvchain.cpp.
Referenced by DoGetNextProgram(), GetChannelName(), GetInputName(), GetInputType(), GetProgramAt(), JumpToNext(), and SwitchTo().
|
inline |
Definition at line 54 of file livetvchain.h.
Referenced by MainServer::connectionClosed(), TV::customEvent(), TVRec::GetChainID(), TV::HandleStateChange(), TVRec::StartRecording(), and TV::SwitchInputs().
| QString LiveTVChain::GetInputName | ( | int | pos = -1 | ) | const |
Definition at line 699 of file livetvchain.cpp.
| QString LiveTVChain::GetInputType | ( | int | pos = -1 | ) | const |
Definition at line 707 of file livetvchain.cpp.
Referenced by TV::HandleStateChange(), MythPlayerUI::JumpToProgram(), MythPlayer::OpenFile(), TV::SwitchInputs(), TVRec::SwitchLiveTVRingBuffer(), and MythPlayerUI::SwitchToProgram().
| std::chrono::seconds LiveTVChain::GetJumpPos | ( | void | ) |
Returns the jump position in seconds and clears it.
Definition at line 684 of file livetvchain.cpp.
Referenced by MythPlayerUI::JumpToProgram().
| std::chrono::seconds LiveTVChain::GetLengthAtCurPos | ( | void | ) |
Definition at line 368 of file livetvchain.cpp.
Referenced by MythPlayerUI::JumpToProgram(), and MythPlayerOverlayUI::UpdateSliderInfo().
| std::chrono::seconds LiveTVChain::GetLengthAtPos | ( | int | pos | ) |
Definition at line 376 of file livetvchain.cpp.
Referenced by GetLengthAtCurPos(), and JumpToNext().
| 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 328 of file livetvchain.cpp.
Referenced by PlayerContext::ReloadTVChain(), and TVRec::TuningRestartRecorder().
| 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 responsible for deleting the ProgramInfo
Definition at line 435 of file livetvchain.cpp.
Referenced by MythPlayerUI::JumpToProgram(), and MythPlayerUI::SwitchToProgram().
| bool LiveTVChain::HasNext | ( | void | ) | const |
Definition at line 412 of file livetvchain.cpp.
Referenced by MythPlayer::CalcMaxFFTime(), MythPlayer::CheckTVChain(), TV::customEvent(), MythPlayerUI::EventLoop(), MythPlayer::FindFrame(), MythPlayer::HasTVChainNext(), MythPlayer::IsNearEnd(), MythPlayerUI::JumpToProgram(), MythMediaBuffer::run(), SwitchToNext(), MythPlayerOverlayUI::UpdateSliderInfo(), and MythPlayer::WaitForSeek().
|
inline |
Definition at line 62 of file livetvchain.h.
Referenced by MythPlayer::CalcRWTime(), SwitchToNext(), and MythPlayerOverlayUI::UpdateSliderInfo().
| uint LiveTVChain::HostSocketCount | ( | void | ) | const |
Definition at line 729 of file livetvchain.cpp.
Referenced by MainServer::connectionClosed(), and MainServer::HandleRecorderQuery().
| QString LiveTVChain::InitializeNewChain | ( | const QString & | seed | ) |
Definition at line 40 of file livetvchain.cpp.
Referenced by PlayerContext::SetTVChain().
| bool LiveTVChain::IsHostSocket | ( | MythSocket * | sock | ) |
Definition at line 723 of file livetvchain.cpp.
| void LiveTVChain::JumpTo | ( | int | num, |
| std::chrono::seconds | pos | ||
| ) |
Definition at line 614 of file livetvchain.cpp.
Referenced by TV::UnpauseLiveTV().
| void LiveTVChain::JumpToNext | ( | bool | up, |
| std::chrono::seconds | pos | ||
| ) |
jump to the next (up == true) or previous (up == false) liveTV program If pos > 0: indicate the absolute position where to start the next program If pos < 0: indicate offset position; in which case the right liveTV program will be found accordingly.
Offset is in reference to the beginning of the current recordings when going down and in reference to the end of the current recording when going up
Definition at line 628 of file livetvchain.cpp.
Referenced by MythPlayer::CalcMaxFFTime(), MythPlayer::CalcRWTime(), MythPlayerUI::EventLoop(), and MythPlayerCaptionsUI::SetStream().
| void LiveTVChain::LoadFromExistingChain | ( | const QString & | id | ) |
Definition at line 57 of file livetvchain.cpp.
Referenced by MainServer::HandleRecorderQuery().
|
inline |
Returns true iff a switch and jump are required.
Definition at line 69 of file livetvchain.h.
Referenced by MythPlayerUI::EventLoop().
|
inline |
Returns true iff a switch is required but no jump is required m_jumppos sets to INT_MAX means not set.
Definition at line 66 of file livetvchain.h.
Referenced by MythPlayerUI::EventLoop().
| int LiveTVChain::ProgramIsAt | ( | const ProgramInfo & | pginfo | ) | const |
Definition at line 360 of file livetvchain.cpp.
| int LiveTVChain::ProgramIsAt | ( | uint | chanid, |
| const QDateTime & | starttime | ||
| ) | const |
Definition at line 339 of file livetvchain.cpp.
Referenced by ProgramIsAt(), ReloadAll(), and SetProgram().
| void LiveTVChain::ReloadAll | ( | const QStringList & | data = QStringList() | ) |
Definition at line 216 of file livetvchain.cpp.
Referenced by GetSwitchProgram(), LoadFromExistingChain(), MythMediaBuffer::ReadPriv(), PlayerContext::ReloadTVChain(), TVRec::SpawnLiveTV(), and PlayerContext::UpdateTVChain().
| void LiveTVChain::SetHostPrefix | ( | const QString & | prefix | ) |
Definition at line 47 of file livetvchain.cpp.
Referenced by TVRec::SpawnLiveTV().
| void LiveTVChain::SetHostSocket | ( | MythSocket * | sock | ) |
Definition at line 715 of file livetvchain.cpp.
Referenced by MainServer::HandleRecorderQuery().
| void LiveTVChain::SetInputType | ( | const QString & | type | ) |
Definition at line 52 of file livetvchain.cpp.
Referenced by TVRec::SpawnLiveTV(), and TVRec::TuningFrequency().
| void LiveTVChain::SetProgram | ( | const ProgramInfo & | pginfo | ) |
Definition at line 400 of file livetvchain.cpp.
Referenced by MythPlayerUI::FileChanged(), MythPlayerUI::JumpToProgram(), TV::SwitchInputs(), and MythPlayerUI::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 566 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 603 of file livetvchain.cpp.
Referenced by JumpToNext(), and MythMediaBuffer::run().
| QString LiveTVChain::toString | ( | ) | const |
Definition at line 750 of file livetvchain.cpp.
Referenced by MythPlayerUI::JumpToProgram(), ReloadAll(), MythPlayerUI::SwitchToProgram(), and toString().
| int LiveTVChain::TotalSize | ( | void | ) | const |
Definition at line 395 of file livetvchain.cpp.
Referenced by TVRec::CreateLiveTVRingBuffer().
|
protected |
Definition at line 108 of file livetvchain.h.
Referenced by AppendNewProgram(), DeleteProgram(), DestroyChain(), DoGetNextProgram(), entriesFromStringList(), entriesToStringList(), FinishedRecording(), GetEntryAt(), GetLengthAtPos(), HasNext(), JumpToNext(), ProgramIsAt(), ReloadAll(), SwitchTo(), toString(), and TotalSize().
|
protected |
Definition at line 116 of file livetvchain.h.
Referenced by ReloadAll(), and SetProgram().
|
protected |
Definition at line 115 of file livetvchain.h.
Referenced by GetLengthAtCurPos(), GetSwitchProgram(), HasNext(), JumpToNext(), ReloadAll(), SetProgram(), SwitchTo(), SwitchToNext(), and toString().
|
protected |
Definition at line 117 of file livetvchain.h.
Referenced by ReloadAll(), and SetProgram().
|
protected |
Definition at line 112 of file livetvchain.h.
Referenced by AppendNewProgram(), and SetHostPrefix().
|
protected |
Definition at line 107 of file livetvchain.h.
Referenced by AppendNewProgram(), BroadcastUpdate(), DeleteProgram(), DestroyChain(), InitializeNewChain(), LoadFromExistingChain(), and ReloadAll().
|
protected |
Definition at line 113 of file livetvchain.h.
Referenced by AppendNewProgram(), and SetInputType().
|
protected |
Definition at line 125 of file livetvchain.h.
Referenced by DelHostSocket(), HostSocketCount(), IsHostSocket(), and SetHostSocket().
|
protected |
Definition at line 122 of file livetvchain.h.
Referenced by ClearSwitch(), GetJumpPos(), JumpTo(), and JumpToNext().
|
mutableprotected |
Definition at line 110 of file livetvchain.h.
Referenced by AppendNewProgram(), ClearSwitch(), DeleteProgram(), DestroyChain(), entriesFromStringList(), entriesToStringList(), FinishedRecording(), GetEntryAt(), GetLengthAtPos(), GetSwitchProgram(), JumpToNext(), ProgramIsAt(), ReloadAll(), SetProgram(), SwitchTo(), and toString().
|
protected |
Definition at line 109 of file livetvchain.h.
Referenced by AppendNewProgram(), entriesFromStringList(), entriesToStringList(), and ReloadAll().
|
mutableprotected |
Definition at line 124 of file livetvchain.h.
Referenced by DelHostSocket(), HostSocketCount(), IsHostSocket(), and SetHostSocket().
|
protected |
Definition at line 120 of file livetvchain.h.
Referenced by JumpToNext(), LiveTVChain(), ReloadAll(), and SwitchTo().
|
protected |
Definition at line 119 of file livetvchain.h.
Referenced by ClearSwitch(), GetSwitchProgram(), JumpToNext(), ReloadAll(), SetProgram(), and SwitchTo().