From b5ed30d0f422f572b7e36968a9182b8f2ecdb134 Mon Sep 17 00:00:00 2001 From: andreas 'randy' weinberger Date: Sat, 1 Jan 2011 14:51:33 +0100 Subject: added SVDRP patch from TomJoad see http://projects.vdr-developer.org/issues/488 --- README | 17 +++++++++++++++++ display.c | 8 ++++++++ display.h | 1 + plugin.c | 46 +++++++++++++++++++++++++++++++++++++++++++++- 4 files changed, 71 insertions(+), 1 deletion(-) diff --git a/README b/README index f2024c3..9cdf815 100644 --- a/README +++ b/README @@ -187,6 +187,23 @@ Scroll time interval: (Possible values: 100 <= x <= 2000) +SVDRP Commands: +--------------- +svdrpsend.pl "PLUG graphlcd ", where CMD is: + +ON + Switch Plugin on + +OFF + Switch Plugin off + +UPD + Update LCD Content, Plugin must be active. + +CLS + Clear LCD Content (aka blank screen), Plugin must not be active. + + Changing Fonts: --------------- It's very easy to change the fonts that are used by graphlcd. diff --git a/display.c b/display.c index 37361f0..0b437d5 100644 --- a/display.c +++ b/display.c @@ -732,6 +732,13 @@ void cGraphLCDDisplay::Update() update = true; } +void cGraphLCDDisplay::Clear() +{ + bitmap->Clear(); + mLcd->SetScreen(bitmap->Data(), bitmap->Width(), bitmap->Height(), bitmap->LineSize()); + mLcd->Refresh(false); +} + void cGraphLCDDisplay::DisplayTime() { static char buffer[32]; @@ -2022,3 +2029,4 @@ const char * cGraphLCDDisplay::Convert(const char *s) return s_converted; } + diff --git a/display.h b/display.h index a9a1354..9074f2a 100644 --- a/display.h +++ b/display.h @@ -65,6 +65,7 @@ public: void SetVolume(int Volume, bool Absolute); void Update(); + void Clear(); protected: virtual void Action(); diff --git a/plugin.c b/plugin.c index 582b577..2a06a1d 100644 --- a/plugin.c +++ b/plugin.c @@ -22,7 +22,7 @@ #include -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! -- cgit v1.2.3