reg_sens (editor_actions, "playhead-to-range-end", _("Playhead to Range End"), sigc::bind (sigc::mem_fun(*this, &Editor::cursor_to_selection_end), playhead_cursor));
reg_sens (editor_actions, "select-all-objects", _("Select All Objects"), sigc::bind (sigc::mem_fun(*this, &Editor::select_all_objects), Selection::Set));
- reg_sens (editor_actions, "select-all-tracks", _("Select All Tracks"), sigc::mem_fun(*this, &Editor::select_all_tracks));
- reg_sens (editor_actions, "deselect-all", _("Deselect All"), sigc::mem_fun(*this, &Editor::deselect_all));
- reg_sens (editor_actions, "invert-selection", _("Invert Selection"), sigc::mem_fun(*this, &Editor::invert_selection));
reg_sens (editor_actions, "select-loop-range", _("Set Range to Loop Range"), sigc::mem_fun(*this, &Editor::set_selection_from_loop));
reg_sens (editor_actions, "select-punch-range", _("Set Range to Punch Range"), sigc::mem_fun(*this, &Editor::set_selection_from_punch));
myactions.register_action (editor_actions, X_("cycle-zoom-focus"), _("Next Zoom Focus"), sigc::mem_fun (*this, &Editor::cycle_zoom_focus));
- for (int i = 1; i <= 9; ++i) {
+ for (int i = 1; i <= MAX_LUA_ACTION_SCRIPTS; ++i) {
string const a = string_compose (X_("script-action-%1"), i);
string const n = string_compose (_("Unset #%1"), i);
act = myactions.register_action (editor_actions, a.c_str(), n.c_str(), sigc::bind (sigc::mem_fun (*this, &Editor::trigger_script), i - 1));
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.sandbox (true);
+ lua.Print.connect (&_lua_print);
+ lua.sandbox (false);
lua_State* L = lua.getState();
LuaInstance::register_classes (L);
LuaBindings::set_session (L, _session);
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()) {
} 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
tact->set_active (s);
}
}
- } else if (p == "velocity-display") {
- _track_canvas->request_redraw (_track_canvas->visible_area());
}
}