diff --git a/libs/ardour/ardour/region.h b/libs/ardour/ardour/region.h index 5d0413beb8..ab3e2886d6 100644 --- a/libs/ardour/ardour/region.h +++ b/libs/ardour/ardour/region.h @@ -205,6 +205,7 @@ public: bool size_equivalent (boost::shared_ptr) const; bool overlap_equivalent (boost::shared_ptr) const; bool enclosed_equivalent (boost::shared_ptr) const; + bool layer_and_time_equivalent (boost::shared_ptr) const; bool region_list_equivalent (boost::shared_ptr) const; bool source_equivalent (boost::shared_ptr) const; bool any_source_equivalent (boost::shared_ptr) const; diff --git a/libs/ardour/ardour/types.h b/libs/ardour/ardour/types.h index 733429b175..19c96fb130 100644 --- a/libs/ardour/ardour/types.h +++ b/libs/ardour/ardour/types.h @@ -631,7 +631,8 @@ typedef std::vector > BundleList; enum RegionEquivalence { Exact, Enclosed, - Overlap + Overlap, + LayerTime }; enum WaveformScale { diff --git a/libs/ardour/enums.cc b/libs/ardour/enums.cc index d0afc9a07b..1fd1359d5d 100644 --- a/libs/ardour/enums.cc +++ b/libs/ardour/enums.cc @@ -694,6 +694,7 @@ setup_enum_writer () REGISTER_ENUM(Exact); REGISTER_ENUM(Enclosed); REGISTER_ENUM(Overlap); + REGISTER_ENUM(LayerTime); REGISTER(_RegionEquivalence); REGISTER_ENUM(Linear); diff --git a/libs/ardour/playlist.cc b/libs/ardour/playlist.cc index 3dce9123a9..bf95fde434 100644 --- a/libs/ardour/playlist.cc +++ b/libs/ardour/playlist.cc @@ -846,6 +846,13 @@ Playlist::get_equivalent_regions (boost::shared_ptr other, vectorlayer_and_time_equivalent (other)) { + results.push_back (*i); + } + } + break; case Enclosed: for (RegionList::iterator i = regions.begin(); i != regions.end(); ++i) { if ((*i)->enclosed_equivalent (other)) { diff --git a/libs/ardour/region.cc b/libs/ardour/region.cc index deffd11224..13dcdff326 100644 --- a/libs/ardour/region.cc +++ b/libs/ardour/region.cc @@ -1484,6 +1484,14 @@ Region::enclosed_equivalent (boost::shared_ptr other) const (first_sample() <= other->first_sample() && last_sample() >= other->last_sample()) ; } +bool +Region::layer_and_time_equivalent (boost::shared_ptr other) const +{ + return _layer == other->_layer && + _position == other->_position && + _length == other->_length; +} + bool Region::exact_equivalent (boost::shared_ptr other) const {