aboutsummaryrefslogtreecommitdiff
path: root/emms-volume-amixer.el
diff options
context:
space:
mode:
authorMartin Schoenmakers <aiviru@diamond-age.net>2006-05-30 22:35:00 +0000
committerMartin Schoenmakers <aiviru@diamond-age.net>2006-05-30 22:35:00 +0000
commita21f33c5dc56e95d8273ab502907a8b81da6a3e9 (patch)
treee919b8e3a1db8198150db17b3256223cd17a4934 /emms-volume-amixer.el
parentac9bb221022b60c987f0caab4be4cfcd99a33964 (diff)
Add emms-volume and emms-volume-amixer.
New files: emms-volume.el provides some general volume changing things, including a minor mode to more easily change volume when not in the EMMS buffer. emms-volume-amixer.el is a backend using amixer. darcs-hash:20060530223500-97144-6c3f95ef335a5f100bc2c6d061a82cb5323b2557.gz
Diffstat (limited to 'emms-volume-amixer.el')
-rw-r--r--emms-volume-amixer.el57
1 files changed, 57 insertions, 0 deletions
diff --git a/emms-volume-amixer.el b/emms-volume-amixer.el
new file mode 100644
index 0000000..b721b38
--- /dev/null
+++ b/emms-volume-amixer.el
@@ -0,0 +1,57 @@
+;;; emms-volume-amixer.el --- a mode for changing volume using amixer
+
+;; Copyright (C) 2006 Free Software Foundation, Inc.
+
+;; Author: Martin Schoenmakers <aiviru@diamond-age.net>
+
+;; This file is free software; you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation; either version 2, or (at your option)
+;; any later version.
+;;
+;; GNU Emacs is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+;; GNU General Public License for more details.
+;;
+;; You should have received a copy of the GNU General Public License
+;; along with GNU Emacs; see the file COPYING. If not, write to the
+;; Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
+;; Boston, MA 02110-1301 USA
+
+;;; Commentary:
+
+;; This file defines a few simple functions to raise or lower the volume
+;; using amixer. It can be used stand-alone, though it's meant for usage
+;; with EMMS, particularly with emms-volume.el
+
+;;; History:
+
+;; May 30 2006: First cleanup and collation of amixer functions into a
+;; separate file for releasability.
+
+;;; Todo:
+
+;; There probably needs to be more configurability, which may in turn
+;; mean adding some more functions.
+;; Some of this could benefit from adding customize interfaces.
+
+;;; Code:
+
+(defun emms-volume-amixer-sset-master (var)
+ "Change amixer master volume by VAR."
+ (start-process "mixer" nil "amixer" "sset" "Master" var))
+
+(defun emms-volume-amixer-raise ()
+ "Increase volume by 2%."
+ (interactive)
+ (emms-volume-amixer-sset-master "2%+"))
+
+(defun emms-volume-amixer-lower ()
+ "Decrease volume by 2%."
+ (interactive)
+ (emms-volume-amixer-sset-master "2%-"))
+
+(provide 'emms-volume-amixer)
+
+;;; emms-volume-amixer.el ends here