vdr 2.7.7
cRecording Class Reference

#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
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
cRecordingInfoInfo (void) const
const char * PrefixFileName (char Prefix)
int HierarchyLevels (void) const
void ResetResume (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
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
cListObjectPrev (void) const
cListObjectNext (void) const

Private Member Functions

 cRecording (const cRecording &)
cRecordingoperator= (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
int resume
char * titleBuffer
char * sortBufferName
char * sortBufferTime
char * fileName
char * name
int fileSizeMB
int numFrames
int channel
int instanceId
bool isPesRecording
int isOnVideoDirectoryFileSystem
cRecordingInfoinfo
time_t start
time_t deleted

Friends

class cRecordings

Detailed Description

Definition at line 119 of file recording.h.

Constructor & Destructor Documentation

◆ cRecording() [1/3]

cRecording::cRecording ( const cRecording & )
private

References cRecording().

Referenced by Compare(), cRecording(), and operator=().

◆ cRecording() [2/3]

◆ cRecording() [3/3]

◆ ~cRecording()

cRecording::~cRecording ( )
overridevirtual

Definition at line 1045 of file recording.c.

References fileName, info, name, sortBufferName, sortBufferTime, and titleBuffer.

Member Function Documentation

◆ BaseName()

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 1153 of file recording.c.

References FOLDERDELIMCHAR, name, and strgetlast().

◆ ChangeName()

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 1340 of file recording.c.

References ClearSortName(), dsyslog, esyslog, FileName(), fileName, info, isOnVideoDirectoryFileSystem, MakeDirs(), cVideoDirectory::MoveVideoFile(), Name(), and name.

Referenced by cMenuRecordingEdit::ApplyChanges().

◆ ChangePriorityLifetime()

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 1317 of file recording.c.

References dsyslog, FileName(), fileName, info, IsPesRecording(), Lifetime(), Name(), Priority(), cVideoDirectory::RenameVideoFile(), and WriteInfo().

Referenced by cMenuRecordingEdit::ApplyChanges().

◆ ClearSortName()

void cRecording::ClearSortName ( void )
private

Definition at line 1108 of file recording.c.

References sortBufferName, and sortBufferTime.

Referenced by ChangeName().

◆ Compare()

int cRecording::Compare ( const cListObject & ListObject) const
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 1129 of file recording.c.

References cListObject::cListObject(), cRecording(), rsdAscending, Setup, and SortName().

◆ Delete()

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 1368 of file recording.c.

References DELEXT, FileName(), cRecordingUserCommand::InvokeCommand(), isyslog, RECEXT, cVideoDirectory::RemoveVideoFile(), cVideoDirectory::RenameVideoFile(), and RUC_DELETERECORDING.

Referenced by cRecordingsHandlerEntry::Active(), AssertFreeDiskSpace(), and cMenuRecordings::Delete().

◆ Deleted()

time_t cRecording::Deleted ( void ) const
inline

Definition at line 152 of file recording.h.

References deleted.

◆ DeleteMarks()

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 1279 of file recording.c.

References cMarks::DeleteMarksFile().

◆ FileName()

◆ FileSizeMB()

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 1490 of file recording.c.

References DirSizeMB(), FileName(), fileSizeMB, and StillRecording().

Referenced by cVideoDirectoryScannerThread::ScanVideoDir().

◆ Folder()

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 1146 of file recording.c.

References FOLDERDELIMCHAR, and name.

Referenced by cMenuRecordingEdit::ApplyChanges().

◆ FramesPerSecond()

◆ GetResume()

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 1120 of file recording.c.

References FileName(), isPesRecording, cResumeFile::Read(), resume, and RESUME_NOT_INITIALIZED.

Referenced by cRecording(), and IsNew().

◆ HasMarks()

bool cRecording::HasMarks ( void ) const

Returns true if this recording has any editing marks.

Definition at line 1274 of file recording.c.

References cMarks::MarksFileName().

◆ HierarchyLevels()

int cRecording::HierarchyLevels ( void ) const

Definition at line 1250 of file recording.c.

References FOLDERDELIMCHAR, and name.

Referenced by Title().

◆ Id()

int cRecording::Id ( void ) const
inline

Definition at line 148 of file recording.h.

References id.

Referenced by cSVDRPServer::CmdLSTR(), operator=(), and SetId().

◆ Info()

◆ IsEdited()

bool cRecording::IsEdited ( void ) const

Definition at line 1261 of file recording.c.

References FOLDERDELIMCHAR, name, and strgetlast().

Referenced by AssertFreeDiskSpace().

◆ IsInPath()

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 1138 of file recording.c.

References FOLDERDELIMCHAR, isempty(), and name.

◆ IsInUse()

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 1431 of file recording.c.

References FileName(), cRecordControls::GetRecordControl(), cReplayControl::NowReplaying(), RecordingsHandler, ruNone, ruReplay, and ruTimer.

◆ IsNew()

bool cRecording::IsNew ( void ) const
inline

Definition at line 194 of file recording.h.

References GetResume().

Referenced by Title().

◆ IsOnVideoDirectoryFileSystem()

bool cRecording::IsOnVideoDirectoryFileSystem ( void ) const

◆ IsPesRecording()

◆ LengthInSeconds()

int cRecording::LengthInSeconds ( void ) const

Returns the length (in seconds) of this recording, or -1 in case of error.

Definition at line 1474 of file recording.c.

References FramesPerSecond(), and NumFrames().

Referenced by Title().

◆ LengthInSecondsAfterEdit()

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 1482 of file recording.c.

References FramesPerSecond(), and NumFramesAfterEdit().

◆ Lifetime()

int cRecording::Lifetime ( void ) const
inline

Definition at line 151 of file recording.h.

References info.

Referenced by AssertFreeDiskSpace(), and ChangePriorityLifetime().

◆ Name()

◆ NumFrames()

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 1452 of file recording.c.

References FileName(), cIndexFile::GetLength(), IsPesRecording(), numFrames, and StillRecording().

Referenced by FileSizeMBafterEdit(), LengthInSeconds(), and cVideoDirectoryScannerThread::ScanVideoDir().

◆ NumFramesAfterEdit()

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 1463 of file recording.c.

References fileName, FramesPerSecond(), cMarks::GetFrameAfterEdit(), cIndexFile::GetLength(), isPesRecording, and cMarks::Load().

Referenced by FileSizeMBafterEdit(), and LengthInSecondsAfterEdit().

◆ operator=()

cRecording & cRecording::operator= ( const cRecording & )
private

References cRecording(), and Id().

◆ PrefixFileName()

const char * cRecording::PrefixFileName ( char Prefix)

Definition at line 1239 of file recording.c.

References FileName(), fileName, and cVideoDirectory::PrefixVideoFileName().

Referenced by cCutter::EditedFileName().

◆ Priority()

int cRecording::Priority ( void ) const
inline

Definition at line 150 of file recording.h.

References info.

Referenced by AssertFreeDiskSpace(), and ChangePriorityLifetime().

◆ ReadInfo()

void cRecording::ReadInfo ( bool Force = false)

Definition at line 1284 of file recording.c.

References info.

Referenced by cVideoDirectoryScannerThread::ScanVideoDir().

◆ Remove()

bool cRecording::Remove ( void )

Actually removes the file from the disk Returns false in case of error.

Definition at line 1394 of file recording.c.

References DELEXT, endswith(), esyslog, FileName(), isyslog, and cVideoDirectory::RemoveVideoFile().

Referenced by AssertFreeDiskSpace().

◆ ResetResume()

void cRecording::ResetResume ( void ) const

Definition at line 1447 of file recording.c.

References resume, and RESUME_NOT_INITIALIZED.

◆ SetDeleted()

void cRecording::SetDeleted ( void )
inline

Definition at line 153 of file recording.h.

References deleted.

Referenced by cRecordings::DelByName(), and cVideoDirectoryScannerThread::ScanVideoDir().

◆ SetId()

void cRecording::SetId ( int Id)
private

Definition at line 1115 of file recording.c.

References Id().

Referenced by cRecordings::Add().

◆ SetStartTime()

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 1310 of file recording.c.

References fileName, Start(), and start.

Referenced by cCutter::EditedFileName().

◆ SortName()

char * cRecording::SortName ( void ) const
private

◆ Start()

◆ StripEpisodeName()

char * cRecording::StripEpisodeName ( char * s,
bool Strip )
staticprivate

Definition at line 1055 of file recording.c.

References rsdAscending, and Setup.

Referenced by SortName().

◆ Title()

const char * cRecording::Title ( char Delimiter = ' ',
bool NewIndicator = false,
int Level = -1 ) const

◆ Undelete()

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 1405 of file recording.c.

References DELEXT, esyslog, FileName(), isyslog, RECEXT, and cVideoDirectory::RenameVideoFile().

◆ WriteInfo()

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 1289 of file recording.c.

References cSafeFile::Close(), cRecordingInfo::Errors(), FileName(), info, INFOFILESUFFIX, isPesRecording, LOG_ERROR_STR, max(), cSafeFile::Open(), cRecordingInfo::Read(), and cString::sprintf().

Referenced by ChangePriorityLifetime(), and cRecordControl::cRecordControl().

◆ cRecordings

friend class cRecordings
friend

Definition at line 120 of file recording.h.

References cRecordings.

Referenced by cRecordings.

Member Data Documentation

◆ channel

int cRecording::channel
private

Definition at line 131 of file recording.h.

Referenced by cRecording(), cRecording(), and FileName().

◆ deleted

time_t cRecording::deleted
private

Definition at line 143 of file recording.h.

Referenced by cRecording(), cRecording(), Deleted(), and SetDeleted().

◆ fileName

◆ fileSizeMB

int cRecording::fileSizeMB
mutableprivate

Definition at line 129 of file recording.h.

Referenced by cRecording(), cRecording(), and FileSizeMB().

◆ id

int cRecording::id
private

Definition at line 122 of file recording.h.

Referenced by Id().

◆ info

◆ instanceId

int cRecording::instanceId
private

Definition at line 132 of file recording.h.

Referenced by cRecording(), cRecording(), and FileName().

◆ isOnVideoDirectoryFileSystem

int cRecording::isOnVideoDirectoryFileSystem
mutableprivate

Definition at line 134 of file recording.h.

Referenced by ChangeName(), cRecording(), cRecording(), and IsOnVideoDirectoryFileSystem().

◆ isPesRecording

bool cRecording::isPesRecording
private

◆ name

char* cRecording::name
mutableprivate

◆ numFrames

int cRecording::numFrames
mutableprivate

Definition at line 130 of file recording.h.

Referenced by cRecording(), cRecording(), and NumFrames().

◆ resume

int cRecording::resume
mutableprivate

Definition at line 123 of file recording.h.

Referenced by cRecording(), cRecording(), GetResume(), and ResetResume().

◆ sortBufferName

char* cRecording::sortBufferName
mutableprivate

Definition at line 125 of file recording.h.

Referenced by ClearSortName(), cRecording(), cRecording(), SortName(), and ~cRecording().

◆ sortBufferTime

char* cRecording::sortBufferTime
mutableprivate

Definition at line 126 of file recording.h.

Referenced by ClearSortName(), cRecording(), cRecording(), SortName(), and ~cRecording().

◆ start

time_t cRecording::start
private

Definition at line 142 of file recording.h.

Referenced by cRecording(), cRecording(), FileName(), SetStartTime(), SortName(), Start(), and Title().

◆ titleBuffer

char* cRecording::titleBuffer
mutableprivate

Definition at line 124 of file recording.h.

Referenced by cRecording(), cRecording(), Title(), and ~cRecording().


The documentation for this class was generated from the following files: