emms-patches
[Top][All Lists]
Advanced

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

[Emms-patches] darcs patch: emms-player-mpd: Implement seek-to support (


From: Michael Olson
Subject: [Emms-patches] darcs patch: emms-player-mpd: Implement seek-to support (and 6 more)
Date: Sat, 21 Oct 2006 21:11:47 -0400

Tue Oct 17 16:51:06 EDT 2006  Michael Olson <address@hidden>
  * emms-player-mpd: Implement seek-to support

Tue Oct 17 16:53:10 EDT 2006  Michael Olson <address@hidden>
  * emms-browser: Fix compiler warning

Tue Oct 17 17:02:38 EDT 2006  Michael Olson <address@hidden>
  * Since emms-player-seeked-to-functions and emms-player-time-set-functions 
hooks do the same thing, replace the former with the latter

Tue Oct 17 17:53:45 EDT 2006  Michael Olson <address@hidden>
  * Documentation cleanups in emms-player-mpd and emms-source-playlist

Tue Oct 17 18:04:04 EDT 2006  Michael Olson <address@hidden>
  * emms-player-mpd: When using the emms-volume interface, allow the user to 
specify the amount of change in the volume

Tue Oct 17 18:21:17 EDT 2006  Michael Olson <address@hidden>
  * Add NEWS items since version 2.1

Sat Oct 21 21:10:50 EDT 2006  Michael Olson <address@hidden>
  * emms-player-mpd: Work properly with tracks inserted by emms-browser
New patches:

[emms-player-mpd: Implement seek-to support
Michael Olson <address@hidden>**20061017205106] {
hunk ./emms-player-mpd.el 227
+(emms-player-set emms-player-mpd
+                 'seek-to
+                 'emms-player-mpd-seek-to)
+
hunk ./emms-player-mpd.el 879
+(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)))))
+
}

[emms-browser: Fix compiler warning
Michael Olson <address@hidden>**20061017205310] {
hunk ./emms-browser.el 1109
-            parent-data parent-point)
+            parent-bdata parent-point)
}

[Since emms-player-seeked-to-functions and emms-player-time-set-functions hooks 
do the same thing, replace the former with the latter
Michael Olson <address@hidden>**20061017210238] {
hunk ./emms-playing-time.el 120
-       (add-hook 'emms-player-seeked-to-functions 'emms-playing-time-set)
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 seeked to."
-  :group 'emms
-  :type 'hook)
-
hunk ./emms.el 1345
-        (run-hook-with-args 'emms-player-seeked-to-functions seconds)))))
+        (run-hook-with-args 'emms-player-time-set-functions seconds)))))
}

[Documentation cleanups in emms-player-mpd and emms-source-playlist
Michael Olson <address@hidden>**20061017215345] {
hunk ./emms-player-mpd.el 121
+
hunk ./emms-player-mpd.el 158
-  "Formats supported by MusicPD Client."
+  "Formats supported by MusicPD."
hunk ./emms-player-mpd.el 317
+
hunk ./emms-player-mpd.el 327
+
hunk ./emms-player-mpd.el 337
+
hunk ./emms-player-mpd.el 363
+
hunk ./emms-player-mpd.el 376
+
hunk ./emms-player-mpd.el 392
+
hunk ./emms-player-mpd.el 656
-If an error occurs, display a relevant message.
+Execute CALLBACK with CLOSURE as its first argument when done.
hunk ./emms-player-mpd.el 658
-Execute CALLBACK with CLOSURE as its first argument when done."
+If an error occurs, display a relevant message."
hunk ./emms-player-mpd.el 675
-This handles both m3u and pls type playlists.
+Execute CALLBACK with CLOSURE as its first argument when done.
hunk ./emms-player-mpd.el 677
-Execute CALLBACK with CLOSURE as its first argument when done."
+This handles both m3u and pls type playlists."
hunk ./emms-player-mpd.el 687
-This handles both m3u and pls type playlists.
+Execute CALLBACK with CLOSURE as its first argument when done.
hunk ./emms-player-mpd.el 689
-Execute CALLBACK with CLOSURE as its first argument when done."
+This handles both m3u and pls type playlists."
hunk ./emms-player-mpd.el 697
-
hunk ./emms-player-mpd.el 708
-
hunk ./emms-player-mpd.el 723
-
hunk ./emms-player-mpd.el 733
-
hunk ./emms-player-mpd.el 820
+
hunk ./emms-player-mpd.el 970
-If INSERTP is non-nil, insert the description into the current buffer instead.
-If CALLBACK is a function, call it with the current buffer and description.
+
+If INSERTP is non-nil, insert the description into the current
+buffer instead.
+
+If CALLBACK is a function, call it with the current buffer and
+description.
+
hunk ./emms-player-mpd.el 1013
-This is a useful addition to `emms-info-functions'.
hunk ./emms-player-mpd.el 1014
-info from MusicPD."
+info from MusicPD.
+
+This is a useful addition to `emms-info-functions'."
hunk ./emms-player-mpd.el 1037
+
hunk ./emms-player-mpd.el 1051
+
hunk ./emms-player-mpd.el 1077
+
hunk ./emms-source-playlist.el 242
-  "Return non-nil if the current buffer contains a native EMMS playlist."
+  "Return non-nil if the current buffer contains an m3u playlist.
+
+We currently have no metric for determining whether a buffer is
+an .m3u playlist based on its contents alone, so we assume that
+the more restrictive playlist formats have already been
+detected and simply return non-nil always."
hunk ./emms-source-playlist.el 251
-  "Parse the native EMMS playlist in the current buffer."
+  "Parse the m3u playlist in the current buffer."
hunk ./emms-source-playlist.el 259
-  "Extract a list of filenames from the given .m3u playlist.
+  "Extract a list of filenames from the given m3u playlist.
+
hunk ./emms-source-playlist.el 271
-IN should be a buffer with a EMMS playlist in it.
+IN should be a buffer containing an m3u playlist.
hunk ./emms-source-playlist.el 311
-  "Return non-nil if the current buffer contains a native EMMS playlist."
+  "Return non-nil if the current buffer contains a pls playlist."
hunk ./emms-source-playlist.el 319
-  "Parse the native EMMS playlist in the current buffer."
+  "Parse the pls playlist in the current buffer."
hunk ./emms-source-playlist.el 327
-  "Extract a list of filenames from the given .pls playlist.
+  "Extract a list of filenames from the given pls playlist.
+
hunk ./emms-source-playlist.el 339
-IN should be a buffer with a EMMS playlist in it.
+IN should be a buffer conatining a pls playlist.
}

[emms-player-mpd: When using the emms-volume interface, allow the user to 
specify the amount of change in the volume
Michael Olson <address@hidden>**20061017220404] {
hunk ./emms-player-mpd.el 188
+(defcustom emms-player-mpd-volume-change-amount 5
+  "The amount to use when raising or lowering the volume using the
+emms-volume interface.
+
+This should be a positive integer."
+  :type 'integer
+  :group 'emms-player-mpd)
+
hunk ./emms-player-mpd.el 201
-  :type 'integer
+  :type 'number
hunk ./emms-player-mpd.el 929
-  (emms-volume-mpd-change 5))
+  (emms-volume-mpd-change emms-player-mpd-volume-change-amount))
hunk ./emms-player-mpd.el 934
-  (emms-volume-mpd-change -5))
+  (emms-volume-mpd-change (- 0 emms-player-mpd-volume-change-amount)))
hunk ./emms.texinfo 1655
+
address@hidden emms-player-mpd-volume-change-amount
+The amount to use when raising or lowering the volume using the
+emms-volume interface.
+
+This should be a positive integer.
address@hidden defopt
}

[Add NEWS items since version 2.1
Michael Olson <address@hidden>**20061017222117] {
hunk ./NEWS 1
+News since version 2.1:
+
+  - Saving bookmarks in individual tracks is now supported.
+  - Support deleting files from the cache.
+  - Add mms:// URL support for emms-player-mplayer.
+  - Implement pause, resume, and seek support for
+    emms-player-alsaplayer.
+  - A new player called emms-player-timidity has been implemented
+    which is capable of playing midi files.
+  - Hitting "<" or ">" in emms-playlist-mode causes seeking backward
+    and forward, respectively.
+  - emms-player-mpd:
+    - Display the correct error message if an error occurs while
+      trying to play a stream.
+    - When using the emms-volume interface, allow the amount of change
+      in the volume to be specified using the
+      `emms-player-mpd-volume-change-amount' option.
+
}

[emms-player-mpd: Work properly with tracks inserted by emms-browser
Michael Olson <address@hidden>**20061022011050] {
hunk ./NEWS 13
+    - Using the emms-browser to insert and play tracks now works
+      properly with emms-player-mpd.
hunk ./emms-player-mpd.el 539
+(defun emms-player-mpd-select-song (prev-song new-song)
+  "Move to the given song position.
+
+The amount to move is the number difference between PREV-SONG and
+NEW-SONG.  NEW-SONG should be a string containing a number.
+PREV-SONG may be either a string containing a number or nil,
+which indicates that we should start from the beginning of the
+buffer and move to NEW-SONG."
+  (with-current-emms-playlist
+    ;; move to current track
+    (goto-char (if (and (stringp prev-song)
+                        emms-playlist-selected-marker
+                        (marker-position emms-playlist-selected-marker))
+                   emms-playlist-selected-marker
+                 (point-min)))
+    ;; seek forward or backward
+    (let ((diff (if (stringp prev-song)
+                    (- (string-to-number new-song)
+                       (string-to-number prev-song))
+                  (string-to-number new-song))))
+      (condition-case nil
+          (progn
+            ;; skip to first track if not on one
+            (when (and (> diff 0)
+                       (not (emms-playlist-track-at (point))))
+              (emms-playlist-next))
+            ;; move to new track
+            (while (> diff 0)
+              (emms-playlist-next)
+              (setq diff (- diff 1)))
+            (while (< diff 0)
+              (emms-playlist-previous)
+              (setq diff (+ diff 1)))
+            ;; select track at point
+            (unless (emms-playlist-selected-track-at-p)
+              (emms-playlist-select (point))))
+        (error (concat "Could not move to position " new-song))))))
+
hunk ./emms-player-mpd.el 616
-              (progn
-                (goto-line (1+ (string-to-number song)))
-                (emms-playlist-select (point)))
+              (emms-player-mpd-select-song nil song)
hunk ./emms-player-mpd.el 660
-             (setq emms-player-mpd-current-song song)
hunk ./emms-player-mpd.el 662
-             (with-current-emms-playlist
-               (emms-playlist-select (progn
-                                       (goto-line (1+ (string-to-number song)))
-                                       (point))))
+             (emms-player-mpd-select-song emms-player-mpd-current-song song)
+             (setq emms-player-mpd-current-song song)
hunk ./emms-player-mpd.el 826
-        (emms-player-mpd-play (1- (emms-line-number-at-pos
-                                   emms-playlist-selected-marker)))))))
+        (let ((track-cnt 0))
+          (save-excursion
+            (goto-char
+             (if (and emms-playlist-selected-marker
+                      (marker-position emms-playlist-selected-marker))
+                 emms-playlist-selected-marker
+               (point-min)))
+            (condition-case nil
+                (while t
+                  (emms-playlist-previous)
+                  (setq track-cnt (1+ track-cnt)))
+              (error nil)))
+          (emms-player-mpd-play track-cnt))))))
}

Context:

[fix faulty emms-playlist-mode keybinding, fix due to William and Damien.
address@hidden 
[Added seeking to the playlist keymap, and updated the manual.
address@hidden 
[emms-player-mpd: Only display error if we are certain that url.el is not 
up-to-date
Michael Olson <address@hidden>**20061004032213] 
[seek-for-alsaplayer
address@hidden
 Add relative seek support for alsaplayer
] 
[midi-files-via-timidity
address@hidden
 A simple-player definition for timidity
] 
[emms-playing-time.el: Minor cleanups.
address@hidden 
[emms-lyrics.el: Minor Cleanups.
address@hidden 
[pause-for-alsaplayer
address@hidden
 Get pause/resume working for alsaplayer
] 
[mms-for-mplayer
address@hidden
 mplayer also supports mms:// URLs
] 
[DoTheRightThing with player pausing and emms-bookmarks.el
address@hidden 
[Added emms-bookmarks.el
address@hidden 
[Added `emms-pause' to emms-playlist-mode.el bound to to ``P''.
address@hidden 
[browser: add deletion started/finished message
Damien Elmes <address@hidden>**20060923051128] 
[Added a link to the online version of the manual.
address@hidden 
[emms-playing-time.el now works with `seek-to'.
address@hidden 
[Added `seek-to' to emms.el and emms-player-mplayer.el.
address@hidden 
[browser/cache: support deleting files, make emms-cache-dirty a defsubst
Damien Elmes <address@hidden>**20060922090553] 
[TAG 2.1
address@hidden 
Patch bundle hash:
2bc8da77a6e2e4abe5e8933312a46a4bb6c6b738

reply via email to

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