summaryrefslogtreecommitdiffstats
path: root/DOCS/man/lua.rst
Commit message (Collapse)AuthorAgeFilesLines
* manpage: replace gendered pronounsNicolas F2017-04-191-2/+2
|
* lua: allow unregistration of idle handlersOlivier Perret2017-01-151-0/+5
|
* client API: turn mpv_suspend() and mpv_resume() into stubswm42016-11-221-20/+8
| | | | | | | | | | | As threatened by the API changes document. This commit also removes or stubs equivalent calls in IPC and Lua scripting. The stubs are left to maintain ABI compatibility. The semantics of the API functions have been close enough to doing nothing that this probably won't even break existing API users. Probably.
* lua: add API for registering idle handlerswm42016-09-211-0/+7
| | | | | This is only a functionality the Lua event dispatcher provides, rather than the libmpv client API.
* manpage: lua: mention recent deprecationswm42016-09-211-4/+6
| | | | | These are listed in interface-changes.rst, but the documentation in the manpage wasn't updated.
* lua: expose subprocess_detachedrr-2016-09-211-0/+13
|
* manpage: minor fixwm42016-07-101-2/+2
| | | | Also fix some other type in interface-changes.rst.
* man: fix typosJakub Wilk2016-07-091-1/+1
|
* lua: add timer:is_enabled() functionJulian2016-05-141-0/+4
| | | | | Allows to query if some timer is currently running or was stopped/killed.
* manpage: fix some script_message references to preferred namewm42016-05-091-3/+3
|
* lua: don't require key for mp.add_key_binding()wm42016-03-261-1/+2
| | | | | Requested. The intention is that scripts can provide mappable actions for key bindings without setting a default key.
* man: lua: fix typo in script-binding example.torque2016-03-191-1/+1
| | | | This line was added in ae5df9be98e4193342321f30285655fcf88e7e63, and it appears to have been a typo.
* lua: don't suspend core by default during script executionwm42016-03-181-7/+1
| | | | | | | | | This changes behavior somewhat. The old behavior can be restored by running "mp.use_suspend=true". It was originally introduced for the OSC, but I can't reproduce whatever misbehavior I was seeing. (See mp.suspend()/resume() for explanations what the suspend mechanism does.)
* manpage: lua: fix command nameswm42015-12-291-5/+5
| | | | Both variants work, but the ones with "-" are preferred now.
* man: fix grammar issuesMartin Herkt2015-12-191-1/+1
|
* subprocess, lua: export whether the process was killed by uswm42015-06-271-0/+4
| | | | | | | | We want to distinguish actual errors, and just aborting the program intentionally. Also be a bit more careful with handling the wait() exit status: do not called WEXITSTATUS() without checking WIFEXITED() first.
* DOCS/manpage: fix typosrrooij2015-06-171-1/+1
| | | | | | | Fix some errors in the man pages by spell checking them. Most of them were typos. Signed-off-by: wm4 <wm4@nowhere>
* lua: support MPV_END_FILE_REASON_REDIRECTwm42015-06-111-0/+10
| | | | And also add the missing "unknown" entry to the manpage.
* lua: export end-file event fieldswm42015-06-111-0/+17
|
* lua: fix options submodulewm42015-05-291-1/+1
| | | | | | | | | It polluted the global namespace, instead of exporting the function properly. For now, keep it compatible by explicitly keeping the bogus export. Also fix a mistake in the manpage example.
* manpage: lua: clarify OSD differences between mp.command/mp.commandvwm42015-05-161-0/+7
| | | | | | Conflicts: player/audio.c player/video.c
* lua: add utils.format_json() functionwm42015-04-221-0/+8
| | | | Requested. Why not.
* manpage: lua: clarify timer usagewm42015-04-081-0/+17
| | | | | | This seems to come up often. I guess '.' vs. ':' for Lua calls is confusing, and this part of the scripting API is the only one which requires using it.
* DOCS, options: fix exampleChrisK22015-03-051-1/+1
|
* manpage: remove empty line to fix formattingwm42015-03-021-1/+0
| | | | | | The HTML rendering of this page formats the ``timeout`` section differently, and we suspect it's because of this. (Or in other words: wtf rst??)
* manpage: document hook APIwm42015-02-041-14/+3
| | | | | | | This shouldn't exist and for the most part is meant to be used by the ytdl Lua script, but let's document it anyway. Since the Lua API handles all the details, it's considered much more "stable" than the raw API, which is why the raw API wasn't documented.
* command: add on_unload hookwm42015-02-041-0/+4
| | | | Fixes #1552.
* manpage: lua: fix a linkwm42014-12-261-1/+1
|
* manpage: lua: fixes and improvementswm42014-12-251-20/+15
| | | | Some things were outdated, or outright wrong.
* options: deprecate 'lua' based options/dirs for 'script'Avi Halachmi (:avih)2014-12-151-10/+10
| | | | | | | | | | | | - --lua and --lua-opts change to --script and --script-opts - 'lua' default script dirs change to 'scripts' - DOCS updated - 'lua-settings' dir was _not_ modified The old lua-based names/dirs still work, but display a warning. Signed-off-by: wm4 <wm4@nowhere>
* manpage: lua: fix examplewm42014-11-291-2/+2
| | | | Oops.
* manpage: minor fixeswm42014-11-291-6/+5
| | | | | Also update the Lua example. The "pause" event was declared deprecated, so the example should use the newer API.
* lua: add a function that formats Lua values as stringswm42014-11-291-0/+4
| | | | | | | | Yep, Lua is so crappy that the stdlib doesn't provide anything like this. Repurposes the undocumented mp.format_table() function and moves it to mp.utils.
* manpage: lua: fix typo paramater -> parameterAlessandro Ghedini2014-11-261-1/+1
|
* input, lua: redo input handlingwm42014-11-231-7/+18
| | | | | Much of it is the same, but now there's the possibility to distinguish key down/up events in the Lua API.
* manpage: update utils.subprocess() for WindowsJames Ross-Gowan2014-11-221-2/+3
|
* lua: add a way to add repeatable key bindingswm42014-11-211-1/+5
| | | | For these, autorepeat is enabled.
* client API: deprecate some eventswm42014-11-081-22/+3
| | | | | | | | | | | Following the discussion in #1253. The events won't be removed for a while, though. (Or maybe never, unless we run out of bits for the uint64_t event mask.) This is not a real change (the events still work, and the alternative mechanisms were established a few API revisions earlier), but for the sake of notifying API users, update DOCS/client-api-changes.rst.
* lua: add convenience function for hookswm42014-10-211-0/+26
| | | | So the user doesn't have to care about the awkward low-level details.
* lua: expose JSON parserwm42014-10-191-0/+14
| | | | | | | The JSON parser was introduced for the IPC protocol, but I guess it's useful here too. The motivation for this commit is the same as with 8e4fa5fc (again).
* lua: add an utility function for starting processeswm42014-10-191-0/+42
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Because 1) Lua is terrible, and 2) popen() is terrible. Unfortunately, since Unix is also terrible, this turned out more complicated than I hoped. As a consequence and to avoid that this code has to be maintained forever, add a disclaimer that any function in Lua's utils module can disappear any time. The complexity seems a bit ridiculous, especially for a feature so far removed from actual video playback, so if it turns out that we don't really need this function, it will be dropped again. The motivation for this commit is the same as with 8e4fa5fc. Note that there is an "#ifndef __GLIBC__". The GNU people are very special people and thought it'd be convenient to actually declare "environ", even though the POSIX people, which are also very special people, state that no header declares this and that the user has to declare this manually. Since the GNU people overtook the Unix world with their very clever "embrace, extend, extinguish" strategy, but not 100%, and trying to build without _GNU_SOURCE is hopeless; but since there might be Unix environments which support _GNU_SOURCE features partially, this means that in practice "environ" will be randomly declared or not declared by system headers. Also, gcc was written by very clever people too, and prints a warning if an external variable is declared twice (I didn't check, but I suppose redeclaring is legal C, and not even the gcc people are clever enough to only warn against a definitely not legal C construct, although sometimes they do this), ...and since we at mpv hate compiler warnings, we seek to silence them all. Adding a configure test just for a warning seems too radical, so we special-case this against __GLIBC__, which is hopefully not defined on other libcs, especially not libcs which don't implement all aspects of _GNU_SOURCE, and redefine "environ" on systems even if the headers define it already (because they support _GNU_SOURCE - as I mentioned before, the clever GNU people wrote software THAT portable that other libcs just gave up and implemented parts of _GNU_SOURCE, although probably not all), which means that compiling mpv will print a warning about "environ" being redefined, but at least this won't happen on my system, so all is fine. However, should someone complain about this warning, I will force whoever complained about this warning to read this ENTIRE commit message, and if possible, will also force them to eat a printed-out copy of the GNU Manifesto, and if that is not enough, maybe this person could even be forced to convince the very clever POSIX people of not doing crap like this: having the user to manually declare somewhat central symbols - but I doubt it's possible, because the POSIX people are too far gone and only care about maintaining compatibility with old versions of AIX and HP-UX. Oh, also, this code contains some subtle and obvious issues, but writing about this is not fun.
* lua: add command_native() functionwm42014-10-111-0/+9
| | | | This is the Lua equivalent of mpv_command_node().
* manpage: improve consistency with new ~/.config/mpv defaultKevin Mitchell2014-10-041-11/+13
| | | | Signed-off-by: wm4 <wm4@nowhere>
* lua: add mpv/lua directories to the lua pathOtto Modinos2014-09-281-3/+8
| | | | Signed-off-by: wm4 <wm4@nowhere>
* lua: synchronously wait until scripts are loadedwm42014-09-061-0/+9
| | | | | | | | | | | | | | | | | This makes the player wait until each script is loaded. Do this to give the script a chance to setup all its event handlers. It might also be useful to allow a script to change options that matter for playback. While waiting for a script to be loaded, the player actually accepts input. This is needed because the scripts can execute player commands anyway while they are being "loaded". The player won't react to most commands though: it can't quit or navigate the playlist in this state. For deciding whether a script is finally loaded, we use a cheap hack: if mpv_wait_event() is called, it's considered loaded. Let's hope this is good enough. I think it's better than introducing explicit API for this. Although I'm sure this will turn out as too simplistic some time in the future, the same would probably happen with a more explicit API.
* man: fix a whole bunch of typosMartin Herkt2014-09-011-9/+9
|
* lua: expose mp_getcwd through mp.utilsOtto Modinos2014-08-311-0/+4
|
* manpage: mention that mp.commandv doesn't expand propertiesOtto Modinos2014-08-251-0/+4
| | | | | | | | The little lua snippet at #488 as well as the actual implementation seems to indicate that not expanding properties is indeed the correct behavior. Document that. Signed-off-by: wm4 <wm4@nowhere>
* manpage: lua: document timer timeout and oneshot fieldswm42014-07-291-0/+14
| | | | | Might be useful for scripts, so document them. (Which means scripts are allowed to use them, without risking breakage.)
* DOCS: remove en/ sub-directorywm42014-06-201-0/+633
This additional sub-directory doesn't serve any purpose anymore. Get rid of it.