From 2f921303ebcf497617c439953e88bbf13cb60a7b Mon Sep 17 00:00:00 2001 From: Tobias Doerffel Date: Wed, 1 Sep 2010 23:51:43 +0200 Subject: [PATCH] PianoView: call InstrumentTrack::silenceAllNotes() on focus out If we lose focus, call InstrumentTrack::silenceAllNotes() after explicitely sending NoteOff MIDI events for all keys for which presses were recorded. In case the arpeggiator is enabled this is not sufficient. Fixes hanging notes when switching active subwindow while pressing keys in an instrument track window with arpeggiator enabled. Closes #3052228. --- src/gui/PianoView.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/gui/PianoView.cpp b/src/gui/PianoView.cpp index 343f1a4d1..024d79e2a 100644 --- a/src/gui/PianoView.cpp +++ b/src/gui/PianoView.cpp @@ -1,9 +1,8 @@ /* - * Piano.cpp - implementation of piano-widget used in instrument-track-window - * for testing + according model class + * PianoView.cpp - implementation of piano widget used in instrument-track-window * * Copyright (c) 2004-2010 Tobias Doerffel - * + * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * * This program is free software; you can redistribute it and/or @@ -23,7 +22,7 @@ * */ -/** \file piano.cpp +/** \file PianoView.cpp * \brief A piano keyboard to play notes on in the instrument plugin window. */ @@ -723,6 +722,9 @@ void PianoView::focusOutEvent( QFocusEvent * ) m_piano->m_pressedKeys[i] = false; } } + + m_piano->m_instrumentTrack->silenceAllNotes(); + update(); }