Commit: 3bee334ea8ffce474206983f51900508d74e6850
Parent: 11f6649122e4635815942b5268e05cc14da706c8
Author: Ren Tatsumoto
Date: Wed, 5 Aug 2020 21:02:55 +0300
notify when starting point is set/reset
Diffstat:
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/subs2srs.lua b/subs2srs.lua
@@ -359,6 +359,9 @@ end
subs.set_starting_point = function()
subs.list = {}
mp.observe_property("sub-text", "string", subs.append)
+
+ local starting_point = seconds_to_human_readable_time(subs.get_current()['start'])
+ mp.osd_message("Starting point is set to " .. starting_point, 2)
end
subs.clear = function()
@@ -366,6 +369,11 @@ subs.clear = function()
subs.list = {}
end
+subs.reset_starting_point = function()
+ subs.clear()
+ mp.osd_message("Starting point is reset.", 2)
+end
+
function export_to_anki()
local sub = subs.get()
subs.clear()
@@ -411,5 +419,5 @@ config.check_sanity()
ankiconnect.create_deck_if_doesnt_exist(config.deck_name)
mp.add_key_binding("ctrl+e", "anki-export-note", export_to_anki)
mp.add_key_binding("ctrl+s", "set-starting-point", subs.set_starting_point)
-mp.add_key_binding("ctrl+a", "abort-multiline-export", subs.clear)
+mp.add_key_binding("ctrl+r", "reset-starting-point", subs.reset_starting_point)
mp.add_key_binding("ctrl+t", "toggle-sub-autocopy", clip_autocopy.toggle)