From e64ea8d75164f4788c39230a4c0bc87894bd9ed6 Mon Sep 17 00:00:00 2001 From: Michael Olson Date: Tue, 17 Oct 2006 20:51:00 +0000 Subject: emms-player-mpd: Implement seek-to support darcs-hash:20061017205106-1bfb2-d01f0f9e55a027a2f9a9467b7544bdc6df4cfa39.gz --- emms-player-mpd.el | 15 +++++++++++++++ 1 file changed, 15 insertions(+) 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) -- cgit v1.2.3