vdr 2.7.4
|
#include <recording.h>
Public Member Functions | |
cRecordingsHandler (void) | |
virtual | ~cRecordingsHandler () |
bool | Add (int Usage, const char *FileNameSrc, const char *FileNameDst=NULL) |
void | Del (const char *FileName) |
void | DelAll (void) |
int | GetUsage (const char *FileName) |
int | GetRequiredDiskSpaceMB (const char *FileName=NULL) |
bool | Finished (bool &Error) |
![]() | |
cThread (const char *Description=NULL, bool LowPriority=false) | |
virtual | ~cThread () |
void | SetDescription (const char *Description,...) __attribute__((format(printf |
void bool | Start (void) |
bool | Active (void) |
Protected Member Functions | |
virtual void | Action (void) |
![]() | |
void | SetPriority (int Priority) |
void | SetIOPriority (int Priority) |
void | Lock (void) |
void | Unlock (void) |
bool | Running (void) |
void | Cancel (int WaitSeconds=0) |
Private Member Functions | |
cRecordingsHandlerEntry * | Get (const char *FileName) |
Private Attributes | |
cMutex | mutex |
cList< cRecordingsHandlerEntry > | operations |
bool | finished |
bool | error |
Additional Inherited Members | |
![]() | |
static tThreadId | ThreadId (void) |
static tThreadId | IsMainThread (void) |
static void | SetMainThreadId (void) |
Definition at line 335 of file recording.h.
cRecordingsHandler::cRecordingsHandler | ( | void | ) |
Definition at line 2117 of file recording.c.
References cThread::cThread(), error, and finished.
|
virtual |
Definition at line 2124 of file recording.c.
References cThread::Cancel().
|
protectedvirtual |
A derived cThread class must implement the code it wants to execute as a separate thread in this function.
If this is a loop, it must check Running() repeatedly to see whether it's time to stop.
Implements cThread.
Definition at line 2129 of file recording.c.
References error, LOCK_RECORDINGS_WRITE, mutex, operations, cThread::Running(), and cCondWait::SleepMs().
bool cRecordingsHandler::Add | ( | int | Usage, |
const char * | FileNameSrc, | ||
const char * | FileNameDst = NULL ) |
Adds the given FileNameSrc to the recordings handler for (later) processing.
Usage can be either ruCut, ruMove or ruCopy. FileNameDst is only applicable for ruMove and ruCopy. At any given time there can be only one operation for any FileNameSrc or FileNameDst in the list. An attempt to add a file name twice will result in an error. Returns true if the operation was successfully added to the list.
Definition at line 2167 of file recording.c.
References dsyslog, cCutter::EditedFileName(), esyslog, finished, Get(), mutex, operations, ruCopy, ruCut, ruMove, ruPending, and cThread::Start().
void cRecordingsHandler::Del | ( | const char * | FileName | ) |
Deletes the given FileName from the list of operations.
If an action is already in progress, it will be terminated. FileName can be either the FileNameSrc or FileNameDst (if applicable) that was given when the operation was added with Add().
Definition at line 2198 of file recording.c.
void cRecordingsHandler::DelAll | ( | void | ) |
Deletes/terminates all operations.
Definition at line 2205 of file recording.c.
References mutex, and operations.
bool cRecordingsHandler::Finished | ( | bool & | Error | ) |
Returns true if all operations in the list have been finished.
If there have been any errors, Errors will be set to true. This function will only return true once if the list of operations has actually become empty since the last call.
Definition at line 2238 of file recording.c.
References error, finished, mutex, and operations.
|
private |
Definition at line 2154 of file recording.c.
References operations, and ruCanceled.
Referenced by Add(), Del(), and GetUsage().
int cRecordingsHandler::GetRequiredDiskSpaceMB | ( | const char * | FileName = NULL | ) |
Returns the total disk space required to process all actions.
If FileName is given, only the drive that contains that file is taken into account.
Definition at line 2220 of file recording.c.
References DirSizeMB(), EntriesOnSameFileSystem(), FileSizeMBafterEdit(), operations, ruCanceled, ruCopy, ruCut, and ruMove.
int cRecordingsHandler::GetUsage | ( | const char * | FileName | ) |
Returns the usage type for the given FileName.
Definition at line 2212 of file recording.c.
|
private |
Definition at line 340 of file recording.h.
Referenced by Action(), cRecordingsHandler(), and Finished().
|
private |
Definition at line 339 of file recording.h.
Referenced by Add(), cRecordingsHandler(), and Finished().
|
private |
Definition at line 337 of file recording.h.
Referenced by Action(), Add(), Del(), DelAll(), Finished(), and GetUsage().
|
private |
Definition at line 338 of file recording.h.
Referenced by Action(), Add(), DelAll(), Finished(), Get(), and GetRequiredDiskSpaceMB().