aboutsummaryrefslogtreecommitdiff
path: root/emms-volume.el
diff options
context:
space:
mode:
authorYe Wenbin <wenbinye@gmail.com>2006-12-08 05:21:00 +0000
committerYe Wenbin <wenbinye@gmail.com>2006-12-08 05:21:00 +0000
commitfc233207f029ca9642e7411e29df3b3d460943a5 (patch)
tree50b4be15ad9806e3614c042db8c4b96d8789c229 /emms-volume.el
parent12d0f5f9a066637e787e2f95de687b9245785ebd (diff)
change raise/lower-function to change-functon, add change-amount
darcs-hash:20061208052114-94065-3871387b8052194dc22627408e58b7822b670a10.gz
Diffstat (limited to 'emms-volume.el')
-rw-r--r--emms-volume.el28
1 files changed, 13 insertions, 15 deletions
diff --git a/emms-volume.el b/emms-volume.el
index c7e0357..8f9493b 100644
--- a/emms-volume.el
+++ b/emms-volume.el
@@ -56,33 +56,31 @@
:group 'emms)
;; General volume setting related code.
-(defcustom emms-volume-raise-function 'emms-volume-amixer-raise
- "*The function to use to raise the volume.
-If you have your own functions for changing volume, set this and
- `emms-volume-lower-function' accordingly."
- :type '(choice (const :tag "Amixer" emms-volume-amixer-raise)
- (const :tag "MPD" emms-volume-mpd-raise)
+(defcustom emms-volume-change-function 'emms-volume-amixer-change
+ "*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)
+ (const :tag "MPD" emms-volume-mpd-change)
(function :tag "Lisp function"))
:group 'emms-volume)
-(defcustom emms-volume-lower-function 'emms-volume-amixer-lower
- "*The function to use to lower the volume.
-If you have your own functions for changing volume, set this and
- `emms-volume-raise-function' accordingly."
- :type '(choice (const :tag "Amixer" emms-volume-amixer-lower)
- (const :tag "MPD" emms-volume-mpd-lower)
- (function :tag "Lisp function"))
+(defcustom emms-volume-change-amount 2
+ "The amount to use when raising or lowering the volume using the
+emms-volume interface.
+
+This should be a positive integer."
+ :type 'integer
:group 'emms-volume)
(defun emms-volume-raise ()
"Raise the speaker volume."
(interactive)
- (funcall emms-volume-raise-function))
+ (funcall emms-volume-change-function emms-volume-change-amount))
(defun emms-volume-lower ()
"Lower the speaker volume."
(interactive)
- (funcall emms-volume-lower-function))
+ (funcall emms-volume-change-function (- emms-volume-change-amount)))
(define-key emms-playlist-mode-map (kbd "+") 'emms-volume-raise)
(define-key emms-playlist-mode-map (kbd "-") 'emms-volume-lower)