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

#include <recording.h>

Public Member Functions

 cRecordingsHandler (void)
 
 ~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 Active (void)
 
bool Finished (bool &Error)
 

Private Member Functions

cRecordingsHandlerEntryGet (const char *FileName)
 

Private Attributes

cMutex mutex
 
cList< cRecordingsHandlerEntryoperations
 
bool finished
 
bool error
 

Detailed Description

Definition at line 291 of file recording.h.

Constructor & Destructor Documentation

cRecordingsHandler::cRecordingsHandler ( void  )

Definition at line 1912 of file recording.c.

References cDirCopier::error.

cRecordingsHandler::~cRecordingsHandler ( )

Definition at line 1918 of file recording.c.

Member Function Documentation

bool cRecordingsHandler::Active ( void  )

Checks whether there is currently any operation running and starts

the next one form the list if the previous one has finished.

This function must be called regularly to trigger switching to the next operation in the list. Returns true if there are any operations in the list.

Definition at line 1989 of file recording.c.

References cDirCopier::error, and cThread::mutex.

Referenced by cShutdownHandler::ConfirmRestart(), cShutdownHandler::ConfirmShutdown(), main(), and cMenuMain::Update().

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

References cThread::Active(), cRecordings::ChangeState(), dsyslog, cCutter::EditedFileName(), esyslog, cThread::mutex, ruCopy, ruCut, ruMove, and ruPending.

Referenced by cMenuRecordingEdit::Action(), cSVDRP::CmdCPYR(), cSVDRP::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 1965 of file recording.c.

References cRecordings::ChangeState(), and cThread::mutex.

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

void cRecordingsHandler::DelAll ( void  )

Deletes/terminates all operations.

Definition at line 1974 of file recording.c.

References cRecordings::ChangeState(), and cThread::mutex.

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

References cDirCopier::error, and cThread::mutex.

Referenced by main().

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

Definition at line 1922 of file recording.c.

References cListObject::Next().

int cRecordingsHandler::GetUsage ( const char *  FileName)

Returns the usage type for the given FileName.

Definition at line 1981 of file recording.c.

References cThread::mutex, and ruNone.

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

Member Data Documentation

bool cRecordingsHandler::error
private

Definition at line 296 of file recording.h.

bool cRecordingsHandler::finished
private

Definition at line 295 of file recording.h.

cMutex cRecordingsHandler::mutex
private

Definition at line 293 of file recording.h.

cList<cRecordingsHandlerEntry> cRecordingsHandler::operations
private

Definition at line 294 of file recording.h.


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