Re: [vdr] Patch: Add 'MUTEON' and 'MUTEOFF' options to the SVDRP VOLU command

2013-03-22 Thread Klaus Schmidinger

On 21.03.2013 20:48, Sebastian Frei wrote:

Hi all,

I made a tiny patch to extend the SVDRP VOLU command.


There will be no more changes for version 2.0.
I'll look at this again after that.


Up until now VDR only had an option to _toggle_ the current audio muted status,
but no options to force the audio muted status on or off. I want to mute the
audio via SVDRP and unmute it again later.

My usecase: I'm running mpd on the same host as VDR, if I start playing music
with mpd from my tablet I can mute VDR automatically with a shell script and
unmute it again after stopping the music.
Using the (already implemented) VOLU 0 command also mutes the audio, but the
previous audio volume gets lost, so you cannot unmute audio again and return to
the previous volume.


You could query the current volume level with a plain VOLU command, store that
value and use it later.

Klaus

___
vdr mailing list
vdr@linuxtv.org
http://www.linuxtv.org/cgi-bin/mailman/listinfo/vdr


[vdr] Patch: Add 'MUTEON' and 'MUTEOFF' options to the SVDRP VOLU command

2013-03-21 Thread Sebastian Frei
Hi all,

I made a tiny patch to extend the SVDRP VOLU command.
Up until now VDR only had an option to _toggle_ the current audio muted status,
but no options to force the audio muted status on or off. I want to mute the
audio via SVDRP and unmute it again later.

My usecase: I'm running mpd on the same host as VDR, if I start playing music
with mpd from my tablet I can mute VDR automatically with a shell script and
unmute it again after stopping the music.
Using the (already implemented) VOLU 0 command also mutes the audio, but the
previous audio volume gets lost, so you cannot unmute audio again and return to
the previous volume.

Best regards
Sebastian

--- vdr-1.7.41/svdrp.c  2013-02-17 14:17:36.0 +0100
+++ vdr-1.7.41.mute/svdrp.c 2013-03-21 20:30:53.440746278 +0100
@@ -317,12 +317,13 @@
   UPDR\n
   Initiates a re-read of the recordings directory, which is the SVDRP\n
   equivalent to 'touch .update'.,
-  VOLU [ number | + | - | mute ]\n
+  VOLU [ number | + | - | mute | muteon | muteoff ]\n
   Set the audio volume to the given number (which is limited to the 
range\n
   0...255). If the special options '+' or '-' are given, the volume 
will\n
   be turned up or down, respectively. The option 'mute' will toggle the\n
-  audio muting. If no option is given, the current audio volume level 
will\n
-  be returned.,
+  audio muting, 'muteon' will turn muting on, 'muteoff' will turn 
muting\n
+  off.  If no option is given, the current audio volume level will be\n
+  returned.,
   QUIT\n
   Exit vdr (SVDRP).\n
   You can also hit Ctrl-D to exit.,
@@ -1609,6 +1610,10 @@
 cDevice::PrimaryDevice()-SetVolume(-VOLUMEDELTA);
  else if (strcasecmp(Option, MUTE) == 0)
 cDevice::PrimaryDevice()-ToggleMute();
+ else if ((strcasecmp(Option, MUTEON) == 
0)(!cDevice::PrimaryDevice()-IsMute()))
+cDevice::PrimaryDevice()-ToggleMute();
+ else if ((strcasecmp(Option, MUTEOFF) == 
0)(cDevice::PrimaryDevice()-IsMute()))
+cDevice::PrimaryDevice()-ToggleMute();
  else {
 Reply(501, Unknown option: \%s\, Option);
 return;--- vdr-1.7.41/svdrp.c	2013-02-17 14:17:36.0 +0100
+++ vdr-1.7.41.mute/svdrp.c	2013-03-21 20:30:53.440746278 +0100
@@ -317,12 +317,13 @@
   UPDR\n
   Initiates a re-read of the recordings directory, which is the SVDRP\n
   equivalent to 'touch .update'.,
-  VOLU [ number | + | - | mute ]\n
+  VOLU [ number | + | - | mute | muteon | muteoff ]\n
   Set the audio volume to the given number (which is limited to the range\n
   0...255). If the special options '+' or '-' are given, the volume will\n
   be turned up or down, respectively. The option 'mute' will toggle the\n
-  audio muting. If no option is given, the current audio volume level will\n
-  be returned.,
+  audio muting, 'muteon' will turn muting on, 'muteoff' will turn muting\n
+  off.  If no option is given, the current audio volume level will be\n
+  returned.,
   QUIT\n
   Exit vdr (SVDRP).\n
   You can also hit Ctrl-D to exit.,
@@ -1609,6 +1610,10 @@
 cDevice::PrimaryDevice()-SetVolume(-VOLUMEDELTA);
  else if (strcasecmp(Option, MUTE) == 0)
 cDevice::PrimaryDevice()-ToggleMute();
+ else if ((strcasecmp(Option, MUTEON) == 0)(!cDevice::PrimaryDevice()-IsMute()))
+cDevice::PrimaryDevice()-ToggleMute();
+ else if ((strcasecmp(Option, MUTEOFF) == 0)(cDevice::PrimaryDevice()-IsMute()))
+cDevice::PrimaryDevice()-ToggleMute();
  else {
 Reply(501, Unknown option: \%s\, Option);
 return;
___
vdr mailing list
vdr@linuxtv.org
http://www.linuxtv.org/cgi-bin/mailman/listinfo/vdr


Re: [vdr] Patch: Add 'MUTEON' and 'MUTEOFF' options to the SVDRP VOLU command

2013-03-21 Thread Hardy Flor

Hi Sebastian Frei,

with  ... (!cDevice::PrimaryDevice()-IsMute())) is the command not 
recognized and the string Unknown option: MuteON will return, when you 
call svdr more than one with MuteON.


Hardy


___
vdr mailing list
vdr@linuxtv.org
http://www.linuxtv.org/cgi-bin/mailman/listinfo/vdr


Re: [vdr] Patch: Add 'MUTEON' and 'MUTEOFF' options to the SVDRP VOLU command

2013-03-21 Thread Sebastian Frei
Hi Hardy,

yes you are right.

This one should be better:

--- vdr-1.7.41/svdrp.c  2013-02-17 14:17:36.0 +0100
+++ vdr-1.7.41.mute/svdrp.c 2013-03-21 21:58:34.226895799 +0100
@@ -317,12 +317,13 @@
   UPDR\n
   Initiates a re-read of the recordings directory, which is the SVDRP\n
   equivalent to 'touch .update'.,
-  VOLU [ number | + | - | mute ]\n
+  VOLU [ number | + | - | mute | muteon | muteoff ]\n
   Set the audio volume to the given number (which is limited to the 
range\n
   0...255). If the special options '+' or '-' are given, the volume 
will\n
   be turned up or down, respectively. The option 'mute' will toggle the\n
-  audio muting. If no option is given, the current audio volume level 
will\n
-  be returned.,
+  audio muting, 'muteon' will turn muting on, 'muteoff' will turn 
muting\n
+  off.  If no option is given, the current audio volume level will be\n
+  returned.,
   QUIT\n
   Exit vdr (SVDRP).\n
   You can also hit Ctrl-D to exit.,
@@ -1609,6 +1610,12 @@
 cDevice::PrimaryDevice()-SetVolume(-VOLUMEDELTA);
  else if (strcasecmp(Option, MUTE) == 0)
 cDevice::PrimaryDevice()-ToggleMute();
+ else if ((strcasecmp(Option, MUTEON) == 0)
+if (!cDevice::PrimaryDevice()-IsMute()))
+  cDevice::PrimaryDevice()-ToggleMute();
+ else if ((strcasecmp(Option, MUTEOFF) == 0)
+if (cDevice::PrimaryDevice()-IsMute()))
+  cDevice::PrimaryDevice()-ToggleMute();
  else {
 Reply(501, Unknown option: \%s\, Option);
 return;


Best regards

Sebastian

Am Donnerstag, 21. März 2013, 21:40:06 schrieb Hardy Flor:
 Hi Sebastian Frei,
 
 with  ... (!cDevice::PrimaryDevice()-IsMute())) is the command not
 recognized and the string Unknown option: MuteON will return, when you
 call svdr more than one with MuteON.
 
 Hardy
 
 
 ___
 vdr mailing list
 vdr@linuxtv.org
 http://www.linuxtv.org/cgi-bin/mailman/listinfo/vdr--- vdr-1.7.41/svdrp.c	2013-02-17 14:17:36.0 +0100
+++ vdr-1.7.41.mute/svdrp.c	2013-03-21 21:58:34.226895799 +0100
@@ -317,12 +317,13 @@
   UPDR\n
   Initiates a re-read of the recordings directory, which is the SVDRP\n
   equivalent to 'touch .update'.,
-  VOLU [ number | + | - | mute ]\n
+  VOLU [ number | + | - | mute | muteon | muteoff ]\n
   Set the audio volume to the given number (which is limited to the range\n
   0...255). If the special options '+' or '-' are given, the volume will\n
   be turned up or down, respectively. The option 'mute' will toggle the\n
-  audio muting. If no option is given, the current audio volume level will\n
-  be returned.,
+  audio muting, 'muteon' will turn muting on, 'muteoff' will turn muting\n
+  off.  If no option is given, the current audio volume level will be\n
+  returned.,
   QUIT\n
   Exit vdr (SVDRP).\n
   You can also hit Ctrl-D to exit.,
@@ -1609,6 +1610,12 @@
 cDevice::PrimaryDevice()-SetVolume(-VOLUMEDELTA);
  else if (strcasecmp(Option, MUTE) == 0)
 cDevice::PrimaryDevice()-ToggleMute();
+ else if ((strcasecmp(Option, MUTEON) == 0)
+if (!cDevice::PrimaryDevice()-IsMute()))
+  cDevice::PrimaryDevice()-ToggleMute();
+ else if ((strcasecmp(Option, MUTEOFF) == 0)
+if (cDevice::PrimaryDevice()-IsMute()))
+  cDevice::PrimaryDevice()-ToggleMute();
  else {
 Reply(501, Unknown option: \%s\, Option);
 return;
___
vdr mailing list
vdr@linuxtv.org
http://www.linuxtv.org/cgi-bin/mailman/listinfo/vdr


Re: [vdr] Patch: Add 'MUTEON' and 'MUTEOFF' options to the SVDRP VOLU command

2013-03-21 Thread Magnus Sirwiö

Why can't you use the HITK svdrp command sending the MUTE key?

# svdrpsend hitk mute

- Magnus



From: sebast...@familie-frei.net
To: vdr@linuxtv.org
Date: Thu, 21 Mar 2013 22:03:50 +0100
Subject: Re: [vdr] Patch: Add 'MUTEON' and 'MUTEOFF' options to the SVDRP VOLU 
command


Hi Hardy,

yes you are right.

This one should be better:

--- vdr-1.7.41/svdrp.c 2013-02-17 14:17:36.0 +0100
+++ vdr-1.7.41.mute/svdrp.c 2013-03-21 21:58:34.226895799 +0100
@@ -317,12 +317,13 @@
UPDR\n
 Initiates a re-read of the recordings directory, which is the SVDRP\n
 equivalent to 'touch .update'.,
- VOLU [ number | + | - | mute ]\n
+ VOLU [ number | + | - | mute | muteon | muteoff ]\n
 Set the audio volume to the given number (which is limited to the range\n
 0...255). If the special options '+' or '-' are given, the volume will\n
 be turned up or down, respectively. The option 'mute' will toggle the\n
-  audio muting. If no option is given, the current audio volume level will\n
-  be returned.,
+  audio muting, 'muteon' will turn muting on, 'muteoff' will turn muting\n
+  off. If no option is given, the current audio volume level will be\n
+  returned.,
QUIT\n
 Exit vdr (SVDRP).\n
 You can also hit Ctrl-D to exit.,
@@ -1609,6 +1610,12 @@
cDevice::PrimaryDevice()-SetVolume(-VOLUMEDELTA);
else if (strcasecmp(Option, MUTE) == 0)
cDevice::PrimaryDevice()-ToggleMute();
+ else if ((strcasecmp(Option, MUTEON) == 0)
+ if (!cDevice::PrimaryDevice()-IsMute()))
+ cDevice::PrimaryDevice()-ToggleMute();
+ else if ((strcasecmp(Option, MUTEOFF) == 0)
+ if (cDevice::PrimaryDevice()-IsMute()))
+ cDevice::PrimaryDevice()-ToggleMute();
else {
Reply(501, Unknown option: \%s\, Option);
return;


Best regards

Sebastian

Am Donnerstag, 21. März 2013, 21:40:06 schrieb Hardy Flor:
 Hi Sebastian Frei,

 with ... (!cDevice::PrimaryDevice()-IsMute())) is the command not
 recognized and the string Unknown option: MuteON will return, when you
 call svdr more than one with MuteON.

 Hardy


 ___
 vdr mailing list
 vdr@linuxtv.org
 http://www.linuxtv.org/cgi-bin/mailman/listinfo/vdr

___
vdr mailing list
vdr@linuxtv.org
http://www.linuxtv.org/cgi-bin/mailman/listinfo/vdr
  
___
vdr mailing list
vdr@linuxtv.org
http://www.linuxtv.org/cgi-bin/mailman/listinfo/vdr


Re: [vdr] Patch: Add 'MUTEON' and 'MUTEOFF' options to the SVDRP VOLU command

2013-03-21 Thread Sebastian Frei
Hi Magnus,

I want to mute VDR when I start playing music. If I use the VOLU MUTE or the 
HITK MUTE command, I can't be sure that I'll really mute VDR. If it was muted 
before VDR becomes unmuted.
The existing SVDRP commands only toggle the status but I can't set the muted 
status to an absolute value.

Sebastian



Magnus Sirwiö sir...@hotmail.com schrieb:


Why can't you use the HITK svdrp command sending the MUTE key?

# svdrpsend hitk mute

- Magnus



From: sebast...@familie-frei.net
To: vdr@linuxtv.org
Date: Thu, 21 Mar 2013 22:03:50 +0100
Subject: Re: [vdr] Patch: Add 'MUTEON' and 'MUTEOFF' options to the
SVDRP VOLU command


Hi Hardy,

yes you are right.

This one should be better:

--- vdr-1.7.41/svdrp.c 2013-02-17 14:17:36.0 +0100
+++ vdr-1.7.41.mute/svdrp.c 2013-03-21 21:58:34.226895799 +0100
@@ -317,12 +317,13 @@
UPDR\n
 Initiates a re-read of the recordings directory, which is the
SVDRP\n
 equivalent to 'touch .update'.,
- VOLU [ number | + | - | mute ]\n
+ VOLU [ number | + | - | mute | muteon | muteoff ]\n
 Set the audio volume to the given number (which is limited to the
range\n
 0...255). If the special options '+' or '-' are given, the volume
will\n
 be turned up or down, respectively. The option 'mute' will toggle
the\n
-  audio muting. If no option is given, the current audio volume level
will\n
-  be returned.,
+  audio muting, 'muteon' will turn muting on, 'muteoff' will turn
muting\n
+  off. If no option is given, the current audio volume level will
be\n
+  returned.,
QUIT\n
 Exit vdr (SVDRP).\n
 You can also hit Ctrl-D to exit.,
@@ -1609,6 +1610,12 @@
cDevice::PrimaryDevice()-SetVolume(-VOLUMEDELTA);
else if (strcasecmp(Option, MUTE) == 0)
cDevice::PrimaryDevice()-ToggleMute();
+ else if ((strcasecmp(Option, MUTEON) == 0)
+ if (!cDevice::PrimaryDevice()-IsMute()))
+ cDevice::PrimaryDevice()-ToggleMute();
+ else if ((strcasecmp(Option, MUTEOFF) == 0)
+ if (cDevice::PrimaryDevice()-IsMute()))
+ cDevice::PrimaryDevice()-ToggleMute();
else {
Reply(501, Unknown option: \%s\, Option);
return;


Best regards

Sebastian

Am Donnerstag, 21. März 2013, 21:40:06 schrieb Hardy Flor:
 Hi Sebastian Frei,

 with ... (!cDevice::PrimaryDevice()-IsMute())) is the command not
 recognized and the string Unknown option: MuteON will return, when
you
 call svdr more than one with MuteON.

 Hardy


 ___
 vdr mailing list
 vdr@linuxtv.org
 http://www.linuxtv.org/cgi-bin/mailman/listinfo/vdr

___
vdr mailing list
vdr@linuxtv.org
http://www.linuxtv.org/cgi-bin/mailman/listinfo/vdr
 
___
vdr mailing list
vdr@linuxtv.org
http://www.linuxtv.org/cgi-bin/mailman/listinfo/vdr


___
vdr mailing list
vdr@linuxtv.org
http://www.linuxtv.org/cgi-bin/mailman/listinfo/vdr