Add parameters to callback function
Posted: 19 Aug 2015 14:02
Hello,
I made a script to seek through my videos.
Since I don't know how to give a callback
function a parameter, my code looks like this:
calling does not work
Thanks for you help
I made a script to seek through my videos.
Since I don't know how to give a callback
function a parameter, my code looks like this:
Code: Select all
require 'common'
function descriptor ()
return {title = "Seek"; version = "0.1"; author = "DasEarl"; capabilities = {}}
end
function activate()
print("Seek started")
dlg = vlc.dialog("Seeker")
dlg:add_button("10%", seek_10, 1, 1, 1, 1)
dlg:add_button("20%", seek_20, 1, 2, 1, 1)
dlg:add_button("30%", seek_30, 1, 3, 1, 1)
dlg:add_button("40%", seek_40, 1, 4, 1, 1)
dlg:add_button("50%", seek_50, 1, 5, 1, 1)
dlg:add_button("60%", seek_60, 1, 6, 1, 1)
dlg:add_button("70%", seek_70, 1, 7, 1, 1)
dlg:add_button("80%", seek_80, 1, 8, 1, 1)
dlg:add_button("90%", seek_90, 1, 9, 1, 1)
end
function seek_90()
common.seek("90%")
end
function seek_80()
common.seek("80%")
end
function seek_70()
common.seek("70%")
end
function seek_60()
common.seek("60%")
end
function seek_50()
common.seek("50%")
end
function seek_40()
common.seek("40%")
end
function seek_30()
common.seek("30%")
end
function seek_20()
common.seek("20%")
end
function seek_10()
common.seek("10%")
end
function deactivate()
print("Seek stopped")
end
function close()
print("Seek closed")
vlc.deactivate()
end
Code: Select all
dlg:add_button("10%", seek(10), 1, 9, 1, 1)
Thanks for you help