diff options
author | mrwastl <mrwastl@users.sourceforge.net> | 2011-09-17 21:28:10 +0200 |
---|---|---|
committer | mrwastl <mrwastl@users.sourceforge.net> | 2011-09-17 21:28:10 +0200 |
commit | 0703b948dd63eb281df5dc531abdf66818becdf7 (patch) | |
tree | b76b3ba4634a95ed71c0dd2ab1e1a4354109870d /plugin.c | |
parent | 9e0f177243221e2123758d196315cb63d0f8902b (diff) | |
download | vdr-plugin-graphlcd-0703b948dd63eb281df5dc531abdf66818becdf7.tar.gz vdr-plugin-graphlcd-0703b948dd63eb281df5dc531abdf66818becdf7.tar.bz2 |
cExtData is now a singleton class, thus its content survives a DISCONN/CONNECT of a display; trans() now works as expected; three new tokens: 'IsMenuList', 'MenuText', 'MenuTextScroll'; support added for ':clean' and ':rest' for tokens 'MenuTitle', 'MenuCurrent', and 'MenuText'
Diffstat (limited to 'plugin.c')
-rw-r--r-- | plugin.c | 13 |
1 files changed, 9 insertions, 4 deletions
@@ -24,6 +24,7 @@ #include "display.h" #include "global.h" #include "menu.h" +#include "extdata.h" #include <vdr/plugin.h> @@ -53,6 +54,7 @@ private: std::string mSkinName; GLCD::cDriver * mLcd; cGraphLCDDisplay * mDisplay; + cExtData * mExtData; uint64_t to_timestamp; bool ConnectDisplay(); @@ -85,11 +87,14 @@ cPluginGraphLCD::cPluginGraphLCD() mLcd(NULL), mDisplay(NULL) { + mExtData = cExtData::GetExtData(); } cPluginGraphLCD::~cPluginGraphLCD() { DisconnectDisplay(); + mExtData->ReleaseExtData(); + mExtData = NULL; } const char * cPluginGraphLCD::CommandLineHelp() @@ -361,7 +366,7 @@ cString cPluginGraphLCD::SVDRPCommand(const char *Command, const char *Option, i if (firstpos != std::string::npos) { std::string key = option.substr(0, firstpos); if ( isalpha(key[0]) ) { - mDisplay->GetExtData()->Set(key, option.substr(firstpos+1)); + mExtData->Set(key, option.substr(firstpos+1)); return "SET ok"; } } @@ -373,7 +378,7 @@ cString cPluginGraphLCD::SVDRPCommand(const char *Command, const char *Option, i std::string value = option.substr(secondpos+1); if ( isalpha(key[0]) && isdigit(option[0]) ) { uint32_t expsec = (uint32_t)strtoul( option.substr(0, firstpos).c_str(), NULL, 10); - mDisplay->GetExtData()->Set( key, value, expsec ); + mExtData->Set( key, value, expsec ); return "SETEXP ok"; } } @@ -381,7 +386,7 @@ cString cPluginGraphLCD::SVDRPCommand(const char *Command, const char *Option, i } else if (strcasecmp(Command, "UNSET") == 0) { if (firstpos == std::string::npos) { - mDisplay->GetExtData()->Unset( option ); + mExtData->Unset( option ); return "UNSET ok"; } else { return "UNSET requires exactly one parameter: UNSET <key>."; @@ -389,7 +394,7 @@ cString cPluginGraphLCD::SVDRPCommand(const char *Command, const char *Option, i } else if (strcasecmp(Command, "GET") == 0) { if (firstpos == std::string::npos) { - std::string res = mDisplay->GetExtData()->Get( option ); + std::string res = mExtData->Get( option ); std::string retval = "GET "; retval.append(option); retval.append(": "); if (res != "" ) { retval.append(res); |