summaryrefslogtreecommitdiffstats
path: root/DOCS/man/en/lua.rst
Commit message (Collapse)AuthorAgeFilesLines
* DOCS: remove en/ sub-directorywm42014-06-201-633/+0
| | | | | This additional sub-directory doesn't serve any purpose anymore. Get rid of it.
* lua: fix compilation with lua 5.2wm42014-05-261-1/+1
| | | | | | | | | | | Commit e2e450f9 started making use of luaL_register(), but OF COURSE this function disappeared in Lua 5.2, and was replaced with a 5.2-only alternative, slightly different mechanism. So just NIH our own function. This is actually slightly more correct, since it forces the user to call "require" to actually make the module visible for builtin C-only modules other than "mp". Fix autoload.lua accordingly.
* lua: add some filesystem utility functionswm42014-05-251-0/+42
| | | | | | | | | | | We need this only because Lua's stdlib is so scarce. Lua doesn't intend to include a complete stdlib - they confine themselves to standard C, both for portability reasons and to keep the code minimal. But standard C does not provide much either. It would be possible to use Lua POSIX wrapper libraries, but that would be a messy (and unobvious) dependency. It's better to implement the missing functions ourselves, as long as they're small in number.
* manpage: lua: cosmetic changes to mp.options sectionwm42014-05-251-4/+4
|
* osc: fix chapter list displayChrisK22014-05-241-2/+2
| | | | also fix small typo in DOCS
* lua/osc: forgot some changed files in previous commitChrisK22014-05-231-2/+53
|
* manpage: minor correctionswm42014-05-111-5/+7
|
* options: rename msg-related optionsMartin Herkt2014-05-041-1/+1
| | | | | | | | | --msgcolor → --msg-color --msglevel → --msg-level --msgmodule → --msg-module --msgtime → --msg-time (also document this one) --playing-msg → --term-playing-msg --status-msg → --term-status-msg
* lua: remove "lua/" prefix from script nameswm42014-05-021-5/+5
| | | | | | | | | This affects the return value of mp.script_name, the "client name" (what's returned by mpv_client_name()) and all associated features, as well as the mpv terminal output module prefix when scripts print something. As discussed in #748.
* man: grammar tweak of mp.add_timeout()Kevin Mitchell2014-04-291-3/+3
|
* client API: add chapter change eventwm42014-04-271-0/+3
| | | | Also works for mpv_observe_property() on the "chapter" property.
* client API: remove mpv_event_pause_reasonwm42014-04-141-21/+5
| | | | | | | | | And slightly adjust the semantics of MPV_EVENT_PAUSE/MPV_EVENT_UNPAUSE. The real pause state can now be queried with the "core-idle" property, the user pause state with the "pause" property, whether the player is paused due to cache with "paused-for-cache", and the keep open event can be guessed with the "eof-reached" property.
* manpage: lua: separate "advanced" functions into a separate sectionwm42014-04-121-4/+10
| | | | This will be less confusing.
* lua: make it easier to integrate with foreign event loopswm42014-04-121-0/+20
| | | | We provide some "official" utility functions for this.
* lua: wrap mpv_get_wakeup_pipe()wm42014-04-121-0/+4
| | | | Pretty much experimental for issue #661.
* lua: add a minor helper functionwm42014-04-101-0/+4
|
* 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.