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 | |
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.
-rw-r--r-- | CONTRIBUTORS | 1 | ||||
-rw-r--r-- | HISTORY | 2 | ||||
-rw-r--r-- | dxr3.c | 81 | ||||
-rw-r--r-- | dxr3device.c | 10 | ||||
-rw-r--r-- | dxr3interface.c | 18 | ||||
-rw-r--r-- | dxr3interface.h | 1 |
6 files changed, 100 insertions, 13 deletions
diff --git a/CONTRIBUTORS b/CONTRIBUTORS index 9ccc309..c37d05d 100644 --- a/CONTRIBUTORS +++ b/CONTRIBUTORS @@ -21,6 +21,7 @@ Lars Neufurth (donated some money for Christian's DD 5.1 system) Andre Neumann Luca Olivetti Richard P. +Krzysztof Parma Miika Pekkarinen Diego Pierotto Teemu Rantanen @@ -345,3 +345,5 @@ NOTE: I havent found time to include all of the languages, will be done in pre2 - Update Italian translation (Diego Pierotto) - Error handling improvements (Ville Skyttä) +- Add SVDRP commands for device release/reopen, audio output settings, + brightness/contrast/saturation (Krzysztof Parma, Ville Skyttä) @@ -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: diff --git a/dxr3device.c b/dxr3device.c index c7ad807..62045c2 100644 --- a/dxr3device.c +++ b/dxr3device.c @@ -106,16 +106,6 @@ bool cDxr3Device::SetPlayMode(ePlayMode PlayMode) m_DemuxDevice.Stop(); } - // TODO: what about AC3??? - if (cDxr3ConfigData::Instance().GetUseDigitalOut()) - { - cDxr3Interface::Instance().SetAudioDigitalPCM(); - } - else - { - cDxr3Interface::Instance().SetAudioAnalog(); - } - return true; } diff --git a/dxr3interface.c b/dxr3interface.c index 5574bea..a92ec3b 100644 --- a/dxr3interface.c +++ b/dxr3interface.c @@ -890,6 +890,8 @@ void cDxr3Interface::ExternalReopenDevices() SetChannelCount(1); m_ExternalReleased = false; + + ConfigureDeviceAudio(); } Resuscitation(); @@ -1044,8 +1046,20 @@ void cDxr3Interface::ConfigureDevice() exit(1); } - // set audio mode - if (!cDxr3ConfigData::Instance().GetUseDigitalOut()) + ConfigureDeviceAudio(); +} + +// ================================== +//! setup device audio based on config +void cDxr3Interface::ConfigureDeviceAudio() +{ + // TODO: AC3? + if (cDxr3ConfigData::Instance().GetUseDigitalOut()) + { + dsyslog("dxr3: configure: audio mode: digital"); + SetAudioDigitalPCM(); + } + else { dsyslog("dxr3: configure: audio mode: analog"); SetAudioAnalog(); diff --git a/dxr3interface.h b/dxr3interface.h index 6b432c8..70e9132 100644 --- a/dxr3interface.h +++ b/dxr3interface.h @@ -207,6 +207,7 @@ private: void UploadMicroCode(); void ConfigureDevice(); + void ConfigureDeviceAudio(); void ResampleVolume(short* pcmbuf, int size); void ClaimDevices(); void ReleaseDevices(); |