diff options
Diffstat (limited to 'libs/ardour/ardour')
-rw-r--r-- | libs/ardour/ardour/region_sorters.h | 13 |
1 files changed, 13 insertions, 0 deletions
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<Region> a, boost::shared_ptr<Region> b) { + return + (a->layer() < b->layer() && a->position() < b->position()) + || (a->layer() == b->layer() && a->position() < b->position()); + } +}; + } // namespace #endif /* __libardour_region_sorters_h__ */ |