r466 - in vdr/vdr/trunk/debian: . patches

Thomas Schmidt pkg-vdr-dvb-changes@lists.alioth.debian.org
Sat, 16 Apr 2005 21:29:14 +0000


Author: tschmidt
Date: 2005-04-16 21:29:13 +0000 (Sat, 16 Apr 2005)
New Revision: 466

Added:
   vdr/vdr/trunk/debian/patches/14_update-resume.dpatch
Modified:
   vdr/vdr/trunk/debian/changelog
   vdr/vdr/trunk/debian/patches/00list
Log:
vdr: Added update-resume patch from vdrdevel (updates the resume
     status of recordings after replaying them)


Modified: vdr/vdr/trunk/debian/changelog
===================================================================
--- vdr/vdr/trunk/debian/changelog	2005-04-16 19:50:49 UTC (rev 465)
+++ vdr/vdr/trunk/debian/changelog	2005-04-16 21:29:13 UTC (rev 466)
@@ -16,6 +16,8 @@
       + Added commands.update-recordings.conf from vdrdevel to have a 
         command for updating the recordings list manually
       + Added "Blue LCARS" and "Cool" themes from vdrdevel
+      + Added update-resume patch from vdrdevel (updates the resume
+        status of recordings after replaying them)
   * Tobias Grimm <tg@e-tobi.net>
     - Don't restrict root capabilities with --allow-root anymore
     - Passing $OPTIONS to binary compatibility test in plugin loader now

Modified: vdr/vdr/trunk/debian/patches/00list
===================================================================
--- vdr/vdr/trunk/debian/patches/00list	2005-04-16 19:50:49 UTC (rev 465)
+++ vdr/vdr/trunk/debian/patches/00list	2005-04-16 21:29:13 UTC (rev 466)
@@ -7,6 +7,7 @@
 07_not_as_root
 08_security_CAN-2005-0071
 13_remote
+14_update-resume
 
 # The Elchi AIO 4d patch for a nicer OSD, inlcuding the frames and black
 # square fix.

Added: vdr/vdr/trunk/debian/patches/14_update-resume.dpatch
===================================================================
--- vdr/vdr/trunk/debian/patches/14_update-resume.dpatch	2005-04-16 19:50:49 UTC (rev 465)
+++ vdr/vdr/trunk/debian/patches/14_update-resume.dpatch	2005-04-16 21:29:13 UTC (rev 466)
@@ -0,0 +1,101 @@
+#!/bin/sh /usr/share/dpatch/dpatch-run
+
+## update-resume - version 0.1 - Thomas Günther <tom@toms-cafe.de>
+##
+## 2005-03-08: version 0.1
+##   - trigger reread of the resume file after replaying a recording
+##   - reset resume of a recording when the resume file is deleted
+##   - trigger reread of the resume files for all recordings if Resume ID is
+##     changed
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: Updates resume of a recording after replay.
+
+@DPATCH@
+--- vdr-1.3.18/menu.c
++++ vdr-1.3.18/menu.c
+@@ -2161,6 +2161,8 @@
+ // --- cMenuSetupReplay ------------------------------------------------------
+ 
+ class cMenuSetupReplay : public cMenuSetupBase {
++protected:
++  virtual void Store(void);
+ public:
+   cMenuSetupReplay(void);
+   };
+@@ -2173,6 +2175,13 @@
+   Add(new cMenuEditIntItem(tr("Setup.Replay$Resume ID"), &data.ResumeID, 0, 99));
+ }
+ 
++void cMenuSetupReplay::Store(void)
++{
++  if (Setup.ResumeID != data.ResumeID)
++     Recordings.ResetResume();
++  cMenuSetupBase::Store();
++}
++
+ // --- cMenuSetupMisc --------------------------------------------------------
+ 
+ class cMenuSetupMisc : public cMenuSetupBase {
+--- vdr-1.3.18/recording.c
++++ vdr-1.3.18/recording.c
+@@ -199,6 +199,7 @@
+         if (safe_write(f, &Index, sizeof(Index)) < 0)
+            LOG_ERROR_STR(fileName);
+         close(f);
++        Recordings.ResetResume(fileName);
+         return true;
+         }
+      }
+@@ -210,6 +211,7 @@
+   if (fileName) {
+      if (remove(fileName) < 0 && errno != ENOENT)
+         LOG_ERROR_STR(fileName);
++     Recordings.ResetResume(fileName);
+      }
+ }
+ 
+@@ -616,6 +618,11 @@
+   return RemoveVideoFile(FileName());
+ }
+ 
++void cRecording::ResetResume(void) const
++{
++  resume = RESUME_NOT_INITIALIZED;
++}
++
+ // --- cRecordings -----------------------------------------------------------
+ 
+ cRecordings Recordings;
+@@ -702,6 +709,13 @@
+      Del(recording);
+ }
+ 
++void cRecordings::ResetResume(const char *ResumeFileName)
++{
++  for (cRecording *recording = First(); recording; recording = Next(recording))
++     if (!ResumeFileName || strncmp(ResumeFileName, recording->FileName(), strlen(recording->FileName())) == 0)
++        recording->ResetResume();
++}
++
+ // --- cMark -----------------------------------------------------------------
+ 
+ cMark::cMark(int Position, const char *Comment)
+--- vdr-1.3.18/recording.h
++++ vdr-1.3.18/recording.h
+@@ -58,6 +58,7 @@
+   const char *PrefixFileName(char Prefix);
+   int HierarchyLevels(void) const;
+   bool IsNew(void) const { return GetResume() <= 0; }
++  void ResetResume(void) const;
+   bool IsEdited(void) const;
+   bool WriteSummary(void);
+   bool Delete(void);
+@@ -78,6 +79,7 @@
+   bool Load(void);
+   void TriggerUpdate(void) { lastUpdate = 0; }
+   bool NeedsUpdate(void);
++  void ResetResume(const char *ResumeFileName = NULL);
+   cRecording *GetByName(const char *FileName);
+   void AddByName(const char *FileName);
+   void DelByName(const char *FileName);