summaryrefslogtreecommitdiffstats
path: root/DOCS/man/en/lua.rst
Commit message (Collapse)AuthorAgeFilesLines
* client API: avoid redundant property change events if possiblewm42014-04-081-5/+9
| | | | | This is done simply by comparing the previous and current values. Do this only if the requested format is not MPV_FORMAT_NONE.
* lua: add API for observing property changeswm42014-04-081-0/+22
| | | | | A low level API was added already earlier, but that was merely a binding for the raw C API. Add a "proper" one, and document it.
* lua: give more control over timerswm42014-04-021-5/+17
| | | | | | | | | | | Now they can be paused and resumed. Since pausing and disabling the timer is essentially the same underlying operation, we also just provide one method for it. mp.cancel_timer probably still works, but I'm considering this deprecated, and it's removed from the manpage. (We didn't have a release with this function yet, so no formal deprecation.)
* lua: add mp.unregister_event() functionwm42014-04-011-0/+5
| | | | Someone requested this... I think.
* lua: rename mp.register_script_command() to mp.register_script_message()wm42014-03-171-5/+5
| | | | More consistent naming.
* command, lua: change script_message semanticswm42014-03-171-7/+15
| | | | | | | | Change script_message to broadcast the message to all clients. Add a new script_message_to command, which does what the old script_message command did. This is intended as simplification, although it might lead to chaos too.
* manpage: lua: fix typowm42014-02-281-1/+1
|
* manpage: lua: update from previous commitwm42014-02-281-1/+7
| | | | I forgot about this.
* lua: add set_property_native functionwm42014-02-261-2/+12
| | | | | | Probably completely useless, at least for now. Also not very well tested, but initial test seems successful.
* client API: report pause/unpause reasonwm42014-02-241-0/+19
| | | | | | | | | Not sure about this... might redo. At least this provides a case of a broadcasted event, which requires per-event data allocation. See github issue #576.
* lua: add a bunch of functions to get/set properties by their native typewm42014-02-241-2/+40
| | | | | | There are some complications because the client API distinguishes between integers and floats, while Lua has only "numbers" (which are usually floats). But I think this should work now.
* manpage: lua: improve explanation of tracks-changed and tracks-switchedwm42014-02-191-4/+4
|
* client API: add event for metadata changeswm42014-02-191-0/+3
|
* manpage: lua: shorten description of register_script_command()wm42014-02-171-37/+12
| | | | | | | | | This is simply not important enough to warrant so much space, and it's perhaps also very confusing. Although I'm not fully sure, since this is about the only way that allows a user to interact with a script, besides key bindings and static options.
* manpage: lua: attempt to improve add_key_binding() descriptionwm42014-02-171-18/+23
|
* manpage: lua: improve introduction, add simplistic examplewm42014-02-171-15/+26
|
* manpage: lua: fix typowm42014-02-171-1/+1
|
* client API: add events for video and audio reconfigwm42014-02-171-0/+6
|
* lua: add mechanism for script provided key bindingswm42014-02-171-1/+99
| | | | | | | | | | | | | 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.)
* client API: add a client message eventwm42014-02-171-0/+6
| | | | | This comes with a "script_message" input command, which sends these messages. Used by the following commits.
* lua: allow giving fallback values in get_property() callswm42014-02-171-6/+8
| | | | | E.g. ``mp.get_property("foo", "value")`` will return ``value`` if the property can't be read.
* lua: make register_event() not overwrite previous event handlerwm42014-02-141-0/+4
| | | | | | | | 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.
* manpage: lua: move less important events to the end of the listwm42014-02-121-36/+35
|
* manpage: lua: document receiving of terminal messageswm42014-02-121-2/+36
|
* manpage: lua: rewrite event descriptionwm42014-02-121-30/+86
| | | | | Using such a small table is not such a great idea, because you can't put much information in it, even if you need to.
* manpage: lua: minor fixeswm42014-02-121-4/+4
|
* manpage: fix Lua script shutdown description againwm42014-02-111-6/+6
| | | | | | It was split at the wrong sentence. Also, sneak in a reference to mp.suspend.
* manpage: use Lua for Lua examplewm42014-02-111-1/+1
|
* manpage: document mp.commandv Lua commandwm42014-02-111-0/+15
|
* manpage: move description of script shutdown to a separate paragraphwm42014-02-111-4/+6
| | | | No other changes, just adding a paragraph break and reflowing the text.
* manpage: fix formatting of example codewm42014-02-111-6/+7
|
* manpage: document some Lua scripting functionswm42014-02-111-2/+160
|
* manpage: fix typowm42014-01-051-1/+1
|
* Add initial Lua scripting supportwm42013-09-261-0/+18
This is preliminary. There are still tons of issues, and any aspect of scripting may change in the future. I decided to merge this (preliminary) work now because it makes it easier to develop it, not because it's done. lua.rst is clear enough about it (plus some sarcasm). This requires linking to Lua. Lua has no official pkg-config file, but there are distribution specific .pc files, all with different names. Adding a non-pkg-config based configure test was considered, but we'd rather not. One major complication is that libquvi links against Lua too, and if the Lua version is different from mpv's, you will get a crash as soon as libquvi uses Lua. (libquvi by design always runs when a file is opened.) I would consider this the problem of distros and whoever builds mpv, but to make things easier for users, we add a terrible runtime test to the configure script, which probes whether libquvi will crash. This is disabled when cross-compiling, but in that case we hope the user knows what he is doing.