From d3b56435896d5fde202f56214e3ea3c2e153465d Mon Sep 17 00:00:00 2001 From: wm4 Date: Thu, 16 Jan 2014 23:06:06 +0100 Subject: lua: add a --lua-opts option, which can be queried by scripts The values set by this new option can be queried by Lua scripts using the mp.getopt() function. The function takes a string parameter, and returns the value of the first key that matches. If no key matches, nil is returned. --- options/options.c | 1 + options/options.h | 1 + 2 files changed, 2 insertions(+) (limited to 'options') diff --git a/options/options.c b/options/options.c index cff2eff810..b1131f0938 100644 --- a/options/options.c +++ b/options/options.c @@ -239,6 +239,7 @@ const m_option_t mp_opts[] = { #if HAVE_LUA OPT_STRINGLIST("lua", lua_files, CONF_GLOBAL), + OPT_KEYVALUELIST("lua-opts", lua_opts, CONF_GLOBAL), OPT_FLAG("osc", lua_load_osc, CONF_GLOBAL), #endif diff --git a/options/options.h b/options/options.h index 0a50352d0d..e328ccd25c 100644 --- a/options/options.h +++ b/options/options.h @@ -52,6 +52,7 @@ typedef struct MPOpts { char **reset_options; char **lua_files; + char **lua_opts; int lua_load_osc; struct m_obj_settings *audio_driver_list, *ao_defs; -- cgit v1.2.3