Add Lua signal emitted when editor selection changed
This commit is contained in:
parent
efed61af44
commit
9b8040a9f4
|
@ -539,6 +539,7 @@ using namespace ARDOUR;
|
||||||
PBD::Signal0<void> LuaInstance::LuaTimerS;
|
PBD::Signal0<void> LuaInstance::LuaTimerS;
|
||||||
PBD::Signal0<void> LuaInstance::LuaTimerDS;
|
PBD::Signal0<void> LuaInstance::LuaTimerDS;
|
||||||
PBD::Signal0<void> LuaInstance::SetSession;
|
PBD::Signal0<void> LuaInstance::SetSession;
|
||||||
|
PBD::Signal0<void> LuaInstance::SelectionChanged;
|
||||||
|
|
||||||
void
|
void
|
||||||
LuaInstance::register_hooks (lua_State* L)
|
LuaInstance::register_hooks (lua_State* L)
|
||||||
|
@ -1346,6 +1347,12 @@ LuaInstance::init ()
|
||||||
|
|
||||||
luabridge::push <PublicEditor *> (L, &PublicEditor::instance());
|
luabridge::push <PublicEditor *> (L, &PublicEditor::instance());
|
||||||
lua_setglobal (L, "Editor");
|
lua_setglobal (L, "Editor");
|
||||||
|
|
||||||
|
Selection& sel (PublicEditor::instance().get_selection ());
|
||||||
|
sel.TimeChanged.connect (sigc::mem_fun (*this, &LuaInstance::selection_changed));
|
||||||
|
sel.RegionsChanged.connect (sigc::mem_fun (*this, &LuaInstance::selection_changed));
|
||||||
|
sel.TracksChanged.connect (sigc::mem_fun (*this, &LuaInstance::selection_changed));
|
||||||
|
sel.MarkersChanged.connect (sigc::mem_fun (*this, &LuaInstance::selection_changed));
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
|
@ -1458,6 +1465,12 @@ LuaInstance::every_point_one_seconds ()
|
||||||
LuaTimerDS (); // emit signal
|
LuaTimerDS (); // emit signal
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
LuaInstance::selection_changed ()
|
||||||
|
{
|
||||||
|
SelectionChanged (); // emit signal
|
||||||
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
LuaInstance::set_state (const XMLNode& node)
|
LuaInstance::set_state (const XMLNode& node)
|
||||||
{
|
{
|
||||||
|
|
|
@ -154,6 +154,7 @@ public:
|
||||||
static PBD::Signal0<void> LuaTimerS; // deci-seconds (Timer every 1s)
|
static PBD::Signal0<void> LuaTimerS; // deci-seconds (Timer every 1s)
|
||||||
static PBD::Signal0<void> LuaTimerDS; // deci-seconds (Timer every .1s)
|
static PBD::Signal0<void> LuaTimerDS; // deci-seconds (Timer every .1s)
|
||||||
static PBD::Signal0<void> SetSession; // emitted when a session is loaded
|
static PBD::Signal0<void> SetSession; // emitted when a session is loaded
|
||||||
|
static PBD::Signal0<void> SelectionChanged; // emitted when editor selection changes
|
||||||
|
|
||||||
private:
|
private:
|
||||||
LuaInstance();
|
LuaInstance();
|
||||||
|
@ -180,11 +181,14 @@ private:
|
||||||
LuaCallbackMap _callbacks;
|
LuaCallbackMap _callbacks;
|
||||||
PBD::ScopedConnectionList _slotcon;
|
PBD::ScopedConnectionList _slotcon;
|
||||||
|
|
||||||
|
void selection_changed ();
|
||||||
|
|
||||||
void every_second ();
|
void every_second ();
|
||||||
sigc::connection second_connection;
|
sigc::connection second_connection;
|
||||||
|
|
||||||
void every_point_one_seconds ();
|
void every_point_one_seconds ();
|
||||||
sigc::connection point_one_second_connection;
|
sigc::connection point_one_second_connection;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -91,6 +91,9 @@ STATIC(LuaTimerDS, &LuaInstance::LuaTimerDS, 0)
|
||||||
// Session load
|
// Session load
|
||||||
STATIC(SetSession, &LuaInstance::SetSession, 0)
|
STATIC(SetSession, &LuaInstance::SetSession, 0)
|
||||||
|
|
||||||
|
// Editor Selection Changed
|
||||||
|
STATIC(SelectionChanged, &LuaInstance::SelectionChanged, 0)
|
||||||
|
|
||||||
// TODO per track/route signals,
|
// TODO per track/route signals,
|
||||||
// TODO per plugin actions / controllables
|
// TODO per plugin actions / controllables
|
||||||
// TODO per region actions
|
// TODO per region actions
|
||||||
|
|
Loading…
Reference in New Issue
Block a user