From 58507c28ecc73469ec37c073c6321124a99a2f85 Mon Sep 17 00:00:00 2001 From: Lukas W Date: Mon, 12 Jan 2015 11:03:49 +0100 Subject: [PATCH] Fix piano roll detuning redraw --- src/gui/editors/PianoRoll.cpp | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/gui/editors/PianoRoll.cpp b/src/gui/editors/PianoRoll.cpp index c4e4bdcb8..8c5acca5e 100644 --- a/src/gui/editors/PianoRoll.cpp +++ b/src/gui/editors/PianoRoll.cpp @@ -1201,9 +1201,19 @@ void PianoRoll::mousePressEvent(QMouseEvent * me ) if( m_editMode == ModeEditDetuning && noteUnderMouse() ) { + static AutomationPattern* detuningPattern = nullptr; + if (detuningPattern != nullptr) + { + detuningPattern->disconnect(this); + } Note* n = noteUnderMouse(); - if (n->detuning() == NULL) n->createDetuning(); - gui->automationEditor()->open( noteUnderMouse()->detuning()->automationPattern() ); + if (n->detuning() == nullptr) + { + n->createDetuning(); + } + detuningPattern = n->detuning()->automationPattern(); + connect(detuningPattern, SIGNAL(dataChanged()), this, SLOT(update())); + gui->automationEditor()->open(detuningPattern); return; }