lua: wrap mpv_get_wakeup_pipe()

Pretty much experimental for issue #661.
This commit is contained in:
wm4 2014-04-12 20:13:53 +02:00
parent 4e5cea86c2
commit 19abeaf62d
2 changed files with 12 additions and 0 deletions

View File

@ -334,6 +334,10 @@ The ``mp`` module is preloaded, although it can be loaded manually with
long time, but doesn't really need access to the player (like a network long time, but doesn't really need access to the player (like a network
operation). Note that you still can access the player at any time. operation). Note that you still can access the player at any time.
``mp.get_wakeup_pipe()``
Calls ``mpv_get_wakeup_pipe()`` and returns the read end of the wakeup
pipe. (See ``client.h`` for details.)
``mp.enable_messages(level)`` ``mp.enable_messages(level)``
Set the minimum log level of which mpv message output to receive. These Set the minimum log level of which mpv message output to receive. These
messages are normally printed to the terminal. By calling this function, messages are normally printed to the terminal. By calling this function,

View File

@ -1047,6 +1047,13 @@ static int script_format_time(lua_State *L)
return 1; return 1;
} }
static int script_get_wakeup_pipe(lua_State *L)
{
struct script_ctx *ctx = get_ctx(L);
lua_pushinteger(L, mpv_get_wakeup_pipe(ctx->client));
return 1;
}
struct fn_entry { struct fn_entry {
const char *name; const char *name;
int (*fn)(lua_State *L); int (*fn)(lua_State *L);
@ -1085,6 +1092,7 @@ static struct fn_entry fn_list[] = {
FN_ENTRY(input_set_section_mouse_area), FN_ENTRY(input_set_section_mouse_area),
FN_ENTRY(format_time), FN_ENTRY(format_time),
FN_ENTRY(enable_messages), FN_ENTRY(enable_messages),
FN_ENTRY(get_wakeup_pipe),
}; };
// On stack: mp table // On stack: mp table