aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYe Wenbin <wenbinye@gmail.com>2006-12-08 05:20:00 +0000
committerYe Wenbin <wenbinye@gmail.com>2006-12-08 05:20:00 +0000
commit12d0f5f9a066637e787e2f95de687b9245785ebd (patch)
tree148731a1c7b397833a58a5849026de9c4f819b38
parent1c6cb9eb79a794ad30f358a1fa3fd15ce989fc58 (diff)
Remove emms-volume-amixer-raise/lower commands, use emms-volume-change-function
darcs-hash:20061208052019-94065-5be6631013ce5b2e97279fd97caeb54c6a254c0a.gz
-rw-r--r--emms-volume-amixer.el31
1 files 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