summaryrefslogtreecommitdiff
path: root/gtk2_ardour
diff options
context:
space:
mode:
authorRobin Gareus <robin@gareus.org>2018-07-31 02:00:27 +0200
committerRobin Gareus <robin@gareus.org>2018-07-31 02:00:27 +0200
commit506a42daf34fc6791e5cf1319bf51da2b4a4ef3b (patch)
treefec8c0764ba9a33955a33e78a70f37c2f90e04ba /gtk2_ardour
parent734bb51384d7619a0364b64396d4793f38173754 (diff)
Cleanup trigger_script_by_name() debug/error messages
Diffstat (limited to 'gtk2_ardour')
-rw-r--r--gtk2_ardour/editor_actions.cc13
1 files changed, 6 insertions, 7 deletions
diff --git a/gtk2_ardour/editor_actions.cc b/gtk2_ardour/editor_actions.cc
index fded7e6fae..e5af91d132 100644
--- a/gtk2_ardour/editor_actions.cc
+++ b/gtk2_ardour/editor_actions.cc
@@ -758,12 +758,14 @@ Editor::trigger_script_by_name (const std::string script_name)
script_path = (*s)->path;
if (!Glib::file_test (script_path, Glib::FILE_TEST_EXISTS | Glib::FILE_TEST_IS_REGULAR)) {
+#ifndef NDEBUG
cerr << "Lua Script action: path to " << script_path << " does not appear to be valid" << endl;
+#endif
return;
}
LuaState lua;
- lua.Print.connect (&_lua_print); //ToDo
+ lua.Print.connect (&_lua_print);
lua.sandbox (false);
lua_State* L = lua.getState();
LuaInstance::register_classes (L);
@@ -774,9 +776,6 @@ Editor::trigger_script_by_name (const std::string script_name)
lua.do_file (script_path);
luabridge::LuaRef args (luabridge::newTable (L));
- //ToDo: args?
- // args["how_many"] = count;
-
try {
luabridge::LuaRef fn = luabridge::getGlobal (L, "factory");
if (fn.isFunction()) {
@@ -787,12 +786,12 @@ Editor::trigger_script_by_name (const std::string script_name)
} catch (...) {
cerr << "Lua script failed: " << script_path << endl;
}
-
- continue; //script found; we're done
+ return;
}
}
-
+#ifndef NDEBUG
cerr << "Lua script was not found: " << script_name << endl;
+#endif
}
void