vdr  2.4.1
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | List of all members
cRecordingsHandler Class Reference

#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)
 
- Public Member Functions inherited from cThread
 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)
 
- Protected Member Functions inherited from cThread
void SetPriority (int Priority)
 
void SetIOPriority (int Priority)
 
void Lock (void)
 
void Unlock (void)
 
void Cancel (int WaitSeconds=0)
 

Private Member Functions

cRecordingsHandlerEntryGet (const char *FileName)
 

Private Attributes

cMutex mutex
 
cList< cRecordingsHandlerEntryoperations
 
bool finished
 
bool error
 

Additional Inherited Members

- Static Public Member Functions inherited from cThread
static tThreadId ThreadId (void)
 
static tThreadId IsMainThread (void)
 
static void SetMainThreadId (void)
 

Detailed Description

Definition at line 313 of file recording.h.

Constructor & Destructor Documentation

◆ cRecordingsHandler()

cRecordingsHandler::cRecordingsHandler ( void  )

Definition at line 1969 of file recording.c.

References error, and finished.

◆ ~cRecordingsHandler()

cRecordingsHandler::~cRecordingsHandler ( )
virtual

Definition at line 1976 of file recording.c.

References cThread::Cancel().

Member Function Documentation

◆ Action()

void cRecordingsHandler::Action ( void  )
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, LOCK_RECORDINGS_WRITE, mutex, operations, and cCondWait::SleepMs().

◆ Add()

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().

◆ Del()

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.

References Get(), and mutex.

Referenced by cMenuRecordingEdit::Action(), and cMenuRecordings::Delete().

◆ DelAll()

void cRecordingsHandler::DelAll ( void  )

Deletes/terminates all operations.

Definition at line 2057 of file recording.c.

References mutex, cList< T >::Next(), and operations.

Referenced by main(), and cMenuMain::ProcessKey().

◆ Finished()

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().

◆ Get()

cRecordingsHandlerEntry * cRecordingsHandler::Get ( const char *  FileName)
private

Definition at line 2006 of file recording.c.

References cList< T >::Next(), operations, and ruCanceled.

Referenced by Add(), Del(), and GetUsage().

◆ 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().

Member Data Documentation

◆ error

bool cRecordingsHandler::error
private

Definition at line 318 of file recording.h.

Referenced by Action(), cRecordingsHandler(), and Finished().

◆ finished

bool cRecordingsHandler::finished
private

Definition at line 317 of file recording.h.

Referenced by Add(), cRecordingsHandler(), and Finished().

◆ mutex

cMutex cRecordingsHandler::mutex
private

Definition at line 315 of file recording.h.

Referenced by Action(), Add(), Del(), DelAll(), Finished(), and GetUsage().

◆ operations

cList<cRecordingsHandlerEntry> cRecordingsHandler::operations
private

Definition at line 316 of file recording.h.

Referenced by Action(), Add(), DelAll(), Finished(), and Get().


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