aboutsummaryrefslogtreecommitdiff
path: root/emms-mode-line.el
diff options
context:
space:
mode:
authorMichael Olson <mwolson@gnu.org>2006-04-01 19:18:00 +0000
committerMichael Olson <mwolson@gnu.org>2006-04-01 19:18:00 +0000
commitca867192b76b7e10f1672cdd1fa7862eb2f40341 (patch)
tree03c5e57077abc3ce33459ebbcd2b5961d7d7c7d4 /emms-mode-line.el
parente9cfafc1da50e7ea469a3ed58add63b7785f09ae (diff)
emms-mode-line: Add toggle functions and autoload cookies.
darcs-hash:20060401191825-1bfb2-763dcaee4201c44565e113e516b844e448a0c4a1.gz
Diffstat (limited to 'emms-mode-line.el')
-rw-r--r--emms-mode-line.el26
1 files changed, 26 insertions, 0 deletions
diff --git a/emms-mode-line.el b/emms-mode-line.el
index 8847fa0..0f12f72 100644
--- a/emms-mode-line.el
+++ b/emms-mode-line.el
@@ -67,12 +67,16 @@
(emms-track-description
(emms-playlist-current-selected-track))))))
+(defvar emms-mode-line-active-p nil
+ "If non-nil, emms mode line is active.")
+
(defvar emms-mode-line-initial-titlebar frame-title-format)
(defun emms-mode-line (arg)
"Turn on `emms-mode-line' if ARG is positive, off otherwise."
(interactive "p")
(or global-mode-string (setq global-mode-string '("")))
+ (setq emms-mode-line-active-p arg)
(if (and arg (> arg 0))
(progn
(add-hook 'emms-track-updated-functions 'emms-mode-line-alter)
@@ -92,6 +96,28 @@
(emms-mode-line-restore-titlebar)
(emms-mode-line-restore-mode-line)))
+;;;###autoload
+(defun emms-mode-line-enable ()
+ "Turn on `emms-mode-line'."
+ (interactive)
+ (emms-mode-line 1)
+ (message "emms mode line enabled"))
+
+;;;###autoload
+(defun emms-mode-line-disable ()
+ "Turn off `emms-mode-line'."
+ (interactive)
+ (emms-mode-line -1)
+ (message "emms mode line disabled"))
+
+;;;###autoload
+(defun emms-playing-time-toggle ()
+ "Toggle `emms-mode-line'."
+ (interactive)
+ (if emms-mode-line-active-p
+ (emms-mode-line-enable)
+ (emms-mode-line-disable)))
+
(defun emms-mode-line-alter (&optional track)
"Alter mode-line/titlebar.