summaryrefslogtreecommitdiff
path: root/libs/ardour/ardour/region_sorters.h
diff options
context:
space:
mode:
authorCarl Hetherington <carl@carlh.net>2011-12-27 01:42:49 +0000
committerCarl Hetherington <carl@carlh.net>2011-12-27 01:42:49 +0000
commit6304261b980419eaafde84bc32ff5e8f1c7aa236 (patch)
tree1261360e5eb22f7539a1a0afcc2d760ea017b7ad /libs/ardour/ardour/region_sorters.h
parent0082e3364f7682ff41df52305cfff2cf7a861ef3 (diff)
Re-work layering in possibly debatable ways. Sketchy docs in doc/layering.
git-svn-id: svn://localhost/ardour2/branches/3.0@11088 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour/ardour/region_sorters.h')
-rw-r--r--libs/ardour/ardour/region_sorters.h27
1 files changed, 10 insertions, 17 deletions
diff --git a/libs/ardour/ardour/region_sorters.h b/libs/ardour/ardour/region_sorters.h
index ee34dcaafe..0e3203ef20 100644
--- a/libs/ardour/ardour/region_sorters.h
+++ b/libs/ardour/ardour/region_sorters.h
@@ -30,31 +30,24 @@ struct RegionSortByPosition {
}
};
-struct RegionSortByLastLayerOp {
+struct RegionSortByLayer {
bool operator() (boost::shared_ptr<Region> a, boost::shared_ptr<Region> b) {
- return a->last_layer_op() < b->last_layer_op();
+ return a->layer() < b->layer();
}
};
-struct RegionSortByLayer {
+struct RegionSortByAdd {
bool operator() (boost::shared_ptr<Region> a, boost::shared_ptr<Region> b) {
- return a->layer() < b->layer();
+ return (
+ (a->last_layer_op (LayerOpAdd) < b->last_layer_op (LayerOpAdd))
+ );
}
};
-struct RegionSortByLayerWithPending {
- bool operator () (boost::shared_ptr<Region> a, boost::shared_ptr<Region> b) {
-
- double p = a->layer ();
- if (a->pending_explicit_relayer()) {
- p += 0.5;
- }
-
- double q = b->layer ();
- if (b->pending_explicit_relayer()) {
- q += 0.5;
- }
-
+struct RegionSortByAddOrBounds {
+ bool operator() (boost::shared_ptr<Region> a, boost::shared_ptr<Region> b) {
+ uint64_t const p = std::max (a->last_layer_op (LayerOpAdd), a->last_layer_op (LayerOpBoundsChange));
+ uint64_t const q = std::max (b->last_layer_op (LayerOpAdd), b->last_layer_op (LayerOpBoundsChange));
return p < q;
}
};