summaryrefslogtreecommitdiff
path: root/recording.h
diff options
context:
space:
mode:
authorKlaus Schmidinger <kls (at) cadsoft (dot) de>2005-09-25 18:00:00 +0200
committerKlaus Schmidinger <kls (at) cadsoft (dot) de>2005-09-25 18:00:00 +0200
commitc16bbf7422f37108580e559ca849e5aafbdac672 (patch)
tree8ee8d17a971364a9231a83abf5bcff4e30bed9b3 /recording.h
parentd5c85f5ff84ffea666c63eca5dbe04632283cb04 (diff)
downloadvdr-patch-lnbsharing-c16bbf7422f37108580e559ca849e5aafbdac672.tar.gz
vdr-patch-lnbsharing-c16bbf7422f37108580e559ca849e5aafbdac672.tar.bz2
Version 1.3.33vdr-1.3.33
- Fixed two errors in 'newplugin' (thanks to Alexander Rieger). - Fixed converting arbitrarily formatted summary.vdr files (thanks to Thomas Günther). - Fixed handling color buttons in cMenuEditStrItem (thanks to Alexander Rieger). - Added cChannel::LinkChannels() and cChannel::RefChannel() (suggested by Helmut Auer). Note that VDR itself doesn't actually use the linked channels, yet, so there is no guarantee that this really works under all circumstances. - Added a missing include statement to the 'sky' plugin (thanks to Alfred Zastrow for reporting this one). - Fixed handling key macros with keys after @plugin (thanks to Rolf Ahrenberg for reporting this one). - Fixed error handling in cCiTransportConnection::RecvTPDU() (thanks to Georg Acher for reporting this one). - Removed obsolete 'shift' code in device.[hc]. - The SVDRP command DELR no longer triggers a complete reload of the global Recordings list, but rather deletes that particular entry. - The list of recordings is now read in a separate thread, resulting in a faster startup if there are a great many of recordings, or the disk(s) have to spin up. If the Recordings menu is opened while the list of recordings is still being read, the menu will be updated accordingly. Plugins that access the global Recordings variable should lock the thread by putting something like cThreadLock RecordingsLock(&Recordings); into the respective code block. Thanks to Carsten Koch for his help in testing and debugging this. - The 'new' indicator in the Recordings menu is now kept up-to-date (thanks to Thomas Günther). - Updated the Romanian OSD texts (thanks to Lucian Muresan). - Updated the Russian OSD texts (thanks to Oleg Roitburd). - The '.update' file in the video directory is now touched when a recording is added or deleted, so that other VDR instances can update their lists (thanks to Alexander Rieger). - Made the function ExchangeChars() public (suggested by Lucian Muresan).
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