aboutsummaryrefslogtreecommitdiff
path: root/emms-player-mpd.el
diff options
context:
space:
mode:
authorMichael Olson <mwolson@gnu.org>2006-04-21 22:47:00 +0000
committerMichael Olson <mwolson@gnu.org>2006-04-21 22:47:00 +0000
commit7cec9d03b8941c466afc773e6ae96b65d6ef0533 (patch)
tree70a332cfcf69f7157badfe21aa969e857351edb9 /emms-player-mpd.el
parent45115aee206a609edc51656190220a443fed0ee3 (diff)
emms-player-mpd: Make sure that emms-player-finished-hook is called once the playlist is exhausted.
darcs-hash:20060421224715-1bfb2-33f5e3e65bff53f48a17854f3ba31f196ed290cb.gz
Diffstat (limited to 'emms-player-mpd.el')
-rw-r--r--emms-player-mpd.el24
1 files changed, 17 insertions, 7 deletions
diff --git a/emms-player-mpd.el b/emms-player-mpd.el
index c030e65..3b3609c 100644
--- a/emms-player-mpd.el
+++ b/emms-player-mpd.el
@@ -619,7 +619,16 @@ MusicPD playlist."
(status (emms-player-mpd-get-mpd-state nil #'ignore info))
(time (emms-player-mpd-get-playing-time nil #'ignore info)))
(cond ((string= status "stop")
- (emms-player-mpd-stop t))
+ (if (with-current-emms-playlist
+ (save-excursion
+ (forward-line 1)
+ (emms-playlist-track-at (point))))
+ ;; a track remains, so use the conservative stop method
+ (let ((emms-player-stopped-p t))
+ (emms-player-mpd-stop t))
+ ;; at the last track: we probably ran out of stuff to
+ ;; play, so let EMMS do something further if it wants to
+ (emms-player-mpd-stop t)))
((string= status "pause")
nil)
((string= status "play")
@@ -808,12 +817,13 @@ just terminate the timer and mark the player as stopped."
(setq emms-player-mpd-status-timer nil)
(setq emms-player-mpd-playlist-id nil)
(setq emms-player-mpd-current-song nil)
- (let ((emms-player-stopped-p t))
- (unless no-send
- (condition-case nil
- (emms-player-mpd-send "stop" nil #'ignore)
- (error nil)))
- (emms-player-stopped)))
+ (if no-send
+ (emms-player-stopped)
+ (condition-case nil
+ (emms-player-mpd-send "stop" nil #'ignore)
+ (error nil))
+ (let ((emms-player-stopped-p t))
+ (emms-player-stopped))))
(defun emms-player-mpd-pause ()
"Pause the currently playing song."