vdr 2.7.7
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 () override
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< cMark >
 cList (const char *NeedsLocking=NULL)
const cMarkGet (int Index) const
const cMarkFirst (void) const
const cMarkLast (void) const
const cMarkPrev (const cMark *Object) const
const cMarkNext (const cMark *Object) const
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 398 of file recording.h.

Constructor & Destructor Documentation

◆ cMarks()

cMarks::cMarks ( void )
inline

Definition at line 408 of file recording.h.

References cConfig< cMark >::cConfig().

Referenced by Get(), GetNext(), GetNextBegin(), GetNextEnd(), and GetPrev().

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

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

◆ 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 444 of file recording.h.

References cMarks().

◆ Get() [2/2]

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

Definition at line 2398 of file recording.c.

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

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

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

Referenced by cRecording::NumFramesAfterEdit().

◆ GetNext() [1/2]

cMark * cMarks::GetNext ( int Position)
inline

Definition at line 446 of file recording.h.

References cMarks().

◆ GetNext() [2/2]

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

Definition at line 2416 of file recording.c.

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

◆ GetNextBegin() [1/2]

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

Definition at line 447 of file recording.h.

References cMarks().

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

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

Referenced by cCutter::EditedFileName(), and GetNumSequences().

◆ GetNextEnd() [1/2]

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

Definition at line 448 of file recording.h.

References cMarks().

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

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

Referenced by 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 2459 of file recording.c.

References GetNextBegin(), and GetNextEnd().

Referenced by CutRecording().

◆ GetPrev() [1/2]

cMark * cMarks::GetPrev ( int Position)
inline

Definition at line 445 of file recording.h.

References cMarks().

◆ GetPrev() [2/2]

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

Definition at line 2407 of file recording.c.

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

◆ 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 2300 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 2359 of file recording.c.

References fileName, lastFileTime, LastModifiedTime(), and cConfig< T >::Save().

◆ Sort()

void cMarks::Sort ( void )

Definition at line 2380 of file recording.c.

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

Referenced by Add(), and Update().

◆ Update()

Member Data Documentation

◆ fileName

cString cMarks::fileName
private

Definition at line 401 of file recording.h.

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

◆ framesPerSecond

double cMarks::framesPerSecond
private

Definition at line 402 of file recording.h.

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

◆ isPesRecording

bool cMarks::isPesRecording
private

Definition at line 403 of file recording.h.

Referenced by Align(), and Load().

◆ lastChange

time_t cMarks::lastChange
private

Definition at line 406 of file recording.h.

Referenced by Load(), and Update().

◆ lastFileTime

time_t cMarks::lastFileTime
private

Definition at line 405 of file recording.h.

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

◆ nextUpdate

time_t cMarks::nextUpdate
private

Definition at line 404 of file recording.h.

Referenced by Load(), and Update().

◆ recordingFileName

cString cMarks::recordingFileName
private

Definition at line 400 of file recording.h.

Referenced by Align(), and Load().


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