From 33c6cbef3ab2be9ff8b818441b5cda101b913f15 Mon Sep 17 00:00:00 2001 From: wm4 Date: Tue, 11 Feb 2014 00:23:10 +0100 Subject: lua: add set_property function --- player/lua.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/player/lua.c b/player/lua.c index e7ff414298..922b49417a 100644 --- a/player/lua.c +++ b/player/lua.c @@ -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), -- cgit v1.2.3