Commit Graph

12 Commits

Author SHA1 Message Date
wm4 24fa69dbfa lua: add mechanism for script provided key bindings
There was already an undocumented mechanism provided by
mp.set_key_bindings and other functions, but this was relatively
verbose, and also weird. It was mainly to make the OSC happy (including
being efficient and supporting weird corner cases), while the new
functions try to be a bit simpler.

This also provides a way to let users rebind script-provided commands.

(This mechanism is less efficient, because it's O(n^2) for n added key
bindings, but it shouldn't matter.)
2014-02-17 02:52:58 +01:00
wm4 1fa8e2b602 lua: remove redundant inline documentation
Nobody will loom at this, and the proper documentation of these
functions is in lua.rst.
2014-02-17 02:52:58 +01:00
wm4 ce6fb9175c options: make --no-config block all auto-loaded configuration files
Until now, the --no-config was explicitly checked in multiple places to
suppress loading of config files.

Add such a check to the config path code itself, and refuse to resolve
_any_ configuration file locations if the option is set.

osc.lua needs a small fixup, because it didn't handle the situation when
no path was returned. There may some of such cases in the C code too,
but I didn't find any on a quick look.
2014-02-14 14:01:27 +01:00
wm4 414c4f9322 lua: make register_event() not overwrite previous event handler
Instead, chain them.

Note that there's no logic to prevent the other event handlers to be run
from an event handler (like it's popular in GUI toolkits), because I
think that's not very useful for this purpose.
2014-02-14 14:01:27 +01:00
wm4 212d4e6061 lua: some minor API changes 2014-02-11 00:57:40 +01:00
wm4 7a53dd5f2f lua: rename some API functions
send_command     -> command
send_commandv    -> commandv
get_timer        -> get_time
property_get     -> get_property
property_get_string -> get_property_osd
getopt           -> get_opt
2014-02-11 00:01:57 +01:00
wm4 92a004bf87 lua: add a timer API 2014-02-10 21:07:23 +01:00
wm4 206616b697 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.
2014-02-10 21:03:59 +01:00
wm4 e10e1a57d0 lua: use core log level names
When the Lua code was written, the core didn't have names for log levels
yet (just numbers). The only user visible change is that "verbose"
becomes "v", since this level had different names.
2014-01-16 23:06:41 +01:00
ChrisK2 195e087086 osc: check for availabillity of percent-pos instead of length
... to decide wether the seekbar should be enabled or not.
2014-01-15 22:33:58 +01:00
wm4 2f6144c74b osc: use mp.send_commandv
See previous commit. Drop no-osd prefixes, as this is the default for
send_commandv anyway. send_command should probably be renamed later.
2013-12-20 18:02:01 +01:00
wm4 e449111429 Move mpvcore/player/ to player/ 2013-12-17 00:53:22 +01:00