vdr  2.6.9
Public Member Functions | Static Public Member Functions | Private Attributes | List of all members
cMarks Class Reference

#include <recording.h>

Public Member Functions

 cMarks (void)
 
bool Load (const char *RecordingFileName, double FramesPerSecond=DEFAULTFRAMESPERSECOND, bool IsPesRecording=false)
 
bool Update (void)
 
bool Save (void)
 
void Align (void)
 
void Sort (void)
 
void Add (int Position)
 
const cMarkGet (int Position) const
 
const cMarkGetPrev (int Position) const
 
const cMarkGetNext (int Position) const
 
const cMarkGetNextBegin (const cMark *EndMark=NULL) const
 
const cMarkGetNextEnd (const cMark *BeginMark) const
 
int GetNumSequences (void) const
 
int GetFrameAfterEdit (int Frame, int LastFrame) const
 
cMarkGet (int Position)
 
cMarkGetPrev (int Position)
 
cMarkGetNext (int Position)
 
cMarkGetNextBegin (const cMark *EndMark=NULL)
 
cMarkGetNextEnd (const cMark *BeginMark)
 
- Public Member Functions inherited from cConfig< cMark >
 cConfig (const char *NeedsLocking=NULL)
 
virtual ~cConfig ()
 
const char * FileName (void)
 
bool Load (const char *FileName=NULL, bool AllowComments=false, bool MustExist=false)
 
bool Save (void) const
 
- Public Member Functions inherited from cList< T >
 cList (const char *NeedsLocking=NULL)
 
const T * Get (int Index) const
 
const T * First (void) const
 
const T * Last (void) const
 
const T * Prev (const T *Object) const
 
const T * Next (const T *Object) const
 
T * Get (int Index)
 
T * First (void)
 
T * Last (void)
 
T * Prev (const T *Object)
 
T * Next (const T *Object)
 
- Public Member Functions inherited from cListBase
virtual ~cListBase ()
 
bool Lock (cStateKey &StateKey, bool Write=false, int TimeoutMs=0) const
 
void SetSyncStateKey (cStateKey &StateKey)
 
void SetUseGarbageCollector (void)
 
void SetExplicitModify (void)
 
void SetModified (void)
 
void Add (cListObject *Object, cListObject *After=NULL)
 
void Ins (cListObject *Object, cListObject *Before=NULL)
 
void Del (cListObject *Object, bool DeleteObject=true)
 
virtual void Move (int From, int To)
 
void Move (cListObject *From, cListObject *To)
 
bool Contains (const cListObject *Object) const
 
const cListObjectGet (int Index) const
 
cListObjectGet (int Index)
 
int Count (void) const
 
void Sort (void)
 

Static Public Member Functions

static cString MarksFileName (const cRecording *Recording)
 
static bool DeleteMarksFile (const cRecording *Recording)
 

Private Attributes

cString recordingFileName
 
cString fileName
 
double framesPerSecond
 
bool isPesRecording
 
time_t nextUpdate
 
time_t lastFileTime
 
time_t lastChange
 

Additional Inherited Members

- Protected Member Functions inherited from cListBase
 cListBase (const char *NeedsLocking=NULL)
 
- Protected Attributes inherited from cListBase
cListObjectobjects
 
cListObjectlastObject
 
int count
 
cStateLock stateLock
 
const char * needsLocking
 
bool useGarbageCollector
 

Detailed Description

Definition at line 396 of file recording.h.

Constructor & Destructor Documentation

◆ cMarks()

cMarks::cMarks ( void  )
inline

Definition at line 406 of file recording.h.

Member Function Documentation

◆ Add()

void cMarks::Add ( int  Position)

If this cMarks object is used by multiple threads, the caller must Lock() it before calling Add() and Unlock() it afterwards.

The same applies to calls to Del(), or any of the functions that return a "cMark *", in case an other thread might modify the list while the returned pointer is considered valid.

Definition at line 2371 of file recording.c.

References cListBase::Add(), framesPerSecond, and Sort().

Referenced by cReplayControl::MarkToggle(), and cCuttingThread::ProcessSequence().

◆ Align()

void cMarks::Align ( void  )

◆ DeleteMarksFile()

bool cMarks::DeleteMarksFile ( const cRecording Recording)
static

◆ Get() [1/2]

cMark* cMarks::Get ( int  Position)
inline

Definition at line 442 of file recording.h.

References Get().

Referenced by Get().

◆ Get() [2/2]

const cMark * cMarks::Get ( int  Position) const

◆ GetFrameAfterEdit()

int cMarks::GetFrameAfterEdit ( int  Frame,
int  LastFrame 
) const

Returns the number of the given Frame within the region covered by begin/end sequences.

LastFrame must be given by the caller. If there are no editing marks or in case of an error -1 is returned.

Definition at line 2455 of file recording.c.

References cListBase::Count(), cList< T >::First(), and cList< T >::Next().

Referenced by cRecording::NumFramesAfterEdit().

◆ GetNext() [1/2]

cMark* cMarks::GetNext ( int  Position)
inline

Definition at line 444 of file recording.h.

References GetNext().

Referenced by GetNext().

◆ GetNext() [2/2]

const cMark * cMarks::GetNext ( int  Position) const

Definition at line 2395 of file recording.c.

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

Referenced by cReplayControl::EditTest(), and cReplayControl::MarkJump().

◆ GetNextBegin() [1/2]

cMark* cMarks::GetNextBegin ( const cMark EndMark = NULL)
inline

Definition at line 445 of file recording.h.

References GetNextBegin().

Referenced by GetNextBegin().

◆ GetNextBegin() [2/2]

const cMark * cMarks::GetNextBegin ( const cMark EndMark = NULL) const

Returns the next "begin" mark after EndMark, skipping any marks at the same position as EndMark.

If EndMark is NULL, the first actual "begin" will be returned (if any).

Definition at line 2404 of file recording.c.

References cList< T >::First(), cList< T >::Next(), and cMark::Position().

Referenced by cCuttingThread::Action(), cDvbPlayer::Action(), cCutter::EditedFileName(), and GetNumSequences().

◆ GetNextEnd() [1/2]

cMark* cMarks::GetNextEnd ( const cMark BeginMark)
inline

Definition at line 446 of file recording.h.

References GetNextEnd().

Referenced by GetNextEnd().

◆ GetNextEnd() [2/2]

const cMark * cMarks::GetNextEnd ( const cMark BeginMark) const

Returns the next "end" mark after BeginMark, skipping any marks at the same position as BeginMark.

Definition at line 2420 of file recording.c.

References cList< T >::Next(), and cMark::Position().

Referenced by cCuttingThread::Action(), and GetNumSequences().

◆ GetNumSequences()

int cMarks::GetNumSequences ( void  ) const

Returns the actual number of sequences to be cut from the recording.

If there is only one actual "begin" mark, and it is positioned at index 0 (the beginning of the recording), and there is no "end" mark, the return value is 0, which means that the result is the same as the original recording.

Definition at line 2438 of file recording.c.

References GetNextBegin(), and GetNextEnd().

Referenced by cCuttingThread::cCuttingThread(), CutRecording(), and cReplayControl::EditCut().

◆ GetPrev() [1/2]

cMark* cMarks::GetPrev ( int  Position)
inline

Definition at line 443 of file recording.h.

References GetPrev().

Referenced by GetPrev().

◆ GetPrev() [2/2]

const cMark * cMarks::GetPrev ( int  Position) const

Definition at line 2386 of file recording.c.

References cList< T >::Last(), and cList< T >::Prev().

Referenced by cReplayControl::MarkJump().

◆ Load()

bool cMarks::Load ( const char *  RecordingFileName,
double  FramesPerSecond = DEFAULTFRAMESPERSECOND,
bool  IsPesRecording = false 
)

◆ MarksFileName()

cString cMarks::MarksFileName ( const cRecording Recording)
static

Returns the marks file name for the given Recording (regardless whether such a file actually exists).

Definition at line 2279 of file recording.c.

References AddDirectory(), cRecording::FileName(), cRecording::IsPesRecording(), and MARKSFILESUFFIX.

Referenced by DeleteMarksFile(), and cRecording::HasMarks().

◆ Save()

bool cMarks::Save ( void  )

Definition at line 2338 of file recording.c.

References fileName, lastFileTime, and LastModifiedTime().

Referenced by cReplayControl::Hide(), and cCuttingThread::ProcessSequence().

◆ Sort()

void cMarks::Sort ( void  )

Definition at line 2359 of file recording.c.

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

Referenced by Add(), and Update().

◆ Update()

bool cMarks::Update ( void  )

Member Data Documentation

◆ fileName

cString cMarks::fileName
private

Definition at line 399 of file recording.h.

Referenced by Load(), Save(), and Update().

◆ framesPerSecond

double cMarks::framesPerSecond
private

Definition at line 400 of file recording.h.

Referenced by Add(), Load(), and Update().

◆ isPesRecording

bool cMarks::isPesRecording
private

Definition at line 401 of file recording.h.

Referenced by Align(), and Load().

◆ lastChange

time_t cMarks::lastChange
private

Definition at line 404 of file recording.h.

Referenced by Load(), and Update().

◆ lastFileTime

time_t cMarks::lastFileTime
private

Definition at line 403 of file recording.h.

Referenced by Load(), Save(), and Update().

◆ nextUpdate

time_t cMarks::nextUpdate
private

Definition at line 402 of file recording.h.

Referenced by Load(), and Update().

◆ recordingFileName

cString cMarks::recordingFileName
private

Definition at line 398 of file recording.h.

Referenced by Align(), and Load().


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