X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=gtk2_ardour%2Froute_sorter.h;h=fb7f574d720a4026160236c1466ce325fa4074ad;hb=2eae3b5cd19e845a2258fb578548c2b571e46348;hp=e84788243cfd474ce0c0317aaa960d3a036d146f;hpb=a0f0bdc063e81fd6f98fbcb1268538106cca753a;p=ardour.git diff --git a/gtk2_ardour/route_sorter.h b/gtk2_ardour/route_sorter.h index e84788243c..fb7f574d72 100644 --- a/gtk2_ardour/route_sorter.h +++ b/gtk2_ardour/route_sorter.h @@ -26,26 +26,29 @@ #include "ardour/stripable.h" -struct OrderKeys { +/* This is used to keep numerical tree-order in sync + * with Stripable ordering (mixer_ui.cc editor_routes.cc) + */ + +struct TreeOrderKey { uint32_t old_display_order; - uint32_t new_display_order; + boost::shared_ptr stripable; - OrderKeys (uint32_t ok, uint32_t nk) + TreeOrderKey (uint32_t ok, boost::shared_ptr s) : old_display_order (ok) - , new_display_order (nk) {} + , stripable (s) + {} }; -typedef std::vector OrderingKeys; - -struct SortByNewDisplayOrder { - bool operator() (const OrderKeys& a, const OrderKeys& b) { - return a.new_display_order < b.new_display_order; - } -}; +typedef std::vector TreeOrderKeys; -struct StripablePresentationInfoSorter { - bool operator() (boost::shared_ptr a, boost::shared_ptr b) { - return a->presentation_info().order () < b->presentation_info().order (); +struct TreeOrderKeySorter +{ + bool operator() (const TreeOrderKey& ok_a, const TreeOrderKey& ok_b) + { + boost::shared_ptr const& a = ok_a.stripable; + boost::shared_ptr const& b = ok_b.stripable; + return ARDOUR::Stripable::Sorter () (a, b); } };