[vdr-plugin-remotetimers] 01/03: Imported Upstream version 1.0.2

Tobias Grimm tiber-guest at moszumanska.debian.org
Thu Sep 3 17:06:09 UTC 2015


This is an automated email from the git hooks/post-receive script.

tiber-guest pushed a commit to branch master
in repository vdr-plugin-remotetimers.

commit 47b27ae7a3426c0e12b91513613436702d9a04d1
Author: etobi <git at e-tobi.net>
Date:   Thu Sep 3 19:03:58 2015 +0200

    Imported Upstream version 1.0.2
---
 HISTORY                                            |  8 +++++
 Makefile                                           |  3 ++
 menu.c                                             | 34 ++++++++++++++++++++++
 menu.h                                             | 13 +++++++++
 ...f => vdr-1.6.0-2.0.3-MainMenuHooks-v1_0_2.diff} |  0
 ..._2.diff => vdr-2.0.4-MainMenuHooks-v1_0_2.diff} |  4 +--
 remotetimers.c                                     | 14 ++++++++-
 watcher.c                                          |  8 +++++
 8 files changed, 81 insertions(+), 3 deletions(-)

diff --git a/HISTORY b/HISTORY
index ad639b0..aa44ab9 100644
--- a/HISTORY
+++ b/HISTORY
@@ -1,6 +1,14 @@
 VDR Plugin 'remotetimers' Revision History
 ------------------------------------------
 
+2015-07-29: Version 1.0.2
+
+- Added compatibility for VDR 2.1.2 (thanks to Christopher Reimer and Lars
+  Hanisch)
+- Added support for graphtft. Use -DUSE_GRAPHTFT when compiling to enable.
+  (thanks to J�rg Wendel)
+- Updated MainMenuHooks patch for VDR 2.0.4
+
 2013-08-12: Version 1.0.1
 
 - Fixed channel name width in schedule menus (reported by hummel99 at vdrportal)
diff --git a/Makefile b/Makefile
index af91f44..273ab1e 100644
--- a/Makefile
+++ b/Makefile
@@ -51,6 +51,9 @@ INCLUDES +=
 
 DEFINES += -DPLUGIN_NAME_I18N='"$(PLUGIN)"'
 
+# uncomment this to enable support for the graphtft plugin.
+#DEFINES += -DUSE_GRAPHTFT
+
 ### The object files (add further files here):
 
 OBJS = $(PLUGIN).o svdrp.o conflict.o menu.o menuitems.o setup.o moverec.o watcher.o
diff --git a/menu.c b/menu.c
index 2b5cd3c..cf4368d 100644
--- a/menu.c
+++ b/menu.c
@@ -189,14 +189,23 @@ cString cFreeDiskSpace::lastPath("/");
 bool cFreeDiskSpace::HasChanged(const char *SubDir, bool ForceCheck)
 {
   cString path(ExchangeChars(strdup(SubDir ? SubDir : ""), true), true);
+#if APIVERSNUM > 20101
+  path = cString::sprintf("%s/%s", cVideoDirectory::Name(), *path);
+#else
   path = cString::sprintf("%s/%s", VideoDirectory, *path);
+#endif
   if (ForceCheck || time(NULL) - lastDiskSpaceCheck > DISKSPACECHEK || !EntriesOnSameFileSystem(path, lastPath)) {
      int FreeMB;
      int Percent;
      int MBperMinute = -1;
      lastPath = path;
+#if APIVERSNUM > 20101
+     if (cVideoDirectory::IsOnVideoDirectoryFileSystem(path)) {
+        Percent = cVideoDirectory::VideoDiskSpace(&FreeMB);
+#else
      if (IsOnVideoDirectoryFileSystem(path)) {
         Percent = ::VideoDiskSpace(&FreeMB);
+#endif
         MBperMinute = Recordings.MBperMinute();
      }
      else {
@@ -868,6 +877,10 @@ void cMenuEvent::Display(void)
 {
   cOsdMenu::Display();
   DisplayMenu()->SetEvent(event);
+#ifdef USE_GRAPHTFT
+  cStatus::MsgOsdSetEvent(event);
+#endif
+
   if (event->Description())
      cStatus::MsgOsdTextItem(event->Description());
 }
@@ -1758,8 +1771,13 @@ eOSState cMenuEditRecording::Cut()
         int len = strlen(RemoteTimersSetup.serverDir);
         bool remote = len == 0 || (strstr(name, RemoteTimersSetup.serverDir) == name && name[len] == FOLDERDELIMCHAR);
         if (!remote) {
+#if APIVERSNUM > 20101
+           if (RecordingsHandler.GetUsage(*fileName) == ruNone) {
+              if (RecordingsHandler.Add(ruCut, *fileName))
+#else
            if (!cCutter::Active()) {
               if (cCutter::Start(*fileName))
+#endif
                  Skins.Message(mtInfo, tr("Editing process started"));
               else
                  Skins.Message(mtError, tr("Can't start editing process!"));
@@ -1898,7 +1916,11 @@ bool cMenuEditRecording::UpdateName(cRecording *Recording)
          name[len] = '\0';
      }
      cString newName(ExchangeChars(strdup(name), true), true);
+#if APIVERSNUM > 20101
+     newName = cString::sprintf("%s/%s%s", cVideoDirectory::Name(), *newName, p);
+#else
      newName = cString::sprintf("%s/%s%s", VideoDirectory, *newName, p);
+#endif
      bool wasMoving = cMoveRec::IsMoving();
      if (Rename(Recording, newName)) {
         // keep old name when moving recording in background
@@ -2215,7 +2237,11 @@ void cMenuRecordings::Set(bool Refresh)
 
 cString cMenuRecordings::DirectoryName(void)
 {
+#if APIVERSNUM > 20101
+  cString d(cVideoDirectory::Name());
+#else
   cString d(VideoDirectory);
+#endif
   if (base) {
      char *s = ExchangeChars(strdup(base), true);
      d = AddDirectory(d, s);
@@ -2312,9 +2338,17 @@ eOSState cMenuRecordings::Delete(void)
            }
         cRecording *recording = ri->Recording();
         cString FileName = recording->FileName();
+#if APIVERSNUM > 20101
+        if (RecordingsHandler.GetUsage(*FileName) != ruNone) {
+#else
         if (cCutter::Active(ri->Recording()->FileName())) {
+#endif
            if (Interface->Confirm(tr("Recording is being edited - really delete?"))) {
+#if APIVERSNUM > 20101
+              RecordingsHandler.Del(*FileName);
+#else
               cCutter::Stop();
+#endif
               recording = Recordings.GetByName(FileName); // cCutter::Stop() might have deleted it if it was the edited version
               // we continue with the code below even if recording is NULL,
               // in order to have the menu updated etc.
diff --git a/menu.h b/menu.h
index 8289e99..177b973 100644
--- a/menu.h
+++ b/menu.h
@@ -76,10 +76,14 @@ private:
   void Set(eRemoteTimersState State = rtsOk);
   void CheckState(eRemoteTimersState State, bool RefreshMsg = true);
   bool UpdateConflicts(bool Remote);
+
 public:
   cMenuTimers(const char* ServerIp = NULL, unsigned short ServerPort = 0);
   virtual ~cMenuTimers();
   virtual eOSState ProcessKey(eKeys Key);
+#ifdef USE_GRAPHTFT
+  virtual const char* MenuKind() { return "MenuTimers"; }
+#endif
   };
 
 class cMenuSchedule : public cOsdMenu {
@@ -115,6 +119,9 @@ public:
   cMenuEvent(const cEvent *Event, bool CanSwitch = false, bool Buttons = false);
   virtual void Display(void);
   virtual eOSState ProcessKey(eKeys Key);
+#ifdef USE_GRAPHTFT
+  virtual const char* MenuKind() { return "MenuEvent"; }
+#endif
   };
 
 class cMenuRecordingItem;
@@ -148,6 +155,9 @@ public:
   cMenuRecordings(const char *Base = NULL, int Level = 0, bool OpenSubMenus = false);
   ~cMenuRecordings();
   virtual eOSState ProcessKey(eKeys Key);
+#ifdef USE_GRAPHTFT
+  virtual const char* MenuKind() { return "MenuRecordings"; }
+#endif
   };
 
 class cMenuMain : public cOsdMenu {
@@ -159,6 +169,9 @@ public:
   cMenuMain(const char *Title, eOSState State);
   virtual ~cMenuMain();
   virtual eOSState ProcessKey(eKeys Key);
+#ifdef USE_GRAPHTFT
+  virtual const char* MenuKind() { return "MenuMain"; }
+#endif
   };
 
 }; // namespace PluginRemoteTimers
diff --git a/patches/MainMenuHooks-v1_0_2.diff b/patches/vdr-1.6.0-2.0.3-MainMenuHooks-v1_0_2.diff
similarity index 100%
copy from patches/MainMenuHooks-v1_0_2.diff
copy to patches/vdr-1.6.0-2.0.3-MainMenuHooks-v1_0_2.diff
diff --git a/patches/MainMenuHooks-v1_0_2.diff b/patches/vdr-2.0.4-MainMenuHooks-v1_0_2.diff
similarity index 98%
rename from patches/MainMenuHooks-v1_0_2.diff
rename to patches/vdr-2.0.4-MainMenuHooks-v1_0_2.diff
index 21a7cb8..76433a9 100644
--- a/patches/MainMenuHooks-v1_0_2.diff
+++ b/patches/vdr-2.0.4-MainMenuHooks-v1_0_2.diff
@@ -85,7 +85,7 @@ diff -ru vdr-1.6.0.orig/menu.c vdr-1.6.0/menu.c
 -    case osSchedule:   AddSubMenu(new cMenuSchedule); break;
 -    case osChannels:   AddSubMenu(new cMenuChannels); break;
 -    case osTimers:     AddSubMenu(new cMenuTimers); break;
--    case osRecordings: AddSubMenu(new cMenuRecordings(NULL, 0, true)); break;
+-    case osRecordings: AddSubMenu(new cMenuRecordings(NULL, 0, OpenSubMenus)); break;
 -    case osSetup:      AddSubMenu(new cMenuSetup); break;
 -    case osCommands:   AddSubMenu(new cMenuCommands(tr("Commands"), &Commands)); break;
 +    case osSchedule:
@@ -102,7 +102,7 @@ diff -ru vdr-1.6.0.orig/menu.c vdr-1.6.0/menu.c
 +        break;
 +    case osRecordings:
 +        if (!cPluginManager::CallFirstService("MainMenuHooksPatch-v1.0::osRecordings", &menu))
-+            menu = new cMenuRecordings(NULL, 0, true);
++            menu = new cMenuRecordings(NULL, 0, OpenSubMenus);
 +        break;
 +    case osSetup:      menu = new cMenuSetup; break;
 +    case osCommands:   menu = new cMenuCommands(tr("Commands"), &Commands); break;
diff --git a/remotetimers.c b/remotetimers.c
index ffc0154..3a0a842 100644
--- a/remotetimers.c
+++ b/remotetimers.c
@@ -30,7 +30,7 @@
 #include "watcher.h"
 #include "i18n.h"
 
-static const char *VERSION        = "1.0.1";
+static const char *VERSION        = "1.0.2";
 static const char *DESCRIPTION    = trNOOP("Edit timers on remote VDR");
 static const char *MAINMENUENTRY  = trNOOP("Remote Timers");
 
@@ -172,11 +172,23 @@ bool cPluginRemotetimers::Service(const char *Id, void *Data)
                    if (*RemoteTimersSetup.serverDir) {
                       ir->name = cString::sprintf("%s~%s", RemoteTimersSetup.serverDir, recording.Name());
 
+#if APIVERSNUM > 20101
+                      int len = strlen(cVideoDirectory::Name());
+#else
                       int len = strlen(VideoDirectory);
+#endif
                       ir->fileName = recording.FileName();
+#if APIVERSNUM > 20101
+                      if (strncmp(ir->fileName, cVideoDirectory::Name(), strlen(cVideoDirectory::Name())) == 0 && ir->fileName[len] == '/') {
+#else
                       if (strncmp(ir->fileName, VideoDirectory, strlen(VideoDirectory)) == 0 && ir->fileName[len] == '/') {
+#endif
                          char *serverDir = ExchangeChars(strdup(RemoteTimersSetup.serverDir), true);
+#if APIVERSNUM > 20101
+                         ir->fileName = cString::sprintf("%s/%s%s", cVideoDirectory::Name(), serverDir, ir->fileName + len);
+#else
                          ir->fileName = cString::sprintf("%s/%s%s", VideoDirectory, serverDir, ir->fileName + len);
+#endif
                          free(serverDir);
                       }
                       else {
diff --git a/watcher.c b/watcher.c
index 7cd6323..11a793a 100644
--- a/watcher.c
+++ b/watcher.c
@@ -44,7 +44,11 @@ void cUpdateWatcher::DeleteInstance()
 cUpdateWatcher::cUpdateWatcher(): cThread("remotetimers update file watcher")
 {
 	serverLastModifiedTime = 0;
+#if APIVERSNUM > 20101
+	clientUpdateFile = AddDirectory(cVideoDirectory::Name(), ".update");
+#else
 	clientUpdateFile = AddDirectory(VideoDirectory, ".update");
+#endif
 	clientLastDev = 0;
 	inSubDir = false;
 }
@@ -63,7 +67,11 @@ void cUpdateWatcher::Initialize()
 		// server recordings in subdir: check mtime of subdir/.update
 		char *tmpDir = strdup(RemoteTimersSetup.serverDir);
 		tmpDir = ExchangeChars(tmpDir, true);
+#if APIVERSNUM > 20101
+		serverUpdateFile = AddDirectory(cVideoDirectory::Name(), AddDirectory(tmpDir, ".update"));
+#else
 		serverUpdateFile = AddDirectory(VideoDirectory, AddDirectory(tmpDir, ".update"));
+#endif
 	        serverLastModifiedTime = LastModifiedTime(serverUpdateFile);
 		free(tmpDir);
 	}

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-vdr-dvb/vdr-plugin-remotetimers.git



More information about the pkg-vdr-dvb-changes mailing list