[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/subed c1ee129 181/389: Add functions to adjust start/stop
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/subed c1ee129 181/389: Add functions to adjust start/stop timestamps to player's ones |
Date: |
Fri, 3 Dec 2021 11:00:22 -0500 (EST) |
branch: elpa/subed
commit c1ee1293a1dd2a77831808f3409133ddab4aa7c0
Author: i-blis <i-blis@yandex.ru>
Commit: Random User <rndusr@posteo.de>
Add functions to adjust start/stop timestamps to player's ones
---
subed/subed.el | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
diff --git a/subed/subed.el b/subed/subed.el
index 6eae9ec..f7c8c50 100644
--- a/subed/subed.el
+++ b/subed/subed.el
@@ -237,6 +237,23 @@ See `subed-increase-start-time' about ARG."
(interactive "P")
(subed-adjust-subtitle-stop (* -1 (subed-get-milliseconds-adjust arg))))
+(defun subed-adjust-to-player-start-timestamp ()
+ "Replace current subtitle's start timestamp with mpv player's current
timestamp."
+ (interactive)
+ (subed-srt--jump-to-subtitle-time-start)
+ (when (and subed-mpv-playback-position
+ (looking-at subed-srt--regexp-timestamp))
+ (replace-match (subed-srt--msecs-to-timestamp subed-mpv-playback-position))
+ (subed--run-subtitle-time-adjusted-hook)))
+
+(defun subed-adjust-to-player-stop-timestamp ()
+ "Replace current subtitle's stop timestamp with mpv player's current
timestamp."
+ (interactive)
+ (subed-srt--jump-to-subtitle-time-stop)
+ (when (and subed-mpv-playback-position
+ (looking-at subed-srt--regexp-timestamp))
+ (replace-match (subed-srt--msecs-to-timestamp subed-mpv-playback-position))
+ (subed--run-subtitle-time-adjusted-hook)))
;;; Moving subtitles
;;; (adjusting start and stop time by the same amount)
- [nongnu] elpa/subed 0924465 261/389: subed-srt--prepend-subtitle: Fix docstring, (continued)
- [nongnu] elpa/subed 0924465 261/389: subed-srt--prepend-subtitle: Fix docstring, ELPA Syncer, 2021/12/03
- [nongnu] elpa/subed f62fdb9 263/389: Remove empty line, ELPA Syncer, 2021/12/03
- [nongnu] elpa/subed ce6bf04 271/389: Point to subed-mode docstring in "Installation", ELPA Syncer, 2021/12/03
- [nongnu] elpa/subed 464d0cb 284/389: Add defcustom: subed-enforce-time-boundaries, ELPA Syncer, 2021/12/03
- [nongnu] elpa/subed a1c66c5 116/389: Make if clause easier to grasp, ELPA Syncer, 2021/12/03
- [nongnu] elpa/subed f31424e 115/389: Show message when enabling/disable features manually, ELPA Syncer, 2021/12/03
- [nongnu] elpa/subed b30293d 120/389: subed--replay-adjusted-subtitle: Fix docstring, ELPA Syncer, 2021/12/03
- [nongnu] elpa/subed 34caefb 117/389: Explain usage of prefix argument when adjusting/moving, ELPA Syncer, 2021/12/03
- [nongnu] elpa/subed b1cb470 134/389: Deduplicate code by adding subed-move-subtitles function, ELPA Syncer, 2021/12/03
- [nongnu] elpa/subed f7c04d2 167/389: Fix tests for inserting subtitle(s), ELPA Syncer, 2021/12/03
- [nongnu] elpa/subed c1ee129 181/389: Add functions to adjust start/stop timestamps to player's ones,
ELPA Syncer <=
- [nongnu] elpa/subed 9bf3fcc 213/389: Make timestamp adjustment limitations generic, ELPA Syncer, 2021/12/03
- [nongnu] elpa/subed 6fd0468 193/389: Use (defalias ...) instead of (fset ...), ELPA Syncer, 2021/12/03
- [nongnu] elpa/subed af4d876 211/389: use emacs 25 for e.g. alist-get, ELPA Syncer, 2021/12/03
- [nongnu] elpa/subed 9bc42c6 192/389: arg instead of (not (eq nil arg)), ELPA Syncer, 2021/12/03
- [nongnu] elpa/subed 7b5c5e0 205/389: Add/Fix tests for moving subtitles, ELPA Syncer, 2021/12/03
- [nongnu] elpa/subed 3b69f02 225/389: Simplify basic test for moving subtitle, ELPA Syncer, 2021/12/03
- [nongnu] elpa/subed b6e484f 204/389: Move subtitles in active region as a unit, ELPA Syncer, 2021/12/03
- [nongnu] elpa/subed 07a3774 218/389: Add generic function subed-subtitle-id-max, ELPA Syncer, 2021/12/03
- [nongnu] elpa/subed 80a2545 223/389: Reduce LOC, ELPA Syncer, 2021/12/03
- [nongnu] elpa/subed cfe8d1c 228/389: subed-srt--backward-subtitle-id: Don't look for different ID, ELPA Syncer, 2021/12/03