diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2011-08-14 17:11:33 +0000 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2011-08-14 17:11:33 +0000 |
commit | ae5f278202c6a13637644a39c57fe34100cd7f6e (patch) | |
tree | 3af61718df4ddffbbc97b466fde5c0b53cb6ea3e /gtk2_ardour/editor.cc | |
parent | bd1d705498a30939712deada370d868664b61a34 (diff) |
make control protocol's SelectByRID signal work, thus enabling MIDI binding maps to use function="select" with an argument; fix minor bug in previous commit
git-svn-id: svn://localhost/ardour2/branches/3.0@9991 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/editor.cc')
-rw-r--r-- | gtk2_ardour/editor.cc | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/gtk2_ardour/editor.cc b/gtk2_ardour/editor.cc index d45d89a96e..cf1619156f 100644 --- a/gtk2_ardour/editor.cc +++ b/gtk2_ardour/editor.cc @@ -704,6 +704,7 @@ Editor::Editor () ControlProtocol::ZoomIn.connect (*this, invalidator (*this), boost::bind (&Editor::temporal_zoom_step, this, false), gui_context()); ControlProtocol::ZoomOut.connect (*this, invalidator (*this), boost::bind (&Editor::temporal_zoom_step, this, true), gui_context()); ControlProtocol::ScrollTimeline.connect (*this, invalidator (*this), ui_bind (&Editor::control_scroll, this, _1), gui_context()); + ControlProtocol::SelectByRID.connect (*this, invalidator (*this), ui_bind (&Editor::control_select, this, _1), gui_context()); BasicUI::AccessAction.connect (*this, invalidator (*this), ui_bind (&Editor::access_action, this, _1, _2), gui_context()); /* problematic: has to return a value and thus cannot be x-thread */ @@ -912,6 +913,32 @@ Editor::zoom_adjustment_changed () } void +Editor::control_select (uint32_t rid) +{ + /* handles the (static) signal from the ControlProtocol class that + * requests setting the selected track to a given RID + */ + + if (!_session) { + return; + } + + boost::shared_ptr<Route> r = _session->route_by_remote_id (rid); + + if (!r) { + return; + } + + TimeAxisView* tav = axis_view_from_route (r); + + if (tav) { + selection->set (tav); + } else { + selection->clear_tracks (); + } +} + +void Editor::control_scroll (float fraction) { ENSURE_GUI_THREAD (*this, &Editor::control_scroll, fraction) |