diff options
author | Johns <johns98@gmx.net> | 2012-01-12 15:20:01 +0100 |
---|---|---|
committer | Johns <johns98@gmx.net> | 2012-01-12 15:20:01 +0100 |
commit | 19a37bb0bf64be87d39e0a5d1d398ae4958ba888 (patch) | |
tree | bc6b8ac5050b84642f6dffaf4bf2b70c97751543 /softhddevice.cpp | |
parent | 2087968d55287078a5ec6976a1b02739cb30b0fc (diff) | |
download | vdr-plugin-softhddevice-19a37bb0bf64be87d39e0a5d1d398ae4958ba888.tar.gz vdr-plugin-softhddevice-19a37bb0bf64be87d39e0a5d1d398ae4958ba888.tar.bz2 |
Add SVDRP support.
Diffstat (limited to 'softhddevice.cpp')
-rw-r--r-- | softhddevice.cpp | 40 |
1 files changed, 38 insertions, 2 deletions
diff --git a/softhddevice.cpp b/softhddevice.cpp index d34daea..52fefb2 100644 --- a/softhddevice.cpp +++ b/softhddevice.cpp @@ -773,7 +773,9 @@ class cPluginSoftHdDevice:public cPlugin virtual cOsdObject *MainMenuAction(void); virtual cMenuSetupPage *SetupMenu(void); virtual bool SetupParse(const char *, const char *); -// virtual bool Service(const char *Id, void *Data = NULL); +// virtual bool Service(const char *, void * = NULL); + virtual const char **SVDRPHelpPages(void); + virtual cString SVDRPCommand(const char *, const char *, int &); }; cPluginSoftHdDevice::cPluginSoftHdDevice(void) @@ -908,7 +910,6 @@ void cPluginSoftHdDevice::MainThreadHook(void) cDevice::SetPrimaryDevice(MyDevice->DeviceNumber() + 1); DoMakePrimary = 0; } - // check if user is inactive, automatic enter suspend mode if (ShutdownHandler.IsUserInactive()) { // this is regular called, but guarded against double calls @@ -1002,4 +1003,39 @@ bool cPluginSoftHdDevice::Service(const char *Id, void *Data) #endif +//---------------------------------------------------------------------------- +// cPlugin SVDRP +//---------------------------------------------------------------------------- + +/** +** Return SVDRP commands help pages. +** +** return a pointer to a list of help strings for all of the plugin's +** SVDRP commands. +*/ +const char **cPluginSoftHdDevice::SVDRPHelpPages(void) +{ + // FIXME: translation? + static const char *text[] = { + "SUSP\n", + " Suspend plugin", + NULL + }; + + return text; +} + +/** +** Handle SVDRP commands. +*/ +cString cPluginSoftHdDevice::SVDRPCommand(const char *command, + const char *option, int &reply_code) +{ + if (!strcasecmp(command, "SUSP")) { + Suspend(); + return "SoftHdDevice is suspended"; + } + return NULL; +} + VDRPLUGINCREATOR(cPluginSoftHdDevice); // Don't touch this! |