X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=libs%2Fardour%2Fardour%2Fregion_sorters.h;h=3afd66bf3ca9613ef61a639d120e9c0e2fb411b4;hb=0b471df0c3883bb04103f006192652e6d6eb6807;hp=9fd739a4da725c66588f82e64da0602f4cb239ab;hpb=b9185d2c07c77eccf3679ac99f6b69f8fdd79c48;p=ardour.git diff --git a/libs/ardour/ardour/region_sorters.h b/libs/ardour/ardour/region_sorters.h index 9fd739a4da..3afd66bf3c 100644 --- a/libs/ardour/ardour/region_sorters.h +++ b/libs/ardour/ardour/region_sorters.h @@ -36,6 +36,19 @@ struct LIBARDOUR_API RegionSortByLayer { } }; +/* sort by RegionSortByLayerAndPosition() + * is equivalent to + * stable_sort by RegionSortByPosition(); + * stable_sort by RegionSortByLayer(); + */ +struct LIBARDOUR_API RegionSortByLayerAndPosition { + bool operator() (boost::shared_ptr a, boost::shared_ptr b) { + return + (a->layer() < b->layer() && a->position() < b->position()) + || (a->layer() == b->layer() && a->position() < b->position()); + } +}; + } // namespace #endif /* __libardour_region_sorters_h__ */