InstrumentTrack: check for instrument instance in processOutEvent()

There are situations where processOutEvent() is being called while
loading instrument track settings e.g. when loading the pitch model
whose dataChanged() signal is connected to InstrumentTrack::updatePitch()
which in turn calls processOutEvent(). At this time we do not have an
instrument instance and therefore have to skip processing.

Closes #164.
This commit is contained in:
Tobias Doerffel
2014-01-26 09:46:20 +01:00
parent 13917973c5
commit c5ab13e5c5

View File

@@ -356,6 +356,12 @@ void InstrumentTrack::processInEvent( const MidiEvent& event, const MidiTime& ti
void InstrumentTrack::processOutEvent( const MidiEvent& event, const MidiTime& time )
{
// do nothing if we do not have an instrument instance (e.g. when loading settings)
if( m_instrument == NULL )
{
return;
}
const MidiEvent transposedEvent = applyMasterKey( event );
const int key = transposedEvent.key();