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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Hardy,

yes you are right.

This one should be better:

--- vdr-1.7.41/svdrp.c	2013-02-17 14:17:36.000000000 +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@xxxxxxxxxxx
> http://www.linuxtv.org/cgi-bin/mailman/listinfo/vdr
--- vdr-1.7.41/svdrp.c	2013-02-17 14:17:36.000000000 +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@xxxxxxxxxxx
http://www.linuxtv.org/cgi-bin/mailman/listinfo/vdr

[Index of Archives]     [Linux Media]     [Asterisk]     [DCCP]     [Netdev]     [Xorg]     [Util Linux NG]     [Xfree86]     [Big List of Linux Books]     [Fedora Users]     [Fedora Women]     [ALSA Devel]     [Linux USB]

  Powered by Linux