emacs-elpa-diffs
[Top][All Lists]
Advanced

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

[nongnu] elpa/mpv 028d85efae 06/12: Notify of AB-loop status upon invoca


From: ELPA Syncer
Subject: [nongnu] elpa/mpv 028d85efae 06/12: Notify of AB-loop status upon invocation
Date: Mon, 1 Aug 2022 09:58:52 -0400 (EDT)

branch: elpa/mpv
commit 028d85efae27c68d3c051ae93212537bf507eab4
Author: efimerspan <96617722+efimerspan@users.noreply.github.com>
Commit: efimerspan <96617722+efimerspan@users.noreply.github.com>

    Notify of AB-loop status upon invocation
---
 mpv.el | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)

diff --git a/mpv.el b/mpv.el
index 88387d0e57..c193ec86f7 100644
--- a/mpv.el
+++ b/mpv.el
@@ -343,7 +343,20 @@ in the current mpv playback."
 (defun mpv-set-ab-loop ()
   "Invokes an A-B loop command in the current mpv playback."
   (interactive)
-  (mpv-run-command "ab-loop"))
+  (mpv-run-command "ab-loop")
+  (cl-flet ((ab-loop-p
+             (point)
+             (or (numberp (mpv-get-property point))
+                 (not (string= (mpv-get-property point) "no")))))
+    (cond
+     ((and (not (ab-loop-p "ab-loop-a"))
+           (not (ab-loop-p "ab-loop-b")))
+      (message "Removed A-B loop"))
+     ((and (ab-loop-p "ab-loop-a")
+           (ab-loop-p "ab-loop-b"))
+      (message "Set point B for A-B loop"))
+     ((ab-loop-p "ab-loop-a")
+      (message "Set point A for A-B loop")))))
 
 (defun mpv-chapter-next ()
   "Jumps to the next chapter in the current playback."



reply via email to

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