vdr
2.2.0
|
#include <recording.h>
Public Member Functions | |
cRecordings (bool Deleted=false) | |
virtual | ~cRecordings () |
bool | Load (void) |
bool | Update (bool Wait=false) |
void | TouchUpdate (void) |
bool | NeedsUpdate (void) |
void | ChangeState (void) |
bool | StateChanged (int &State) |
void | ResetResume (const char *ResumeFileName=NULL) |
void | ClearSortNames (void) |
cRecording * | GetByName (const char *FileName) |
void | AddByName (const char *FileName, bool TriggerUpdate=true) |
void | DelByName (const char *FileName) |
void | UpdateByName (const char *FileName) |
int | TotalFileSizeMB (void) |
double | MBperMinute (void) |
int | PathIsInUse (const char *Path) |
int | GetNumRecordingsInPath (const char *Path) |
bool | MoveRecordings (const char *OldPath, const char *NewPath) |
![]() | |
cRecording * | Get (int Index) const |
cRecording * | First (void) const |
cRecording * | Last (void) const |
cRecording * | Prev (const cRecording *object) const |
cRecording * | Next (const cRecording *object) const |
![]() | |
virtual | ~cListBase () |
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) |
cListObject * | Get (int Index) const |
int | Count (void) const |
void | Sort (void) |
![]() | |
cThread (const char *Description=NULL, bool LowPriority=false) | |
virtual | ~cThread () |
void | SetDescription (const char *Description,...) __attribute__((format(printf |
void bool | Start (void) |
bool | Active (void) |
Protected Member Functions | |
void | Action (void) |
![]() | |
cListBase (void) | |
![]() | |
void | SetPriority (int Priority) |
void | SetIOPriority (int Priority) |
void | Lock (void) |
void | Unlock (void) |
bool | Running (void) |
void | Cancel (int WaitSeconds=0) |
Private Member Functions | |
const char * | UpdateFileName (void) |
void | Refresh (bool Foreground=false) |
bool | ScanVideoDir (const char *DirName, bool Foreground=false, int LinkLevel=0, int DirLevel=0) |
Private Attributes | |
bool | deleted |
bool | initial |
time_t | lastUpdate |
int | state |
Static Private Attributes | |
static char * | updateFileName = NULL |
Additional Inherited Members | |
![]() | |
static tThreadId | ThreadId (void) |
static tThreadId | IsMainThread (void) |
static void | SetMainThreadId (void) |
![]() | |
cListObject * | objects |
cListObject * | lastObject |
int | count |
Definition at line 219 of file recording.h.
cRecordings::cRecordings | ( | bool | Deleted = false | ) |
Definition at line 1369 of file recording.c.
References deleted, initial, lastUpdate, and state.
|
virtual |
Definition at line 1378 of file recording.c.
References cThread::Cancel().
|
protectedvirtual |
void cRecordings::AddByName | ( | const char * | FileName, |
bool | TriggerUpdate = true |
||
) |
Definition at line 1521 of file recording.c.
References cListBase::Add(), ChangeState(), GetByName(), LOCK_THREAD, and TouchUpdate().
Referenced by cMenuRecordingEdit::Action(), cSVDRP::CmdCPYR(), cRecordControl::cRecordControl(), cCutter::Start(), and cDirCopier::Stop().
|
inline |
Definition at line 249 of file recording.h.
References DeletedRecordings, and Recordings.
Referenced by cRecordingsHandlerEntry::Active(), cRecordingsHandler::Add(), AddByName(), cRecording::ChangeName(), cRecording::ChangePriorityLifetime(), cRecordingsHandler::Del(), cRecordingsHandler::DelAll(), DelByName(), MoveRecordings(), Refresh(), ResetResume(), and ScanVideoDir().
void cRecordings::ClearSortNames | ( | void | ) |
Definition at line 1650 of file recording.c.
References cList< cRecording >::First(), LOCK_THREAD, and cList< cRecording >::Next().
Referenced by cMenuSetupOSD::ProcessKey().
void cRecordings::DelByName | ( | const char * | FileName | ) |
Definition at line 1534 of file recording.c.
References cListBase::Add(), ChangeState(), cListBase::Del(), cRecording::deleted, DeletedRecordings(), DELEXT, cRecording::fileName, cRecording::FileName(), GetByName(), LOCK_THREAD, and TouchUpdate().
Referenced by cRecordingsHandlerEntry::Active(), cSVDRP::CmdDELR(), cMenuRecordings::Delete(), cCutter::Stop(), cReplayControl::Stop(), and cDirCopier::Stop().
cRecording * cRecordings::GetByName | ( | const char * | FileName | ) |
Definition at line 1509 of file recording.c.
References cList< cRecording >::First(), LOCK_THREAD, and cList< cRecording >::Next().
Referenced by AddByName(), cSVDRP::CmdMOVR(), cMenuTimers::Commands(), DelByName(), cMenuRecordings::Delete(), cReplayControl::GetInfo(), cReplayControl::GetRecording(), cReplayControl::LastReplayed(), cMenuRecordingEdit::RefreshRecording(), cMenuRecording::RefreshRecording(), ScanVideoDir(), SetTrackDescriptions(), cReplayControl::ShowProgress(), cReplayControl::Stop(), and UpdateByName().
int cRecordings::GetNumRecordingsInPath | ( | const char * | Path | ) |
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 1611 of file recording.c.
References cList< cRecording >::First(), LOCK_THREAD, and cList< cRecording >::Next().
Referenced by cMenuPathEdit::ApplyChanges().
|
inline |
Loads the current list of recordings and returns true if there is anything in it (for compatibility with older plugins - use Update(true) instead).
Definition at line 234 of file recording.h.
Referenced by cMenuTimers::Commands().
double cRecordings::MBperMinute | ( | void | ) |
Returns the average data rate (in MB/min) of all recordings, or -1 if this value is unknown.
Definition at line 1578 of file recording.c.
References cList< cRecording >::First(), LIMIT_SECS_PER_MB_RADIO, LOCK_THREAD, and cList< cRecording >::Next().
Referenced by cVideoDiskUsage::HasChanged().
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 1622 of file recording.c.
References ChangeState(), dsyslog, cList< cRecording >::First(), LOCK_THREAD, cList< cRecording >::Next(), and cString::sprintf().
Referenced by cMenuPathEdit::ApplyChanges().
bool cRecordings::NeedsUpdate | ( | void | ) |
Definition at line 1490 of file recording.c.
References LastModifiedTime(), lastUpdate, and UpdateFileName().
Referenced by main(), and TouchUpdate().
int cRecordings::PathIsInUse | ( | const char * | Path | ) |
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 1600 of file recording.c.
References cList< cRecording >::First(), LOCK_THREAD, cList< cRecording >::Next(), and ruNone.
Referenced by cMenuPathEdit::cMenuPathEdit().
|
private |
Definition at line 1395 of file recording.c.
References ChangeState(), cListBase::Clear(), cListBase::Count(), deleted, initial, lastUpdate, cThread::Lock(), cVideoDirectory::Name(), ScanVideoDir(), and cThread::Unlock().
void cRecordings::ResetResume | ( | const char * | ResumeFileName = NULL | ) |
Definition at line 1640 of file recording.c.
References ChangeState(), cList< cRecording >::First(), LOCK_THREAD, and cList< cRecording >::Next().
Referenced by cResumeFile::Delete(), cRecording::Info(), cResumeFile::Save(), and cMenuSetupReplay::Store().
|
private |
Definition at line 1408 of file recording.c.
References cListBase::Add(), AddDirectory(), ChangeState(), cListBase::Del(), cRecording::deleted, deleted, DELEXT, endswith(), cRecording::FileName(), cRecording::FileSizeMB(), cList< cRecording >::First(), GetByName(), initial, cRecording::IsOnVideoDirectoryFileSystem(), isyslog, cThread::Lock(), MAX_LINK_LEVEL, cRecording::Name(), cReadDir::Next(), cList< cRecording >::Next(), cRecording::NumFrames(), RECEXT, cThread::Running(), and cThread::Unlock().
Referenced by Refresh().
bool cRecordings::StateChanged | ( | int & | State | ) |
Definition at line 1474 of file recording.c.
References state.
Referenced by cMenuRecording::cMenuRecording(), cMenuRecordingEdit::cMenuRecordingEdit(), cMenuRecordings::cMenuRecordings(), cMenuRecordings::ProcessKey(), cMenuRecordingEdit::RefreshRecording(), cMenuRecording::RefreshRecording(), and cMenuFolder::Set().
int cRecordings::TotalFileSizeMB | ( | void | ) |
Definition at line 1566 of file recording.c.
References cList< cRecording >::First(), LOCK_THREAD, and cList< cRecording >::Next().
Referenced by cVideoDirectory::VideoDiskSpace().
void cRecordings::TouchUpdate | ( | void | ) |
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 1482 of file recording.c.
References lastUpdate, NeedsUpdate(), TouchFile(), and UpdateFileName().
Referenced by cCuttingThread::Action(), cRecordingsHandlerEntry::Active(), AddByName(), cRecording::ChangeName(), cRecording::ChangePriorityLifetime(), and DelByName().
bool cRecordings::Update | ( | bool | Wait = false | ) |
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. Returns true if Wait is true and there is anything in the list of recordings, false otherwise.
Definition at line 1498 of file recording.c.
References cListBase::Count(), Refresh(), and cThread::Start().
Referenced by AssertFreeDiskSpace(), cSVDRP::CmdLSTR(), cSVDRP::CmdUPDR(), and main().
void cRecordings::UpdateByName | ( | const char * | FileName | ) |
Definition at line 1558 of file recording.c.
References GetByName(), LOCK_THREAD, and cRecording::ReadInfo().
Referenced by cRecorder::Action(), and cIndexFileGenerator::Action().
|
private |
Definition at line 1388 of file recording.c.
References AddDirectory(), cVideoDirectory::Name(), and updateFileName.
Referenced by NeedsUpdate(), and TouchUpdate().
|
private |
Definition at line 222 of file recording.h.
Referenced by cRecordings(), cRecording::Deleted(), Refresh(), and ScanVideoDir().
|
private |
Definition at line 223 of file recording.h.
Referenced by cRecordings(), Refresh(), and ScanVideoDir().
|
private |
Definition at line 224 of file recording.h.
Referenced by cRecordings(), NeedsUpdate(), Refresh(), and TouchUpdate().
|
private |
Definition at line 225 of file recording.h.
Referenced by cRecordings(), and StateChanged().
|
staticprivate |
Definition at line 221 of file recording.h.
Referenced by UpdateFileName().