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
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];
continue;
}
+ nroutes++;
+
if (r->order_key() == (routes.front()->order_key() + routes.size())) {
insert_iter = it;
break;
}
}
- if(!from_scratch) {
+ if (nroutes) {
_selection.clear_routes ();
}
row[track_columns.strip] = strip;
row[track_columns.vca] = 0;
- if (!from_scratch) {
+ if (nroutes != 0) {
_selection.add (strip);
}