13
0

Retain order of concurrent MIDI events

This fixes an issue with FaderPort8 (and maybe other surfaces or synths).
This commit is contained in:
Robin Gareus 2017-04-08 23:43:50 +02:00
parent d4f2121cfa
commit f9db9bf5fd
4 changed files with 4 additions and 4 deletions

View File

@ -2319,7 +2319,7 @@ void* AlsaMidiPort::get_buffer (pframes_t /* nframes */)
(_buffer[_bufperiod]).push_back (boost::shared_ptr<AlsaMidiEvent>(new AlsaMidiEvent (**it)));
}
}
std::sort ((_buffer[_bufperiod]).begin (), (_buffer[_bufperiod]).end (), MidiEventSorter());
std::stable_sort ((_buffer[_bufperiod]).begin (), (_buffer[_bufperiod]).end (), MidiEventSorter());
}
return &(_buffer[_bufperiod]);
}

View File

@ -2142,7 +2142,7 @@ void* CoreMidiPort::get_buffer (pframes_t /* nframes */)
(_buffer[_bufperiod]).push_back (boost::shared_ptr<CoreMidiEvent>(new CoreMidiEvent (**it)));
}
}
std::sort ((_buffer[_bufperiod]).begin (), (_buffer[_bufperiod]).end (), MidiEventSorter());
std::stable_sort ((_buffer[_bufperiod]).begin (), (_buffer[_bufperiod]).end (), MidiEventSorter());
}
return &(_buffer[_bufperiod]);

View File

@ -2134,7 +2134,7 @@ void* DummyMidiPort::get_buffer (pframes_t n_samples)
_buffer.push_back (boost::shared_ptr<DummyMidiEvent>(new DummyMidiEvent (**it)));
}
}
std::sort (_buffer.begin (), _buffer.end (), MidiEventSorter());
std::stable_sort (_buffer.begin (), _buffer.end (), MidiEventSorter());
} else if (is_output () && is_physical () && is_terminal()) {
if (!_gen_cycle) {
midi_generate(n_samples);

View File

@ -2374,7 +2374,7 @@ void* PortMidiPort::get_buffer (pframes_t /* nframes */)
(_buffer[_bufperiod]).push_back (boost::shared_ptr<PortMidiEvent>(new PortMidiEvent (**it)));
}
}
std::sort ((_buffer[_bufperiod]).begin (), (_buffer[_bufperiod]).end (), MidiEventSorter());
std::stable_sort ((_buffer[_bufperiod]).begin (), (_buffer[_bufperiod]).end (), MidiEventSorter());
}
return &(_buffer[_bufperiod]);
}