13
0

Add API to check if a given region is part of the region-selection

This commit is contained in:
Robin Gareus 2017-03-12 01:20:14 +01:00
parent 0b6e2d1e46
commit 3477ecb0aa
2 changed files with 11 additions and 0 deletions

View File

@ -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,

View File

@ -47,6 +47,7 @@ class RegionSelection : public std::list<RegionView*>
void sort_by_position_and_track ();
bool contains (RegionView*) const;
bool contains (boost::shared_ptr<ARDOUR::Region>) const;
bool involves (const TimeAxisView&) const;
void clear_all();