aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Olson <mwolson@gnu.org>2006-04-01 23:30:00 +0000
committerMichael Olson <mwolson@gnu.org>2006-04-01 23:30:00 +0000
commitb8ff219abfe062695d166e4e6013740dc3e9446e (patch)
tree2678f64aad97724e1dca13aee4f115975ba54082
parentd28577592c5b8c1857faaa8a43fce46d7462e924 (diff)
emms-player-mpd: Don't use define-emms-simple-player, since we provide our own versions of the functions that it produces.
darcs-hash:20060401233036-1bfb2-a67d7b4d6de02703fde818b9db9342445ba7428d.gz
-rw-r--r--emms-player-mpd.el23
1 files changed, 21 insertions, 2 deletions
diff --git a/emms-player-mpd.el b/emms-player-mpd.el
index 6bac3fd..8808c7a 100644
--- a/emms-player-mpd.el
+++ b/emms-player-mpd.el
@@ -117,6 +117,18 @@ or nil if we cannot figure it out."
"\\.\\(m3u\\|ogg\\|flac\\|mp3\\|wav\\|mod\\|aac\\)\\'")
"Formats supported by MusicPD Client.")
+(defgroup emsm-player-mpd nil
+ "EMMS player for MusicPD."
+ :group 'emms-player
+ :prefix "emms-player-mpd-")
+
+(defcustom emms-player-mpd (emms-player 'emms-player-mpd-start
+ 'emms-player-mpd-stop
+ 'emms-player-mpd-playable-p)
+ "*Parameters for the MusicPD player."
+ :type '(cons symbol alist)
+ :group 'emms-player-mpd)
+
(defcustom emms-player-mpd-music-directory nil
"The value of 'music_directory' in your MusicPD configuration file.
You need this if your playlists use absolute file names, otherwise
@@ -175,8 +187,9 @@ If your EMMS playlist contains stored playlists, set this to nil."
:type 'boolean
:group 'emms-player-mpd)
-(define-emms-simple-player mpd '(file url playlist)
- emms-player-mpd-supported-regexp "mpd")
+(emms-player-set emms-player-mpd
+ 'regex
+ emms-player-mpd-supported-regexp)
(emms-player-set emms-player-mpd
'pause
@@ -531,6 +544,12 @@ This handles both m3u and pls type playlists."
;;; EMMS API
+(defun emms-player-mpd-playablep (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)
+ (emms-track-name track))))
+
(defun emms-player-mpd-play (&optional id)
"Play whatever is in the current MusicPD playlist.
If ID is specified, play the song at that position in the MusicPD