summaryrefslogtreecommitdiff
path: root/recording.h
diff options
context:
space:
mode:
Diffstat (limited to 'recording.h')
-rw-r--r--recording.h42
1 files changed, 35 insertions, 7 deletions
diff --git a/recording.h b/recording.h
index 567c6c4..96bb4b5 100644
--- a/recording.h
+++ b/recording.h
@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
- * $Id: recording.h 1.40 2005/09/03 13:04:41 kls Exp $
+ * $Id: recording.h 1.44 2005/09/25 14:30:13 kls Exp $
*/
#ifndef __RECORDING_H
@@ -71,7 +71,7 @@ public:
int lifetime;
cRecording(cTimer *Timer, const cEvent *Event);
cRecording(const char *FileName);
- ~cRecording();
+ virtual ~cRecording();
virtual int Compare(const cListObject &ListObject) const;
const char *Name(void) const { return name; }
const char *FileName(void) const;
@@ -79,6 +79,7 @@ public:
const cRecordingInfo *Info(void) const { return info; }
const char *PrefixFileName(char Prefix);
int HierarchyLevels(void) const;
+ void ResetResume(void) const;
bool IsNew(void) const { return GetResume() <= 0; }
bool IsEdited(void) const;
bool WriteInfo(void);
@@ -90,16 +91,37 @@ public:
// Returns false in case of error
};
-class cRecordings : public cList<cRecording> {
+class cRecordings : public cList<cRecording>, public cThread {
private:
+ char *updateFileName;
bool deleted;
time_t lastUpdate;
- void ScanVideoDir(const char *DirName);
+ int state;
+ void Refresh(bool Foreground = false);
+ void ScanVideoDir(const char *DirName, bool Foreground = false);
+protected:
+ void Action(void);
public:
cRecordings(bool Deleted = false);
- bool Load(void);
- void TriggerUpdate(void) { lastUpdate = 0; }
+ virtual ~cRecordings();
+ bool Load(void) { return Update(true); }
+ ///< Loads the current list of recordings and returns true if there
+ ///< is anything in it (for compatibility with older plugins - use
+ ///< Update(true) instead).
+ bool Update(bool Wait = false);
+ ///< Triggers an update of the list of recordings, which will run
+ ///< as a separate thread if Wait is false. If Wait is true, the
+ ///< function returns only after the update has completed.
+ ///< Returns true if Wait is true and there is anyting in the list
+ ///< of recordings, false otherwise.
+ void TouchUpdate(void);
+ ///< Touches the '.update' file in the video directory, so that other
+ ///< instances of VDR that access the same video directory can be triggered
+ ///< to update their recordings list.
bool NeedsUpdate(void);
+ void ChangeState(void) { state++; }
+ bool StateChanged(int &State);
+ void ResetResume(const char *ResumeFileName = NULL);
cRecording *GetByName(const char *FileName);
void AddByName(const char *FileName);
void DelByName(const char *FileName);
@@ -112,7 +134,7 @@ public:
int position;
char *comment;
cMark(int Position = 0, const char *Comment = NULL);
- ~cMark();
+ virtual ~cMark();
cString ToText(void);
bool Parse(const char *s);
bool Save(FILE *f);
@@ -205,4 +227,10 @@ int SecondsToFrames(int Seconds); //XXX+ ->player???
int ReadFrame(int f, uchar *b, int Length, int Max);
+char *ExchangeChars(char *s, bool ToFileSystem);
+ // Exchanges the characters in the given string to or from a file system
+ // specific representation (depending on ToFileSystem). The given string will
+ // be modified and may be reallocated if more space is needed. The return
+ // value points to the resulting string, which may be different from s.
+
#endif //__RECORDING_H