X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=libs%2Fbackends%2Fwavesaudio%2Fwaves_midiport.cc;h=df9566ea7bb729d777f6e00d413acf7422b9c5dc;hb=ef9713d5c6ff7e2fc0c829d59d7edc652f49d8c2;hp=cadf36eb2a6515b57e37bde3bc28c74d9cab3134;hpb=8c9749e42faf7808034ed8b7afce4a2fe6dc6f33;p=ardour.git diff --git a/libs/backends/wavesaudio/waves_midiport.cc b/libs/backends/wavesaudio/waves_midiport.cc index cadf36eb2a..df9566ea7b 100644 --- a/libs/backends/wavesaudio/waves_midiport.cc +++ b/libs/backends/wavesaudio/waves_midiport.cc @@ -1,5 +1,5 @@ /* - Copyright (C) 2013 Gorobchenko Dmytro + Copyright (C) 2013 Waves Audio Ltd. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -26,10 +26,16 @@ WavesMidiPort::WavesMidiPort (const std::string& port_name, PortFlags flags) : WavesDataPort (port_name, flags) , _midi_device (NULL) , _waves_midi_buffer (port_name) -{ +{ } -void* +struct MidiEventSorter { + bool operator() (const WavesMidiEvent* a, const WavesMidiEvent* b) { + return *a < *b; + } +}; + +void* WavesMidiPort::get_buffer (pframes_t nframes) { if (is_input ()) { @@ -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()); } } @@ -58,4 +64,4 @@ void WavesMidiPort::_wipe_buffer() { _waves_midi_buffer.clear (); -} \ No newline at end of file +}