|
vdr 2.8.1
|
#include <recording.h>
Public Member Functions | |
| cRecording (cTimer *Timer, const cEvent *Event) | |
| cRecording (const char *FileName) | |
| virtual | ~cRecording () override |
| int | Id (void) const |
| time_t | Start (void) const |
| int | Priority (void) const |
| int | Lifetime (void) const |
| time_t | Deleted (void) const |
| bool | RetentionExpired (void) const |
| void | SetDeleted (void) |
| virtual int | Compare (const cListObject &ListObject) const override |
| bool | IsInPath (const char *Path) const |
| cString | Folder (void) const |
| cString | BaseName (void) const |
| const char * | Name (void) const |
| const char * | FileName (void) const |
| const char * | Title (char Delimiter=' ', bool NewIndicator=false, int Level=-1) const |
| cRecordingInfo * | Info (void) const |
| const char * | PrefixFileName (char Prefix) |
| int | HierarchyLevels (void) const |
| void | ResetResume (void) const |
| void | DeleteResume (void) const |
| double | FramesPerSecond (void) const |
| int | NumFrames (void) const |
| int | NumFramesAfterEdit (void) const |
| int | LengthInSeconds (void) const |
| int | LengthInSecondsAfterEdit (void) const |
| int | FileSizeMB (void) const |
| int | GetResume (void) const |
| time_t | GetLastReplayTime (void) const |
| bool | IsNew (void) const |
| bool | IsEdited (void) const |
| bool | IsPesRecording (void) const |
| bool | IsOnVideoDirectoryFileSystem (void) const |
| bool | HasMarks (void) const |
| bool | DeleteMarks (void) |
| void | ReadInfo (bool Force=false) |
| bool | WriteInfo (const char *OtherFileName=NULL) |
| void | SetStartTime (time_t Start) |
| bool | ChangePriorityLifetime (int NewPriority, int NewLifetime) |
| bool | ChangeName (const char *NewName) |
| bool | Delete (void) |
| bool | Remove (void) |
| bool | Undelete (void) |
| int | IsInUse (void) const |
| Public Member Functions inherited from cListObject | |
| cListObject (void) | |
| virtual | ~cListObject () |
| void | Append (cListObject *Object) |
| void | Insert (cListObject *Object) |
| void | Unlink (void) |
| int | Index (void) const |
| cListObject * | Prev (void) const |
| cListObject * | Next (void) const |
Private Member Functions | |
| cRecording (const cRecording &) | |
| cRecording & | operator= (const cRecording &) |
| char * | SortName (void) const |
| void | ClearSortName (void) |
| void | SetId (int Id) |
Static Private Member Functions | |
| static char * | StripEpisodeName (char *s, bool Strip) |
Private Attributes | |
| int | id |
| cResumeFile * | resume |
| char * | titleBuffer |
| char * | sortBufferName |
| char * | sortBufferTime |
| char * | fileName |
| char * | name |
| int | fileSizeMB |
| int | numFrames |
| int | channel |
| int | instanceId |
| bool | isPesRecording |
| int | isOnVideoDirectoryFileSystem |
| cRecordingInfo * | info |
| time_t | start |
| time_t | deleted |
Friends | |
| class | cRecordings |
Definition at line 133 of file recording.h.
|
private |
References cRecording().
Referenced by Compare(), cRecording(), and operator=().
Definition at line 931 of file recording.c.
References cTimer::Aux(), cTimer::Channel(), channel, deleted, cTimer::File(), fileName, fileSizeMB, FOLDERDELIMCHAR, info, InstanceId, instanceId, isempty(), isOnVideoDirectoryFileSystem, isPesRecording, cTimer::IsSingleEvent(), cTimer::Lifetime(), cChannel::Name(), name, cChannel::Number(), numFrames, cTimer::Priority(), resume, cTimer::SetFile(), Setup, cEvent::ShortText(), sortBufferName, sortBufferTime, cString::sprintf(), start, cTimer::StartTime(), strreplace(), TIMERMACRO_EPISODE, TIMERMACRO_TITLE, cEvent::Title(), Title(), and titleBuffer.
| cRecording::cRecording | ( | const char * | FileName | ) |
Definition at line 984 of file recording.c.
References channel, DATAFORMATPES, DATAFORMATTS, deleted, esyslog, ExchangeChars(), FileName(), fileName, fileSizeMB, FOLDERDELIMCHAR, GetResume(), info, INFOFILESUFFIX, instanceId, isempty(), isOnVideoDirectoryFileSystem, isPesRecording, LOG_ERROR_STR, MALLOC, MAXLIFETIME, MAXPRIORITY, cVideoDirectory::Name(), name, numFrames, cReadLine::Read(), resume, sortBufferName, sortBufferTime, cString::sprintf(), start, strgetlast(), SUMMARYFILESUFFIX, and titleBuffer.
|
overridevirtual |
Definition at line 1110 of file recording.c.
References fileName, info, name, resume, sortBufferName, sortBufferTime, and titleBuffer.
| cString cRecording::BaseName | ( | void | ) | const |
Returns the base name of this recording (without the video directory and folder).
For use in menus etc.
Definition at line 1234 of file recording.c.
References FOLDERDELIMCHAR, name, and strgetlast().
| bool cRecording::ChangeName | ( | const char * | NewName | ) |
Changes the name of this recording to the given value.
NewName is in the same format as the one returned by Name(), i.e. without the video directory and the actual '*.rec' part, and using FOLDERDELIMCHAR as the directory delimiter. If the new name is the same as the old one, nothing happens. Returns false in case of error.
Definition at line 1422 of file recording.c.
References ClearSortName(), dsyslog, esyslog, FileName(), fileName, info, isOnVideoDirectoryFileSystem, MakeDirs(), cVideoDirectory::MoveVideoFile(), Name(), name, and resume.
Referenced by cMenuRecordingEdit::ApplyChanges().
| bool cRecording::ChangePriorityLifetime | ( | int | NewPriority, |
| int | NewLifetime ) |
Changes the priority and lifetime of this recording to the given values.
If the new values are the same as the old ones, nothing happens. Returns false in case of error.
Definition at line 1398 of file recording.c.
References dsyslog, FileName(), fileName, info, IsPesRecording(), Lifetime(), Name(), Priority(), cVideoDirectory::RenameVideoFile(), resume, and WriteInfo().
Referenced by cMenuRecordingEdit::ApplyChanges().
|
private |
Definition at line 1174 of file recording.c.
References sortBufferName, and sortBufferTime.
Referenced by ChangeName().
|
overridevirtual |
Must return 0 if this object is equal to ListObject, a positive value if it is "greater", and a negative value if it is "smaller".
Reimplemented from cListObject.
Definition at line 1210 of file recording.c.
References cListObject::cListObject(), cRecording(), rsdAscending, Setup, and SortName().
| bool cRecording::Delete | ( | void | ) |
Changes the file name (both internally and on disk) to make this a "deleted" recording.
The caller must explicitly move this object from the Recordings to the DeletedRecordings list. Returns false in case of error.
Definition at line 1451 of file recording.c.
References DELEXT, FileName(), fileName, cRecordingUserCommand::InvokeCommand(), isyslog, RECEXT, cVideoDirectory::RemoveVideoFile(), cVideoDirectory::RenameVideoFile(), RUC_DELETERECORDING, SetDeleted(), and TouchFile().
Referenced by AssertFreeDiskSpace(), and cMenuRecordings::Delete().
|
inline |
Definition at line 166 of file recording.h.
References deleted.
Referenced by AssertFreeDiskSpace(), and RetentionExpired().
| bool cRecording::DeleteMarks | ( | void | ) |
Deletes the editing marks from this recording (if any).
Returns true if the operation was successful. If there is no marks file for this recording, it also returns true.
Definition at line 1360 of file recording.c.
References cMarks::DeleteMarksFile().
| void cRecording::DeleteResume | ( | void | ) | const |
Definition at line 1546 of file recording.c.
References resume.
Referenced by cMenuRecordings::Rewind().
| const char * cRecording::FileName | ( | void | ) | const |
Returns the full path name to the recording directory, including the video directory and the actual '*.rec'.
For disk file access use.
Definition at line 1239 of file recording.c.
References channel, DirectoryNameMax, DirectoryPathMax, dsyslog, ExchangeChars(), fileName, info, instanceId, isPesRecording, LimitNameLengths(), Name(), cVideoDirectory::Name(), name, NAMEFORMATPES, NAMEFORMATTS, cString::sprintf(), and start.
Referenced by ChangeName(), ChangePriorityLifetime(), cMenuRecordings::Commands(), cRecordControl::cRecordControl(), cRecording(), cReplayControl::cReplayControl(), cRecordings::DelByName(), cMenuRecordings::Delete(), Delete(), cMarks::DeleteMarksFile(), FileSizeMB(), IsInUse(), IsOnVideoDirectoryFileSystem(), cMarks::MarksFileName(), NumFrames(), cMenuRecordings::Play(), PrefixFileName(), RecordingInUseMessage(), Remove(), cVideoDirectoryScannerThread::ScanVideoDir(), SetDeleted(), SortName(), Undelete(), and WriteInfo().
| int cRecording::FileSizeMB | ( | void | ) | const |
Returns the total file size of this recording (in MB), or -1 if the file size is unknown.
Definition at line 1590 of file recording.c.
References DirSizeMB(), FileName(), fileSizeMB, and StillRecording().
Referenced by cVideoDirectoryScannerThread::ScanVideoDir().
| cString cRecording::Folder | ( | void | ) | const |
Returns the name of the folder this recording is stored in (without the video directory).
For use in menus etc.
Definition at line 1227 of file recording.c.
References FOLDERDELIMCHAR, and name.
Referenced by cMenuRecordingEdit::ApplyChanges().
|
inline |
Definition at line 191 of file recording.h.
References info.
Referenced by cCuttingThread::cCuttingThread(), cDvbPlayer::cDvbPlayer(), cReplayControl::cReplayControl(), CutRecording(), cCutter::EditedFileName(), LengthInSeconds(), LengthInSecondsAfterEdit(), and NumFramesAfterEdit().
| time_t cRecording::GetLastReplayTime | ( | void | ) | const |
Returns the time this recording was last replayed (which is actually the timestamp of the resume file), or 0 if no resume file exists.
Definition at line 1191 of file recording.c.
References resume.
| int cRecording::GetResume | ( | void | ) | const |
Returns the index of the frame where replay of this recording shall be resumed, or -1 in case of an error.
Definition at line 1186 of file recording.c.
References resume.
Referenced by cRecording(), and IsNew().
| bool cRecording::HasMarks | ( | void | ) | const |
Returns true if this recording has any editing marks.
Definition at line 1355 of file recording.c.
References cMarks::MarksFileName().
| int cRecording::HierarchyLevels | ( | void | ) | const |
Definition at line 1331 of file recording.c.
References FOLDERDELIMCHAR, and name.
Referenced by Title().
|
inline |
Definition at line 162 of file recording.h.
References id.
Referenced by cSVDRPServer::CmdLSTR(), operator=(), and SetId().
|
inline |
Definition at line 186 of file recording.h.
References info.
Referenced by cMenuRecordingEdit::ApplyChanges(), cSkinClassicDisplayMenu::SetRecording(), cSkinCursesDisplayMenu::SetRecording(), cSkinLCARSDisplayMenu::SetRecording(), cSkinLCARSDisplayReplay::SetRecording(), and cSkinSTTNGDisplayMenu::SetRecording().
| bool cRecording::IsEdited | ( | void | ) | const |
Definition at line 1342 of file recording.c.
References FOLDERDELIMCHAR, name, and strgetlast().
Referenced by AssertFreeDiskSpace().
| bool cRecording::IsInPath | ( | const char * | Path | ) | const |
Returns true if this recording is stored anywhere under the given Path.
If Path is NULL or an empty string, the entire video directory is checked.
Definition at line 1219 of file recording.c.
References FOLDERDELIMCHAR, isempty(), and name.
| int cRecording::IsInUse | ( | void | ) | const |
Checks whether this recording is currently in use and therefore shall not be tampered with.
Returns 0 (ruNone) if the recording is not in use. The return value may consist of several or'd eRecordingUsage flags. If the caller is just interested in whether the recording is in use or not, the return value can be used like a boolean value. A recording may be in use for several reasons (like being recorded and replayed, as in time-shift).
Definition at line 1524 of file recording.c.
References FileName(), cRecordControls::GetRecordControl(), cReplayControl::NowReplaying(), RecordingsHandler, ruNone, ruReplay, and ruTimer.
|
inline |
| bool cRecording::IsOnVideoDirectoryFileSystem | ( | void | ) | const |
Definition at line 1348 of file recording.c.
References FileName(), cVideoDirectory::IsOnVideoDirectoryFileSystem(), and isOnVideoDirectoryFileSystem.
Referenced by AssertFreeDiskSpace(), and cVideoDirectoryScannerThread::ScanVideoDir().
|
inline |
Definition at line 215 of file recording.h.
References isPesRecording.
Referenced by cCuttingThread::cCuttingThread(), cDvbPlayer::cDvbPlayer(), ChangePriorityLifetime(), cReplayControl::cReplayControl(), CutRecording(), cCutter::EditedFileName(), GenerateIndex(), cMarks::MarksFileName(), and NumFrames().
| int cRecording::LengthInSeconds | ( | void | ) | const |
Returns the length (in seconds) of this recording, or -1 in case of error.
Definition at line 1574 of file recording.c.
References FramesPerSecond(), and NumFrames().
Referenced by Title().
| int cRecording::LengthInSecondsAfterEdit | ( | void | ) | const |
Returns the length (in seconds) of the edited version of this recording, or -1 in case of error.
If there are no editing marks, 0 will be returned.
Definition at line 1582 of file recording.c.
References FramesPerSecond(), and NumFramesAfterEdit().
|
inline |
Definition at line 165 of file recording.h.
References info.
Referenced by AssertFreeDiskSpace(), and ChangePriorityLifetime().
|
inline |
Returns the full name of the recording (without the video directory).
For use in menus etc.
Definition at line 179 of file recording.h.
References name.
Referenced by cMenuRecordingEdit::ApplyChanges(), ChangeName(), ChangePriorityLifetime(), cRecordControl::cRecordControl(), cReplayControl::cReplayControl(), CutRecording(), FileName(), GenerateIndex(), cVideoDirectoryScannerThread::ScanVideoDir(), cSkinClassicDisplayMenu::SetRecording(), cSkinCursesDisplayMenu::SetRecording(), cSkinLCARSDisplayMenu::SetRecording(), and cSkinSTTNGDisplayMenu::SetRecording().
| int cRecording::NumFrames | ( | void | ) | const |
Returns the number of frames in this recording.
If the number of frames is unknown, -1 will be returned.
Definition at line 1552 of file recording.c.
References FileName(), cIndexFile::GetLength(), IsPesRecording(), numFrames, and StillRecording().
Referenced by FileSizeMBafterEdit(), LengthInSeconds(), and cVideoDirectoryScannerThread::ScanVideoDir().
| int cRecording::NumFramesAfterEdit | ( | void | ) | const |
Returns the number of frames in the edited version of this recording.
If there are no editing marks, 0 will be returned. If the number of frames is unknown, -1 will be returned.
Definition at line 1563 of file recording.c.
References fileName, FramesPerSecond(), cMarks::GetFrameAfterEdit(), cIndexFile::GetLength(), isPesRecording, and cMarks::Load().
Referenced by FileSizeMBafterEdit(), and LengthInSecondsAfterEdit().
|
private |
References cRecording(), and Id().
| const char * cRecording::PrefixFileName | ( | char | Prefix | ) |
Definition at line 1320 of file recording.c.
References FileName(), fileName, and cVideoDirectory::PrefixVideoFileName().
Referenced by cCutter::EditedFileName().
|
inline |
Definition at line 164 of file recording.h.
References info.
Referenced by AssertFreeDiskSpace(), and ChangePriorityLifetime().
| void cRecording::ReadInfo | ( | bool | Force = false | ) |
Definition at line 1365 of file recording.c.
References info.
Referenced by cVideoDirectoryScannerThread::ScanVideoDir().
| bool cRecording::Remove | ( | void | ) |
Actually removes the file from the disk.
The caller must explicitly delete this object from the DeletedRecordings list. Returns false in case of error.
Definition at line 1483 of file recording.c.
References DELEXT, endswith(), esyslog, FileName(), isyslog, and cVideoDirectory::RemoveVideoFile().
Referenced by AssertFreeDiskSpace().
| void cRecording::ResetResume | ( | void | ) | const |
Definition at line 1540 of file recording.c.
References resume.
| bool cRecording::RetentionExpired | ( | void | ) | const |
Definition at line 1196 of file recording.c.
References Deleted(), DELETEDLIFETIME, SECSINDAY, and Setup.
| void cRecording::SetDeleted | ( | void | ) |
Definition at line 1205 of file recording.c.
References deleted, FileName(), and LastModifiedTime().
Referenced by cRecordings::DelByName(), Delete(), and cVideoDirectoryScannerThread::ScanVideoDir().
|
private |
| void cRecording::SetStartTime | ( | time_t | Start | ) |
Sets the start time of this recording to the given value.
If a filename has already been set for this recording, it will be deleted and a new one will be generated (using the new start time) at the next call to FileName(). Use this function with care - it does not check whether a recording with this new name already exists, and if there is one, results may be unexpected!
Definition at line 1391 of file recording.c.
References fileName, Start(), and start.
Referenced by cCutter::EditedFileName().
|
private |
Definition at line 1150 of file recording.c.
References FileName(), MALLOC, cVideoDirectory::Name(), RecordingsSortMode, rsdAscending, rsmName, rsmTime, Setup, sortBufferName, sortBufferTime, start, StripEpisodeName(), and strreplace().
Referenced by Compare().
|
inline |
Definition at line 163 of file recording.h.
References start.
Referenced by AssertFreeDiskSpace(), cCutter::EditedFileName(), cSkinClassicDisplayMenu::SetRecording(), cSkinCursesDisplayMenu::SetRecording(), cSkinLCARSDisplayMenu::SetRecording(), cSkinLCARSDisplayReplay::SetRecording(), cSkinSTTNGDisplayMenu::SetRecording(), and SetStartTime().
|
staticprivate |
Definition at line 1121 of file recording.c.
References rsdAscending, and Setup.
Referenced by SortName().
| const char * cRecording::Title | ( | char | Delimiter = ' ', |
| bool | NewIndicator = false, | ||
| int | Level = -1 ) const |
Definition at line 1257 of file recording.c.
References FOLDERDELIMCHAR, HierarchyLevels(), info, IsNew(), LengthInSeconds(), MALLOC, max(), name, cString::sprintf(), start, stripspace(), strn0cpy(), and titleBuffer.
Referenced by cSVDRPServer::CmdLSTR(), cRecording(), and cSkinDisplayReplay::SetRecording().
| bool cRecording::Undelete | ( | void | ) |
Changes the file name (both internally and on disk) to make this a "normal" recording.
The caller must explicitly move this object from the DeletedRecordings to the Recordings list. Returns false in case of error.
Definition at line 1494 of file recording.c.
References deleted, DELEXT, esyslog, FileName(), fileName, isyslog, RECEXT, and cVideoDirectory::RenameVideoFile().
| bool cRecording::WriteInfo | ( | const char * | OtherFileName = NULL | ) |
Writes the info file of this recording.
If OtherFileName is given, the info file will be written under that recording file name instead of this recording's file name.
Definition at line 1370 of file recording.c.
References cSafeFile::Close(), cRecordingInfo::Errors(), FileName(), info, INFOFILESUFFIX, isPesRecording, LOG_ERROR_STR, max(), cSafeFile::Open(), cRecordingInfo::Read(), cString::sprintf(), and cRecordingInfo::TmpErrors().
Referenced by cMenuRecordingEdit::ApplyChanges(), ChangePriorityLifetime(), and cRecordControl::cRecordControl().
|
friend |
|
private |
Definition at line 145 of file recording.h.
Referenced by cRecording(), cRecording(), and FileName().
|
private |
Definition at line 157 of file recording.h.
Referenced by cRecording(), cRecording(), Deleted(), SetDeleted(), and Undelete().
|
mutableprivate |
Definition at line 141 of file recording.h.
Referenced by ChangeName(), ChangePriorityLifetime(), cRecording(), cRecording(), cRecordings::DelByName(), Delete(), FileName(), NumFramesAfterEdit(), PrefixFileName(), SetStartTime(), Undelete(), and ~cRecording().
|
mutableprivate |
Definition at line 143 of file recording.h.
Referenced by cRecording(), cRecording(), and FileSizeMB().
|
private |
Definition at line 136 of file recording.h.
Referenced by Id().
|
private |
Definition at line 149 of file recording.h.
Referenced by ChangeName(), ChangePriorityLifetime(), cRecording(), cRecording(), FileName(), FramesPerSecond(), Info(), Lifetime(), Priority(), ReadInfo(), Title(), WriteInfo(), and ~cRecording().
|
private |
Definition at line 146 of file recording.h.
Referenced by cRecording(), cRecording(), and FileName().
|
mutableprivate |
Definition at line 148 of file recording.h.
Referenced by ChangeName(), cRecording(), cRecording(), and IsOnVideoDirectoryFileSystem().
|
private |
Definition at line 147 of file recording.h.
Referenced by cRecording(), cRecording(), FileName(), IsPesRecording(), NumFramesAfterEdit(), and WriteInfo().
|
mutableprivate |
Definition at line 142 of file recording.h.
Referenced by BaseName(), ChangeName(), cRecording(), cRecording(), FileName(), Folder(), HierarchyLevels(), IsEdited(), IsInPath(), Name(), Title(), and ~cRecording().
|
mutableprivate |
Definition at line 144 of file recording.h.
Referenced by cRecording(), cRecording(), and NumFrames().
|
mutableprivate |
Definition at line 137 of file recording.h.
Referenced by ChangeName(), ChangePriorityLifetime(), cRecording(), cRecording(), DeleteResume(), GetLastReplayTime(), GetResume(), ResetResume(), and ~cRecording().
|
mutableprivate |
Definition at line 139 of file recording.h.
Referenced by ClearSortName(), cRecording(), cRecording(), SortName(), and ~cRecording().
|
mutableprivate |
Definition at line 140 of file recording.h.
Referenced by ClearSortName(), cRecording(), cRecording(), SortName(), and ~cRecording().
|
private |
Definition at line 156 of file recording.h.
Referenced by cRecording(), cRecording(), FileName(), SetStartTime(), SortName(), Start(), and Title().
|
mutableprivate |
Definition at line 138 of file recording.h.
Referenced by cRecording(), cRecording(), Title(), and ~cRecording().