diff options
author | Robin Gareus <robin@gareus.org> | 2015-09-14 04:55:01 +0200 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2015-09-14 04:55:01 +0200 |
commit | e63c3d028aac5880c36f1eb17892a5b42d5d565a (patch) | |
tree | 41fd27c3c259586bd04fb950eb3ce4f2944beea3 /libs/evoral/evoral | |
parent | 67aa2f876344e6052d634575529e9821f6458f9e (diff) |
note-off ordering - fixes #6340
Evoral::Beats::operator>() rounds to (1.0 / PPQN), hardcoded 1/1920.0.
If the time difference between two events is smaller than 1/PPQN,
Beats::operator>() and Beats::operator<() produce ambiguous results.
The same pair of values is both "less than" and "greater than" depending
which operator is used.
While it's fine for some cases to ignore the order of nearly concurent
events, the std::priority_queue must be strictly ordered.
Diffstat (limited to 'libs/evoral/evoral')
-rw-r--r-- | libs/evoral/evoral/Sequence.hpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/libs/evoral/evoral/Sequence.hpp b/libs/evoral/evoral/Sequence.hpp index dd5dd17e19..93e97c65e1 100644 --- a/libs/evoral/evoral/Sequence.hpp +++ b/libs/evoral/evoral/Sequence.hpp @@ -134,6 +134,7 @@ public: } }; +#if 0 // NOT USED struct LaterNoteComparator { typedef const Note<Time>* value_type; inline bool operator()(const boost::shared_ptr< const Note<Time> > a, @@ -141,12 +142,13 @@ public: return a->time() > b->time(); } }; +#endif struct LaterNoteEndComparator { typedef const Note<Time>* value_type; inline bool operator()(const boost::shared_ptr< const Note<Time> > a, const boost::shared_ptr< const Note<Time> > b) const { - return a->end_time() > b->end_time(); + return a->end_time().to_double() > b->end_time().to_double(); } }; |