From cd6a88d0d4d925be253f1cc394236b7a27909547 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Fri, 4 Mar 2016 15:40:44 -0500 Subject: [PATCH] fix incorrect selection of all strips/tracks at opening. Old code was counting how many child nodes where in the MixerUI, assuming they were all routes, and using that to decide if this was a from_scratch setup. The addition of VCAs to the track_model changes that, so now we have to actually check there are no existing Routes before doing the from_scratch setup --- gtk2_ardour/mixer_ui.cc | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/gtk2_ardour/mixer_ui.cc b/gtk2_ardour/mixer_ui.cc index 5313bb2ac4..c7e827ef3e 100644 --- a/gtk2_ardour/mixer_ui.cc +++ b/gtk2_ardour/mixer_ui.cc @@ -398,8 +398,8 @@ Mixer_UI::remove_master (VCAMasterStrip* vms) void Mixer_UI::add_strips (RouteList& routes) { - bool from_scratch = track_model->children().size() == 0; Gtk::TreeModel::Children::iterator insert_iter = track_model->children().end(); + uint32_t nroutes = 0; for (Gtk::TreeModel::Children::iterator it = track_model->children().begin(); it != track_model->children().end(); ++it) { boost::shared_ptr r = (*it)[track_columns.route]; @@ -408,13 +408,15 @@ Mixer_UI::add_strips (RouteList& routes) continue; } + nroutes++; + if (r->order_key() == (routes.front()->order_key() + routes.size())) { insert_iter = it; break; } } - if(!from_scratch) { + if (nroutes) { _selection.clear_routes (); } @@ -476,7 +478,7 @@ Mixer_UI::add_strips (RouteList& routes) row[track_columns.strip] = strip; row[track_columns.vca] = 0; - if (!from_scratch) { + if (nroutes != 0) { _selection.add (strip); }