Allow to pre-seed Lua action script params
This commit is contained in:
parent
d5e1f536a7
commit
bb5345614d
@ -80,11 +80,12 @@ struct LIBARDOUR_API LuaScriptParam {
|
||||
const std::string& n,
|
||||
const std::string& t,
|
||||
const std::string& d,
|
||||
bool o)
|
||||
bool o, bool p)
|
||||
: name (n)
|
||||
, title (t)
|
||||
, dflt (d)
|
||||
, optional (o)
|
||||
, preseeded (p)
|
||||
, is_set (false)
|
||||
, value (d)
|
||||
{}
|
||||
@ -93,6 +94,7 @@ struct LIBARDOUR_API LuaScriptParam {
|
||||
std::string title;
|
||||
std::string dflt;
|
||||
bool optional;
|
||||
bool preseeded;
|
||||
bool is_set;
|
||||
std::string value;
|
||||
};
|
||||
|
@ -410,6 +410,7 @@ LuaScriptParams::script_params (LuaState& lua, const std::string& s, const std::
|
||||
std::string title = i.value ()["title"].cast<std::string> ();
|
||||
std::string dflt;
|
||||
bool optional = false;
|
||||
bool preseeded = false;
|
||||
|
||||
if (i.value ()["default"].isString ()) {
|
||||
dflt = i.value ()["default"].cast<std::string> ();
|
||||
@ -417,7 +418,10 @@ LuaScriptParams::script_params (LuaState& lua, const std::string& s, const std::
|
||||
if (i.value ()["optional"].isBoolean ()) {
|
||||
optional = i.value ()["optional"].cast<bool> ();
|
||||
}
|
||||
LuaScriptParamPtr lsspp (new LuaScriptParam(name, title, dflt, optional));
|
||||
if (i.value ()["preseeded"].isBoolean ()) {
|
||||
preseeded = i.value ()["preseeded"].cast<bool> ();
|
||||
}
|
||||
LuaScriptParamPtr lsspp (new LuaScriptParam(name, title, dflt, optional, preseeded));
|
||||
rv.push_back (lsspp);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user