diff options
author | andreas 'randy' weinberger <vdr@smue.org> | 2011-01-01 14:51:33 +0100 |
---|---|---|
committer | andreas 'randy' weinberger <vdr@smue.org> | 2011-01-01 14:51:33 +0100 |
commit | b5ed30d0f422f572b7e36968a9182b8f2ecdb134 (patch) | |
tree | 9f51ac93dfb9595a3f7c9d574df33d9f3f43ec8a /plugin.c | |
parent | 07df0b7d65164254613e77c93ff75e045be0955a (diff) | |
download | vdr-plugin-graphlcd-b5ed30d0f422f572b7e36968a9182b8f2ecdb134.tar.gz vdr-plugin-graphlcd-b5ed30d0f422f572b7e36968a9182b8f2ecdb134.tar.bz2 |
added SVDRP patch from TomJoad
see http://projects.vdr-developer.org/issues/488
Diffstat (limited to 'plugin.c')
-rw-r--r-- | plugin.c | 46 |
1 files changed, 45 insertions, 1 deletions
@@ -22,7 +22,7 @@ #include <vdr/plugin.h> -static const char *VERSION = "0.1.9-pre (git 2010/11)"; +static const char *VERSION = "0.1.9-pre (git 20110101)"; static const char *DESCRIPTION = "Output to graphic LCD"; static const char *MAINMENUENTRY = NULL; @@ -52,6 +52,8 @@ public: virtual cOsdObject * MainMenuAction(); virtual cMenuSetupPage * SetupMenu(); virtual bool SetupParse(const char * Name, const char * Value); + virtual const char **SVDRPHelpPages(void); + virtual cString SVDRPCommand(const char *Command, const char *Option, int &ReplyCode); }; cPluginGraphLCD::cPluginGraphLCD() @@ -240,4 +242,46 @@ bool cPluginGraphLCD::SetupParse(const char * Name, const char * Value) return true; } +const char **cPluginGraphLCD::SVDRPHelpPages(void) +{ + static const char *HelpPages[] = { + "CLS Clear Display.", + "UPD Update Display.", + "OFF Switch Plugin off.", + "ON Switch Plugin on.", + NULL + }; + return HelpPages; +} + +cString cPluginGraphLCD::SVDRPCommand(const char *Command, const char *Option, int &ReplyCode) +{ + if (strcasecmp(Command, "CLS") == 0) { + if (GraphLCDSetup.PluginActive == 1) { + return "Error: Plugin is active."; + } else { + mDisplay->Clear(); + return "GraphLCD cleared."; + }; + } + if (strcasecmp(Command, "UPD") == 0) { + if (GraphLCDSetup.PluginActive == 0) { + return "Error: Plugin is not active."; + } else { + mDisplay->Update(); + return "GraphLCD updated."; + }; + } + + if (strcasecmp(Command, "OFF") == 0) { + GraphLCDSetup.PluginActive = 0; + return "GraphLCD Plugin switched off."; + } + if (strcasecmp(Command, "ON") == 0) { + GraphLCDSetup.PluginActive = 1; + return "GraphLCD Plugin switched on."; + } + return NULL; +} + VDRPLUGINCREATOR(cPluginGraphLCD); // Don't touch this! |