vdr
2.4.1
|
#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) |
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 313 of file recording.h.
cRecordingsHandler::cRecordingsHandler | ( | void | ) |
Definition at line 1969 of file recording.c.
|
virtual |
Definition at line 1976 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 1981 of file recording.c.
References cListBase::Del(), error, cList< T >::First(), 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 2019 of file recording.c.
References cListBase::Add(), dsyslog, cCutter::EditedFileName(), esyslog, finished, Get(), mutex, operations, ruCopy, ruCut, ruMove, ruPending, and cThread::Start().
Referenced by cMenuRecordingEdit::Action(), cSVDRPServer::CmdCPYR(), cSVDRPServer::CmdEDIT(), cReplayControl::EditCut(), and cVideoDirectory::Move().
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 2050 of file recording.c.
Referenced by cMenuRecordingEdit::Action(), and cMenuRecordings::Delete().
void cRecordingsHandler::DelAll | ( | void | ) |
Deletes/terminates all operations.
Definition at line 2057 of file recording.c.
References cList< T >::First(), mutex, cList< T >::Next(), and operations.
Referenced by main(), and cMenuMain::ProcessKey().
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 2072 of file recording.c.
References cListBase::Count(), error, finished, mutex, and operations.
Referenced by main().
|
private |
Definition at line 2006 of file recording.c.
References cList< T >::First(), cList< T >::Next(), operations, and ruCanceled.
Referenced by Add(), Del(), and GetUsage().
int cRecordingsHandler::GetUsage | ( | const char * | FileName | ) |
Returns the usage type for the given FileName.
Definition at line 2064 of file recording.c.
References Get(), mutex, and ruNone.
Referenced by cMenuRecordings::Delete(), cReplayControl::EditCut(), and cRecording::IsInUse().
|
private |
Definition at line 318 of file recording.h.
Referenced by Action(), cRecordingsHandler(), and Finished().
|
private |
Definition at line 317 of file recording.h.
Referenced by Add(), cRecordingsHandler(), and Finished().
|
private |
Definition at line 315 of file recording.h.
Referenced by Action(), Add(), Del(), DelAll(), Finished(), and GetUsage().
|
private |
Definition at line 316 of file recording.h.
Referenced by Action(), Add(), DelAll(), Finished(), and Get().