From 4ba5edc32c35b07f6a2e3d9f876b2ee4fff3da7a Mon Sep 17 00:00:00 2001 From: Tobias Doerffel Date: Sun, 26 Jan 2014 10:17:10 +0100 Subject: [PATCH] InstrumentTrack: generally do not forward NoteOn/NoteOff/KeyPressure events If we receive MidiNoteOn, MidiNoteOff or MidiKeyPressure events we always kind of handle them in processInEvent() so do not forward them to the instrument. This fixes a freeze when loading VST plugins as PianoView::focusOutEvent() tried to send MIDI events to the not yet completely loaded and thus locked VST plugin. Closes #160. --- src/tracks/InstrumentTrack.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/tracks/InstrumentTrack.cpp b/src/tracks/InstrumentTrack.cpp index 8cd840ced..a326716fc 100644 --- a/src/tracks/InstrumentTrack.cpp +++ b/src/tracks/InstrumentTrack.cpp @@ -251,10 +251,9 @@ void InstrumentTrack::processInEvent( const MidiEvent& event, const MidiTime& ti } emit noteOn( n ); - - eventHandled = true; - } + + eventHandled = true; break; } @@ -277,20 +276,19 @@ void InstrumentTrack::processInEvent( const MidiEvent& event, const MidiTime& ti // be deleted later automatically) nph->noteOff(); m_notes[event.key()] = NULL; - - eventHandled = true; } + eventHandled = true; break; } case MidiKeyPressure: if( m_notes[event.key()] != NULL ) { - eventHandled = true; // setVolume() calls processOutEvent() with MidiKeyPressure so the // attached instrument will receive the event as well m_notes[event.key()]->setVolume( event.volume() ); } + eventHandled = true; break; case MidiPitchBend: