13
0

Fix EventsSortByTimeAndType (type/event-type API mismatch)

Correct use would be
`parameter_is_midi (midi_parameter_type (ev->type()))`
However that only checks for control params. Note events
are excluded.
This commit is contained in:
Robin Gareus 2022-09-10 18:12:16 +02:00
parent b67b18483c
commit c457dd2eac
Signed by: rgareus
GPG Key ID: A090BCE02CF57F04

View File

@ -95,13 +95,13 @@ template<typename Time>
struct EventsSortByTimeAndType {
bool operator() (const Evoral::Event<Time>* a, const Evoral::Event<Time>* b) {
if (a->time() == b->time()) {
if (parameter_is_midi ((AutomationType)a->event_type()) &&
parameter_is_midi ((AutomationType)b->event_type())) {
if (a->is_midi () && b->is_midi ()) {
/* negate return value since we must return whether
* or not a should sort before b, not b before a
*/
return !MidiBuffer::second_simultaneous_midi_byte_is_first (a->buffer()[0], b->buffer()[0]);
}
return a->type () < b->type ();
}
return a->time() < b->time();
}