From 25b2dc242028076cd1d6c011b509133ae193af7e Mon Sep 17 00:00:00 2001 From: Yoni Rabkin Date: Wed, 11 Oct 2017 14:58:31 -0400 Subject: * lisp/emms-volume-amixer.el: card choice Add an option to specify the card amixer will control. --- lisp/emms-volume-amixer.el | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'lisp') diff --git a/lisp/emms-volume-amixer.el b/lisp/emms-volume-amixer.el index 2b9980f..190f6b0 100644 --- a/lisp/emms-volume-amixer.el +++ b/lisp/emms-volume-amixer.el @@ -49,6 +49,13 @@ controls, run `amixer controls' in a shell." (string :tag "Something else: ")) :group 'emms-volume) +(defcustom emms-volume-amixer-card 0 + "The card number to change volume. +The card is identified by a number. For a full list run `cat +/proc/asound/cards' in a shell." + :type 'integer + :group 'emms-volume) + ;;;###autoload (defun emms-volume-amixer-change (amount) "Change amixer master volume by AMOUNT." @@ -56,6 +63,8 @@ controls, run `amixer controls' in a shell." (with-temp-buffer (when (zerop (call-process "amixer" nil (current-buffer) nil + "-c" + (format "%d" emms-volume-amixer-card) "sset" emms-volume-amixer-control (format "%d%%%s" (abs amount) (if (< amount 0) "-" "+")))) -- cgit v1.2.3