21 #define FOLDERDELIMCHAR '~'
41 cResumeFile(
const char *FileName,
bool IsPesRecording);
70 const char *
Title(
void)
const {
return event->Title(); }
71 const char *
ShortText(
void)
const {
return event->ShortText(); }
72 const char *
Description(
void)
const {
return event->Description(); }
74 const char *
Aux(
void)
const {
return aux; }
77 bool Write(FILE *f,
const char *Prefix =
"")
const;
79 bool Write(
void)
const;
120 const char *
Title(
char Delimiter =
' ',
bool NewIndicator =
false,
int Level = -1)
const;
169 void Refresh(
bool Foreground =
false);
170 void ScanVideoDir(
const char *DirName,
bool Foreground =
false,
int LinkLevel = 0,
int DirLevel = 0);
180 bool Update(
bool Wait =
false);
193 void ResetResume(
const char *ResumeFileName = NULL);
196 void AddByName(
const char *FileName,
bool TriggerUpdate =
true);
197 void DelByName(
const char *FileName,
bool RemoveRecording =
true);
210 #define DEFAULTFRAMESPERSECOND 25.0
226 bool Parse(
const char *s);
245 void Add(
int Position);
264 #define RUC_BEFORERECORDING "before"
265 #define RUC_AFTERRECORDING "after"
266 #define RUC_EDITEDRECORDING "edited"
267 #define RUC_DELETERECORDING "deleted"
274 static void InvokeCommand(
const char *State,
const char *RecordingFileName,
const char *SourceFileName = NULL);
278 #define MAXFRAMESIZE (KILOBYTE(1024) / TS_SIZE * TS_SIZE) // multiple of TS_SIZE to avoid breaking up TS packets
285 #define MAXVIDEOFILESIZETS 1048570 // MB
286 #define MAXVIDEOFILESIZEPES 2000 // MB
287 #define MINVIDEOFILESIZE 100 // MB
288 #define MAXVIDEOFILESIZEDEFAULT MAXVIDEOFILESIZEPES
307 cIndexFile(
const char *FileName,
bool Record,
bool IsPesRecording =
false,
bool PauseLive =
false);
310 bool Write(
bool Independent, uint16_t FileNumber, off_t FileOffset);
311 bool Get(
int Index, uint16_t *FileNumber, off_t *FileOffset,
bool *Independent = NULL,
int *Length = NULL);
312 int GetNextIFrame(
int Index,
bool Forward, uint16_t *FileNumber = NULL, off_t *FileOffset = NULL,
int *Length = NULL);
318 int Get(uint16_t FileNumber, off_t FileOffset);
325 static int GetLength(
const char *FileName,
bool IsPesRecording =
false);
340 cFileName(
const char *FileName,
bool Record,
bool Blocking =
false,
bool IsPesRecording =
false);
375 #endif //__RECORDING_H
void SetFramesPerSecond(double FramesPerSecond)
bool Update(bool Wait=false)
Triggers an update of the list of recordings, which will run as a separate thread if Wait is false...
int TotalFileSizeMB(void)
int NumFrames(void) const
Returns the number of frames in this recording.
void Refresh(bool Foreground=false)
static char * StripEpisodeName(char *s, bool Strip)
const char * UpdateFileName(const char *FileName)
#define DEFAULTFRAMESPERSECOND
bool Load(void)
Loads the current list of recordings and returns true if there is anything in it (for compatibility w...
cMark * GetPrev(int Position)
const cRecordingInfo * Info(void) const
void ResetResume(const char *ResumeFileName=NULL)
bool CatchUp(int Index=-1)
cResumeFile(const char *FileName, bool IsPesRecording)
const char * ShortText(void) const
bool IsEdited(void) const
int HMSFToIndex(const char *HMSF, double FramesPerSecond=DEFAULTFRAMESPERSECOND)
void DelByName(const char *FileName, bool RemoveRecording=true)
static void InvokeCommand(const char *State, const char *RecordingFileName, const char *SourceFileName=NULL)
double FramesPerSecond(void) const
cMark * GetNextBegin(cMark *EndMark=NULL)
Returns the next "begin" mark after EndMark, skipping any marks at the same position as EndMark...
cUnbufferedFile * SetOffset(int Number, off_t Offset=0)
const char * Title(char Delimiter= ' ', bool NewIndicator=false, int Level=-1) const
int GetNextIFrame(int Index, bool Forward, uint16_t *FileNumber=NULL, off_t *FileOffset=NULL, int *Length=NULL)
bool IsOnVideoDirectoryFileSystem(void) const
cUnbufferedFile * NextFile(void)
const cComponents * Components(void) const
cString IndexToHMSF(int Index, bool WithFrame=false, double FramesPerSecond=DEFAULTFRAMESPERSECOND)
double FramesPerSecond(void) const
void ResetResume(void) const
cRecording(const cRecording &)
int Last(void)
Returns the index of the last entry in this file, or -1 if the file is empty.
void SetPosition(int Position)
void SetAux(const char *Aux)
cUnbufferedFile is used for large files that are mainly written or read in a streaming manner...
static cString IndexFileName(const char *FileName, bool IsPesRecording)
bool GetLastPatPmtVersions(int &PatVersion, int &PmtVersion)
static void SetCommand(const char *Command)
static const char * command
bool HasRecordingsSortMode(const char *Directory)
void IncRecordingsSortMode(const char *Directory)
eRecordingsSortMode RecordingsSortMode
char * SortName(void) const
cMark * GetNextEnd(cMark *BeginMark)
Returns the next "end" mark after BeginMark, skipping any marks at the same position as BeginMark...
cMark(int Position=0, const char *Comment=NULL, double FramesPerSecond=DEFAULTFRAMESPERSECOND)
cRecording & operator=(const cRecording &)
cRecording * GetByName(const char *FileName)
cIndexFile(const char *FileName, bool Record, bool IsPesRecording=false, bool PauseLive=false)
cMark * GetNext(int Position)
const char * Comment(void) const
void RemoveDeletedRecordings(void)
char * ExchangeChars(char *s, bool ToFileSystem)
time_t Deleted(void) const
void SetData(const char *Title, const char *ShortText, const char *Description)
int GetResume(void) const
int LengthInSeconds(void) const
Returns the length (in seconds) of this recording, or -1 in case of error.
bool GenerateIndex(const char *FileName)
void UpdateByName(const char *FileName)
void AssertFreeDiskSpace(int Priority=0, bool Force=false)
The special Priority value -1 means that we shall get rid of any deleted recordings faster than norma...
void SetStartTime(time_t Start)
Sets the start time of this recording to the given value.
int FileSizeMB(void) const
Returns the total file size of this recording (in MB), or -1 if the file size is unknown.
bool Delete(void)
Changes the file name so that it will no longer be visible in the "Recordings" menu Returns false in ...
tChannelID ChannelID(void) const
void ConvertToPes(tIndexTs *IndexTs, int Count)
cUnbufferedFile * Open(void)
static int GetLength(const char *FileName, bool IsPesRecording=false)
Calculates the recording length (number of frames) without actually reading the index file...
int isOnVideoDirectoryFileSystem
void ConvertFromPes(tIndexTs *IndexTs, int Count)
int GetClosestIFrame(int Index)
Returns the index of the I-frame that is closest to the given Index (or Index itself, if it already points to an I-frame).
static char * updateFileName
int HierarchyLevels(void) const
void Action(void)
A derived cThread class must implement the code it wants to execute as a separate thread in this func...
void TouchUpdate(void)
Touches the '.update' file in the video directory, so that other instances of VDR that access the sam...
int SecondsToFrames(int Seconds, double FramesPerSecond=DEFAULTFRAMESPERSECOND)
bool Parse(const char *s)
const char * UpdateFileName(void)
bool Remove(void)
Actually removes the file from the disk Returns false in case of error.
cRecordings DeletedRecordings
bool StoreResume(int Index)
cIndexFileGenerator * indexFileGenerator
cRecordings(bool Deleted=false)
void GetRecordingsSortMode(const char *Directory)
int ReadFrame(cUnbufferedFile *f, uchar *b, int Length, int Max)
int GetNumSequences(void)
Returns the actual number of sequences to be cut from the recording.
void SetRecordingsSortMode(const char *Directory, eRecordingsSortMode SortMode)
void ScanVideoDir(const char *DirName, bool Foreground=false, int LinkLevel=0, int DirLevel=0)
cMark * Get(int Position)
cFileName(const char *FileName, bool Record, bool Blocking=false, bool IsPesRecording=false)
double MBperMinute(void)
Returns the average data rate (in MB/min) of all recordings, or -1 if this value is unknown...
const cEvent * GetEvent(void) const
const char * Description(void) const
const char * Name(void) const
void ClearVanishedRecordings(void)
const char * Title(void) const
void ClearSortNames(void)
bool StateChanged(int &State)
bool Load(const char *RecordingFileName, double FramesPerSecond=DEFAULTFRAMESPERSECOND, bool IsPesRecording=false)
cRecordingInfo(const cChannel *Channel=NULL, const cEvent *Event=NULL)
bool Get(int Index, uint16_t *FileNumber, off_t *FileOffset, bool *Independent=NULL, int *Length=NULL)
const char * ChannelName(void) const
bool IsStillRecording(void)
void SetComment(const char *Comment)
const char * Aux(void) const
cString recordingFileName
cRecordings Recordings
Any access to Recordings that loops through the list of recordings needs to hold a thread lock on thi...
const char * FileName(void) const
virtual int Compare(const cListObject &ListObject) const
Must return 0 if this object is equal to ListObject, a positive value if it is "greater", and a negative value if it is "smaller".
const char * PrefixFileName(char Prefix)
void AddByName(const char *FileName, bool TriggerUpdate=true)
bool IsPesRecording(void) const
bool Write(bool Independent, uint16_t FileNumber, off_t FileOffset)
bool Undelete(void)
Changes the file name so that it will be visible in the "Recordings" menu again and not processed by ...