diff options
Diffstat (limited to 'muse2/muse/eventlist.cpp')
-rw-r--r-- | muse2/muse/eventlist.cpp | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/muse2/muse/eventlist.cpp b/muse2/muse/eventlist.cpp index 50ba2652..f499fd2d 100644 --- a/muse2/muse/eventlist.cpp +++ b/muse2/muse/eventlist.cpp @@ -129,11 +129,22 @@ void EventList::move(Event& event, unsigned tick) //--------------------------------------------------------- iEvent EventList::find(const Event& event) +{ + std::pair<iEvent,iEvent> range = equal_range(event.type() == Wave ? event.frame() : event.tick()); + + for (iEvent i = range.first; i != range.second; ++i) { + if (i->second == event) + return i; + } + return end(); +} + +ciEvent EventList::find(const Event& event) const { EventRange range = equal_range(event.type() == Wave ? event.frame() : event.tick()); - for (iEvent i = range.first; i != range.second; ++i) { + for (ciEvent i = range.first; i != range.second; ++i) { if (i->second == event) return i; } |