Code: Select all
function descriptor()
return {
title = "Fine adjust playback speed",
capabilities = {"meta-listener"}
}
end
function activate()
Create_dialog()
click_Rate(0)
end
function deactivate()
end
function meta_changed()
click_Rate(0)
end
--- Dialog box ---
function close()
vlc.deactivate()
end
function Create_dialog()
d = vlc.dialog(descriptor().title)
ti_step = d:add_text_input("0.01",1,1,2,1)
d:add_button("<<", function() click_Rate(-1) end, 1,2,1,1)
d:add_button(">>", function() click_Rate(1) end, 2,2,1,1)
end
rate=1
function click_Rate(dir)
local input=vlc.object.input()
if input then
rate=rate+dir*tonumber(ti_step:get_text())
vlc.var.set(input, "rate", rate)
--
crate=vlc.var.get(input,"rate")
d:set_title(rate .. " (" .. crate .. ")")
end
end