update CLI.py and SYS/cli_parsing.py to add new command line options for the pipeline. Also updated SYS/pipeline.py to handle the new options. Modified plugins/mpv/LUA/main.lua and plugins/mpv/portable_config/input.conf to reflect changes in the pipeline configuration.

This commit is contained in:
2026-07-04 18:19:02 -07:00
parent c97f3df288
commit e748c21e2e
5 changed files with 62 additions and 25 deletions
+44 -9
View File
@@ -1573,7 +1573,7 @@ end
function M._attempt_start_lyric_helper_async(reason)
reason = trim(tostring(reason or 'startup'))
local state = M._lyric_helper_state or { last_start_ts = -1000, debounce = 3.0 }
local state = M._lyric_helper_state or { last_start_ts = -1000, debounce = 3.0, launch_inflight = false }
M._lyric_helper_state = state
if not ensure_mpv_ipc_server() then
@@ -1581,6 +1581,10 @@ function M._attempt_start_lyric_helper_async(reason)
return false
end
if state.launch_inflight then
return false
end
local now = mp.get_time() or 0
if (state.last_start_ts or -1000) > -1 and (now - (state.last_start_ts or -1000)) < (state.debounce or 3.0) then
return false
@@ -1626,16 +1630,32 @@ function M._attempt_start_lyric_helper_async(reason)
args[#args + 1] = lyric_log
end
local ok, result, detail = _run_subprocess_command({ name = 'subprocess', args = args, detach = true })
if not ok then
ok, result, detail = _run_subprocess_command({ name = 'subprocess', args = args })
end
if not ok then
_lua_log('lyric-helper: spawn failed reason=' .. tostring(reason) .. ' detail=' .. tostring(detail or _describe_subprocess_result(result)))
state.launch_inflight = true
local ok_async, async_err = pcall(mp.command_native_async, {
name = 'subprocess',
args = args,
detach = true,
}, function(success, result, callback_err)
state.launch_inflight = false
if not success then
_lua_log('lyric-helper: async spawn failed reason=' .. tostring(reason) .. ' detail=' .. tostring(callback_err or 'subprocess failed'))
return
end
if type(result) == 'table' then
local result_err = trim(tostring(result.error or ''))
local status = tonumber(result.status)
if (result_err ~= '' and result_err ~= 'success') or (status ~= nil and status ~= 0) then
_lua_log('lyric-helper: async spawn failed reason=' .. tostring(reason) .. ' detail=' .. tostring(_describe_subprocess_result(result)))
return
end
end
_lua_log('lyric-helper: start requested reason=' .. tostring(reason) .. ' script=' .. tostring(lyric_script))
end)
if not ok_async then
state.launch_inflight = false
_lua_log('lyric-helper: async spawn failed reason=' .. tostring(reason) .. ' detail=' .. tostring(async_err))
return false
end
_lua_log('lyric-helper: start requested reason=' .. tostring(reason) .. ' script=' .. tostring(lyric_script))
return true
end
@@ -6840,6 +6860,21 @@ mp.add_timeout(0, function()
else
_lua_log('[KEY] forced mbtn_right failed: ' .. tostring(rclick_err) .. ' (falling back to input.conf)')
end
-- Some mpv/uosc input paths emit double-right-click as `mbtn_right_dbl`.
-- Register it explicitly so menu invocation still works and mpv doesn't
-- warn about missing binding for this key.
local ok_rclick_dbl, rclick_dbl_err = pcall(function()
mp.add_forced_key_binding('mbtn_right_dbl', 'medios-mbtn-right-dbl-forced', function()
_lua_log('[KEY] mbtn_right_dbl -> show_menu')
M.show_menu()
end, {repeatable = false})
end)
if ok_rclick_dbl then
_lua_log('[KEY] registered forced mbtn_right_dbl binding')
else
_lua_log('[KEY] forced mbtn_right_dbl failed: ' .. tostring(rclick_dbl_err) .. ' (falling back to input.conf)')
end
end)
return M
+1
View File
@@ -1,6 +1,7 @@
# Medios Macina keybindings
# Route right-click to our menu handler (before UOSC can claim it)
mbtn_right script-message medios-show-menu
mbtn_right_dbl script-message medios-show-menu
# Route 'm' key (alternative to keybinding, in case keybinding doesn't work)
m script-message medios-show-menu