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
This commit is contained in:
Paul Davis 2016-03-04 15:40:44 -05:00
parent 6f9beb1e33
commit cd6a88d0d4
1 changed files with 5 additions and 3 deletions

View File

@ -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);
}