summaryrefslogtreecommitdiff
path: root/libs
diff options
context:
space:
mode:
authorRobin Gareus <robin@gareus.org>2017-02-17 00:50:52 +0100
committerRobin Gareus <robin@gareus.org>2017-02-17 00:50:52 +0100
commitd0e3eb42a62343ca91d5efef40003c0035039e7d (patch)
tree82c8e8c8b407a2830c2004bc6129a246cad8ad70 /libs
parent91cee14ca670b3c93a2eb6cab79c1fbf3d4b71c9 (diff)
Fix initial order-keys when creating tracks/busses
.. and leave some notes for the day when UI treemodel won't be canonical to set order-keys.
Diffstat (limited to 'libs')
-rw-r--r--libs/ardour/session.cc21
1 files changed, 21 insertions, 0 deletions
diff --git a/libs/ardour/session.cc b/libs/ardour/session.cc
index 540665be18..e28685d03f 100644
--- a/libs/ardour/session.cc
+++ b/libs/ardour/session.cc
@@ -3484,6 +3484,16 @@ Session::add_routes_inner (RouteList& new_routes, bool input_auto_connect, bool
}
}
+ /* auditioner and monitor routes are not part of the order */
+ if (auditioner) {
+ assert (n_routes > 0);
+ --n_routes;
+ }
+ if (_monitor_out) {
+ assert (n_routes > 0);
+ --n_routes;
+ }
+
DEBUG_TRACE (DEBUG::OrderKeys, string_compose ("ensure order gap starting at %1 for %2\n", order, new_routes.size()));
ensure_route_presentation_info_gap (order, new_routes.size());
@@ -3532,6 +3542,17 @@ Session::add_routes_inner (RouteList& new_routes, bool input_auto_connect, bool
/* presentation info order may already have been set from XML */
if (!r->presentation_info().order_set()) {
+ /* this is only useful for headless sessions,
+ * Editor::add_routes() and Mixer_UI::add_routes() will
+ * override it following the RouteAdded signal.
+ *
+ * Also routes should be sorted before VCAs (like the GUI does).
+ * Session::ensure_route_presentation_info_gap() does not special case VCAs either.
+ *
+ * ... but not to worry, the GUI's
+ * gtk2_ardour/route_sorter.h and various ::sync_presentation_info_from_treeview()
+ * handle this :)
+ */
if (order == PresentationInfo::max_order) {
/* just add to the end */