#include <videodir.h>
|
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 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) |
|
Definition at line 16 of file include/vdr/videodir.h.
◆ cVideoDirectory() [1/2]
cVideoDirectory::cVideoDirectory |
( |
void |
| ) |
|
◆ ~cVideoDirectory() [1/2]
cVideoDirectory::~cVideoDirectory |
( |
| ) |
|
|
virtual |
◆ cVideoDirectory() [2/2]
cVideoDirectory::cVideoDirectory |
( |
void |
| ) |
|
◆ ~cVideoDirectory() [2/2]
virtual cVideoDirectory::~cVideoDirectory |
( |
| ) |
|
|
virtual |
◆ Cleanup() [1/2]
void cVideoDirectory::Cleanup |
( |
const char * |
IgnoreFiles[] = NULL | ) |
|
|
virtual |
◆ Cleanup() [2/2]
virtual void cVideoDirectory::Cleanup |
( |
const char * |
IgnoreFiles[] = NULL | ) |
|
|
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().
◆ Contains() [1/2]
bool cVideoDirectory::Contains |
( |
const char * |
Name | ) |
|
|
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 120 of file videodir.c.
References EntriesOnSameFileSystem(), and Name().
Referenced by IsOnVideoDirectoryFileSystem().
◆ Contains() [2/2]
virtual bool cVideoDirectory::Contains |
( |
const char * |
Name | ) |
|
|
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().
◆ Current() [1/2]
Definition at line 41 of file videodir.c.
References current, cVideoDirectory(), cMutex::Lock(), mutex, and cMutex::Unlock().
Referenced by IsOnVideoDirectoryFileSystem(), MoveVideoFile(), OpenVideoFile(), RemoveEmptyVideoDirectories(), RemoveVideoFile(), RenameVideoFile(), VideoDiskSpace(), and VideoFileSpaceAvailable().
◆ Current() [2/2]
◆ Destroy() [1/2]
void cVideoDirectory::Destroy |
( |
void |
| ) |
|
|
static |
◆ Destroy() [2/2]
static void cVideoDirectory::Destroy |
( |
void |
| ) |
|
|
static |
◆ FreeMB() [1/2]
int cVideoDirectory::FreeMB |
( |
int * |
UsedMB = NULL | ) |
|
|
virtual |
◆ FreeMB() [2/2]
virtual int cVideoDirectory::FreeMB |
( |
int * |
UsedMB = NULL | ) |
|
|
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.
◆ IsOnVideoDirectoryFileSystem() [1/2]
bool cVideoDirectory::IsOnVideoDirectoryFileSystem |
( |
const char * |
FileName | ) |
|
|
static |
◆ IsOnVideoDirectoryFileSystem() [2/2]
static bool cVideoDirectory::IsOnVideoDirectoryFileSystem |
( |
const char * |
FileName | ) |
|
|
static |
◆ Move() [1/2]
bool cVideoDirectory::Move |
( |
const char * |
FromName, |
|
|
const char * |
ToName |
|
) |
| |
|
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 91 of file videodir.c.
References cRecordingsHandler::Add(), dsyslog, EntriesOnSameFileSystem(), cRecordingUserCommand::InvokeCommand(), LOG_ERROR_STR, RecordingsHandler, RUC_MOVEDRECORDING, RUC_RENAMEDRECORDING, ruMove, and strgetbefore().
Referenced by MoveVideoFile().
◆ Move() [2/2]
virtual bool cVideoDirectory::Move |
( |
const char * |
FromName, |
|
|
const char * |
ToName |
|
) |
| |
|
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.
◆ MoveVideoFile() [1/2]
bool cVideoDirectory::MoveVideoFile |
( |
const char * |
FromName, |
|
|
const char * |
ToName |
|
) |
| |
|
static |
◆ MoveVideoFile() [2/2]
static bool cVideoDirectory::MoveVideoFile |
( |
const char * |
FromName, |
|
|
const char * |
ToName |
|
) |
| |
|
static |
◆ Name() [1/2]
const char * cVideoDirectory::Name |
( |
void |
| ) |
|
|
static |
Definition at line 60 of file videodir.c.
References name.
Referenced by cRemoveDeletedRecordingsThread::Action(), cVideoDirectoryScannerThread::Action(), AssertFreeDiskSpace(), Cleanup(), Contains(), cRecording::cRecording(), cMenuRecordings::DirectoryName(), cRecording::FileName(), FreeMB(), Register(), Remove(), SetName(), cRecording::SortName(), and cRecordings::UpdateFileName().
◆ Name() [2/2]
static const char * cVideoDirectory::Name |
( |
void |
| ) |
|
|
static |
◆ OpenVideoFile() [1/2]
cUnbufferedFile * cVideoDirectory::OpenVideoFile |
( |
const char * |
FileName, |
|
|
int |
Flags |
|
) |
| |
|
static |
◆ OpenVideoFile() [2/2]
static cUnbufferedFile * cVideoDirectory::OpenVideoFile |
( |
const char * |
FileName, |
|
|
int |
Flags |
|
) |
| |
|
static |
◆ PrefixVideoFileName() [1/2]
cString cVideoDirectory::PrefixVideoFileName |
( |
const char * |
FileName, |
|
|
char |
Prefix |
|
) |
| |
|
static |
◆ PrefixVideoFileName() [2/2]
static cString cVideoDirectory::PrefixVideoFileName |
( |
const char * |
FileName, |
|
|
char |
Prefix |
|
) |
| |
|
static |
◆ Register() [1/2]
bool cVideoDirectory::Register |
( |
const char * |
FileName | ) |
|
|
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 70 of file videodir.c.
References esyslog, and Name().
Referenced by OpenVideoFile().
◆ Register() [2/2]
virtual bool cVideoDirectory::Register |
( |
const char * |
FileName | ) |
|
|
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.
◆ Remove() [1/2]
bool cVideoDirectory::Remove |
( |
const char * |
Name | ) |
|
|
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 110 of file videodir.c.
References Name(), and RemoveFileOrDir().
Referenced by RemoveVideoFile().
◆ Remove() [2/2]
virtual bool cVideoDirectory::Remove |
( |
const char * |
Name | ) |
|
|
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().
◆ RemoveEmptyVideoDirectories() [1/2]
void cVideoDirectory::RemoveEmptyVideoDirectories |
( |
const char * |
IgnoreFiles[] = NULL | ) |
|
|
static |
◆ RemoveEmptyVideoDirectories() [2/2]
static void cVideoDirectory::RemoveEmptyVideoDirectories |
( |
const char * |
IgnoreFiles[] = NULL | ) |
|
|
static |
◆ RemoveVideoFile() [1/2]
bool cVideoDirectory::RemoveVideoFile |
( |
const char * |
FileName | ) |
|
|
static |
◆ RemoveVideoFile() [2/2]
static bool cVideoDirectory::RemoveVideoFile |
( |
const char * |
FileName | ) |
|
|
static |
◆ Rename() [1/2]
bool cVideoDirectory::Rename |
( |
const char * |
OldName, |
|
|
const char * |
NewName |
|
) |
| |
|
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 81 of file videodir.c.
References dsyslog, and LOG_ERROR_STR.
Referenced by RenameVideoFile().
◆ Rename() [2/2]
virtual bool cVideoDirectory::Rename |
( |
const char * |
OldName, |
|
|
const char * |
NewName |
|
) |
| |
|
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.
◆ RenameVideoFile() [1/2]
bool cVideoDirectory::RenameVideoFile |
( |
const char * |
OldName, |
|
|
const char * |
NewName |
|
) |
| |
|
static |
◆ RenameVideoFile() [2/2]
static bool cVideoDirectory::RenameVideoFile |
( |
const char * |
OldName, |
|
|
const char * |
NewName |
|
) |
| |
|
static |
◆ SetName() [1/2]
void cVideoDirectory::SetName |
( |
const char * |
Name | ) |
|
|
static |
◆ SetName() [2/2]
static void cVideoDirectory::SetName |
( |
const char * |
Name | ) |
|
|
static |
◆ VideoDiskSpace() [1/2]
int cVideoDirectory::VideoDiskSpace |
( |
int * |
FreeMB = NULL , |
|
|
int * |
UsedMB = NULL |
|
) |
| |
|
static |
◆ VideoDiskSpace() [2/2]
static int cVideoDirectory::VideoDiskSpace |
( |
int * |
FreeMB = NULL , |
|
|
int * |
UsedMB = NULL |
|
) |
| |
|
static |
◆ VideoFileSpaceAvailable() [1/2]
bool cVideoDirectory::VideoFileSpaceAvailable |
( |
int |
SizeMB | ) |
|
|
static |
◆ VideoFileSpaceAvailable() [2/2]
static bool cVideoDirectory::VideoFileSpaceAvailable |
( |
int |
SizeMB | ) |
|
|
static |
◆ current
◆ mutex
static cMutex cVideoDirectory::mutex |
|
staticprivate |
◆ name
static cString cVideoDirectory::name |
|
staticprivate |
The documentation for this class was generated from the following files: