diff options
author | scop <scop> | 2008-12-28 20:51:31 +0000 |
---|---|---|
committer | scop <scop> | 2008-12-28 20:51:31 +0000 |
commit | 8a3752ff7c72ce23d20a712a89118ce70c833085 (patch) | |
tree | 84ece21db7bb030a7326abfc2da4db2b1d4b286d /dxr3.c | |
parent | 48c50ddec73b9914fbe76828722e8fb84e2f2e35 (diff) | |
download | vdr-plugin-dxr3-8a3752ff7c72ce23d20a712a89118ce70c833085.tar.gz vdr-plugin-dxr3-8a3752ff7c72ce23d20a712a89118ce70c833085.tar.bz2 |
Add bunch of SVDRP commands based on patch from Krzysztof Parma, reconfigure device audio on external reopen.
Diffstat (limited to 'dxr3.c')
-rw-r--r-- | dxr3.c | 81 |
1 files changed, 80 insertions, 1 deletions
@@ -3,7 +3,7 @@ * * See the README file for copyright information and how to reach the author. * - * $Id: dxr3.c,v 1.1.2.36 2008/04/06 18:52:18 scop Exp $ + * $Id: dxr3.c,v 1.1.2.37 2008/12/28 20:51:32 scop Exp $ * */ @@ -152,6 +152,10 @@ public: const char* MainMenuEntry(); cOsdObject* MainMenuAction(); + virtual const char **SVDRPHelpPages(void); + virtual cString SVDRPCommand(const char *Command, const char *Option, + int &ReplyCode); + cMenuSetupPage *SetupMenu(); bool SetupParse(const char *Name, const char *Value); }; @@ -251,6 +255,81 @@ cOsdObject* cPluginDxr3::MainMenuAction() return new cDxr3OsdMenu; } +// ================================== +// TODO: localize command descriptions? +const char **cPluginDxr3::SVDRPHelpPages(void) +{ + static const char *HelpPages[] = { + "DON\n" + " Start DXR3.", + "DOF\n" + " Stop DXR3.", + "SAT\n" + " Set saturation (0..999).", + "CON\n" + " Set contrast (0..999).", + "BRI\n" + " Set brightness (0..999).", + "SAO\n" + " Switch to analog audio output.", + "SDO\n" + " Switch to digital PCM audio output.", + "SAC3\n" + " Switch to digital AC3 audio output.", + NULL + }; + + return HelpPages; +} + +// TODO: localize returned strings? +cString cPluginDxr3::SVDRPCommand(const char *Command, const char *Option, + int &ReplyCode) +{ + if (!strcasecmp(Command, "DON")) + { + cDxr3Interface::Instance().ExternalReopenDevices(); + return "DXR3 started"; + } + if (!strcasecmp(Command, "DOF")) + { + cDxr3Interface::Instance().ExternalReleaseDevices(); + return "DXR3 stopped"; + } + if (!strcasecmp(Command, "BRI")) + { + cDxr3Interface::Instance().SetBrightness(atoi(Option)); + return "Brightness set"; + } + if (!strcasecmp(Command, "CON")) + { + cDxr3Interface::Instance().SetContrast(atoi(Option)); + return "Contrast set"; + } + if (!strcasecmp(Command, "SAT")) + { + cDxr3Interface::Instance().SetSaturation(atoi(Option)); + return "Saturation set"; + } + if (!strcasecmp(Command, "SDO")) + { + cDxr3Interface::Instance().SetAudioDigitalPCM(); + return "Switched to digital PCM audio output"; + } + if (!strcasecmp(Command, "SAO")) + { + cDxr3Interface::Instance().SetAudioAnalog(); + return "Switched to analog audio output"; + } + if (!strcasecmp(Command, "SAC3")) + { + cDxr3Interface::Instance().SetAudioDigitalAC3(); + return "Switched to digital AC3 audio output"; + } + + return NULL; +} + VDRPLUGINCREATOR(cPluginDxr3); // Don't touch this! // Local variables: |