Fix adding new route in front (#9651)

When adding a new route using "Front", its presentation info
order is set to 1, after the master-bus which has PI order 0.
(see Session::ensure_route_presentation_info_gap).

Mixer_UI::add_stripables, looks up the insert iterator:
"after the route with order 0", but since the master bus is
not in mixer's track-model, the insert-iterator is left "at end".

A later call to `sync_presentation_info_from_treeview` then updated
the new track's order key to be at the end.
This commit is contained in:
Robin Gareus 2024-03-02 14:51:34 +01:00
parent 256d3b1d52
commit ed98ff97b2
Signed by: rgareus
GPG Key ID: A090BCE02CF57F04
1 changed files with 3 additions and 1 deletions

View File

@ -588,6 +588,8 @@ Mixer_UI::add_stripables (StripableList& slist)
nroutes++;
// XXX what does this special case do?
// A: it inserts the new track at the correct point in the model
// uness it's the the first (after master-bus, which is not in Mixbus track-model)
if (s->presentation_info().order() == (slist.front()->presentation_info().order() + slist.size())) {
insert_iter = it;
break;
@ -716,7 +718,7 @@ Mixer_UI::add_stripables (StripableList& slist)
track_display.set_model (track_model);
if (!from_scratch) {
sync_presentation_info_from_treeview ();
sync_treeview_from_presentation_info (Properties::order);
}
redisplay_track_list ();