another replacement of ActionManager::get_action() by ActionMap::find_action()
[ardour.git] / gtk2_ardour / route_sorter.h
index e84788243cfd474ce0c0317aaa960d3a036d146f..fb7f574d720a4026160236c1466ce325fa4074ad 100644 (file)
 
 #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<ARDOUR::Stripable> stripable;
 
-       OrderKeys (uint32_t ok, uint32_t nk)
+       TreeOrderKey (uint32_t ok, boost::shared_ptr<ARDOUR::Stripable> s)
                : old_display_order (ok)
-               , new_display_order (nk) {}
+               , stripable (s)
+       {}
 };
 
-typedef std::vector<OrderKeys> OrderingKeys;
-
-struct SortByNewDisplayOrder {
-    bool operator() (const OrderKeys& a, const OrderKeys& b) {
-           return a.new_display_order < b.new_display_order;
-    }
-};
+typedef std::vector<TreeOrderKey> TreeOrderKeys;
 
-struct StripablePresentationInfoSorter {
-       bool operator() (boost::shared_ptr<ARDOUR::Stripable> a, boost::shared_ptr<ARDOUR::Stripable> 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<ARDOUR::Stripable> const& a = ok_a.stripable;
+               boost::shared_ptr<ARDOUR::Stripable> const& b = ok_b.stripable;
+               return ARDOUR::Stripable::Sorter () (a, b);
        }
 };