aboutsummaryrefslogtreecommitdiff
path: root/emms-player-mpd.el
diff options
context:
space:
mode:
authorMichael Olson <mwolson@gnu.org>2006-04-02 02:45:00 +0000
committerMichael Olson <mwolson@gnu.org>2006-04-02 02:45:00 +0000
commit7f7223d6655e67e4e75d54bbd57f04a47b65dba3 (patch)
tree9c8533fc2f7cb8a11914c4c64a5f9b5c68350475 /emms-player-mpd.el
parente1d5bf36570590809922d759be087be97ecd4d43 (diff)
emms-source-playlist: Add support for m3u and pls playlists.
darcs-hash:20060402024556-1bfb2-da264c4af634159a12fed0e3e4425eb238b9c917.gz
Diffstat (limited to 'emms-player-mpd.el')
-rw-r--r--emms-player-mpd.el27
1 files changed, 16 insertions, 11 deletions
diff --git a/emms-player-mpd.el b/emms-player-mpd.el
index 8808c7a..8034b9c 100644
--- a/emms-player-mpd.el
+++ b/emms-player-mpd.el
@@ -90,7 +90,7 @@
;; emms-playing-time, the displayed time will be accurate.
(require 'emms-player-simple)
-(require 'emms-source-file) ; for emms-source-file-parse-playlist
+(require 'emms-source-playlist) ; for emms-source-file-parse-playlist
(defun emms-player-mpd-get-supported-regexp ()
"Returns a regexp of file extensions that MusicPD supports,
@@ -520,15 +520,20 @@ If we succeed in adding the file, return non-nil, nil otherwise."
(defun emms-player-mpd-add-playlist (playlist)
"Load contents of PLAYLIST into MusicPD by adding each line.
This handles both m3u and pls type playlists."
- ;; This allows us to keep playlists anywhere and not worry about
- ;; having to mangle their names. Also, mpd can't handle pls
- ;; playlists by itself.
- (let ((playlist (emms-source-file-parse-playlist playlist))
- (any-success nil))
- (dolist (file playlist)
- (when (emms-player-mpd-add-file file)
- (setq any-success t)))
- any-success))
+ ;; This is useful for playlists of playlists
+ (with-temp-buffer
+ (insert-file-contents playlist)
+ (goto-char (point-min))
+ (let ((list (cond ((emms-source-playlist-m3u-p)
+ (emms-source-playlist-parse-m3u-1))
+ ((emms-source-playlist-pls-p)
+ (emms-source-playlist-parse-pls-1))
+ (t nil)))
+ (any-success nil))
+ (dolist (file list)
+ (when (emms-player-mpd-add-file file)
+ (setq any-success t)))
+ any-success)))
(defun emms-player-mpd-add (track)
"Add TRACK to the MusicPD playlist."
@@ -544,7 +549,7 @@ This handles both m3u and pls type playlists."
;;; EMMS API
-(defun emms-player-mpd-playablep (track)
+(defun emms-player-mpd-playable-p (track)
"Return non-nil when we can play this track."
(and (memq (emms-track-type track) '(file url playlist))
(string-match (emms-player-get emms-player-mpd 'regex)