diff options
author | mrwastl <mrwastl@users.sourceforge.net> | 2011-05-03 22:58:16 +0200 |
---|---|---|
committer | mrwastl <mrwastl@users.sourceforge.net> | 2011-05-03 22:58:16 +0200 |
commit | aa5e2205bbc3a7abc05fc50854ba086777541f13 (patch) | |
tree | 61dc2f4023e3e68b6c94fb2534f85debd15064ea /plugin.c | |
parent | b66325c1c80cb4b03ab981a431684c01e259d111 (diff) | |
download | vdr-plugin-graphlcd-aa5e2205bbc3a7abc05fc50854ba086777541f13.tar.gz vdr-plugin-graphlcd-aa5e2205bbc3a7abc05fc50854ba086777541f13.tar.bz2 |
added extended SVDRP patch (issue 488)
Diffstat (limited to 'plugin.c')
-rw-r--r-- | plugin.c | 44 |
1 files changed, 44 insertions, 0 deletions
@@ -53,6 +53,8 @@ public: virtual bool Initialize(); virtual bool Start(); virtual void Housekeeping(); + virtual const char **SVDRPHelpPages(void); + virtual cString SVDRPCommand(const char *Command, const char *Option, int &ReplyCode); virtual void MainThreadHook(void); virtual const char * MainMenuEntry() { return MAINMENUENTRY; } virtual cOsdObject * MainMenuAction(); @@ -223,6 +225,48 @@ void cPluginGraphLCD::MainThreadHook() mDisplay->Tick(); } +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; +} + cOsdObject * cPluginGraphLCD::MainMenuAction() { return NULL; |