|
vdr 2.8.1
|
#include <recording.h>
Public Member Functions | |
| cRecordings (bool Deleted=false) | |
| virtual | ~cRecordings () override |
| void | ResetResume (const char *ResumeFileName=NULL) |
| void | ClearSortNames (void) |
| const cRecording * | GetById (int Id) const |
| cRecording * | GetById (int Id) |
| const cRecording * | GetByName (const char *FileName) const |
| cRecording * | GetByName (const char *FileName) |
| void | Add (cRecording *Recording) |
| void | AddByName (const char *FileName, bool TriggerUpdate=true) |
| void | DelByName (const char *FileName) |
| void | UpdateByName (const char *FileName) |
| int | TotalFileSizeMB (void) const |
| double | MBperMinute (void) const |
| int | PathIsInUse (const char *Path) const |
| int | GetNumRecordingsInPath (const char *Path) const |
| bool | MoveRecordings (const char *OldPath, const char *NewPath) |
| Public Member Functions inherited from cList< cRecording > | |
| cList (const char *NeedsLocking=NULL) | |
| const cRecording * | Get (int Index) const |
| const cRecording * | First (void) const |
| const cRecording * | Last (void) const |
| const cRecording * | Prev (const cRecording *Object) const |
| const cRecording * | Next (const cRecording *Object) const |
| Public Member Functions inherited from cListBase | |
| virtual | ~cListBase () |
| bool | Lock (cStateKey &StateKey, bool Write=false, int TimeoutMs=0) const |
| void | SetSyncStateKey (cStateKey &StateKey) |
| void | SetUseGarbageCollector (void) |
| void | SetExplicitModify (void) |
| void | SetModified (void) |
| void | Add (cListObject *Object, cListObject *After=NULL) |
| void | Ins (cListObject *Object, cListObject *Before=NULL) |
| void | Del (cListObject *Object, bool DeleteObject=true) |
| virtual void | Move (int From, int To) |
| void | Move (cListObject *From, cListObject *To) |
| virtual void | Clear (void) |
| bool | Contains (const cListObject *Object) const |
| const cListObject * | Get (int Index) const |
| cListObject * | Get (int Index) |
| int | Count (void) const |
| void | Sort (void) |
Static Public Member Functions | |
| static const cRecordings * | GetRecordingsRead (cStateKey &StateKey, int TimeoutMs=0) |
| static cRecordings * | GetRecordingsWrite (cStateKey &StateKey, int TimeoutMs=0) |
| static const cRecordings * | GetDeletedRecordingsRead (cStateKey &StateKey, int TimeoutMs=0) |
| static cRecordings * | GetDeletedRecordingsWrite (cStateKey &StateKey, int TimeoutMs=0) |
| static void | Update (bool Wait=false) |
| static void | TouchUpdate (void) |
| static bool | NeedsUpdate (void) |
Static Private Member Functions | |
| static const char * | UpdateFileName (void) |
Static Private Attributes | |
| static cRecordings | recordings |
| static cRecordings | deletedRecordings |
| static int | lastRecordingId = 0 |
| static char * | updateFileName = NULL |
| static time_t | lastUpdate = 0 |
| static cVideoDirectoryScannerThread * | videoDirectoryScannerThread = NULL |
Additional Inherited Members | |
| Protected Member Functions inherited from cListBase | |
| cListBase (const char *NeedsLocking=NULL) | |
| Protected Attributes inherited from cListBase | |
| cListObject * | objects |
| cListObject * | lastObject |
| int | count |
| cStateLock | stateLock |
| const char * | needsLocking |
| bool | useGarbageCollector |
Definition at line 273 of file recording.h.
| cRecordings::cRecordings | ( | bool | Deleted = false | ) |
Definition at line 1739 of file recording.c.
References cList< cRecording >::cList().
Referenced by GetById(), GetByName(), GetDeletedRecordingsRead(), GetDeletedRecordingsWrite(), GetRecordingsRead(), and GetRecordingsWrite().
|
overridevirtual |
Definition at line 1744 of file recording.c.
References videoDirectoryScannerThread.
| void cRecordings::Add | ( | cRecording * | Recording | ) |
Definition at line 1806 of file recording.c.
References cListBase::Add(), lastRecordingId, and cRecording::SetId().
Referenced by AddByName(), cMenuRecordings::Delete(), cMenuRecordings::Restore(), and cVideoDirectoryScannerThread::ScanVideoDir().
| void cRecordings::AddByName | ( | const char * | FileName, |
| bool | TriggerUpdate = true ) |
Definition at line 1812 of file recording.c.
References Add(), GetByName(), TouchUpdate(), and UpdateByName().
Referenced by cRecordingsHandlerEntry::Active(), and cRecordingsHandlerEntry::Cleanup().
| void cRecordings::ClearSortNames | ( | void | ) |
Definition at line 1947 of file recording.c.
References cList< cRecording >::First(), and cList< cRecording >::Next().
| void cRecordings::DelByName | ( | const char * | FileName | ) |
Definition at line 1823 of file recording.c.
References cListBase::Del(), DELEXT, esyslog, cRecording::FileName(), cRecording::fileName, GetByName(), LOCK_DELETEDRECORDINGS_WRITE, RECEXT, recordings, cRecording::SetDeleted(), and TouchUpdate().
|
inline |
Definition at line 309 of file recording.h.
References cRecordings().
| const cRecording * cRecordings::GetById | ( | int | Id | ) | const |
Definition at line 1786 of file recording.c.
References cList< cRecording >::First(), and cList< cRecording >::Next().
|
inline |
Definition at line 311 of file recording.h.
References cRecordings().
| const cRecording * cRecordings::GetByName | ( | const char * | FileName | ) | const |
Definition at line 1795 of file recording.c.
References cList< cRecording >::First(), and cList< cRecording >::Next().
Referenced by cRecordingsHandlerEntry::Active(), AddByName(), cMenuRecordingEdit::ApplyChanges(), cRecordingsHandlerEntry::Cleanup(), DelByName(), cMenuRecordings::Delete(), cVideoDirectoryScannerThread::ScanVideoDir(), and UpdateByName().
|
inlinestatic |
Gets the list of deleted recordings for read access.
See cTimers::GetTimersRead() for details.
Definition at line 291 of file recording.h.
References cRecordings(), and deletedRecordings.
Referenced by cMenuRecording::RefreshRecording(), and cMenuRecordings::Set().
|
inlinestatic |
Gets the list of deleted recordings for write access.
See cTimers::GetTimersWrite() for details.
Definition at line 294 of file recording.h.
References cRecordings(), and deletedRecordings.
Referenced by cMenuRecordings::Delete(), cMenuRecordings::Purge(), cMenuRecordings::Restore(), and cMenuRecordings::Set().
| int cRecordings::GetNumRecordingsInPath | ( | const char * | Path | ) | const |
Returns the total number of recordings in the given Path, including all sub-folders of Path.
If Path is NULL or an empty string, the entire video directory is checked.
Definition at line 1909 of file recording.c.
References cList< cRecording >::First(), and cList< cRecording >::Next().
|
inlinestatic |
Gets the list of recordings for read access.
See cTimers::GetTimersRead() for details.
Definition at line 285 of file recording.h.
References cRecordings(), and recordings.
Referenced by cSVDRPServer::CmdPLAY(), cMenuRecording::cMenuRecording(), cMenuRecording::RefreshRecording(), cMenuRecordingEdit::RefreshRecording(), cMenuFolder::Set(), and cMenuRecordings::Set().
|
inlinestatic |
Gets the list of recordings for write access.
See cTimers::GetTimersWrite() for details.
Definition at line 288 of file recording.h.
References cRecordings(), and recordings.
Referenced by cMenuRecordingEdit::ApplyChanges(), cMenuRecordings::Delete(), cCuttingThread::HandleErrors(), cMenuRecordings::Restore(), cResumeFile::Save(), and cMenuRecordings::Set().
| double cRecordings::MBperMinute | ( | void | ) | const |
Returns the average data rate (in MB/min) of all recordings, or -1 if this value is unknown.
Definition at line 1878 of file recording.c.
References cList< cRecording >::First(), LIMIT_SECS_PER_MB_RADIO, and cList< cRecording >::Next().
| bool cRecordings::MoveRecordings | ( | const char * | OldPath, |
| const char * | NewPath ) |
Moves all recordings in OldPath to NewPath.
Returns true if all recordings were successfully moved. As soon as the operation fails for one recording, the whole action is aborted and false will be returned. Any recordings that have been successfully moved thus far will keep their new name. If OldPath and NewPath are on different file systems, the recordings will be moved in a background process and this function returns true if all recordings have been successfully added to the RecordingsHandler.
Definition at line 1919 of file recording.c.
References dsyslog, cList< cRecording >::First(), cList< cRecording >::Next(), cString::sprintf(), and TouchUpdate().
|
static |
Definition at line 1766 of file recording.c.
References LastModifiedTime(), lastUpdate, and UpdateFileName().
Referenced by main(), and TouchUpdate().
| int cRecordings::PathIsInUse | ( | const char * | Path | ) | const |
Checks whether any recording in the given Path is currently in use and therefore the whole Path shall not be tampered with.
Returns 0 (ruNone) if no recording is in use. See cRecording::IsInUse() for details about the possible non-zero return values. If several recordings in the Path are currently in use, the return value will be the combination of all individual recordings' flags. If Path is NULL or an empty string, the entire video directory is checked.
Definition at line 1899 of file recording.c.
References cList< cRecording >::First(), cList< cRecording >::Next(), and ruNone.
| void cRecordings::ResetResume | ( | const char * | ResumeFileName = NULL | ) |
Definition at line 1939 of file recording.c.
References cList< cRecording >::First(), and cList< cRecording >::Next().
| int cRecordings::TotalFileSizeMB | ( | void | ) | const |
Definition at line 1867 of file recording.c.
References cList< cRecording >::First(), and cList< cRecording >::Next().
|
static |
Touches the '.update' file in the video directory, so that other instances of VDR that access the same video directory can be triggered to update their recordings list.
Definition at line 1758 of file recording.c.
References lastUpdate, NeedsUpdate(), TouchFile(), and UpdateFileName().
Referenced by cRemoveDeletedRecordingsThread::Action(), cRecordingsHandlerEntry::Active(), AddByName(), cMenuRecordingEdit::ApplyChanges(), DelByName(), cMenuRecordings::Delete(), MoveRecordings(), cMenuRecordings::Purge(), and cMenuRecordings::Restore().
|
static |
Triggers an update of the list of recordings, which will run as a separate thread if Wait is false.
If Wait is true, the function returns only after the update has completed.
Definition at line 1774 of file recording.c.
References deletedRecordings, lastUpdate, recordings, cCondWait::SleepMs(), and videoDirectoryScannerThread.
Referenced by AssertFreeDiskSpace(), and main().
| void cRecordings::UpdateByName | ( | const char * | FileName | ) |
|
staticprivate |
Definition at line 1751 of file recording.c.
References AddDirectory(), cVideoDirectory::Name(), and updateFileName.
Referenced by NeedsUpdate(), and TouchUpdate().
|
staticprivate |
Definition at line 276 of file recording.h.
Referenced by GetDeletedRecordingsRead(), GetDeletedRecordingsWrite(), and Update().
|
staticprivate |
Definition at line 277 of file recording.h.
Referenced by Add().
|
staticprivate |
Definition at line 279 of file recording.h.
Referenced by NeedsUpdate(), TouchUpdate(), and Update().
|
staticprivate |
Definition at line 275 of file recording.h.
Referenced by DelByName(), GetRecordingsRead(), GetRecordingsWrite(), and Update().
|
staticprivate |
Definition at line 278 of file recording.h.
Referenced by UpdateFileName().
|
staticprivate |
Definition at line 280 of file recording.h.
Referenced by Update(), and ~cRecordings().