diff options
Diffstat (limited to 'muse2/muse/eventlist.cpp')
-rw-r--r-- | muse2/muse/eventlist.cpp | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/muse2/muse/eventlist.cpp b/muse2/muse/eventlist.cpp index ecc7f452..80180ab7 100644 --- a/muse2/muse/eventlist.cpp +++ b/muse2/muse/eventlist.cpp @@ -151,6 +151,29 @@ ciEvent EventList::find(const Event& event) const return end(); } +iEvent EventList::findSimilar(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.isSimilarTo(event)) + return i; + } + return end(); +} + +ciEvent EventList::findSimilar(const Event& event) const + { + EventRange range = equal_range(event.type() == Wave ? event.frame() : event.tick()); + + + for (ciEvent i = range.first; i != range.second; ++i) { + if (i->second.isSimilarTo(event)) + return i; + } + return end(); + } + //--------------------------------------------------------- // dump //--------------------------------------------------------- |