mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-21 14:16:31 +01:00
Evoral: add ControlList::has_event_at (timepos_t)
This commit is contained in:
parent
2eb1a31e16
commit
a33edcb3af
2 changed files with 13 additions and 0 deletions
|
|
@ -2350,4 +2350,15 @@ ControlList::dump (ostream& o)
|
|||
}
|
||||
}
|
||||
|
||||
bool
|
||||
ControlList::has_event_at (Temporal::timepos_t const & pos) const
|
||||
{
|
||||
const ControlEvent fake (pos, 0.);
|
||||
EventList::const_iterator i = std::lower_bound (_events.begin(), _events.end(), &fake, time_comparator);
|
||||
if ((i == _events.end()) || ((*i)->when != pos)) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
} // namespace Evoral
|
||||
|
|
|
|||
|
|
@ -213,6 +213,8 @@ public:
|
|||
std::shared_ptr<ControlList> cut (Temporal::timepos_t const &, Temporal::timepos_t const &);
|
||||
std::shared_ptr<ControlList> copy (Temporal::timepos_t const &, Temporal::timepos_t const &);
|
||||
|
||||
bool has_event_at (Temporal::timepos_t const &) const;
|
||||
|
||||
/** Remove all events in the given time range from this list.
|
||||
*
|
||||
* @param start start of range (inclusive) in audio samples
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue