From bc0d2ec1ba99409421d3f75aae315e10b5014b31 Mon Sep 17 00:00:00 2001 From: Yoni Rabkin Date: Sat, 11 Sep 2021 16:26:36 -0400 Subject: * emms-volume.el: load sndioctl load sndioctl and use correct quoting style --- emms-volume.el | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/emms-volume.el b/emms-volume.el index bb92a31..dd40934 100644 --- a/emms-volume.el +++ b/emms-volume.el @@ -52,6 +52,7 @@ (require 'emms-volume-amixer) (require 'emms-volume-pulse) (require 'emms-volume-mixerctl) +(require 'emms-volume-sndioctl) ;; Customize group (defgroup emms-volume nil @@ -61,9 +62,12 @@ ;; General volume setting related code. (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) + ;; check for sndioctl first to avoid picking up mixerctl or pactl + ;; on OpenBSD. + ((executable-find "sndioctl") #'emms-volume-sndioctl-change) + ((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." @@ -71,6 +75,7 @@ If you have your own functions for changing volume, set this." (const :tag "MPD" emms-volume-mpd-change) (const :tag "PulseAudio" emms-volume-pulse-change) (const :tag "Mixerctl" emms-volume-mixerctl-change) + (const :tag "Sndioctl" emms-volume-sndioctl-change) (function :tag "Lisp function"))) (defcustom emms-volume-change-amount 2 -- cgit v1.2.3