Evoral: add ControlList::has_event_at (timepos_t)

This commit is contained in:
Paul Davis 2025-08-21 18:54:20 -06:00 committed by Edgar Aichinger
parent 2eb1a31e16
commit a33edcb3af
2 changed files with 13 additions and 0 deletions

View file

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