From ed98ff97b24fb313ec2682362e558b31ad3f77c4 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Sat, 2 Mar 2024 14:51:34 +0100 Subject: [PATCH] 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. --- gtk2_ardour/mixer_ui.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/gtk2_ardour/mixer_ui.cc b/gtk2_ardour/mixer_ui.cc index 44d98ff91d..ab0329737f 100644 --- a/gtk2_ardour/mixer_ui.cc +++ b/gtk2_ardour/mixer_ui.cc @@ -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 ();