select.lua: add select-secondary-subtitle-line
Requested in https://github.com/mpv-player/mpv/pull/17730#issuecomment-4321224996
This commit is contained in:
1 parent
ed99433277
commit
ae3189567b
4 files changed
+16
-3
No files matched your search
@@ -338,6 +338,9 @@ g-e
|
||||
g-l
|
||||
Select a subtitle line to seek to.
|
||||
|
||||
g-L
|
||||
Select a secondary subtitle line to seek to.
|
||||
|
||||
g-d
|
||||
Select an audio device.
|
||||
|
||||
|
||||
@@ -191,6 +191,7 @@
|
||||
#g-c script-binding select/select-chapter
|
||||
#g-e script-binding select/select-edition
|
||||
#g-l script-binding select/select-subtitle-line
|
||||
#g-L script-binding select/select-secondary-subtitle-line
|
||||
#g-d script-binding select/select-audio-device
|
||||
#g-h script-binding select/select-watch-history
|
||||
#g-w script-binding select/select-watch-later
|
||||
|
||||
@@ -107,6 +107,8 @@ P&layback
|
||||
Increase &delay add secondary-sub-delay 0.1
|
||||
Decrease d&elay add secondary-sub-delay -0.1
|
||||
|
||||
&Lines script-binding select/select-secondary-subtitle-line disabled=not secondary_sid or p["current-tracks/sub2/codec"] == "dvb_subtitle" or p["current-tracks/sub2/codec"] == "dvd_subtitle" or p["current-tracks/sub2/codec"] == "hdmv_pgs_subtitle"
|
||||
|
||||
&Window
|
||||
&Fullscreen cycle fullscreen checked=fullscreen
|
||||
&Border cycle border checked=border
|
||||
|
||||
+10
-3
@@ -284,8 +284,8 @@ mp.add_key_binding(nil, "select-edition", function ()
|
||||
})
|
||||
end)
|
||||
|
||||
mp.add_key_binding(nil, "select-subtitle-line", function ()
|
||||
local lines = mp.get_property_native("sub-lines")
|
||||
local function select_subtitle_line(secondary)
|
||||
local lines = mp.get_property_native(secondary .. "sub-lines")
|
||||
|
||||
if not lines then
|
||||
show_warning("Subtitle lines could not be retrieved.")
|
||||
@@ -294,7 +294,7 @@ mp.add_key_binding(nil, "select-subtitle-line", function ()
|
||||
|
||||
local items = {}
|
||||
local default_item
|
||||
local delay = mp.get_property_native("sub-delay")
|
||||
local delay = mp.get_property_native(secondary .. "sub-delay")
|
||||
local time_pos = mp.get_property_native("time-pos") - delay
|
||||
local duration = mp.get_property_native("duration", math.huge)
|
||||
|
||||
@@ -320,6 +320,13 @@ mp.add_key_binding(nil, "select-subtitle-line", function ()
|
||||
mp.commandv("seek", lines[i].start + delay, "absolute")
|
||||
end,
|
||||
})
|
||||
end
|
||||
|
||||
mp.add_key_binding(nil, "select-subtitle-line", function ()
|
||||
select_subtitle_line("")
|
||||
end)
|
||||
mp.add_key_binding(nil, "select-secondary-subtitle-line", function ()
|
||||
select_subtitle_line("secondary-")
|
||||
end)
|
||||
|
||||
local function format_audio_device(device)
|
||||
|
||||
Reference in new issue
Block a user