From da481b2930c17f39c802ee4ad10644d6884f3355 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Thu, 9 Oct 2014 09:43:53 +0200 Subject: [PATCH] fix wavesbackend midi timing --- libs/backends/wavesaudio/waves_midiport.cc | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/libs/backends/wavesaudio/waves_midiport.cc b/libs/backends/wavesaudio/waves_midiport.cc index f071eda17c..aac5be06ed 100644 --- a/libs/backends/wavesaudio/waves_midiport.cc +++ b/libs/backends/wavesaudio/waves_midiport.cc @@ -29,6 +29,12 @@ WavesMidiPort::WavesMidiPort (const std::string& port_name, PortFlags flags) { } +struct MidiEventSorter { + bool operator() (const WavesMidiEvent* a, const WavesMidiEvent* b) { + return *a < *b; + } +}; + void* WavesMidiPort::get_buffer (pframes_t nframes) { @@ -47,7 +53,7 @@ WavesMidiPort::get_buffer (pframes_t nframes) target += ((const WavesMidiPort*)*cit)->const_buffer (); }while((++cit) != get_connections ().end ()); - std::sort (target.begin (), target.end ()); + std::sort (target.begin (), target.end (), MidiEventSorter()); } }