diff options
author | Robin Gareus <robin@gareus.org> | 2017-03-12 01:20:14 +0100 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2017-03-12 01:20:14 +0100 |
commit | 3477ecb0aa454632b39e18f024e743c2946587cb (patch) | |
tree | 16001a9164dadfa8b52982d5632c14208f1c3f7e /gtk2_ardour/region_selection.cc | |
parent | 0b6e2d1e46b9dfe72fe879d2ddddafeafda07023 (diff) |
Add API to check if a given region is part of the region-selection
Diffstat (limited to 'gtk2_ardour/region_selection.cc')
-rw-r--r-- | gtk2_ardour/region_selection.cc | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/gtk2_ardour/region_selection.cc b/gtk2_ardour/region_selection.cc index 3161b01007..cf9542cb64 100644 --- a/gtk2_ardour/region_selection.cc +++ b/gtk2_ardour/region_selection.cc @@ -87,6 +87,16 @@ bool RegionSelection::contains (RegionView* rv) const return find (begin(), end(), rv) != end(); } +bool RegionSelection::contains (boost::shared_ptr<ARDOUR::Region> region) const +{ + for (const_iterator r = begin (); r != end (); ++r) { + if ((*r)->region () == region) { + return true; + } + } + return false; +} + /** Add a region to the selection. * @param rv Region to add. * @return false if we already had the region or if it cannot be added, |