diff options
author | Robin Gareus <robin@gareus.org> | 2017-06-16 23:44:29 +0200 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2017-06-17 04:36:28 +0200 |
commit | 10db824461e3bd8eb0661ddfb35da283192e8c29 (patch) | |
tree | 8c1a954193147b548dbbc4de8e70cc304a2cab7c /libs/ardour/session.cc | |
parent | 867a0f5228ae7b9ad3d05142e58762d4f7ef3936 (diff) |
Use Stripable::Sorter in libs
Diffstat (limited to 'libs/ardour/session.cc')
-rw-r--r-- | libs/ardour/session.cc | 34 |
1 files changed, 3 insertions, 31 deletions
diff --git a/libs/ardour/session.cc b/libs/ardour/session.cc index 80586acac3..6c2cbd3601 100644 --- a/libs/ardour/session.cc +++ b/libs/ardour/session.cc @@ -4469,7 +4469,7 @@ Session::get_remote_nth_stripable (PresentationInfo::order_t n, PresentationInfo PresentationInfo::order_t match_cnt = 0; get_stripables (sl); - sl.sort (Stripable::PresentationOrderSorter()); + sl.sort (Stripable::Sorter()); for (StripableList::const_iterator s = sl.begin(); s != sl.end(); ++s) { @@ -4501,26 +4501,11 @@ Session::get_remote_nth_stripable (PresentationInfo::order_t n, PresentationInfo return boost::shared_ptr<Stripable>(); } -struct PresentationOrderSorter { - bool operator() (boost::shared_ptr<Stripable> a, boost::shared_ptr<Stripable> b) { - if (a->presentation_info().special() && !b->presentation_info().special()) { - /* a is not ordered, b is; b comes before a */ - return false; - } else if (!b->presentation_info().order_set() && a->presentation_info().order_set()) { - /* b is not ordered, a is; a comes before b */ - return true; - } else { - return a->presentation_info().order() < b->presentation_info().order(); - } - } -}; - boost::shared_ptr<Route> Session::route_by_selected_count (uint32_t id) const { RouteList r (*(routes.reader ())); - PresentationOrderSorter sorter; - r.sort (sorter); + r.sort (Stripable::Sorter()); RouteList::iterator i; @@ -4542,8 +4527,7 @@ Session::reassign_track_numbers () int64_t tn = 0; int64_t bn = 0; RouteList r (*(routes.reader ())); - PresentationOrderSorter sorter; - r.sort (sorter); + r.sort (Stripable::Sorter()); StateProtector sp (this); @@ -5634,18 +5618,6 @@ Session::cancel_audition () } bool -Session::RoutePublicOrderSorter::operator() (boost::shared_ptr<Route> a, boost::shared_ptr<Route> b) -{ - if (a->is_monitor()) { - return true; - } - if (b->is_monitor()) { - return false; - } - return a->presentation_info().order() < b->presentation_info().order(); -} - -bool Session::is_auditioning () const { /* can be called before we have an auditioner object */ |