summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--display.c11
-rw-r--r--display.h1
-rw-r--r--plugin.c44
3 files changed, 56 insertions, 0 deletions
diff --git a/display.c b/display.c
index 3c4dc2f..8802a7f 100644
--- a/display.c
+++ b/display.c
@@ -482,3 +482,14 @@ void cGraphLCDDisplay::ForceUpdateBrightness() {
bBrightnessActive = true;
SetBrightness();
}
+
+
+void cGraphLCDDisplay::Clear() {
+ mScreen->Clear();
+#ifdef GRAPHLCD_CBITMAP_ARGB
+ mLcd->SetScreen(mScreen->Data(), mScreen->Width(), mScreen->Height());
+#else
+ mLcd->SetScreen(mScreen->Data(), mScreen->Width(), mScreen->Height(), mScreen->LineSize());
+#endif
+ mLcd->Refresh(false);
+}
diff --git a/display.h b/display.h
index 6f5c8e6..9d39c2b 100644
--- a/display.h
+++ b/display.h
@@ -57,6 +57,7 @@ public:
bool Initialise(GLCD::cDriver * Lcd, const std::string & CfgPath, const std::string & SkinsPath, const std::string & SkinName);
void Tick();
void Update();
+ void Clear();
void Replaying(bool Starting);
void SetMenuClear();
void SetMenuTitle();
diff --git a/plugin.c b/plugin.c
index bdeea86..b81fbdd 100644
--- a/plugin.c
+++ b/plugin.c
@@ -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;