13
0

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.
This commit is contained in:
Robin Gareus 2015-09-14 04:55:01 +02:00
parent 67aa2f8763
commit e63c3d028a

View File

@ -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();
}
};