diff options
author | Len Ovens <len@ovenwerks.net> | 2016-11-04 08:39:41 -0700 |
---|---|---|
committer | Len Ovens <len@ovenwerks.net> | 2016-11-04 08:39:41 -0700 |
commit | 1457050d7aa2f5e0bee1957ff3710f58c04a2c62 (patch) | |
tree | 9803c64e57f4a532dd8a25d25561f6b8e5f83f04 /gtk2_ardour | |
parent | 8fb8e1bbde25f996533e345ba515a7411525916a (diff) |
Fix Drifting Master hopefully for real this time.
Diffstat (limited to 'gtk2_ardour')
-rw-r--r-- | gtk2_ardour/ardour_ui.cc | 3 | ||||
-rw-r--r-- | gtk2_ardour/editor_routes.cc | 22 | ||||
-rw-r--r-- | gtk2_ardour/mixer_ui.cc | 10 |
3 files changed, 33 insertions, 2 deletions
diff --git a/gtk2_ardour/ardour_ui.cc b/gtk2_ardour/ardour_ui.cc index 1b72edbebb..8c2ec76053 100644 --- a/gtk2_ardour/ardour_ui.cc +++ b/gtk2_ardour/ardour_ui.cc @@ -4053,8 +4053,7 @@ PresentationInfo::order_t ARDOUR_UI::translate_order (RouteDialogs::InsertAt place) { if (editor->get_selection().tracks.empty()) { - // tracks empty actually means we have master, add 1 - return PresentationInfo::max_order + 1; + return PresentationInfo::max_order; } PresentationInfo::order_t order_hint = PresentationInfo::max_order; 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) { diff --git a/gtk2_ardour/mixer_ui.cc b/gtk2_ardour/mixer_ui.cc index edae72fe6c..e8b88c2f93 100644 --- a/gtk2_ardour/mixer_ui.cc +++ b/gtk2_ardour/mixer_ui.cc @@ -714,6 +714,11 @@ Mixer_UI::sync_presentation_info_from_treeview () bool change = false; uint32_t order = 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++; + } + for (ri = rows.begin(); ri != rows.end(); ++ri) { bool visible = (*ri)[stripable_columns.visible]; boost::shared_ptr<Stripable> stripable = (*ri)[stripable_columns.stripable]; @@ -736,6 +741,11 @@ Mixer_UI::sync_presentation_info_from_treeview () stripable->presentation_info().set_hidden (!visible); + // master may not get set here, but if it is zero keep it there + if (stripable->is_master() && (stripable->presentation_info().order() == 0)) { + continue; + } + if (order != stripable->presentation_info().order()) { stripable->set_presentation_order (order, false); change = true; |