vdr
2.2.0
|
#include <videodir.h>
Public Member Functions | |
cVideoDirectory (void) | |
virtual | ~cVideoDirectory () |
virtual int | FreeMB (int *UsedMB=NULL) |
virtual bool | Register (const char *FileName) |
virtual bool | Rename (const char *OldName, const char *NewName) |
virtual bool | Move (const char *FromName, const char *ToName) |
virtual bool | Remove (const char *Name) |
virtual void | Cleanup (const char *IgnoreFiles[]=NULL) |
virtual bool | Contains (const char *Name) |
Static Public Member Functions | |
static const char * | Name (void) |
static void | SetName (const char *Name) |
static void | Destroy (void) |
static cUnbufferedFile * | OpenVideoFile (const char *FileName, int Flags) |
static bool | RenameVideoFile (const char *OldName, const char *NewName) |
static bool | MoveVideoFile (const char *FromName, const char *ToName) |
static bool | RemoveVideoFile (const char *FileName) |
static bool | VideoFileSpaceAvailable (int SizeMB) |
static int | VideoDiskSpace (int *FreeMB=NULL, int *UsedMB=NULL) |
static cString | PrefixVideoFileName (const char *FileName, char Prefix) |
static void | RemoveEmptyVideoDirectories (const char *IgnoreFiles[]=NULL) |
static bool | IsOnVideoDirectoryFileSystem (const char *FileName) |
Static Private Member Functions | |
static cVideoDirectory * | Current (void) |
Static Private Attributes | |
static cString | name |
static cVideoDirectory * | current = NULL |
Definition at line 16 of file videodir.h.
cVideoDirectory::cVideoDirectory | ( | void | ) |
|
virtual |
Definition at line 31 of file videodir.c.
References current.
|
virtual |
Recursively removes all empty directories under the video directory.
If IgnoreFiles is given, the file names in this (NULL terminated) array are ignored when checking whether a directory is empty. These are typically "dot files", like e.g. ".sort". The default implementation calls RemoveEmptyDirectories().
Definition at line 103 of file videodir.c.
References Name(), and RemoveEmptyDirectories().
Referenced by RemoveEmptyVideoDirectories().
|
virtual |
Checks whether the directory Name is on the same file system as the video directory.
Name is the full path name of a recording's '*.rec' directory. This function is usually called when an ongoing recording is about to run out of disk space, and an existing (old) recording needs to be deleted. It shall make sure that deleting this old recording will actually free up space in the video directory, and not on some other device that just happens to be mounted. The default implementation calls EntriesOnSameFileSystem().
Definition at line 108 of file videodir.c.
References EntriesOnSameFileSystem(), and Name().
Referenced by IsOnVideoDirectoryFileSystem().
|
staticprivate |
Definition at line 36 of file videodir.c.
References current, and cVideoDirectory().
Referenced by IsOnVideoDirectoryFileSystem(), MoveVideoFile(), OpenVideoFile(), RemoveEmptyVideoDirectories(), RemoveVideoFile(), RenameVideoFile(), VideoDiskSpace(), and VideoFileSpaceAvailable().
|
static |
|
virtual |
Returns the total amount (in MB) of free disk space for recording.
If UsedMB is given, it returns the amount of disk space in use by existing recordings (or anything else) on that disk.
Definition at line 48 of file videodir.c.
References FreeDiskSpaceMB(), and Name().
Referenced by cVideoDiskUsage::HasChanged(), VideoDiskSpace(), and VideoFileSpaceAvailable().
|
static |
Definition at line 181 of file videodir.c.
References Contains(), and Current().
Referenced by cRecording::IsOnVideoDirectoryFileSystem().
|
virtual |
Moves the directory FromName to the location ToName.
FromName is the full path name of a recording's '*.rec' directory. ToName has the same '*.rec' part as FromName, but a different directory path above it. Returns true if the operation was successful. The default implementation just calls the system's rename() function.
Definition at line 84 of file videodir.c.
References cRecordingsHandler::Add(), dsyslog, EntriesOnSameFileSystem(), LOG_ERROR_STR, RecordingsHandler, and ruMove.
Referenced by MoveVideoFile().
|
static |
Definition at line 125 of file videodir.c.
References Current(), and Move().
Referenced by cRecording::ChangeName().
|
static |
Definition at line 53 of file videodir.c.
References name.
Referenced by cRemoveDeletedRecordingsThread::Action(), AssertFreeDiskSpace(), Cleanup(), Contains(), cRecording::cRecording(), cMenuRecordings::DirectoryName(), cRecording::FileName(), FreeMB(), cRecordings::Refresh(), Register(), SetName(), cRecording::SortName(), and cRecordings::UpdateFileName().
|
static |
Definition at line 113 of file videodir.c.
References cUnbufferedFile::Create(), Current(), and Register().
Referenced by cFileName::Open().
|
static |
Definition at line 156 of file videodir.c.
Referenced by cRecording::PrefixFileName().
|
virtual |
By default VDR assumes that the video directory consists of one large volume, on which it can store its recordings.
A derived cVideoDirectory may, for instance, use several separate disks to store recordings. The given FileName is the full path name (including the video directory) of a recording file ('*.ts') that is about to be opened for writing. If the actual file shall be put on an other disk, the derived cVideoDirectory should create a symbolic link from the given FileName to the other location. Returns true if the operation was successful. The default implementation just checks whether the incoming file name really is under the video directory.
Definition at line 63 of file videodir.c.
References esyslog, and Name().
Referenced by OpenVideoFile().
|
virtual |
Removes the directory with the given Name and everything it contains.
Name is a full path name that begins with the name of the video directory. Returns true if the operation was successful. The default implementation calls RemoveFileOrDir().
Definition at line 98 of file videodir.c.
References RemoveFileOrDir().
Referenced by RemoveVideoFile().
|
static |
Definition at line 176 of file videodir.c.
References Cleanup(), and Current().
Referenced by cRemoveDeletedRecordingsThread::Action().
|
static |
Definition at line 130 of file videodir.c.
References Current(), and Remove().
Referenced by cRecording::Delete(), cRecording::Remove(), cCutter::Start(), cCutter::Stop(), and cDirCopier::Stop().
|
virtual |
Renames the directory OldName to NewName.
OldName and NewName are full path names that begin with the name of the video directory and end with '*.rec' or '*.del'. Only the base name (the rightmost component) of the two names may be different. Returns true if the operation was successful. The default implementation just calls the system's rename() function.
Definition at line 74 of file videodir.c.
References dsyslog, and LOG_ERROR_STR.
Referenced by RenameVideoFile().
|
static |
Definition at line 120 of file videodir.c.
References Current(), and Rename().
Referenced by cRecording::ChangePriorityLifetime(), cRecording::Delete(), and cRecording::Undelete().
|
static |
|
static |
Definition at line 140 of file videodir.c.
References Current(), DeletedRecordings, FreeMB(), and cRecordings::TotalFileSizeMB().
Referenced by cMenuTimers::ActualiseDiskStatus(), cSVDRP::CmdSTAT(), cVideoDiskUsage::HasChanged(), and cRecordControls::Start().
|
static |
Definition at line 135 of file videodir.c.
References Current(), and FreeMB().
Referenced by AssertFreeDiskSpace().
|
staticprivate |
Definition at line 19 of file videodir.h.
Referenced by Current(), cVideoDirectory(), Destroy(), and ~cVideoDirectory().
|
staticprivate |
Definition at line 18 of file videodir.h.