diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2016-03-04 15:40:44 -0500 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2016-05-31 15:30:39 -0400 |
commit | cd6a88d0d4d925be253f1cc394236b7a27909547 (patch) | |
tree | aba649a9bcacf730421bdbf711ef4b4f186bd1db /gtk2_ardour | |
parent | 6f9beb1e332319967ddebf12223a12476766833c (diff) |
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
Diffstat (limited to 'gtk2_ardour')
-rw-r--r-- | gtk2_ardour/mixer_ui.cc | 8 |
1 files 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<Route> 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); } |