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-play...


From: yoni-r
Subject: [Emms-patches] darcs patch: Added `seek-to' to emms.el and emms-play... (and 1 more)
Date: Fri, 22 Sep 2006 12:49:32 +0300

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

Fri Sep 22 12:47:57 IDT 2006  address@hidden
  * emms-playing-time.el now works with `seek-to'.
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)))))
}

[emms-playing-time.el now works with `seek-to'.
address@hidden {
hunk ./emms-playing-time.el 123
+       (add-hook 'emms-player-seeked-to-functions 'emms-playing-time-set)
hunk ./emms.el 225
-seconds the player did seek."
+seconds the player seeked to."
}

Context:

[TAG 2.1
address@hidden 
Patch bundle hash:
b616b5a691f0ef32c8577c00b2bf85185642c822

reply via email to

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