From b9466bfe9813f555c7a589867f0f4153731693ea Mon Sep 17 00:00:00 2001 From: Michael Olson Date: Sun, 2 Apr 2006 03:15:00 +0000 Subject: emms-streams: Make some options customizable. Fix compiler warnings. darcs-hash:20060402031546-1bfb2-9244eec3e8dc3890f2640a1f1f01a18309b9ae4d.gz --- emms-streams.el | 48 ++++++++++++++++++++++++++++++++---------------- 1 file changed, 32 insertions(+), 16 deletions(-) diff --git a/emms-streams.el b/emms-streams.el index dec8318..cd35b86 100644 --- a/emms-streams.el +++ b/emms-streams.el @@ -30,8 +30,31 @@ ;; Code: -(defvar emms-stream-bookmarks-file "~/.emacs.d/emms-streams" - "The file where you store your favorite emms streams") +(require 'emms) +(require 'later-do) + +(defgroup emms-stream nil + "*Add and play streams with EMMS." + :group 'emms) + +(defcustom emms-stream-bookmarks-file "~/.emacs.d/emms-streams" + "*The file where you store your favorite emms streams." + :type 'file + :group 'emms-stream) + +(defcustom emms-stream-default-action "add" + "*The default action when you press RET in the EMMS Stream interface. +Can be either \"add\" or \"play\". The default is \"add\"." + :type 'string + :group 'emms-stream) + +(defface emms-stream-name-face '((t (:bold t :foreground nil :weight bold))) + "Face for stream names." + :group 'emms-stream) + +(defface emms-stream-url-face '((t (:foreground "LightSteelBlue"))) + "Face for stream URLs." + :group 'emms-stream) (defvar emms-stream-list nil "The list that contains your current stream bookmarks.") @@ -50,19 +73,12 @@ Needed by the info method, as the track doesn't contain all the needed info.") -(defvar emms-stream-default-action "add" - "The default action when you press RET in the EMMS Stream interface. -Can be either \"add\" or \"play\". The default is \"add\".") +(defvar emms-stream-popup-old-conf nil + "Old window configuration.") (defvar emms-stream-last-stream nil "The last stream added/played by EMMS.") -(defface emms-stream-name-face '((t (:bold t :foreground nil :weight bold))) - "Face for stream names.") - -(defface emms-stream-url-face '((t (:foreground "LightSteelBlue"))) - "Face for stream URLs.") - ;; Format: (("descriptive name" url feed-number type)) ;; type could be either url or playlist. If url, then it represents a ;; direct IP, otherwite it's a stream playlist @@ -334,16 +350,16 @@ Don't forget to save your modifications !" (type (read-from-minibuffer "Type (url or streamlist): " (format "%s" (emms-stream-type bookmark))))) (emms-stream-delete-bookmark) - (emms-stream-add-bookmark name url (string-to-int fd) type))) + (emms-stream-add-bookmark name url (string-to-number fd) type))) (defun emms-stream-name (el) (car el)) (defun emms-stream-url (el) (cadr el)) (defun emms-stream-fd (el) - (caddr el)) + (car (cddr el))) (defun emms-stream-type (el) - (cadddr el)) + (cadr (cddr el))) (defun emms-stream-play () (interactive) @@ -403,8 +419,8 @@ Don't forget to save your modifications !" ;; last one added by emms-add-url. so in both cases, that's what we ;; want. ;; FIXME : not working with the new design. Yrk ? -(defun emms-stream-last-element () - (elt emms-playlist (- (length emms-playlist) 1))) +; (defun emms-stream-last-element () +; (elt emms-playlist (- (length emms-playlist) 1))) (defun emms-info-url-providep (track) (if (eq (emms-track-type track) 'url) -- cgit v1.2.3