diff -Nru vdr-plugin-remotetimers-1.0.1/debian/changelog vdr-plugin-remotetimers-1.0.2/debian/changelog --- vdr-plugin-remotetimers-1.0.1/debian/changelog 2014-08-26 20:51:37.000000000 +0000 +++ vdr-plugin-remotetimers-1.0.2/debian/changelog 2015-08-01 21:32:23.000000000 +0000 @@ -1,3 +1,11 @@ +vdr-plugin-remotetimers (1.0.2-0easyVDR0~trusty) trusty; urgency=high + + * New Release + * enable support for plugin graphtft + * switch to quilt + + -- easyVDR-Developer Sat, 01 Aug 2015 22:38:31 +0200 + vdr-plugin-remotetimers (1.0.1-1easyVDR3~trusty) trusty; urgency=high * automatic rebuild diff -Nru vdr-plugin-remotetimers-1.0.1/debian/control vdr-plugin-remotetimers-1.0.2/debian/control --- vdr-plugin-remotetimers-1.0.1/debian/control 2013-08-27 09:47:00.000000000 +0000 +++ vdr-plugin-remotetimers-1.0.2/debian/control 2015-08-01 20:43:38.000000000 +0000 @@ -2,7 +2,7 @@ Section: video Priority: extra Maintainer: easyVDR-Developer -Uploaders: Steevee +Uploaders: Wolfgang Mangold Build-Depends: debhelper (>= 8), vdr-dev (>= 2.0.0), pkg-config, gettext, svdrpservice-dev Standards-Version: 3.9.4 Homepage: http://vdr.schmirler.de/ diff -Nru vdr-plugin-remotetimers-1.0.1/debian/copyright vdr-plugin-remotetimers-1.0.2/debian/copyright --- vdr-plugin-remotetimers-1.0.1/debian/copyright 2013-08-27 09:47:00.000000000 +0000 +++ vdr-plugin-remotetimers-1.0.2/debian/copyright 2015-08-01 20:45:20.000000000 +0000 @@ -10,7 +10,7 @@ Thomas Schmidt Copyright: - (C) 2006 Frank Schmirler + (C) 2006 - 2015 Frank Schmirler Copyright (Debian packaging): (C) 2007 - 2009 Tobias Grimm, Thomas Günther, Thomas Schmidt diff -Nru vdr-plugin-remotetimers-1.0.1/debian/patches/Makefile.patch vdr-plugin-remotetimers-1.0.2/debian/patches/Makefile.patch --- vdr-plugin-remotetimers-1.0.1/debian/patches/Makefile.patch 1970-01-01 00:00:00.000000000 +0000 +++ vdr-plugin-remotetimers-1.0.2/debian/patches/Makefile.patch 2015-08-01 21:31:40.000000000 +0000 @@ -0,0 +1,13 @@ +Index: vdr-plugin-remotetimers-1.0.2/Makefile +=================================================================== +--- vdr-plugin-remotetimers-1.0.2.orig/Makefile 2014-03-13 09:17:43.000000000 +0100 ++++ vdr-plugin-remotetimers-1.0.2/Makefile 2015-08-01 23:31:03.987765824 +0200 +@@ -52,7 +52,7 @@ + DEFINES += -DPLUGIN_NAME_I18N='"$(PLUGIN)"' + + # uncomment this to enable support for the graphtft plugin. +-#DEFINES += -DUSE_GRAPHTFT ++DEFINES += -DUSE_GRAPHTFT + + ### The object files (add further files here): + diff -Nru vdr-plugin-remotetimers-1.0.1/debian/patches/series vdr-plugin-remotetimers-1.0.2/debian/patches/series --- vdr-plugin-remotetimers-1.0.1/debian/patches/series 1970-01-01 00:00:00.000000000 +0000 +++ vdr-plugin-remotetimers-1.0.2/debian/patches/series 2015-08-01 21:30:33.000000000 +0000 @@ -0,0 +1 @@ +Makefile.patch diff -Nru vdr-plugin-remotetimers-1.0.1/debian/rules vdr-plugin-remotetimers-1.0.2/debian/rules --- vdr-plugin-remotetimers-1.0.1/debian/rules 2013-08-27 09:47:00.000000000 +0000 +++ vdr-plugin-remotetimers-1.0.2/debian/rules 2015-08-01 20:41:13.000000000 +0000 @@ -10,6 +10,10 @@ override_dh_auto_install: dh_auto_install --destdir=debian/vdr-plugin-remotetimers +override_dh_gencontrol: + sh /usr/share/vdr-dev/dependencies.sh + dh_gencontrol + %: dh $@ diff -Nru vdr-plugin-remotetimers-1.0.1/debian/source/format vdr-plugin-remotetimers-1.0.2/debian/source/format --- vdr-plugin-remotetimers-1.0.1/debian/source/format 1970-01-01 00:00:00.000000000 +0000 +++ vdr-plugin-remotetimers-1.0.2/debian/source/format 2015-08-01 20:37:18.000000000 +0000 @@ -0,0 +1 @@ +3.0 (quilt) diff -Nru vdr-plugin-remotetimers-1.0.1/HISTORY vdr-plugin-remotetimers-1.0.2/HISTORY --- vdr-plugin-remotetimers-1.0.1/HISTORY 2013-08-27 09:47:00.000000000 +0000 +++ vdr-plugin-remotetimers-1.0.2/HISTORY 2015-07-29 19:32:24.000000000 +0000 @@ -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@vdrportal) diff -Nru vdr-plugin-remotetimers-1.0.1/Makefile vdr-plugin-remotetimers-1.0.2/Makefile --- vdr-plugin-remotetimers-1.0.1/Makefile 2013-08-27 09:47:00.000000000 +0000 +++ vdr-plugin-remotetimers-1.0.2/Makefile 2014-03-13 08:17:43.000000000 +0000 @@ -51,6 +51,9 @@ 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 -Nru vdr-plugin-remotetimers-1.0.1/menu.c vdr-plugin-remotetimers-1.0.2/menu.c --- vdr-plugin-remotetimers-1.0.1/menu.c 2013-08-27 09:47:00.000000000 +0000 +++ vdr-plugin-remotetimers-1.0.2/menu.c 2015-07-29 19:31:37.000000000 +0000 @@ -189,14 +189,23 @@ 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 @@ { cOsdMenu::Display(); DisplayMenu()->SetEvent(event); +#ifdef USE_GRAPHTFT + cStatus::MsgOsdSetEvent(event); +#endif + if (event->Description()) cStatus::MsgOsdTextItem(event->Description()); } @@ -1758,8 +1771,13 @@ 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 @@ 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 @@ 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 @@ } 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 -Nru vdr-plugin-remotetimers-1.0.1/menu.h vdr-plugin-remotetimers-1.0.2/menu.h --- vdr-plugin-remotetimers-1.0.1/menu.h 2013-08-27 09:47:00.000000000 +0000 +++ vdr-plugin-remotetimers-1.0.2/menu.h 2014-03-13 08:19:03.000000000 +0000 @@ -76,10 +76,14 @@ 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 @@ 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 @@ 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 @@ 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 -Nru vdr-plugin-remotetimers-1.0.1/patches/MainMenuHooks-v1_0_2.diff vdr-plugin-remotetimers-1.0.2/patches/MainMenuHooks-v1_0_2.diff --- vdr-plugin-remotetimers-1.0.1/patches/MainMenuHooks-v1_0_2.diff 2013-08-27 09:47:00.000000000 +0000 +++ vdr-plugin-remotetimers-1.0.2/patches/MainMenuHooks-v1_0_2.diff 1970-01-01 00:00:00.000000000 +0000 @@ -1,181 +0,0 @@ -This is a "patch" for the Video Disk Recorder (VDR). - -* History -2012-04-06: Version 1.0.2 -- Update für aktuelle VDR-Entwickler-Versionen (Manuel Reimer) - -2010-10-15: Version 1.0.1 -- return a cOsdObject instead of its subclass cOsdMenu (thanks to - Joe_D@vdrportal) -- version number defines in config.h now follow the ususal conventions: - MAINMENUHOOKSVERSNUM is now a number, the newly added define - MAINMENUHOOKSVERSION is a string (suggested by gnapheus@vdrportal) -- patch is now based on VDR 1.6.0 -- updated documentation - -2007-02-26: Version 1.0 -- Initial revision. - -* Authors: -Tobias Grimm -Martin Prochnow -Frank Schmirler -Christian Wieninger - -* Description: -This patch allows plugins to replace the VDR mainmenus "Schedule", -"Channels", "Timers" and "Recordings" by a different implementation. - -The patch is based on a suggestion of Christian Wieninger back in 2006 -(http://www.linuxtv.org/pipermail/vdr/2006-March/008234.html). It is -meant to be an interim solution for VDR 1.4 until (maybe) VDR 1.5 -introduces an official API for this purpose. - -* Installation -Change into the VDR source directory, then issue - patch -p1 < path/to/MainMenuHooks-v1_0_1.patch -and recompile. - -* Notes for plugin authors -The following code sample shows the required plugin code for replacing -the original Schedule menu: - -bool cMyPlugin::Service(const char *Id, void *Data) -{ - cOsdMenu **menu = (cOsdMenu**) Data; - if (MySetup.replaceSchedule && - strcmp(Id, "MainMenuHooksPatch-v1.0::osSchedule") == 0) { - if (menu) - *menu = (cOsdMenu*) MainMenuAction(); - return true; - } - return false; -} - -Since patch version 1.0.1 the service call may return a cOsdObject -instead of a cOsdMenu. Use "#ifdef MAINMENUHOOKSVERSION" to detect -version 1.0.1. - -A plugin can replace more than one menu at a time. Simply replace the -call to MainMenuAction() in the sample above by appropriate code. - -Note that a plugin *should* offer a setup option which allows the user -to enable or disable the replacement. "Disabled" would be a reasonable -default setting. By testing for define MAINMENUHOOKSVERSNUM, a plugin -can leave the setup option out at compiletime. - -In case there is an internal problem when trying to open the replacement -menu, it is safe to return true even though Data is NULL. However an -OSD message should indicate the problem to the user. - -Feel free to ship this patch along with your plugin. However if you -think you need to modify the patch, we'd encourage you to contact the -authors first or at least use a service id which differs in more than -just the version number. - -diff -ru vdr-1.6.0.orig/menu.c vdr-1.6.0/menu.c ---- vdr-1.6.0.orig/menu.c 2008-03-16 12:15:28.000000000 +0100 -+++ vdr-1.6.0/menu.c 2010-10-11 20:32:25.000000000 +0200 -@@ -2973,15 +2973,31 @@ - - // Initial submenus: - -+ cOsdObject *menu = NULL; - switch (State) { -- 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 osSetup: AddSubMenu(new cMenuSetup); break; -- case osCommands: AddSubMenu(new cMenuCommands(tr("Commands"), &Commands)); break; -+ case osSchedule: -+ if (!cPluginManager::CallFirstService("MainMenuHooksPatch-v1.0::osSchedule", &menu)) -+ menu = new cMenuSchedule; -+ break; -+ case osChannels: -+ if (!cPluginManager::CallFirstService("MainMenuHooksPatch-v1.0::osChannels", &menu)) -+ menu = new cMenuChannels; -+ break; -+ case osTimers: -+ if (!cPluginManager::CallFirstService("MainMenuHooksPatch-v1.0::osTimers", &menu)) -+ menu = new cMenuTimers; -+ break; -+ case osRecordings: -+ if (!cPluginManager::CallFirstService("MainMenuHooksPatch-v1.0::osRecordings", &menu)) -+ menu = new cMenuRecordings(NULL, 0, true); -+ break; -+ case osSetup: menu = new cMenuSetup; break; -+ case osCommands: menu = new cMenuCommands(tr("Commands"), &Commands); break; - default: break; - } -+ if (menu) -+ if (menu->IsMenu()) -+ AddSubMenu((cOsdMenu *) menu); - } - - cOsdObject *cMenuMain::PluginOsdObject(void) -@@ -3096,13 +3112,34 @@ - eOSState state = cOsdMenu::ProcessKey(Key); - HadSubMenu |= HasSubMenu(); - -+ cOsdObject *menu = NULL; - switch (state) { -- case osSchedule: return AddSubMenu(new cMenuSchedule); -- case osChannels: return AddSubMenu(new cMenuChannels); -- case osTimers: return AddSubMenu(new cMenuTimers); -- case osRecordings: return AddSubMenu(new cMenuRecordings); -- case osSetup: return AddSubMenu(new cMenuSetup); -- case osCommands: return AddSubMenu(new cMenuCommands(tr("Commands"), &Commands)); -+ case osSchedule: -+ if (!cPluginManager::CallFirstService("MainMenuHooksPatch-v1.0::osSchedule", &menu)) -+ menu = new cMenuSchedule; -+ else -+ state = osContinue; -+ break; -+ case osChannels: -+ if (!cPluginManager::CallFirstService("MainMenuHooksPatch-v1.0::osChannels", &menu)) -+ menu = new cMenuChannels; -+ else -+ state = osContinue; -+ break; -+ case osTimers: -+ if (!cPluginManager::CallFirstService("MainMenuHooksPatch-v1.0::osTimers", &menu)) -+ menu = new cMenuTimers; -+ else -+ state = osContinue; -+ break; -+ case osRecordings: -+ if (!cPluginManager::CallFirstService("MainMenuHooksPatch-v1.0::osRecordings", &menu)) -+ menu = new cMenuRecordings; -+ else -+ state = osContinue; -+ break; -+ case osSetup: menu = new cMenuSetup; break; -+ case osCommands: menu = new cMenuCommands(tr("Commands"), &Commands); break; - case osStopRecord: if (Interface->Confirm(tr("Stop recording?"))) { - cOsdItem *item = Get(Current()); - if (item) { -@@ -3154,6 +3191,12 @@ - default: break; - } - } -+ if (menu) { -+ if (menu->IsMenu()) -+ return AddSubMenu((cOsdMenu *) menu); -+ pluginOsdObject = menu; -+ return osPlugin; -+ } - if (!HasSubMenu() && Update(HadSubMenu)) - Display(); - if (Key != kNone) { -diff -ru vdr-1.6.0.orig/config.h vdr-1.6.0/config.h ---- vdr-1.6.0.orig/config.h 2008-03-23 11:26:10.000000000 +0100 -+++ vdr-1.6.0/config.h 2010-10-11 20:32:25.000000000 +0200 -@@ -36,3 +36,7 @@ - // plugins to work with newer versions of the core VDR as long as no - // VDR header files have changed. -+ -+// The MainMenuHook Patch's version number: -+#define MAINMENUHOOKSVERSION "1.0.1" -+#define MAINMENUHOOKSVERSNUM 10001 // Version * 10000 + Major * 100 + Minor - diff -Nru vdr-plugin-remotetimers-1.0.1/patches/vdr-1.6.0-2.0.3-MainMenuHooks-v1_0_2.diff vdr-plugin-remotetimers-1.0.2/patches/vdr-1.6.0-2.0.3-MainMenuHooks-v1_0_2.diff --- vdr-plugin-remotetimers-1.0.1/patches/vdr-1.6.0-2.0.3-MainMenuHooks-v1_0_2.diff 1970-01-01 00:00:00.000000000 +0000 +++ vdr-plugin-remotetimers-1.0.2/patches/vdr-1.6.0-2.0.3-MainMenuHooks-v1_0_2.diff 2014-03-13 08:13:18.000000000 +0000 @@ -0,0 +1,181 @@ +This is a "patch" for the Video Disk Recorder (VDR). + +* History +2012-04-06: Version 1.0.2 +- Update für aktuelle VDR-Entwickler-Versionen (Manuel Reimer) + +2010-10-15: Version 1.0.1 +- return a cOsdObject instead of its subclass cOsdMenu (thanks to + Joe_D@vdrportal) +- version number defines in config.h now follow the ususal conventions: + MAINMENUHOOKSVERSNUM is now a number, the newly added define + MAINMENUHOOKSVERSION is a string (suggested by gnapheus@vdrportal) +- patch is now based on VDR 1.6.0 +- updated documentation + +2007-02-26: Version 1.0 +- Initial revision. + +* Authors: +Tobias Grimm +Martin Prochnow +Frank Schmirler +Christian Wieninger + +* Description: +This patch allows plugins to replace the VDR mainmenus "Schedule", +"Channels", "Timers" and "Recordings" by a different implementation. + +The patch is based on a suggestion of Christian Wieninger back in 2006 +(http://www.linuxtv.org/pipermail/vdr/2006-March/008234.html). It is +meant to be an interim solution for VDR 1.4 until (maybe) VDR 1.5 +introduces an official API for this purpose. + +* Installation +Change into the VDR source directory, then issue + patch -p1 < path/to/MainMenuHooks-v1_0_1.patch +and recompile. + +* Notes for plugin authors +The following code sample shows the required plugin code for replacing +the original Schedule menu: + +bool cMyPlugin::Service(const char *Id, void *Data) +{ + cOsdMenu **menu = (cOsdMenu**) Data; + if (MySetup.replaceSchedule && + strcmp(Id, "MainMenuHooksPatch-v1.0::osSchedule") == 0) { + if (menu) + *menu = (cOsdMenu*) MainMenuAction(); + return true; + } + return false; +} + +Since patch version 1.0.1 the service call may return a cOsdObject +instead of a cOsdMenu. Use "#ifdef MAINMENUHOOKSVERSION" to detect +version 1.0.1. + +A plugin can replace more than one menu at a time. Simply replace the +call to MainMenuAction() in the sample above by appropriate code. + +Note that a plugin *should* offer a setup option which allows the user +to enable or disable the replacement. "Disabled" would be a reasonable +default setting. By testing for define MAINMENUHOOKSVERSNUM, a plugin +can leave the setup option out at compiletime. + +In case there is an internal problem when trying to open the replacement +menu, it is safe to return true even though Data is NULL. However an +OSD message should indicate the problem to the user. + +Feel free to ship this patch along with your plugin. However if you +think you need to modify the patch, we'd encourage you to contact the +authors first or at least use a service id which differs in more than +just the version number. + +diff -ru vdr-1.6.0.orig/menu.c vdr-1.6.0/menu.c +--- vdr-1.6.0.orig/menu.c 2008-03-16 12:15:28.000000000 +0100 ++++ vdr-1.6.0/menu.c 2010-10-11 20:32:25.000000000 +0200 +@@ -2973,15 +2973,31 @@ + + // Initial submenus: + ++ cOsdObject *menu = NULL; + switch (State) { +- 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 osSetup: AddSubMenu(new cMenuSetup); break; +- case osCommands: AddSubMenu(new cMenuCommands(tr("Commands"), &Commands)); break; ++ case osSchedule: ++ if (!cPluginManager::CallFirstService("MainMenuHooksPatch-v1.0::osSchedule", &menu)) ++ menu = new cMenuSchedule; ++ break; ++ case osChannels: ++ if (!cPluginManager::CallFirstService("MainMenuHooksPatch-v1.0::osChannels", &menu)) ++ menu = new cMenuChannels; ++ break; ++ case osTimers: ++ if (!cPluginManager::CallFirstService("MainMenuHooksPatch-v1.0::osTimers", &menu)) ++ menu = new cMenuTimers; ++ break; ++ case osRecordings: ++ if (!cPluginManager::CallFirstService("MainMenuHooksPatch-v1.0::osRecordings", &menu)) ++ menu = new cMenuRecordings(NULL, 0, true); ++ break; ++ case osSetup: menu = new cMenuSetup; break; ++ case osCommands: menu = new cMenuCommands(tr("Commands"), &Commands); break; + default: break; + } ++ if (menu) ++ if (menu->IsMenu()) ++ AddSubMenu((cOsdMenu *) menu); + } + + cOsdObject *cMenuMain::PluginOsdObject(void) +@@ -3096,13 +3112,34 @@ + eOSState state = cOsdMenu::ProcessKey(Key); + HadSubMenu |= HasSubMenu(); + ++ cOsdObject *menu = NULL; + switch (state) { +- case osSchedule: return AddSubMenu(new cMenuSchedule); +- case osChannels: return AddSubMenu(new cMenuChannels); +- case osTimers: return AddSubMenu(new cMenuTimers); +- case osRecordings: return AddSubMenu(new cMenuRecordings); +- case osSetup: return AddSubMenu(new cMenuSetup); +- case osCommands: return AddSubMenu(new cMenuCommands(tr("Commands"), &Commands)); ++ case osSchedule: ++ if (!cPluginManager::CallFirstService("MainMenuHooksPatch-v1.0::osSchedule", &menu)) ++ menu = new cMenuSchedule; ++ else ++ state = osContinue; ++ break; ++ case osChannels: ++ if (!cPluginManager::CallFirstService("MainMenuHooksPatch-v1.0::osChannels", &menu)) ++ menu = new cMenuChannels; ++ else ++ state = osContinue; ++ break; ++ case osTimers: ++ if (!cPluginManager::CallFirstService("MainMenuHooksPatch-v1.0::osTimers", &menu)) ++ menu = new cMenuTimers; ++ else ++ state = osContinue; ++ break; ++ case osRecordings: ++ if (!cPluginManager::CallFirstService("MainMenuHooksPatch-v1.0::osRecordings", &menu)) ++ menu = new cMenuRecordings; ++ else ++ state = osContinue; ++ break; ++ case osSetup: menu = new cMenuSetup; break; ++ case osCommands: menu = new cMenuCommands(tr("Commands"), &Commands); break; + case osStopRecord: if (Interface->Confirm(tr("Stop recording?"))) { + cOsdItem *item = Get(Current()); + if (item) { +@@ -3154,6 +3191,12 @@ + default: break; + } + } ++ if (menu) { ++ if (menu->IsMenu()) ++ return AddSubMenu((cOsdMenu *) menu); ++ pluginOsdObject = menu; ++ return osPlugin; ++ } + if (!HasSubMenu() && Update(HadSubMenu)) + Display(); + if (Key != kNone) { +diff -ru vdr-1.6.0.orig/config.h vdr-1.6.0/config.h +--- vdr-1.6.0.orig/config.h 2008-03-23 11:26:10.000000000 +0100 ++++ vdr-1.6.0/config.h 2010-10-11 20:32:25.000000000 +0200 +@@ -36,3 +36,7 @@ + // plugins to work with newer versions of the core VDR as long as no + // VDR header files have changed. ++ ++// The MainMenuHook Patch's version number: ++#define MAINMENUHOOKSVERSION "1.0.1" ++#define MAINMENUHOOKSVERSNUM 10001 // Version * 10000 + Major * 100 + Minor + diff -Nru vdr-plugin-remotetimers-1.0.1/patches/vdr-2.0.4-MainMenuHooks-v1_0_2.diff vdr-plugin-remotetimers-1.0.2/patches/vdr-2.0.4-MainMenuHooks-v1_0_2.diff --- vdr-plugin-remotetimers-1.0.1/patches/vdr-2.0.4-MainMenuHooks-v1_0_2.diff 1970-01-01 00:00:00.000000000 +0000 +++ vdr-plugin-remotetimers-1.0.2/patches/vdr-2.0.4-MainMenuHooks-v1_0_2.diff 2014-03-13 08:13:44.000000000 +0000 @@ -0,0 +1,181 @@ +This is a "patch" for the Video Disk Recorder (VDR). + +* History +2012-04-06: Version 1.0.2 +- Update für aktuelle VDR-Entwickler-Versionen (Manuel Reimer) + +2010-10-15: Version 1.0.1 +- return a cOsdObject instead of its subclass cOsdMenu (thanks to + Joe_D@vdrportal) +- version number defines in config.h now follow the ususal conventions: + MAINMENUHOOKSVERSNUM is now a number, the newly added define + MAINMENUHOOKSVERSION is a string (suggested by gnapheus@vdrportal) +- patch is now based on VDR 1.6.0 +- updated documentation + +2007-02-26: Version 1.0 +- Initial revision. + +* Authors: +Tobias Grimm +Martin Prochnow +Frank Schmirler +Christian Wieninger + +* Description: +This patch allows plugins to replace the VDR mainmenus "Schedule", +"Channels", "Timers" and "Recordings" by a different implementation. + +The patch is based on a suggestion of Christian Wieninger back in 2006 +(http://www.linuxtv.org/pipermail/vdr/2006-March/008234.html). It is +meant to be an interim solution for VDR 1.4 until (maybe) VDR 1.5 +introduces an official API for this purpose. + +* Installation +Change into the VDR source directory, then issue + patch -p1 < path/to/MainMenuHooks-v1_0_1.patch +and recompile. + +* Notes for plugin authors +The following code sample shows the required plugin code for replacing +the original Schedule menu: + +bool cMyPlugin::Service(const char *Id, void *Data) +{ + cOsdMenu **menu = (cOsdMenu**) Data; + if (MySetup.replaceSchedule && + strcmp(Id, "MainMenuHooksPatch-v1.0::osSchedule") == 0) { + if (menu) + *menu = (cOsdMenu*) MainMenuAction(); + return true; + } + return false; +} + +Since patch version 1.0.1 the service call may return a cOsdObject +instead of a cOsdMenu. Use "#ifdef MAINMENUHOOKSVERSION" to detect +version 1.0.1. + +A plugin can replace more than one menu at a time. Simply replace the +call to MainMenuAction() in the sample above by appropriate code. + +Note that a plugin *should* offer a setup option which allows the user +to enable or disable the replacement. "Disabled" would be a reasonable +default setting. By testing for define MAINMENUHOOKSVERSNUM, a plugin +can leave the setup option out at compiletime. + +In case there is an internal problem when trying to open the replacement +menu, it is safe to return true even though Data is NULL. However an +OSD message should indicate the problem to the user. + +Feel free to ship this patch along with your plugin. However if you +think you need to modify the patch, we'd encourage you to contact the +authors first or at least use a service id which differs in more than +just the version number. + +diff -ru vdr-1.6.0.orig/menu.c vdr-1.6.0/menu.c +--- vdr-1.6.0.orig/menu.c 2008-03-16 12:15:28.000000000 +0100 ++++ vdr-1.6.0/menu.c 2010-10-11 20:32:25.000000000 +0200 +@@ -2973,15 +2973,31 @@ + + // Initial submenus: + ++ cOsdObject *menu = NULL; + switch (State) { +- 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, OpenSubMenus)); break; +- case osSetup: AddSubMenu(new cMenuSetup); break; +- case osCommands: AddSubMenu(new cMenuCommands(tr("Commands"), &Commands)); break; ++ case osSchedule: ++ if (!cPluginManager::CallFirstService("MainMenuHooksPatch-v1.0::osSchedule", &menu)) ++ menu = new cMenuSchedule; ++ break; ++ case osChannels: ++ if (!cPluginManager::CallFirstService("MainMenuHooksPatch-v1.0::osChannels", &menu)) ++ menu = new cMenuChannels; ++ break; ++ case osTimers: ++ if (!cPluginManager::CallFirstService("MainMenuHooksPatch-v1.0::osTimers", &menu)) ++ menu = new cMenuTimers; ++ break; ++ case osRecordings: ++ if (!cPluginManager::CallFirstService("MainMenuHooksPatch-v1.0::osRecordings", &menu)) ++ menu = new cMenuRecordings(NULL, 0, OpenSubMenus); ++ break; ++ case osSetup: menu = new cMenuSetup; break; ++ case osCommands: menu = new cMenuCommands(tr("Commands"), &Commands); break; + default: break; + } ++ if (menu) ++ if (menu->IsMenu()) ++ AddSubMenu((cOsdMenu *) menu); + } + + cOsdObject *cMenuMain::PluginOsdObject(void) +@@ -3096,13 +3112,34 @@ + eOSState state = cOsdMenu::ProcessKey(Key); + HadSubMenu |= HasSubMenu(); + ++ cOsdObject *menu = NULL; + switch (state) { +- case osSchedule: return AddSubMenu(new cMenuSchedule); +- case osChannels: return AddSubMenu(new cMenuChannels); +- case osTimers: return AddSubMenu(new cMenuTimers); +- case osRecordings: return AddSubMenu(new cMenuRecordings); +- case osSetup: return AddSubMenu(new cMenuSetup); +- case osCommands: return AddSubMenu(new cMenuCommands(tr("Commands"), &Commands)); ++ case osSchedule: ++ if (!cPluginManager::CallFirstService("MainMenuHooksPatch-v1.0::osSchedule", &menu)) ++ menu = new cMenuSchedule; ++ else ++ state = osContinue; ++ break; ++ case osChannels: ++ if (!cPluginManager::CallFirstService("MainMenuHooksPatch-v1.0::osChannels", &menu)) ++ menu = new cMenuChannels; ++ else ++ state = osContinue; ++ break; ++ case osTimers: ++ if (!cPluginManager::CallFirstService("MainMenuHooksPatch-v1.0::osTimers", &menu)) ++ menu = new cMenuTimers; ++ else ++ state = osContinue; ++ break; ++ case osRecordings: ++ if (!cPluginManager::CallFirstService("MainMenuHooksPatch-v1.0::osRecordings", &menu)) ++ menu = new cMenuRecordings; ++ else ++ state = osContinue; ++ break; ++ case osSetup: menu = new cMenuSetup; break; ++ case osCommands: menu = new cMenuCommands(tr("Commands"), &Commands); break; + case osStopRecord: if (Interface->Confirm(tr("Stop recording?"))) { + cOsdItem *item = Get(Current()); + if (item) { +@@ -3154,6 +3191,12 @@ + default: break; + } + } ++ if (menu) { ++ if (menu->IsMenu()) ++ return AddSubMenu((cOsdMenu *) menu); ++ pluginOsdObject = menu; ++ return osPlugin; ++ } + if (!HasSubMenu() && Update(HadSubMenu)) + Display(); + if (Key != kNone) { +diff -ru vdr-1.6.0.orig/config.h vdr-1.6.0/config.h +--- vdr-1.6.0.orig/config.h 2008-03-23 11:26:10.000000000 +0100 ++++ vdr-1.6.0/config.h 2010-10-11 20:32:25.000000000 +0200 +@@ -36,3 +36,7 @@ + // plugins to work with newer versions of the core VDR as long as no + // VDR header files have changed. ++ ++// The MainMenuHook Patch's version number: ++#define MAINMENUHOOKSVERSION "1.0.1" ++#define MAINMENUHOOKSVERSNUM 10001 // Version * 10000 + Major * 100 + Minor + diff -Nru vdr-plugin-remotetimers-1.0.1/remotetimers.c vdr-plugin-remotetimers-1.0.2/remotetimers.c --- vdr-plugin-remotetimers-1.0.1/remotetimers.c 2013-08-27 09:47:00.000000000 +0000 +++ vdr-plugin-remotetimers-1.0.2/remotetimers.c 2015-07-29 19:34:58.000000000 +0000 @@ -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 @@ 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 -Nru vdr-plugin-remotetimers-1.0.1/watcher.c vdr-plugin-remotetimers-1.0.2/watcher.c --- vdr-plugin-remotetimers-1.0.1/watcher.c 2013-08-27 09:47:00.000000000 +0000 +++ vdr-plugin-remotetimers-1.0.2/watcher.c 2015-07-29 19:31:37.000000000 +0000 @@ -44,7 +44,11 @@ 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 @@ // 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); }