lua: add set_property function

This commit is contained in:
wm4 2014-02-11 00:23:10 +01:00
parent 444f79d86f
commit 33c6cbef3a
1 changed files with 10 additions and 0 deletions

View File

@ -468,6 +468,15 @@ static int script_commandv(lua_State *L)
return check_error(L, mpv_command(ctx->client, args));
}
static int script_set_property(lua_State *L)
{
struct script_ctx *ctx = get_ctx(L);
const char *p = luaL_checkstring(L, 1);
const char *v = luaL_checkstring(L, 2);
return check_error(L, mpv_set_property_string(ctx->client, p, v));
}
static int script_property_list(lua_State *L)
{
const struct m_option *props = mp_get_property_list();
@ -734,6 +743,7 @@ static struct fn_entry fn_list[] = {
FN_ENTRY(find_config_file),
FN_ENTRY(command),
FN_ENTRY(commandv),
FN_ENTRY(set_property),
FN_ENTRY(property_list),
FN_ENTRY(set_osd_ass),
FN_ENTRY(get_osd_resolution),