aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--emms-mode-line-icon.el3
-rw-r--r--emms-mode-line.el26
2 files changed, 28 insertions, 1 deletions
diff --git a/emms-mode-line-icon.el b/emms-mode-line-icon.el
index d9ed9ff..04699f3 100644
--- a/emms-mode-line-icon.el
+++ b/emms-mode-line-icon.el
@@ -30,6 +30,7 @@
;; Code:
+(require 'emms-mode-line)
(defvar emms-mode-line-icon-color "black"
"Color of the little icon displayed in the mode-line.")
@@ -37,7 +38,7 @@
(defvar emms-mode-line-icon-before-format ""
"String to put before the icon, in the mode-line.
For example, if you want to have something like :
-[ <icon> Foo - The Foo Song ]
+\[ <icon> Foo - The Foo Song ]
You should set it to \"[\", and set emms-mode-line-format to \"%s ]\"")
(setq emms-mode-line-icon-image-cache
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.