From 491910357b54a5d17e74c70ae3bb73cd780b254f 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. (cherry picked from commit 2f921303ebcf497617c439953e88bbf13cb60a7b) --- src/gui/PianoView.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/gui/PianoView.cpp b/src/gui/PianoView.cpp index baeacea71..3d262fe79 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 * - * Copyright (c) 2004-2009 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. */ @@ -721,6 +720,9 @@ void PianoView::focusOutEvent( QFocusEvent * ) m_piano->m_pressedKeys[i] = false; } } + + m_piano->m_instrumentTrack->silenceAllNotes(); + update(); }