From bbd239959dd26ee023fb256e6178365186194869 Mon Sep 17 00:00:00 2001 From: Florian Jung Date: Tue, 24 May 2011 13:49:56 +0000 Subject: Awl::PitchEdit now can be set with the musical keyboard --- muse2/awl/pitchedit.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'muse2/awl/pitchedit.cpp') diff --git a/muse2/awl/pitchedit.cpp b/muse2/awl/pitchedit.cpp index 71486be8..6bae2f5b 100644 --- a/muse2/awl/pitchedit.cpp +++ b/muse2/awl/pitchedit.cpp @@ -25,6 +25,8 @@ #include +extern QObject* song; // TODO FINDME this is a really dirty hack! + namespace Awl { //--------------------------------------------------------- @@ -36,6 +38,7 @@ PitchEdit::PitchEdit(QWidget* parent) { setRange(0, 127); deltaMode = false; + connect(song, SIGNAL(midiNote(int, int)), SLOT(midiNote(int,int))); } //--------------------------------------------------------- @@ -89,5 +92,14 @@ void PitchEdit::setDeltaMode(bool val) else setRange(0, 127); } + +void PitchEdit::midiNote(int pitch, int velo) +{ + if (hasFocus() && velo) + setValue(pitch); +} + + } + -- cgit v1.2.3