emms.git - EMMS, The Emacs Multimedia System.

index : emms.git
EMMS, The Emacs Multimedia System.
summary refs log tree commit diff
diff options
context:
space:
mode:
authorYoni Rabkin <yoni@rabkins.net>2022年07月12日 17:00:11 -0400
committerYoni Rabkin <yoni@rabkins.net>2022年07月12日 17:00:11 -0400
commitb8d7a7be11e0e475c50f6864c75dfddf8e3c5471 (patch)
tree2692c3a8ce74361b9bd8b91be54e3d9e02741989
parent38ce3e9debbc9bf86a816d6776faf5aa1553a351 (diff)
downloademms-actions.tar.gz
* emms.el: insert actions at right placeactions
Diffstat
-rw-r--r--emms.el 17
1 files changed, 13 insertions, 4 deletions
diff --git a/emms.el b/emms.el
index 4b8d125..11a1eca 100644
--- a/emms.el
+++ b/emms.el
@@ -1408,7 +1408,7 @@ See emms-source-file.el for some examples."
(error "null track"))
(let ((action (emms-track-get track 'before-action)))
(when action
- (message "running Emms track action")
+ (message "running Emms track action (before)")
(funcall action track))))
(defun emms-actions-run-after (track)
@@ -1416,7 +1416,7 @@ See emms-source-file.el for some examples."
(error "null track"))
(let ((action (emms-track-get track 'after-action)))
(when action
- (message "running Emms track action")
+ (message "running Emms track action (after)")
(funcall action track))))
(defun emms-actions-add-action (action-f type track)
@@ -1425,13 +1425,13 @@ See emms-source-file.el for some examples."
(defun emms-actions-remove-action (type track)
(emms-actions-add-action nil type track))
-(defun emms-actions-add (action-f type)
+(defun emms-actions-add-at-point (action-f type)
(let ((track (emms-playlist-track-at (point))))
(if track
(emms-actions-add-action action-f type track)
(error "no track selected"))))
-(defun emms-actions-remove (type)
+(defun emms-actions-remove-at-point (type)
(let ((track (emms-playlist-track-at (point))))
(if track
(emms-actions-remove-action type track)
@@ -1547,6 +1547,11 @@ If the track can be played by more than one player, call
This should only be done by the current player itself."
(setq emms-player-playing-p player
emms-player-paused-p nil)
+ ;; actions
+ (let ((track (emms-playlist-current-selected-track)))
+ (when track
+ (emms-actions-run-before track)))
+ ;; hooks
(run-hooks 'emms-player-started-hook))
(defun emms-player-stop ()
@@ -1564,6 +1569,10 @@ This should only be done by the current player itself."
(run-hooks 'emms-player-stopped-hook)
(sleep-for emms-player-delay)
(run-hooks 'emms-player-finished-hook)
+ ;; actions run on finished, not stopped
+ (let ((track (emms-playlist-current-selected-track)))
+ (when track
+ (emms-actions-run-after track)))
(funcall emms-player-next-function)))
(defun emms-player-pause ()
generated by cgit v1.2.3 (git 2.25.1) at 2025年09月06日 13:46:28 +0000

AltStyle によって変換されたページ (->オリジナル) /