summaryrefslogtreecommitdiff
path: root/gtk2_ardour/editor_routes.cc
diff options
context:
space:
mode:
authorLen Ovens <len@ovenwerks.net>2016-11-04 08:39:41 -0700
committerLen Ovens <len@ovenwerks.net>2016-11-04 08:39:41 -0700
commit1457050d7aa2f5e0bee1957ff3710f58c04a2c62 (patch)
tree9803c64e57f4a532dd8a25d25561f6b8e5f83f04 /gtk2_ardour/editor_routes.cc
parent8fb8e1bbde25f996533e345ba515a7411525916a (diff)
Fix Drifting Master hopefully for real this time.
Diffstat (limited to 'gtk2_ardour/editor_routes.cc')
-rw-r--r--gtk2_ardour/editor_routes.cc22
1 files changed, 22 insertions, 0 deletions
diff --git a/gtk2_ardour/editor_routes.cc b/gtk2_ardour/editor_routes.cc
index 6ea6a1d724..2754ba3dd8 100644
--- a/gtk2_ardour/editor_routes.cc
+++ b/gtk2_ardour/editor_routes.cc
@@ -1013,6 +1013,14 @@ EditorRoutes::sync_presentation_info_from_treeview ()
TreeModel::Children::iterator ri;
bool change = false;
PresentationInfo::order_t order = 0;
+ bool master_is_first = false;
+ uint32_t count = 0;
+
+ // special case master if it's got PI order 0 lets keep it there
+ if (_session->master_out() && (_session->master_out()->presentation_info().order() == 0)) {
+ order++;
+ master_is_first = true;
+ }
for (ri = rows.begin(); ri != rows.end(); ++ri) {
@@ -1029,12 +1037,26 @@ EditorRoutes::sync_presentation_info_from_treeview ()
stripable->presentation_info().set_hidden (!visible);
+ /* special case master if it's got PI order 0 lets keep it there
+ * but still allow master to move if first non-master route has
+ * presentation order 1
+ */
+ if ((count == 0) && master_is_first && (stripable->presentation_info().order() == 1)) {
+ master_is_first = false;
+ order = 0;
+ }
+
+ if (stripable->is_master() && (master_is_first == true)) {
+ continue;
+ }
+
if (order != stripable->presentation_info().order()) {
stripable->set_presentation_order (order, false);
change = true;
}
++order;
+ ++count;
}
if (change) {