summaryrefslogtreecommitdiff
path: root/libs/ardour/luaproc.cc
diff options
context:
space:
mode:
authorRobin Gareus <robin@gareus.org>2019-09-06 15:39:54 +0200
committerRobin Gareus <robin@gareus.org>2019-09-06 15:39:54 +0200
commit6328f926652c20c7b5c0aa8801d84cdaf2e4b8bb (patch)
tree7611805ec08d05c5a0a82f13b41ae8572cd10692 /libs/ardour/luaproc.cc
parent9052b29add802f99ff8bdef8cb2c21a8e3b32d8b (diff)
Fix LuaProc script-parse return status
Diffstat (limited to 'libs/ardour/luaproc.cc')
-rw-r--r--libs/ardour/luaproc.cc24
1 files changed, 15 insertions, 9 deletions
diff --git a/libs/ardour/luaproc.cc b/libs/ardour/luaproc.cc
index 65d0f5d9e6..59409e097e 100644
--- a/libs/ardour/luaproc.cc
+++ b/libs/ardour/luaproc.cc
@@ -241,6 +241,7 @@ LuaProc::load_script ()
}
else {
assert (0);
+ return true;
}
luabridge::LuaRef lua_dsp_latency = luabridge::getGlobal (L, "dsp_latency");
@@ -254,7 +255,10 @@ LuaProc::load_script ()
try {
lua_dsp_init (_session.nominal_sample_rate ());
} catch (luabridge::LuaException const& e) {
- } catch (...) { }
+ return true; // error
+ } catch (...) {
+ return true;
+ }
}
_ctrl_params.clear ();
@@ -274,23 +278,25 @@ LuaProc::load_script ()
for (luabridge::Iterator i (params); !i.isNil (); ++i) {
// required fields
- if (!i.key ().isNumber ()) { return false; }
- if (!i.value ().isTable ()) { return false; }
- if (!i.value ()["type"].isString ()) { return false; }
- if (!i.value ()["name"].isString ()) { return false; }
- if (!i.value ()["min"].isNumber ()) { return false; }
- if (!i.value ()["max"].isNumber ()) { return false; }
+ if (!i.key ().isNumber ()) { return true; }
+ if (!i.value ().isTable ()) { return true; }
+ if (!i.value ()["type"].isString ()) { return true; }
+ if (!i.value ()["name"].isString ()) { return true; }
+ if (!i.value ()["min"].isNumber ()) { return true; }
+ if (!i.value ()["max"].isNumber ()) { return true; }
int pn = i.key ().cast<int> ();
std::string type = i.value ()["type"].cast<std::string> ();
if (type == "input") {
- if (!i.value ()["default"].isNumber ()) { return false; }
+ if (!i.value ()["default"].isNumber ()) {
+ return true; // error
+ }
_ctrl_params.push_back (std::make_pair (false, pn));
}
else if (type == "output") {
_ctrl_params.push_back (std::make_pair (true, pn));
} else {
- return false;
+ return true; // error
}
assert (pn == (int) _ctrl_params.size ());