Home

Dokumentation

Impressum

Dokumentation VDR
 

Main Page   Class Hierarchy   Alphabetical List   Data Structures   File List   Data Fields   Globals  

recording.h

Go to the documentation of this file.
00001 
00010 #ifndef __RECORDING_H
00011 #define __RECORDING_H
00012 
00013 #include <time.h>
00014 #include "config.h"
00015 #include "timers.h"
00016 #include "tools.h"
00017 
00018 void RemoveDeletedRecordings(void);
00019 void AssertFreeDiskSpace(int Priority = 0);
00020 
00022 class cResumeFile {
00023 private:
00024   char *fileName;
00025 public:
00026   cResumeFile(const char *FileName);
00027   ~cResumeFile();
00028   int Read(void);
00029   bool Save(int Index);
00030   void Delete(void);
00031   };
00032 
00034 class cRecording : public cListObject {
00035 private:
00036   int resume;
00037   char *titleBuffer;
00038   char *sortBuffer;
00039   char *fileName;
00040   char *name;
00041   char *summary;
00042   char *StripEpisodeName(char *s);
00043   char *SortName(void);
00044   int GetResume(void);
00045 public:
00046   time_t start;
00047   int priority;
00048   int lifetime;
00049   cRecording(cTimer *Timer, const char *Title, const char *Subtitle, const char *Summary);
00050   cRecording(const char *FileName);
00051   ~cRecording();
00052   virtual bool operator< (const cListObject &ListObject);
00053   const char *Name(void) { return name; }
00054   const char *FileName(void);
00055   const char *Title(char Delimiter = ' ', bool NewIndicator = false, int Level = -1);
00056   const char *Summary(void) { return summary; }
00057   const char *PrefixFileName(char Prefix);
00058   int HierarchyLevels(void);
00059   bool IsNew(void) { return GetResume() <= 0; }
00060   bool WriteSummary(void);
00061 
00067   bool Delete(void);
00068 
00073   bool Remove(void);
00074   };
00075 
00077 class cRecordings : public cList<cRecording> {
00078 public:
00079   bool Load(bool Deleted = false);
00080   cRecording *GetByName(const char *FileName);
00081   };
00082 
00084 class cMark : public cListObject {
00085 private:
00086   static char *buffer;
00087 public:
00088   int position;
00089   char *comment;
00090   cMark(int Position = 0, const char *Comment = NULL);
00091   ~cMark();
00092   const char *ToText(void);
00093   bool Parse(const char *s);
00094   bool Save(FILE *f);
00095   };
00096 
00098 class cMarks : public cConfig<cMark> {
00099 public:
00100   bool Load(const char *RecordingFileName);
00101   void Sort(void);
00102   cMark *Add(int Position);
00103   cMark *Get(int Position);
00104   cMark *GetPrev(int Position);
00105   cMark *GetNext(int Position);
00106   };
00107 
00108 #define RUC_BEFORERECORDING "before"
00109 #define RUC_AFTERRECORDING  "after"
00110 #define RUC_EDITEDRECORDING "edited"
00111 
00113 class cRecordingUserCommand {
00114 private:
00115   static const char *command;
00116 public:
00117   static void SetCommand(const char *Command) { command = Command; }
00118   static void InvokeCommand(const char *State, const char *RecordingFileName);
00119   };
00120 
00125 #define FRAMESPERSEC 25
00126 
00130 #define MAXFRAMESIZE  KILOBYTE(192)
00131 
00140 #define MAXVIDEOFILESIZE 2000 // MB
00141 #define MINVIDEOFILESIZE  100 // MB
00142 
00144 class cIndexFile {
00145 private:
00146   struct tIndex { int offset; uchar type; uchar number; short reserved; };
00147   int f;
00148   char *fileName;
00149   int size, last;
00150   tIndex *index;
00151   cResumeFile resumeFile;
00152   bool CatchUp(int Index = -1);
00153 public:
00154   cIndexFile(const char *FileName, bool Record);
00155   ~cIndexFile();
00156   bool Ok(void) { return index != NULL; }
00157   bool Write(uchar PictureType, uchar FileNumber, int FileOffset);
00158   bool Get(int Index, uchar *FileNumber, int *FileOffset, uchar *PictureType = NULL, int *Length = NULL);
00159   int GetNextIFrame(int Index, bool Forward, uchar *FileNumber = NULL, int *FileOffset = NULL, int *Length = NULL, bool StayOffEnd = false);
00160   int Get(uchar FileNumber, int FileOffset);
00161   int Last(void) { CatchUp(); return last; }
00162   int GetResume(void) { return resumeFile.Read(); }
00163   bool StoreResume(int Index) { return resumeFile.Save(Index); }
00164   };
00165 
00167 class cFileName {
00168 private:
00169   int file;
00170   int fileNumber;
00171   char *fileName, *pFileNumber;
00172   bool record;
00173   bool blocking;
00174 public:
00175   cFileName(const char *FileName, bool Record, bool Blocking = false);
00176   ~cFileName();
00177   const char *Name(void) { return fileName; }
00178   int Number(void) { return fileNumber; }
00179   int Open(void);
00180   void Close(void);
00181   int SetOffset(int Number, int Offset = 0);
00182   int NextFile(void);
00183   };
00184 
00186 const char *IndexToHMSF(int Index, bool WithFrame = false);
00187 
00188 
00190 int HMSFToIndex(const char *HMSF);
00191 
00196 int SecondsToFrames(int Seconds);
00197 
00198 int ReadFrame(int f, uchar *b, int Length, int Max);
00199 
00200 #endif //__RECORDING_H
00201 

Generated on Wed Feb 5 23:30:11 2003 for VDR by doxygen1.3-rc2