From patchwork Thu Mar 21 19:48:29 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sebastian Frei X-Patchwork-Id: 17559 Received: from localhost ([127.0.0.1] helo=www.linuxtv.org) by www.linuxtv.org with esmtp (Exim 4.72) (envelope-from ) id 1UIlTq-0008LV-Ck; Thu, 21 Mar 2013 20:48:54 +0100 Received: from mail.tu-berlin.de ([130.149.7.33]) by www.linuxtv.org with esmtp (Exim 4.72) (envelope-from ) id 1UIlTR-0008Ih-2r for vdr@linuxtv.org; Thu, 21 Mar 2013 20:48:53 +0100 X-tubIT-Incoming-IP: 212.227.126.171 Received: from moutng.kundenserver.de ([212.227.126.171]) by mail.tu-berlin.de (exim-4.75/mailfrontend-2) with esmtps [TLSv1:RC4-SHA:128] for id 1UIlTQ-0000ex-IW; Thu, 21 Mar 2013 20:48:28 +0100 Received: from nop.localnet (31-18-197-86-dynip.superkabel.de [31.18.197.86]) by mrelayeu.kundenserver.de (node=mrbap0) with ESMTP (Nemesis) id 0MZ7Vs-1U00AK0Nf2-00KzgS; Thu, 21 Mar 2013 20:48:28 +0100 From: Sebastian Frei To: vdr@linuxtv.org Date: Thu, 21 Mar 2013 20:48:29 +0100 Message-ID: <14358675.91UhXQkOyA@nop> User-Agent: KMail/4.10.1 (Linux/3.4.33-2.24-desktop; KDE/4.10.1; x86_64; ; ) MIME-Version: 1.0 X-Provags-ID: V02:K0:4ZXETIj6MjMF2WZRACeN4HCjZyZ4mo2juK2kok/JpDC hpxt7i2XpKkjS6anSeL5IsiESxbiXk0/Hc8agdf6vcr19kcVvp yhMKqrfvMdNxaFzYdfC3zPrRXXjvWpszdkPqCfFqEMAEv4L8zU 3QVhxt5S8XCjE8iRm3R6q+2/0vtW4YPS8635dnSxAu3nJ/+Fhr vYwMhMFKQEBP9DC0lvBP6gTBkKF+T8dp6w9POn+emIL8MEtx1I /kZTIXq1qGLTM/aU9/a7u9Qxr2KiHlV14Z64UHTNdp/C13nrGL z26skn57icdQicLJgcrFmgNLXpTN775MzL+TeRfK+/9mXx9Xni NWq24GdB6/+TN0+H/98c= X-PMX-Version: 5.6.1.2065439, Antispam-Engine: 2.7.2.376379, Antispam-Data: 2013.3.21.193628 X-PMX-Spam: Gauge=IIIIIIII, Probability=8%, Report=' HTML_00_01 0.05, HTML_00_10 0.05, MIME_TEXT_ONLY_MP_MIXED 0.05, BODYTEXTP_SIZE_3000_LESS 0, BODY_SIZE_4000_4999 0, BODY_SIZE_5000_LESS 0, BODY_SIZE_7000_LESS 0, INVALID_MSGID_NO_FQDN 0, NO_URI_FOUND 0, __CT 0, __CTE 0, __CTYPE_HAS_BOUNDARY 0, __CTYPE_MULTIPART 0, __CTYPE_MULTIPART_MIXED 0, __HAS_FROM 0, __HAS_MSGID 0, __MIME_TEXT_ONLY 0, __MIME_VERSION 0, __SANE_MSGID 0, __SUBJ_ALPHA_END 0, __TO_MALFORMED_2 0, __TO_NO_NAME 0, __USER_AGENT 0' X-LSpam-Score: -1.1 (-) X-LSpam-Report: No, score=-1.1 required=5.0 tests=BAYES_00=-1.9, RDNS_NONE=0.793 autolearn=no Subject: [vdr] Patch: Add 'MUTEON' and 'MUTEOFF' options to the SVDRP VOLU command X-BeenThere: vdr@linuxtv.org X-Mailman-Version: 2.1.13 Precedence: list Reply-To: VDR Mailing List List-Id: VDR Mailing List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: vdr-bounces@linuxtv.org Errors-To: vdr-bounces@linuxtv.org 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.000000000 +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 [ | + | - | mute ]\n" + "VOLU [ | + | - | 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;