diff options
author | Florian Jung <flo@windfisch.org> | 2011-05-24 13:49:56 +0000 |
---|---|---|
committer | Florian Jung <flo@windfisch.org> | 2011-05-24 13:49:56 +0000 |
commit | bbd239959dd26ee023fb256e6178365186194869 (patch) | |
tree | b3ea4db34d2cbfb7e9326076d922300565365d72 /muse2/awl | |
parent | 50e54c9b95c39badcd1f30443f30a74a7eb69ea3 (diff) |
Awl::PitchEdit now can be set with the musical keyboard
Diffstat (limited to 'muse2/awl')
-rw-r--r-- | muse2/awl/pitchedit.cpp | 12 | ||||
-rw-r--r-- | muse2/awl/pitchedit.h | 3 |
2 files changed, 15 insertions, 0 deletions
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 <QKeyEvent> +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); +} + + } + diff --git a/muse2/awl/pitchedit.h b/muse2/awl/pitchedit.h index f9b5b24e..1512ec8d 100644 --- a/muse2/awl/pitchedit.h +++ b/muse2/awl/pitchedit.h @@ -48,6 +48,9 @@ class PitchEdit : public QSpinBox { public: PitchEdit(QWidget* parent); void setDeltaMode(bool); + + private slots: + void midiNote(int pitch, int velo); }; } |