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:
@@ -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();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user