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.
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user