From 9321f46c453b3df226f0abc8ced6415e1d3e842d Mon Sep 17 00:00:00 2001 From: Colin Fletcher Date: Thu, 13 Sep 2018 14:05:47 -0400 Subject: Implement new Enclosed region equivalence mode --- libs/ardour/region.cc | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'libs/ardour/region.cc') diff --git a/libs/ardour/region.cc b/libs/ardour/region.cc index cad32cd4d7..d4afb7d9c4 100644 --- a/libs/ardour/region.cc +++ b/libs/ardour/region.cc @@ -1478,7 +1478,14 @@ Region::overlap_equivalent (boost::shared_ptr other) const } bool -Region::equivalent (boost::shared_ptr other) const +Region::enclosed_equivalent (boost::shared_ptr other) const +{ + return (first_sample() >= other->first_sample() && last_sample() <= other->last_sample()) || + (first_sample() <= other->first_sample() && last_sample() >= other->last_sample()) ; +} + +bool +Region::exact_equivalent (boost::shared_ptr other) const { return _start == other->_start && _position == other->_position && -- cgit v1.2.3