emms-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emms-patches] darcs patch: Added `seek-to' to emms.el and emms-player-m


From: yoni-r
Subject: [Emms-patches] darcs patch: Added `seek-to' to emms.el and emms-player-mplayer.el.
Date: Fri, 22 Sep 2006 11:57:26 +0300

Fri Sep 22 11:55:13 IDT 2006  address@hidden
  * Added `seek-to' to emms.el and emms-player-mplayer.el.
New patches:

[Added `seek-to' to emms.el and emms-player-mplayer.el.
address@hidden {
hunk ./emms-player-mplayer.el 56
+(emms-player-set emms-player-mplayer
+                'seek-to
+                'emms-player-mplayer-seek-to)
+
hunk ./emms-player-mplayer.el 70
+
+(defun emms-player-mplayer-seek-to (sec)
+  "Depends on mplayer's -slave mode."
+  (process-send-string
+   emms-player-simple-process-name
+   (format "seek %d 2\n" sec)))
hunk ./emms.el 222
+(defcustom emms-player-seeked-to-functions nil
+  "*Functions called when a player is seeking.
+The functions are called with a single argument, the amount of
+seconds the player did seek."
+  :group 'emms
+  :type 'hook)
+
hunk ./emms.el 341
+(defun emms-seek-to (seconds)
+  "Seek the current player to SECONDS seconds.
+This can be a floating point number for sub-second fractions.
+It can also be negative to seek backwards."
+  (interactive "nSeconds to seek to: ")
+  (emms-ensure-player-playing-p)
+  (emms-player-seek-to seconds))
+
hunk ./emms.el 1341
+
+(defun emms-player-seek-to (seconds)
+  "Seek the current player to SECONDS seconds.
+This can be a floating point number for fractions of a second,
+or negative to seek backwards."
+  (if (not emms-player-playing-p)
+      (error "Can't seek-to player, nothing playing right now")
+    (let ((seek (emms-player-get emms-player-playing-p 'seek-to)))
+      (if (not seek)
+          (error "Player does not know how to seek-to")
+        (funcall seek seconds)
+        (run-hook-with-args 'emms-player-seeked-to-functions seconds)))))
}

Context:

[TAG 2.1
address@hidden 
Patch bundle hash:
36aeb5f37f9012f3f7dad2286a53b8fa85541acc

reply via email to

[Prev in Thread] Current Thread [Next in Thread]