From 6d33253189a3be7f7a81e47c83567bb87d8e57ca Mon Sep 17 00:00:00 2001 From: jules Date: Mon, 2 Feb 2015 09:10:31 +0000 Subject: [PATCH] Fix in MidiKeyboardComponent to prevent double notes when using touch input. --- modules/juce_audio_utils/gui/juce_MidiKeyboardComponent.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/juce_audio_utils/gui/juce_MidiKeyboardComponent.cpp b/modules/juce_audio_utils/gui/juce_MidiKeyboardComponent.cpp index db77d0f610..7c3dc57805 100644 --- a/modules/juce_audio_utils/gui/juce_MidiKeyboardComponent.cpp +++ b/modules/juce_audio_utils/gui/juce_MidiKeyboardComponent.cpp @@ -696,7 +696,7 @@ void MidiKeyboardComponent::updateNoteUnderMouse (Point pos, bool isDown, i mouseOverNotes.set (fingerNum, newNote); } - int oldNoteDown = mouseDownNotes.getUnchecked (fingerNum); + const int oldNoteDown = mouseDownNotes.getUnchecked (fingerNum); if (isDown) { @@ -710,7 +710,7 @@ void MidiKeyboardComponent::updateNoteUnderMouse (Point pos, bool isDown, i state.noteOff (midiChannel, oldNoteDown); } - if (newNote >= 0) + if (newNote >= 0 && ! mouseDownNotes.contains (newNote)) { if (! useMousePositionForVelocity) mousePositionVelocity = 1.0f;