mpv/input
wm4 8e4fa5fcd1 command: add a mechanism to allow scripts to intercept file loads
A vague idea to get something similar what libquvi did.

Undocumented because it might change a lot, or even be removed. To give
an idea what it does, a Lua script could do the following:

--                      type       ID priority
mp.commandv("hook_add", "on_load", 0, 0)
mp.register_script_message("hook_run", function(param, param2)
    -- param is "0", the user-chosen ID from the hook_add command
    -- param2 is the magic value that has to be passed to finish
    -- the hook
    mp.resume_all()
    -- do something, maybe set options that are reset on end:
    mp.set_property("file-local-options/name", "value")
    -- or change the URL that's being opened:
    local url = mp.get_property("stream-open-filename")
    mp.set_property("stream-open-filename", url .. ".png")
    -- let the player (or the next script) continue
    mp.commandv("hook_ack", param2)
end)
2014-10-16 01:00:22 +02:00
..
cmd_list.c command: add a mechanism to allow scripts to intercept file loads 2014-10-16 01:00:22 +02:00
cmd_list.h command: add a mechanism to allow scripts to intercept file loads 2014-10-16 01:00:22 +02:00
cmd_parse.c input: remove some unneeded code 2014-10-10 23:05:33 +02:00
cmd_parse.h input: use mpv_node parser for char** command parsers 2014-10-10 22:58:28 +02:00
event.c input: use mpv_node parser for char** command parsers 2014-10-10 22:58:28 +02:00
event.h Move compat/ and bstr/ directory contents somewhere else 2014-08-29 12:31:52 +02:00
input.c input: use mpv_node parser for char** command parsers 2014-10-10 22:58:28 +02:00
input.h command: add a mechanism to allow scripts to intercept file loads 2014-10-16 01:00:22 +02:00
joystick.c input: remove useless joystick.h/lirc.h include files 2014-09-10 00:51:36 +02:00
keycodes.c Move compat/ and bstr/ directory contents somewhere else 2014-08-29 12:31:52 +02:00
keycodes.h
lirc.c input: remove central select() call 2014-09-10 03:24:45 +02:00
pipe-unix.c input: use libwaio for pipe input on Windows 2014-09-14 16:24:01 +02:00
pipe-win32.c input: use libwaio for pipe input on Windows 2014-09-14 16:24:01 +02:00