I try to make a player with something like a "watch folder".
To refresh the list i write a callback find in this forum:
callback=false
Code: Select all
function input_callback(action) -- action=add/del/toggle
if (action=="toggle" and callback==false) then action="add"
elseif (action=="toggle" and callback==true) then action="del" end
local input = vlc.object.input()
vlc.msg.dbg("valeur input : "..input)
if input and callback==false and action=="add" then
callback=true
vlc.var.add_callback(input, "intf-event", input_events_handler, "Hello world!")
elseif input and callback==true and action=="del" then
callback=false
vlc.var.del_callback(input, "intf-event", input_events_handler, "Hello world!")
end
end
My problem is when the playlist start to read a new file(or loop), i stop my function. I have added this two functions:
Code: Select all
function input_changed()
vlc.msg.dbg("000000000000000000000000000000000000000000000000000")
input_callback("toggle")
end
Code: Select all
function meta_changed()
vlc.msg.dbg("111111111111111111111111111111111111111")
input_callback("toggle")
end
testing in 2.0.5 mac osx.
Can some one help me?
I'm new in lua scrip and find any doc about callback.
Regards,
Philippe