diff options
-rw-r--r-- | libs/ardour/ardour/region.h | 1 | ||||
-rw-r--r-- | libs/ardour/ardour/types.h | 3 | ||||
-rw-r--r-- | libs/ardour/enums.cc | 1 | ||||
-rw-r--r-- | libs/ardour/playlist.cc | 7 | ||||
-rw-r--r-- | libs/ardour/region.cc | 8 |
5 files changed, 19 insertions, 1 deletions
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 Region>) const; bool overlap_equivalent (boost::shared_ptr<const Region>) const; bool enclosed_equivalent (boost::shared_ptr<const Region>) const; + bool layer_and_time_equivalent (boost::shared_ptr<const Region>) const; bool region_list_equivalent (boost::shared_ptr<const Region>) const; bool source_equivalent (boost::shared_ptr<const Region>) const; bool any_source_equivalent (boost::shared_ptr<const Region>) 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<boost::shared_ptr<Bundle> > 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<Region> other, vector<boost: } } break; + case LayerTime: + for (RegionList::iterator i = regions.begin(); i != regions.end(); ++i) { + if ((*i)->layer_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 @@ -1485,6 +1485,14 @@ Region::enclosed_equivalent (boost::shared_ptr<const Region> other) const } bool +Region::layer_and_time_equivalent (boost::shared_ptr<const Region> other) const +{ + return _layer == other->_layer && + _position == other->_position && + _length == other->_length; +} + +bool Region::exact_equivalent (boost::shared_ptr<const Region> other) const { return _start == other->_start && |