diff options
author | wm4 <wm4@nowhere> | 2014-02-10 21:03:59 +0100 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2014-02-10 21:03:59 +0100 |
commit | 206616b697672d973b24330af9b094ac851f7ca4 (patch) | |
tree | 5baea012aa584c11f573373c1c7cbeddced209f5 /player/lua/osc.lua | |
parent | 88ae914b1ef2b76362c527985bd459b0d8226d45 (diff) | |
download | mpv-206616b697672d973b24330af9b094ac851f7ca4.tar.bz2 mpv-206616b697672d973b24330af9b094ac851f7ca4.tar.xz |
lua: port to client API
This is partial only, and it still accesses some MPContext internals.
Specifically, chapter and track lists are still read directly, and OSD
access is special-cased too.
The OSC seems to work fine, except using the fast-forward/backward
buttons. These buttons behave differently, because the OSC code had
certain assumptions how often its update code is called.
The Lua interface changes slightly.
Note that this has the odd property that Lua script and video start
at the same time, asynchronously. If this becomes an issue, explicit
synchronization could be added.
Diffstat (limited to 'player/lua/osc.lua')
-rw-r--r-- | player/lua/osc.lua | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/player/lua/osc.lua b/player/lua/osc.lua index cf6ce3449e..d19bfd7d78 100644 --- a/player/lua/osc.lua +++ b/player/lua/osc.lua @@ -1257,14 +1257,9 @@ function tick() end end -function mp_event(name, arg) - if name == "tick" then - tick() - elseif name == "start" or name == "track-layout" then - request_init() - elseif name == "end" then - end -end +mp.register_event("tick", tick) +mp.register_event("start-file", request_init) +mp.register_event("tracks-changed", request_init) -- mouse show/hide bindings mp.set_key_bindings({ |