From 1457050d7aa2f5e0bee1957ff3710f58c04a2c62 Mon Sep 17 00:00:00 2001 From: Len Ovens Date: Fri, 4 Nov 2016 08:39:41 -0700 Subject: Fix Drifting Master hopefully for real this time. --- gtk2_ardour/editor_routes.cc | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'gtk2_ardour/editor_routes.cc') 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) { -- cgit v1.2.3