From 521117054e7217ba80ebec26b0a918aaf60cdc39 Mon Sep 17 00:00:00 2001 From: Ben Loftis Date: Tue, 3 Aug 2021 10:38:07 -0500 Subject: [PATCH] US2400: Fix order of mixbuses in Flip mode (Mixbus only) --- .../us2400/us2400_control_protocol.cc | 26 +++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/libs/surfaces/us2400/us2400_control_protocol.cc b/libs/surfaces/us2400/us2400_control_protocol.cc index cd5698ff2a..91a2470d58 100644 --- a/libs/surfaces/us2400/us2400_control_protocol.cc +++ b/libs/surfaces/us2400/us2400_control_protocol.cc @@ -216,6 +216,24 @@ US2400Protocol::stripable_is_locked_to_strip (boost::shared_ptr r) co return false; } +struct StripableByMixbusOrder +{ + bool operator () (const boost::shared_ptr & a, const boost::shared_ptr & b) const + { + return a->mixbus() < b->mixbus(); + } + + bool operator () (const Stripable & a, const Stripable & b) const + { + return a.mixbus() < b.mixbus(); + } + + bool operator () (const Stripable * a, const Stripable * b) const + { + return a->mixbus() < b->mixbus(); + } +}; + // predicate for sort call in get_sorted_stripables struct StripableByPresentationOrder { @@ -267,7 +285,7 @@ US2400Protocol::get_sorted_stripables() #ifdef MIXBUS if (!s->presentation_info().hidden() && !s->mixbus()) { #else - if (!s->presentation_info().hidden()) { + if (is_track(s) && !s->presentation_info().hidden()) { #endif sorted.push_back (s); } @@ -287,7 +305,11 @@ US2400Protocol::get_sorted_stripables() } } - sort (sorted.begin(), sorted.end(), StripableByPresentationOrder()); + if (_view_mode == Busses) { + sort (sorted.begin(), sorted.end(), StripableByMixbusOrder()); + } else { + sort (sorted.begin(), sorted.end(), StripableByPresentationOrder()); + } return sorted; }