aboutsummaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
authorYoni Rabkin <yoni@rabkins.net>2019-08-27 12:10:01 -0400
committerYoni Rabkin <yoni@rabkins.net>2019-08-27 12:10:01 -0400
commitf209b44c76f4a8532783909384ae7492b8d9b6e7 (patch)
tree13e2a3cf7e6a6dd008367232c1280efe45647683 /lisp
parent16ae09fa2e45306d71337099e524bdbe29ebb792 (diff)
emms-volume auto-detection
Diffstat (limited to 'lisp')
-rw-r--r--lisp/emms-volume.el10
1 files changed, 9 insertions, 1 deletions
diff --git a/lisp/emms-volume.el b/lisp/emms-volume.el
index 917ab2d..99c8c28 100644
--- a/lisp/emms-volume.el
+++ b/lisp/emms-volume.el
@@ -3,6 +3,7 @@
;; Copyright (C) 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
;; Author: Martin Schoenmakers <aiviru@diamond-age.net>
+;; Bruno Félix Rezende Ribeiro <oitofelix@gnu.org>
;; This file is part of EMMS.
@@ -49,6 +50,8 @@
(require 'emms)
(require 'emms-playlist-mode)
(require 'emms-volume-amixer)
+(require 'emms-volume-pulse)
+(require 'emms-volume-mixerctl)
;; Customize group
(defgroup emms-volume nil
@@ -56,7 +59,12 @@
:group 'emms)
;; General volume setting related code.
-(defcustom emms-volume-change-function 'emms-volume-amixer-change
+(defcustom emms-volume-change-function
+ (cond
+ ((executable-find "amixer") 'emms-volume-amixer-change)
+ ((executable-find "pactl") 'emms-volume-pulse-change)
+ ((executable-find "mixerctl") emms-volume-mixerctl-change)
+ ((t #'(lambda (amount) (user-error "%s" "No supported mixer found. Please, define ‘emms-volume-change-function’.")))))
"*The function to use to change the volume.
If you have your own functions for changing volume, set this."
:type '(choice (const :tag "Amixer" emms-volume-amixer-change)