aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Olson <mwolson@gnu.org>2006-10-17 20:51:00 +0000
committerMichael Olson <mwolson@gnu.org>2006-10-17 20:51:00 +0000
commite64ea8d75164f4788c39230a4c0bc87894bd9ed6 (patch)
treea5b04444677416dc6a99451caf636a2ac48ff8fe
parent2b38de90f0691656e5f07e32a651a2816c8150e1 (diff)
emms-player-mpd: Implement seek-to support
darcs-hash:20061017205106-1bfb2-d01f0f9e55a027a2f9a9467b7544bdc6df4cfa39.gz
-rw-r--r--emms-player-mpd.el15
1 files changed, 15 insertions, 0 deletions
diff --git a/emms-player-mpd.el b/emms-player-mpd.el
index ef07624..305d8ee 100644
--- a/emms-player-mpd.el
+++ b/emms-player-mpd.el
@@ -224,6 +224,10 @@ If your EMMS playlist contains stored playlists, set this to nil."
'seek
'emms-player-mpd-seek)
+(emms-player-set emms-player-mpd
+ 'seek-to
+ 'emms-player-mpd-seek-to)
+
;;; Dealing with the MusicPD network process
(defvar emms-player-mpd-process nil)
@@ -872,6 +876,17 @@ from other functions."
(concat "seek " song " " (number-to-string (+ secs amount)))
nil #'ignore))))))
+(defun emms-player-mpd-seek-to (pos)
+ "Seek to POS seconds from the start of the current track."
+ (interactive)
+ (emms-player-mpd-get-current-song
+ pos
+ (lambda (pos song)
+ (when (and song pos)
+ (emms-player-mpd-send
+ (concat "seek " song " " (number-to-string pos))
+ nil #'ignore)))))
+
(defun emms-player-mpd-next ()
"Move forward by one track in MusicPD's internal playlist."
(interactive)