vector<string> tooltips;
vector<string> keys;
vector<Glib::RefPtr<Gtk::Action> > actions;
- Gtkmm2ext::ActionMap::get_all_actions (paths, labels, tooltips, keys, actions);
+ ActionManager::get_all_actions (paths, labels, tooltips, keys, actions);
vector<string>::iterator p;
vector<string>::iterator l;
continue;
if (parts[1] == _("redirectmenu"))
continue;
- if (parts[1] == _("Editor_menus"))
- continue;
if (parts[1] == _("RegionList"))
continue;
if (parts[1] == _("ProcessorMenu"))
continue;
- /* strip <Actions>/ from the start */
- string path = (*p);
- path = path.substr (strlen ("<Actions>/"));
-
if (!action_tbl[parts[1]].isTable()) {
action_tbl[parts[1]] = luabridge::newTable (L);
}
assert (action_tbl[parts[1]].isTable());
luabridge::LuaRef tbl (action_tbl[parts[1]]);
assert (tbl.isTable());
- tbl[*l] = path;
+ tbl[*l] = *p;
}
luabridge::push (L, action_tbl);
using namespace ARDOUR;
+PBD::Signal0<void> LuaInstance::LuaTimerS;
PBD::Signal0<void> LuaInstance::LuaTimerDS;
PBD::Signal0<void> LuaInstance::SetSession;
{
lua.Print.connect (&_lua_print);
init ();
-
- load_state ();
}
LuaInstance::~LuaInstance ()
void
LuaInstance::set_dirty ()
{
+ if (!_session || _session->deletion_in_progress()) {
+ return;
+ }
save_state ();
_session->set_dirty (); // XXX is this reasonable?
}
for (LuaCallbackMap::iterator i = _callbacks.begin(); i != _callbacks.end(); ++i) {
i->second->set_session (s);
}
+ second_connection = Timers::rapid_connect (sigc::mem_fun(*this, & LuaInstance::every_second));
point_one_second_connection = Timers::rapid_connect (sigc::mem_fun(*this, & LuaInstance::every_point_one_seconds));
SetSession (); /* EMIT SIGNAL */
}
LuaInstance::session_going_away ()
{
ENSURE_GUI_THREAD (*this, &LuaInstance::session_going_away);
+ second_connection.disconnect ();
point_one_second_connection.disconnect ();
(*_lua_clear)();
lua.do_command ("collectgarbage();");
}
+void
+LuaInstance::every_second ()
+{
+ LuaTimerS (); // emit signal
+}
+
void
LuaInstance::every_point_one_seconds ()
{
}
}
+ assert (_callbacks.empty());
if ((child = find_named_node (node, "ActionHooks"))) {
for (XMLNodeList::const_iterator n = child->children ().begin (); n != child->children ().end (); ++n) {
try {
_callbacks.insert (std::make_pair(p->id(), p));
p->drop_callback.connect (_slotcon, MISSING_INVALIDATOR, boost::bind (&LuaInstance::unregister_lua_slot, this, p->id()), gui_context());
SlotChanged (p->id(), p->name(), p->signals()); /* EMIT SIGNAL */
+ set_dirty ();
return true;
} catch (luabridge::LuaException const& e) {
cerr << "LuaException:" << e.what () << endl;
} catch (...) { }
- set_dirty ();
return false;
}
if (i != _callbacks.end()) {
SlotChanged (id, "", ActionHook()); /* EMIT SIGNAL */
_callbacks.erase (i);
+ set_dirty ();
return true;
}
- set_dirty ();
return false;
}