PianoView: send NoteOff MIDI events for all keys on focus out

Commit 491910357b was a first try to fix
bug #3052228 but it broke InstrumentPlayHandle-driven instruments.
When losing focus now simply send NoteOff MIDI events for all keys
regardless of the state indicated by Piano::m_pressedKeys.

Closes #3052228.
This commit is contained in:
Tobias Doerffel
2010-09-02 01:49:38 +02:00
parent dd4e7c8aaf
commit f8e73c5293

View File

@@ -715,13 +715,10 @@ void PianoView::focusOutEvent( QFocusEvent * )
// hang otherwise
for( int i = 0; i < NumKeys; ++i )
{
if( m_piano->m_pressedKeys[i] == true )
{
m_piano->m_midiEvProc->processInEvent(
m_piano->m_midiEvProc->processInEvent(
midiEvent( MidiNoteOff, 0, i, 0 ),
midiTime() );
m_piano->m_pressedKeys[i] = false;
}
m_piano->m_pressedKeys[i] = false;
}
update();
}