diff options
author | Robin Gareus <robin@gareus.org> | 2017-06-17 02:31:03 +0200 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2017-06-17 04:36:32 +0200 |
commit | 140c511d2c123aafdb5f74ce0be070e2b464f7dc (patch) | |
tree | ffaa59c64fc06cf17b47d2eaf7477f1aca91dc3b /libs/ardour/session.cc | |
parent | 10db824461e3bd8eb0661ddfb35da283192e8c29 (diff) |
Add method to ensure Stripable sort constrains (for UI use)
Diffstat (limited to 'libs/ardour/session.cc')
-rw-r--r-- | libs/ardour/session.cc | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/libs/ardour/session.cc b/libs/ardour/session.cc index 6c2cbd3601..ae1aff5498 100644 --- a/libs/ardour/session.cc +++ b/libs/ardour/session.cc @@ -3037,6 +3037,30 @@ Session::reconnect_mmc_ports(bool inputs) #endif +bool +Session::ensure_stripable_sort_order () +{ + StripableList sl; + get_stripables (sl); + sl.sort (Stripable::Sorter ()); + + bool change = false; + PresentationInfo::order_t order = 0; + + for (StripableList::iterator si = sl.begin(); si != sl.end(); ++si) { + boost::shared_ptr<Stripable> s (*si); + if (s->is_monitor () || s->is_auditioner ()) { + continue; + } + if (order != s->presentation_info().order()) { + s->set_presentation_order (order); + change = true; + } + ++order; + } + return change; +} + void Session::ensure_route_presentation_info_gap (PresentationInfo::order_t first_new_order, uint32_t how_many) { |