Comment remaining unsolved bug.
[ardour.git] / libs / backends / wavesaudio / waves_midiport.cc
index f071eda17c1c885fd050d39fd99443eedf930e1a..df9566ea7bb729d777f6e00d413acf7422b9c5dc 100644 (file)
@@ -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());
                }
        }