Add support for svdr command "stat".

This commit is contained in:
mini73 2012-04-20 16:51:04 +02:00 committed by Johns
parent 3e39ffd5e0
commit 24a8c7f763
2 changed files with 47 additions and 16 deletions

View File

@ -1,6 +1,14 @@
User johns
Date:
User mini73
Date: Fri Apr 20 16:51:14 CEST 2012
Add support for svdr command "stat".
User johns
Date: Fri Apr 20 16:05:40 CEST 2012
Made showing black picture configurable.
Show black picture, if no video stream is available.
Setup split into foldable sections.

View File

@ -734,8 +734,8 @@ eOSState cMenuSetupSoft::ProcessKey(eKeys key)
if (key != kNone) {
// update menu only, if something on the structure has changed
// this needed because VDR menus are evil slow
if (old_general != General || old_video != Video
|| old_audio != Audio || old_video_format != VideoFormat) {
if (old_general != General || old_video != Video || old_audio != Audio
|| old_video_format != VideoFormat) {
Create(); // update menu
} else {
for (i = 0; i < RESOLUTIONS; ++i) {
@ -843,8 +843,9 @@ void cMenuSetupSoft::Store(void)
SetupStore("VideoFormat", Setup.VideoFormat);
if (Setup.VideoDisplayFormat != VideoDisplayFormat) {
Setup.VideoDisplayFormat = VideoDisplayFormat;
cDevice::PrimaryDevice()->SetVideoDisplayFormat(
eVideoDisplayFormat(Setup.VideoDisplayFormat));
cDevice::
PrimaryDevice()->SetVideoDisplayFormat(eVideoDisplayFormat
(Setup.VideoDisplayFormat));
printf("video-display-format\n");
}
SetupStore("VideoDisplayFormat", Setup.VideoDisplayFormat);
@ -910,12 +911,15 @@ void cMenuSetupSoft::Store(void)
SetupStore("AudioSoftvol", ConfigAudioSoftvol = AudioSoftvol);
AudioSetSoftvol(ConfigAudioSoftvol);
SetupStore("AudioNormalize", ConfigAudioNormalize = AudioNormalize);
SetupStore("AudioMaxNormalize", ConfigAudioMaxNormalize = AudioMaxNormalize );
SetupStore("AudioMaxNormalize", ConfigAudioMaxNormalize =
AudioMaxNormalize);
AudioSetNormalize(ConfigAudioNormalize, ConfigAudioMaxNormalize);
SetupStore("AudioCompression", ConfigAudioCompression = AudioCompression);
SetupStore("AudioMaxCompression", ConfigAudioMaxCompression = AudioMaxCompression );
SetupStore("AudioMaxCompression", ConfigAudioMaxCompression =
AudioMaxCompression);
AudioSetCompression(ConfigAudioCompression, ConfigAudioMaxCompression);
SetupStore("AudioStereoDescent", ConfigAudioStereoDescent = AudioStereoDescent );
SetupStore("AudioStereoDescent", ConfigAudioStereoDescent =
AudioStereoDescent);
AudioSetStereoDescent(ConfigAudioStereoDescent);
SetupStore("AudioBufferTime", ConfigAudioBufferTime = AudioBufferTime);
}
@ -2113,6 +2117,12 @@ static const char *SVDRPHelpText[] = {
" 30: stretch 4:3 to 16:9\n 31: pillar box 4:3 in 16:9\n"
" 32: center cut-out 4:3 to 16:9\n"
" 39: rotate 4:3 to 16:9 zoom mode\n",
"STAT\n" " Display SuspendMode of the plugin.\n\n"
" reply code is 910 + SuspendMode\n"
" SUSPEND_EXTERNAL == -1 (909)\n"
" NOT_SUSPENDED == 0 (910)\n"
" SUSPEND_NORMAL == 1 (911)\n"
" SUSPEND_DETACHED == 2 (912)\n",
NULL
};
@ -2137,6 +2147,19 @@ const char **cPluginSoftHdDevice::SVDRPHelpPages(void)
cString cPluginSoftHdDevice::SVDRPCommand(const char *command,
const char *option, __attribute__ ((unused)) int &reply_code)
{
if (!strcasecmp(command, "STAT")) {
reply_code = 910 + SuspendMode;
switch (SuspendMode) {
case SUSPEND_EXTERNAL:
return "SuspendMode is SUSPEND_EXTERNAL";
case NOT_SUSPENDED:
return "SuspendMode is NOT_SUSPENDED";
case SUSPEND_NORMAL:
return "SuspendMode is SUSPEND_NORMAL";
case SUSPEND_DETACHED:
return "SuspendMode is SUSPEND_DETACHED";
}
}
if (!strcasecmp(command, "SUSP")) {
if (cSoftHdControl::Player) { // already suspended
return "SoftHdDevice already suspended";