Evoral: add ControlList::has_event_at (timepos_t)
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user