vdr 2.6.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)
 
 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)
 
 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)
 
virtual void Action (void)
 
- Protected Member Functions inherited from cThread
void SetPriority (int Priority)
 
void SetIOPriority (int Priority)
 
void Lock (void)
 
void Unlock (void)
 
virtual void Action (void)=0
 
bool Running (void)
 
void Cancel (int WaitSeconds=0)
 
void SetPriority (int Priority)
 
void SetIOPriority (int Priority)
 
void Lock (void)
 
void Unlock (void)
 
virtual void Action (void)=0
 
bool Running (void)
 
void Cancel (int WaitSeconds=0)
 

Private Member Functions

cRecordingsHandlerEntryGet (const char *FileName)
 
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)
 
static tThreadId ThreadId (void)
 
static tThreadId IsMainThread (void)
 
static void SetMainThreadId (void)
 

Detailed Description

Definition at line 314 of file include/vdr/recording.h.

Constructor & Destructor Documentation

◆ cRecordingsHandler() [1/2]

cRecordingsHandler::cRecordingsHandler ( void  )

Definition at line 2002 of file recording.c.

References error, and finished.

◆ ~cRecordingsHandler() [1/2]

cRecordingsHandler::~cRecordingsHandler ( )
virtual

Definition at line 2009 of file recording.c.

References cThread::Cancel().

◆ cRecordingsHandler() [2/2]

cRecordingsHandler::cRecordingsHandler ( void  )

◆ ~cRecordingsHandler() [2/2]

virtual cRecordingsHandler::~cRecordingsHandler ( )
virtual

Member Function Documentation

◆ Action() [1/2]

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 2014 of file recording.c.

References cListBase::Del(), error, cList< T >::First(), LOCK_RECORDINGS_WRITE, mutex, operations, cThread::Running(), and cCondWait::SleepMs().

◆ Action() [2/2]

virtual 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.

◆ Add() [1/2]

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

◆ Add() [2/2]

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.

◆ Del() [1/2]

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 2083 of file recording.c.

References Get(), and mutex.

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

◆ Del() [2/2]

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

◆ DelAll() [1/2]

void cRecordingsHandler::DelAll ( void  )

Deletes/terminates all operations.

Definition at line 2090 of file recording.c.

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

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

◆ DelAll() [2/2]

void cRecordingsHandler::DelAll ( void  )

Deletes/terminates all operations.

◆ Finished() [1/2]

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 2105 of file recording.c.

References cListBase::Count(), error, finished, mutex, and operations.

Referenced by main().

◆ Finished() [2/2]

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.

◆ Get() [1/2]

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

Definition at line 2039 of file recording.c.

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

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

◆ Get() [2/2]

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

◆ GetUsage() [1/2]

int cRecordingsHandler::GetUsage ( const char *  FileName)

Returns the usage type for the given FileName.

Definition at line 2097 of file recording.c.

References Get(), mutex, and ruNone.

Referenced by cMenuRecordings::Delete(), cReplayControl::EditCut(), and cRecording::IsInUse().

◆ GetUsage() [2/2]

int cRecordingsHandler::GetUsage ( const char *  FileName)

Returns the usage type for the given FileName.

Member Data Documentation

◆ error

bool cRecordingsHandler::error
private

Definition at line 319 of file include/vdr/recording.h.

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

◆ finished

bool cRecordingsHandler::finished
private

Definition at line 318 of file include/vdr/recording.h.

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

◆ mutex

cMutex cRecordingsHandler::mutex
private

Definition at line 316 of file include/vdr/recording.h.

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

◆ operations

cList< cRecordingsHandlerEntry > cRecordingsHandler::operations
private

Definition at line 317 of file include/vdr/recording.h.

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


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