mirror of
https://github.com/ksyasuda/SubMiner.git
synced 2026-04-26 16:19:26 -07:00
feat: add primary subtitle bar toggle
This commit is contained in:
@@ -462,6 +462,21 @@ function M.create(ctx)
|
||||
end)
|
||||
end
|
||||
|
||||
local function toggle_primary_subtitle_bar()
|
||||
if not binary.ensure_binary_available() then
|
||||
subminer_log("error", "binary", "SubMiner binary not found")
|
||||
show_osd("Error: binary not found")
|
||||
return
|
||||
end
|
||||
|
||||
run_control_command_async("toggle-primary-subtitle-bar", nil, function(ok)
|
||||
if not ok then
|
||||
subminer_log("warn", "process", "Primary subtitle bar toggle command failed")
|
||||
show_osd("Primary subtitle toggle failed")
|
||||
end
|
||||
end)
|
||||
end
|
||||
|
||||
local function open_options()
|
||||
if not binary.ensure_binary_available() then
|
||||
subminer_log("error", "binary", "SubMiner binary not found")
|
||||
@@ -552,6 +567,7 @@ function M.create(ctx)
|
||||
stop_overlay = stop_overlay,
|
||||
hide_visible_overlay = hide_visible_overlay,
|
||||
toggle_overlay = toggle_overlay,
|
||||
toggle_primary_subtitle_bar = toggle_primary_subtitle_bar,
|
||||
open_options = open_options,
|
||||
restart_overlay = restart_overlay,
|
||||
check_status = check_status,
|
||||
|
||||
@@ -80,6 +80,9 @@ function M.create(ctx)
|
||||
mp.add_key_binding("y-t", "subminer-toggle", function()
|
||||
process.toggle_overlay()
|
||||
end)
|
||||
mp.add_forced_key_binding("v", "subminer-toggle-primary-subtitle-bar", function()
|
||||
process.toggle_primary_subtitle_bar()
|
||||
end)
|
||||
mp.add_key_binding("y-y", "subminer-menu", show_menu)
|
||||
mp.add_key_binding("y-o", "subminer-options", function()
|
||||
process.open_options()
|
||||
|
||||
Reference in New Issue
Block a user