aboutsummaryrefslogtreecommitdiff
path: root/lisp/emms-volume-amixer.el
diff options
context:
space:
mode:
authorYoni Rabkin <yoni@rabkins.net>2017-10-11 14:58:31 -0400
committerYoni Rabkin <yoni@rabkins.net>2017-10-11 14:58:31 -0400
commit25b2dc242028076cd1d6c011b509133ae193af7e (patch)
tree40d1cb294b3d7cae31b333ae6d1b62cfbda638d1 /lisp/emms-volume-amixer.el
parentb1ea89a08da3f5953d55072fffed8f781b461315 (diff)
* lisp/emms-volume-amixer.el: card choice
Add an option to specify the card amixer will control.
Diffstat (limited to 'lisp/emms-volume-amixer.el')
-rw-r--r--lisp/emms-volume-amixer.el9
1 files changed, 9 insertions, 0 deletions
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) "-" "+"))))