summaryrefslogtreecommitdiff
path: root/muse2/awl/pitchedit.cpp
diff options
context:
space:
mode:
authorFlorian Jung <flo@windfisch.org>2011-06-03 14:24:08 +0000
committerFlorian Jung <flo@windfisch.org>2011-06-03 14:24:08 +0000
commitdb164b62e3892bd17d1a2eabca76bde3b67072df (patch)
treeab71ac4b4f05ab94c008d75ef7052bef5af6cc74 /muse2/awl/pitchedit.cpp
parentdef4fdb391f5207ebbe61881416f39f3d896cc5d (diff)
parent9187899632c14d64b3fae6477b7f941240f912a6 (diff)
merged with trunk and adapted new functions
Diffstat (limited to 'muse2/awl/pitchedit.cpp')
-rw-r--r--muse2/awl/pitchedit.cpp16
1 files changed, 14 insertions, 2 deletions
diff --git a/muse2/awl/pitchedit.cpp b/muse2/awl/pitchedit.cpp
index 93f4b310..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)));
}
//---------------------------------------------------------
@@ -54,7 +57,7 @@ void PitchEdit::keyPressEvent(QKeyEvent* ev)
// mapValueToText
//---------------------------------------------------------
-QString PitchEdit::mapValueToText(int v)
+QString PitchEdit::textFromValue(int v) const
{
if (deltaMode) {
QString s;
@@ -69,7 +72,7 @@ QString PitchEdit::mapValueToText(int v)
// mapTextToValue
//---------------------------------------------------------
-int PitchEdit::mapTextToValue(bool* ok)
+int PitchEdit::valueFromText(bool* ok) const
{
printf("AwlPitchEdit: mapTextToValue: not impl.\n");
if (ok)
@@ -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);
+}
+
+
}
+