vdr
2.2.0
|
#include <recording.h>
Public Member Functions | |
cRecording (cTimer *Timer, const cEvent *Event) | |
cRecording (const char *FileName) | |
virtual | ~cRecording () |
time_t | Start (void) const |
int | Priority (void) const |
int | Lifetime (void) const |
time_t | Deleted (void) const |
virtual int | Compare (const cListObject &ListObject) const |
bool | IsInPath (const char *Path) |
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 |
const cRecordingInfo * | Info (void) const |
const char * | PrefixFileName (char Prefix) |
int | HierarchyLevels (void) const |
void | ResetResume (void) const |
double | FramesPerSecond (void) const |
int | NumFrames (void) const |
int | LengthInSeconds (void) const |
int | FileSizeMB (void) const |
int | GetResume (void) const |
bool | IsNew (void) const |
bool | IsEdited (void) const |
bool | IsPesRecording (void) const |
bool | IsOnVideoDirectoryFileSystem (void) const |
bool | HasMarks (void) |
bool | DeleteMarks (void) |
void | ReadInfo (void) |
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 |
![]() | |
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) |
Static Private Member Functions | |
static char * | StripEpisodeName (char *s, bool Strip) |
Private Attributes | |
int | resume |
char * | titleBuffer |
char * | sortBufferName |
char * | sortBufferTime |
char * | fileName |
char * | name |
int | fileSizeMB |
int | numFrames |
int | channel |
int | instanceId |
bool | isPesRecording |
int | isOnVideoDirectoryFileSystem |
double | framesPerSecond |
cRecordingInfo * | info |
time_t | start |
int | priority |
int | lifetime |
time_t | deleted |
Friends | |
class | cRecordings |
Definition at line 98 of file recording.h.
|
private |
Definition at line 754 of file recording.c.
References cTimer::Aux(), cTimer::Channel(), DEFAULTFRAMESPERSECOND, cTimer::File(), FOLDERDELIMCHAR, InstanceId, isempty(), cTimer::IsSingleEvent(), cTimer::Lifetime(), cChannel::Name(), cChannel::Number(), cTimer::Priority(), RESUME_NOT_INITIALIZED, cRecordingInfo::SetAux(), cTimer::SetFile(), cTimers::SetModified(), Setup, cEvent::ShortText(), cString::sprintf(), cTimer::StartTime(), strreplace(), TIMERMACRO_EPISODE, TIMERMACRO_TITLE, Timers, cEvent::Title(), and cSetup::UseSubtitle.
cRecording::cRecording | ( | const char * | FileName | ) |
Definition at line 811 of file recording.c.
References DATAFORMATPES, DATAFORMATTS, DEFAULTFRAMESPERSECOND, esyslog, ExchangeChars(), INFOFILESUFFIX, isempty(), LOG_ERROR_STR, MALLOC, MAXLIFETIME, MAXPRIORITY, cVideoDirectory::Name(), cReadLine::Read(), RESUME_NOT_INITIALIZED, cString::sprintf(), and SUMMARYFILESUFFIX.
|
virtual |
Definition at line 935 of file recording.c.
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 1035 of file recording.c.
References FOLDERDELIMCHAR.
Referenced by cMenuRecordingEdit::cMenuRecordingEdit().
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 1228 of file recording.c.
References cRecordings::ChangeState(), dsyslog, MakeDirs(), cVideoDirectory::MoveVideoFile(), Recordings, and cRecordings::TouchUpdate().
Referenced by cMenuRecordingEdit::ApplyChanges(), and cSVDRP::CmdMOVR().
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 1201 of file recording.c.
References cRecordings::ChangeState(), dsyslog, Recordings, cVideoDirectory::RenameVideoFile(), and cRecordings::TouchUpdate().
Referenced by cMenuRecordingEdit::ApplyChanges().
|
private |
Definition at line 998 of file recording.c.
|
virtual |
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 1014 of file recording.c.
References SortName().
bool cRecording::Delete | ( | void | ) |
Changes the file name so that it will no longer be visible in the "Recordings" menu Returns false in case of error.
Definition at line 1254 of file recording.c.
References DELEXT, cRecordingUserCommand::InvokeCommand(), isyslog, RECEXT, cVideoDirectory::RemoveVideoFile(), cVideoDirectory::RenameVideoFile(), and RUC_DELETERECORDING.
Referenced by cRecordingsHandlerEntry::Active(), AssertFreeDiskSpace(), cSVDRP::CmdDELR(), cMenuRecordings::Delete(), and cReplayControl::Stop().
|
inline |
Definition at line 131 of file recording.h.
References cRecordings::deleted.
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 1162 of file recording.c.
References LOG_ERROR_STR, and cMarks::MarksFileName().
Referenced by cMenuRecordingEdit::Delete().
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 1042 of file recording.c.
References DirectoryNameMax, DirectoryPathMax, dsyslog, ExchangeChars(), LimitNameLengths(), cVideoDirectory::Name(), NAMEFORMATPES, NAMEFORMATTS, and cString::sprintf().
Referenced by cMenuRecordingEdit::Action(), cRecordingsHandlerEntry::Active(), cMenuRecordingEdit::ApplyChanges(), cSVDRP::CmdCPYR(), cSVDRP::CmdDELR(), cSVDRP::CmdEDIT(), cSVDRP::CmdLSTR(), cSVDRP::CmdMOVR(), cSVDRP::CmdPLAY(), cMenuRecording::cMenuRecording(), cMenuRecordingEdit::cMenuRecordingEdit(), cMenuRecordings::Commands(), cMenuTimers::Commands(), cReplayControl::cReplayControl(), cRecordings::DelByName(), cMenuRecordings::Delete(), cMenuRecordingEdit::Delete(), cRecordingInfo::FramesPerSecond(), cMarks::MarksFileName(), cMenuRecordings::Play(), RecordingInUseMessage(), cMenuRecordings::Rewind(), cRecordings::ScanVideoDir(), and cMenuRecordingEdit::SetHelpKeys().
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 1352 of file recording.c.
References DirSizeMB(), cIndexFile::IndexFileName(), LastModifiedTime(), and MININDEXAGE.
Referenced by cRecordings::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 1028 of file recording.c.
References FOLDERDELIMCHAR.
Referenced by cMenuRecordingEdit::cMenuRecordingEdit().
|
inline |
Definition at line 153 of file recording.h.
Referenced by cCuttingThread::cCuttingThread(), cDvbPlayer::cDvbPlayer(), cSVDRP::CmdEDIT(), cSVDRP::CmdPLAY(), cReplayControl::cReplayControl(), CutRecording(), cCutter::EditedFileName(), and cRecordingInfo::FramesPerSecond().
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 1005 of file recording.c.
References cResumeFile::Read(), and RESUME_NOT_INITIALIZED.
bool cRecording::HasMarks | ( | void | ) |
Returns true if this recording has any editing marks.
Definition at line 1157 of file recording.c.
References cMarks::MarksFileName().
Referenced by cMenuRecordingEdit::SetHelpKeys().
int cRecording::HierarchyLevels | ( | void | ) | const |
Definition at line 1132 of file recording.c.
References FOLDERDELIMCHAR.
|
inline |
Definition at line 149 of file recording.h.
References cRecordings::ResetResume().
Referenced by cSVDRP::CmdLSTR(), cMenuRecording::Display(), cSkinClassicDisplayMenu::SetRecording(), cSkinCursesDisplayMenu::SetRecording(), cSkinSTTNGDisplayMenu::SetRecording(), cSkinLCARSDisplayMenu::SetRecording(), cSkinLCARSDisplayReplay::SetRecording(), and SetTrackDescriptions().
bool cRecording::IsEdited | ( | void | ) | const |
Definition at line 1143 of file recording.c.
References FOLDERDELIMCHAR.
Referenced by AssertFreeDiskSpace().
bool cRecording::IsInPath | ( | const char * | Path | ) |
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 1020 of file recording.c.
References FOLDERDELIMCHAR, and isempty().
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 1317 of file recording.c.
References cRecordControls::GetRecordControl(), cRecordingsHandler::GetUsage(), cReplayControl::NowReplaying(), RecordingsHandler, ruNone, ruReplay, and ruTimer.
Referenced by cMenuRecordingEdit::Action(), cSVDRP::CmdCPYR(), cSVDRP::CmdDELR(), cSVDRP::CmdMOVR(), and cMenuRecordingEdit::Set().
|
inline |
Definition at line 165 of file recording.h.
bool cRecording::IsOnVideoDirectoryFileSystem | ( | void | ) | const |
Definition at line 1150 of file recording.c.
References cVideoDirectory::IsOnVideoDirectoryFileSystem().
Referenced by AssertFreeDiskSpace(), and cRecordings::ScanVideoDir().
|
inline |
Definition at line 167 of file recording.h.
References cResumeFile::Delete(), cResumeFile::isPesRecording, and cThread::Start().
Referenced by cCuttingThread::cCuttingThread(), cDvbPlayer::cDvbPlayer(), cSVDRP::CmdEDIT(), cSVDRP::CmdPLAY(), cReplayControl::cReplayControl(), CutRecording(), cMenuRecordingEdit::Delete(), cCutter::EditedFileName(), GenerateIndex(), cMarks::MarksFileName(), cMenuRecordings::Rewind(), and cMenuRecordingEdit::SetHelpKeys().
int cRecording::LengthInSeconds | ( | void | ) | const |
Returns the length (in seconds) of this recording, or -1 in case of error.
Definition at line 1344 of file recording.c.
|
inline |
Definition at line 130 of file recording.h.
Referenced by cMenuRecordingEdit::ApplyChanges(), AssertFreeDiskSpace(), and cMenuRecordingEdit::cMenuRecordingEdit().
|
inline |
Returns the full name of the recording (without the video directory.
For use in menus etc.
Definition at line 142 of file recording.h.
Referenced by cMenuRecordingEdit::Action(), cMenuRecordingEdit::ApplyChanges(), cSVDRP::CmdCPYR(), cSVDRP::CmdMOVR(), cReplayControl::cReplayControl(), CutRecording(), cMenuRecordingEdit::Folder(), GenerateIndex(), cRecordings::ScanVideoDir(), cSkinClassicDisplayMenu::SetRecording(), cSkinCursesDisplayMenu::SetRecording(), cSkinSTTNGDisplayMenu::SetRecording(), and cSkinLCARSDisplayMenu::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 1333 of file recording.c.
References cIndexFile::GetLength(), cIndexFile::IndexFileName(), LastModifiedTime(), and MININDEXAGE.
Referenced by cRecordings::ScanVideoDir().
|
private |
const char * cRecording::PrefixFileName | ( | char | Prefix | ) |
Definition at line 1121 of file recording.c.
References cVideoDirectory::PrefixVideoFileName().
Referenced by cCutter::EditedFileName().
|
inline |
Definition at line 129 of file recording.h.
Referenced by cMenuRecordingEdit::ApplyChanges(), AssertFreeDiskSpace(), and cMenuRecordingEdit::cMenuRecordingEdit().
void cRecording::ReadInfo | ( | void | ) |
Definition at line 1173 of file recording.c.
Referenced by cRecordings::UpdateByName().
bool cRecording::Remove | ( | void | ) |
Actually removes the file from the disk Returns false in case of error.
Definition at line 1280 of file recording.c.
References DELEXT, endswith(), esyslog, isyslog, and cVideoDirectory::RemoveVideoFile().
Referenced by cRemoveDeletedRecordingsThread::Action(), and AssertFreeDiskSpace().
void cRecording::ResetResume | ( | void | ) | const |
Definition at line 1328 of file recording.c.
References RESUME_NOT_INITIALIZED.
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 1194 of file recording.c.
References cThread::Start().
Referenced by cCutter::EditedFileName().
|
private |
Definition at line 974 of file recording.c.
References cSetup::AlwaysSortFoldersFirst, MALLOC, cVideoDirectory::Name(), cSetup::RecordingDirs, RecordingsSortMode, rsmName, rsmTime, Setup, and strreplace().
Referenced by Compare().
|
inline |
Definition at line 128 of file recording.h.
Referenced by AssertFreeDiskSpace(), cCutter::EditedFileName(), cSkinClassicDisplayMenu::SetRecording(), cSkinCursesDisplayMenu::SetRecording(), cSkinSTTNGDisplayMenu::SetRecording(), cSkinLCARSDisplayMenu::SetRecording(), and cSkinLCARSDisplayReplay::SetRecording().
|
staticprivate |
Definition at line 945 of file recording.c.
const char * cRecording::Title | ( | char | Delimiter = ' ' , |
bool | NewIndicator = false , |
||
int | Level = -1 |
||
) | const |
Definition at line 1060 of file recording.c.
References FOLDERDELIMCHAR, MALLOC, max(), cString::sprintf(), stripspace(), and strn0cpy().
Referenced by cSVDRP::CmdEDIT(), cSVDRP::CmdLSTR(), cSVDRP::CmdPLAY(), cMenuRecordingItem::cMenuRecordingItem(), and cSkinDisplayReplay::SetRecording().
bool cRecording::Undelete | ( | void | ) |
Changes the file name so that it will be visible in the "Recordings" menu again and not processed by cRemoveDeletedRecordingsThread.
Returns false in case of error
Definition at line 1291 of file recording.c.
References DELEXT, esyslog, isyslog, RECEXT, and cVideoDirectory::RenameVideoFile().
bool cRecording::WriteInfo | ( | const char * | OtherFileName = NULL | ) |
Writes in 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 1181 of file recording.c.
References cSafeFile::Close(), INFOFILESUFFIX, LOG_ERROR_STR, cSafeFile::Open(), and cString::sprintf().
Referenced by cCutter::Start().
|
friend |
Definition at line 99 of file recording.h.
|
private |
Definition at line 109 of file recording.h.
|
private |
Definition at line 123 of file recording.h.
Referenced by cRecordings::DelByName(), and cRecordings::ScanVideoDir().
|
mutableprivate |
Definition at line 105 of file recording.h.
Referenced by cRecordings::DelByName().
|
mutableprivate |
Definition at line 107 of file recording.h.
|
private |
Definition at line 113 of file recording.h.
Referenced by cRecordingInfo::FramesPerSecond().
|
private |
Definition at line 114 of file recording.h.
|
private |
Definition at line 110 of file recording.h.
|
mutableprivate |
Definition at line 112 of file recording.h.
|
private |
Definition at line 111 of file recording.h.
|
private |
Definition at line 122 of file recording.h.
|
mutableprivate |
Definition at line 106 of file recording.h.
|
mutableprivate |
Definition at line 108 of file recording.h.
|
private |
Definition at line 121 of file recording.h.
|
mutableprivate |
Definition at line 101 of file recording.h.
|
mutableprivate |
Definition at line 103 of file recording.h.
|
mutableprivate |
Definition at line 104 of file recording.h.
|
private |
Definition at line 120 of file recording.h.
|
mutableprivate |
Definition at line 102 of file recording.h.