From 12d0f5f9a066637e787e2f95de687b9245785ebd Mon Sep 17 00:00:00 2001 From: Ye Wenbin Date: Fri, 8 Dec 2006 05:20:00 +0000 Subject: Remove emms-volume-amixer-raise/lower commands, use emms-volume-change-function darcs-hash:20061208052019-94065-5be6631013ce5b2e97279fd97caeb54c6a254c0a.gz --- emms-volume-amixer.el | 31 ++++--------------------------- 1 file changed, 4 insertions(+), 27 deletions(-) diff --git a/emms-volume-amixer.el b/emms-volume-amixer.el index 379dfdb..20cc3c5 100644 --- a/emms-volume-amixer.el +++ b/emms-volume-amixer.el @@ -47,41 +47,18 @@ (string :tag "Something else: ")) :group 'emms-volume) -(defun emms-volume-amixer-sset-master (var) - "Change amixer master volume by VAR." +(defun emms-volume-amixer-change (amount) + "Change amixer master volume by AMOUNT." (message "Playback channels: %s" (with-temp-buffer (when (zerop (call-process "amixer" nil (current-buffer) nil "sset" emms-volume-amixer-control - (format "%d%%%s" (abs var) - (if (< var 0) "-" "+")))) + (format "%d%%%s" (abs amount) + (if (< amount 0) "-" "+")))) (if (re-search-backward "\\[\\([0-9]+%\\)\\]" nil t) (match-string 1)))))) -(defvar emms-volume-amixer-raise-commands - '(?p ?k up ?+ ?=)) -(defvar emms-volume-amixer-lower-commands - '(?n ?j down ?-)) - -(defun emms-volume-amixer-raise (&optional arg) - (interactive "P") - (if arg - (emms-volume-amixer-sset-master -2) - (emms-volume-amixer-sset-master 2)) - (let (command) - (while (progn - (setq command (read-event)) - (cond ((member command emms-volume-amixer-raise-commands) - (emms-volume-amixer-sset-master 2)) - ((member command emms-volume-amixer-lower-commands) - (emms-volume-amixer-sset-master -2))))) - (setq unread-command-events (list command)))) - -(defun emms-volume-amixer-lower () - (interactive) - (emms-volume-amixer-raise -1)) - (provide 'emms-volume-amixer) ;;; emms-volume-amixer.el ends here -- cgit v1.2.3