Add API to check if a given region is part of the region-selection
This commit is contained in:
parent
0b6e2d1e46
commit
3477ecb0aa
@ -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,
|
||||
|
@ -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();
|
||||
|
Loading…
Reference in New Issue
Block a user