From 9ec393422f960f98a3a970805699b2bd05ec803c Mon Sep 17 00:00:00 2001 From: nick_m Date: Fri, 13 Mar 2015 02:47:16 +1100 Subject: [PATCH] Add new routes to selection in the editor, rather than the editor route list. Fixes new tracks not being selected. Also begin selection op history when adding routes. --- gtk2_ardour/editor.cc | 8 ++++++++ gtk2_ardour/editor_routes.cc | 4 ---- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/gtk2_ardour/editor.cc b/gtk2_ardour/editor.cc index 1b00ba9652..6f2773e138 100644 --- a/gtk2_ardour/editor.cc +++ b/gtk2_ardour/editor.cc @@ -5220,6 +5220,8 @@ Editor::add_routes (RouteList& routes) RouteTimeAxisView *rtv; list new_views; + TrackViewList new_selection; + bool from_scratch = (track_views.size() == 0); for (RouteList::iterator x = routes.begin(); x != routes.end(); ++x) { boost::shared_ptr route = (*x); @@ -5242,6 +5244,7 @@ Editor::add_routes (RouteList& routes) new_views.push_back (rtv); track_views.push_back (rtv); + new_selection.push_back (rtv); rtv->effective_gain_display (); @@ -5254,6 +5257,11 @@ Editor::add_routes (RouteList& routes) _summary->routes_added (new_views); } + if (!from_scratch) { + selection->add (new_selection); + begin_selection_op_history(); + } + if (show_editor_mixer_when_tracks_arrive) { show_editor_mixer (true); } diff --git a/gtk2_ardour/editor_routes.cc b/gtk2_ardour/editor_routes.cc index 21e8075d1a..e7a49105f3 100644 --- a/gtk2_ardour/editor_routes.cc +++ b/gtk2_ardour/editor_routes.cc @@ -685,10 +685,6 @@ EditorRoutes::routes_added (list routes) row[_columns.solo_safe_state] = (*x)->route()->solo_safe(); row[_columns.name_editable] = true; - if (!from_scratch) { - _editor->selection->add(*x); - } - boost::weak_ptr wr ((*x)->route()); (*x)->route()->gui_changed.connect (*this, MISSING_INVALIDATOR, boost::bind (&EditorRoutes::handle_gui_changes, this, _1, _2), gui_context());