MythTV
master
|
#include <programinfocache.h>
Public Types | |
enum | UpdateState { PIC_NONE = 0x00, PIC_MARK_CHANGED = 0x01, PIC_RECGROUP_CHANGED = 0x02, PIC_NO_ACTION = 0x80 } |
Public Member Functions | |
Q_DECLARE_FLAGS (UpdateStates, UpdateState) | |
ProgramInfoCache (QObject *o) | |
~ProgramInfoCache () | |
void | ScheduleLoad (bool updateUI=true) |
bool | IsLoadInProgress (void) const |
void | WaitForLoadToComplete (void) const |
void | Refresh (void) |
Refreshed the cache. More... | |
void | Add (const ProgramInfo &pginfo) |
Adds a ProgramInfo to the cache. More... | |
bool | Remove (uint recordingID) |
Marks a ProgramInfo in the cache for deletion on the next call to Refresh(). More... | |
ProgramInfoCache::UpdateStates | Update (const ProgramInfo &pginfo) |
Updates a ProgramInfo in the cache. More... | |
void | UpdateFileSize (uint recordingID, uint64_t filesize, UpdateStates flags) |
Updates a ProgramInfo in the cache. More... | |
void | GetOrdered (std::vector< ProgramInfo * > &list, bool newest_first=false) |
bool | empty (void) const |
ProgramInfo * | GetRecordingInfo (uint recordingID) const |
Private Types | |
using | Cache = QHash< uint, ProgramInfo * > |
Private Member Functions | |
void | Load (bool updateUI=true) |
void | Clear (void) |
Clears the cache, m_lock must be held when this is called. More... | |
Private Attributes | |
QMutex | m_lock |
Cache | m_cache |
std::vector< ProgramInfo * > * | m_nextCache {nullptr} |
QObject * | m_listener {nullptr} |
bool | m_loadIsQueued {false} |
uint | m_loadsInProgress {0} |
QWaitCondition | m_loadWait |
Friends | |
class | ProgramInfoLoader |
Definition at line 20 of file programinfocache.h.
|
private |
Definition at line 62 of file programinfocache.h.
Enumerator | |
---|---|
PIC_NONE | |
PIC_MARK_CHANGED | |
PIC_RECGROUP_CHANGED | |
PIC_NO_ACTION |
Definition at line 25 of file programinfocache.h.
|
inlineexplicit |
Definition at line 33 of file programinfocache.h.
ProgramInfoCache::~ProgramInfoCache | ( | ) |
Definition at line 53 of file programinfocache.cpp.
ProgramInfoCache::Q_DECLARE_FLAGS | ( | UpdateStates | , |
UpdateState | |||
) |
Definition at line 64 of file programinfocache.cpp.
Referenced by PlaybackBox::Create(), PlaybackBox::customEvent(), and PlaybackBox::HandleRecordingRemoveEvent().
bool ProgramInfoCache::IsLoadInProgress | ( | void | ) | const |
Definition at line 135 of file programinfocache.cpp.
Referenced by PlaybackBox::ScheduleUpdateUIList().
void ProgramInfoCache::WaitForLoadToComplete | ( | void | ) | const |
Definition at line 141 of file programinfocache.cpp.
Referenced by PlaybackBox::Load().
void ProgramInfoCache::Refresh | ( | void | ) |
Refreshed the cache.
If a new list has been loaded this fills the cache with that list if not, this simply removes list items marked for deletion from the the list.
Definition at line 158 of file programinfocache.cpp.
Referenced by PlaybackBox::UpdateUILists().
void ProgramInfoCache::Add | ( | const ProgramInfo & | pginfo | ) |
Adds a ProgramInfo to the cache.
Definition at line 272 of file programinfocache.cpp.
Referenced by PlaybackBox::HandleRecordingAddEvent().
Marks a ProgramInfo in the cache for deletion on the next call to Refresh().
Definition at line 285 of file programinfocache.cpp.
Referenced by PlaybackBox::HandleRecordingRemoveEvent().
ProgramInfoCache::UpdateStates ProgramInfoCache::Update | ( | const ProgramInfo & | pginfo | ) |
Updates a ProgramInfo in the cache.
Definition at line 194 of file programinfocache.cpp.
Referenced by Add(), and PlaybackBox::customEvent().
void ProgramInfoCache::UpdateFileSize | ( | uint | recordingID, |
uint64_t | filesize, | ||
UpdateStates | flags | ||
) |
Updates a ProgramInfo in the cache.
Definition at line 234 of file programinfocache.cpp.
Referenced by PlaybackBox::customEvent(), and Update().
void ProgramInfoCache::GetOrdered | ( | std::vector< ProgramInfo * > & | list, |
bool | newest_first = false |
||
) |
Definition at line 313 of file programinfocache.cpp.
Referenced by PlaybackBox::UpdateUILists().
|
inline |
Definition at line 49 of file programinfocache.h.
Referenced by PlaybackBox::updateRecList(), and PlaybackBox::UpdateUILists().
ProgramInfo * ProgramInfoCache::GetRecordingInfo | ( | uint | recordingID | ) | const |
Definition at line 324 of file programinfocache.cpp.
Referenced by PlaybackBox::customEvent(), and PlaybackBox::HandlePreviewEvent().
Definition at line 76 of file programinfocache.cpp.
Referenced by ProgramInfoLoader::run().
|
private |
Clears the cache, m_lock must be held when this is called.
Definition at line 335 of file programinfocache.cpp.
Referenced by Refresh(), and ~ProgramInfoCache().
|
friend |
Definition at line 22 of file programinfocache.h.
Referenced by ScheduleLoad().
|
mutableprivate |
Definition at line 64 of file programinfocache.h.
Referenced by IsLoadInProgress(), Load(), Refresh(), ScheduleLoad(), Update(), WaitForLoadToComplete(), and ~ProgramInfoCache().
|
private |
Definition at line 65 of file programinfocache.h.
Referenced by Add(), Clear(), empty(), GetOrdered(), GetRecordingInfo(), Refresh(), Remove(), Update(), and UpdateFileSize().
|
private |
Definition at line 66 of file programinfocache.h.
Referenced by Load(), Refresh(), and ~ProgramInfoCache().
|
private |
Definition at line 67 of file programinfocache.h.
Referenced by Load(), and UpdateFileSize().
Definition at line 68 of file programinfocache.h.
Referenced by Load(), and ScheduleLoad().
|
private |
Definition at line 69 of file programinfocache.h.
Referenced by IsLoadInProgress(), Load(), ScheduleLoad(), WaitForLoadToComplete(), and ~ProgramInfoCache().
|
mutableprivate |
Definition at line 70 of file programinfocache.h.
Referenced by Load(), WaitForLoadToComplete(), and ~ProgramInfoCache().