summaryrefslogtreecommitdiff
path: root/muse2/awl
diff options
context:
space:
mode:
Diffstat (limited to 'muse2/awl')
-rw-r--r--muse2/awl/midimeter.h3
-rw-r--r--muse2/awl/midimslider.h3
-rw-r--r--muse2/awl/mslider.h3
-rw-r--r--muse2/awl/pitchedit.cpp16
-rw-r--r--muse2/awl/pitchedit.h7
-rw-r--r--muse2/awl/pitchlabel.h4
-rw-r--r--muse2/awl/sigedit.cpp2
-rw-r--r--muse2/awl/tempolabel.h3
8 files changed, 31 insertions, 10 deletions
diff --git a/muse2/awl/midimeter.h b/muse2/awl/midimeter.h
index 2b0d3518..929e648c 100644
--- a/muse2/awl/midimeter.h
+++ b/muse2/awl/midimeter.h
@@ -31,8 +31,9 @@ namespace Awl {
class MidiMeter : public Slider
{
- Q_PROPERTY(int meterWidth READ meterWidth WRITE setMeterWidth)
Q_OBJECT
+ Q_PROPERTY(int meterWidth READ meterWidth WRITE setMeterWidth)
+
double meterval;
int _meterWidth;
diff --git a/muse2/awl/midimslider.h b/muse2/awl/midimslider.h
index a2a2bdaf..a363348a 100644
--- a/muse2/awl/midimslider.h
+++ b/muse2/awl/midimslider.h
@@ -31,8 +31,9 @@ namespace Awl {
class MidiMeterSlider : public Slider
{
- Q_PROPERTY(int meterWidth READ meterWidth WRITE setMeterWidth)
Q_OBJECT
+ Q_PROPERTY(int meterWidth READ meterWidth WRITE setMeterWidth)
+
double meterval;
int _meterWidth;
diff --git a/muse2/awl/mslider.h b/muse2/awl/mslider.h
index 4ae888b1..15dd8a7e 100644
--- a/muse2/awl/mslider.h
+++ b/muse2/awl/mslider.h
@@ -32,9 +32,10 @@ namespace Awl {
class MeterSlider : public VolSlider
{
+ Q_OBJECT
Q_PROPERTY(int meterWidth READ meterWidth WRITE setMeterWidth)
Q_PROPERTY(int channel READ channel WRITE setChannel)
- Q_OBJECT
+
int _channel;
std::vector<double> meterval;
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);
+}
+
+
}
+
diff --git a/muse2/awl/pitchedit.h b/muse2/awl/pitchedit.h
index bdcfc4c4..1512ec8d 100644
--- a/muse2/awl/pitchedit.h
+++ b/muse2/awl/pitchedit.h
@@ -37,8 +37,8 @@ class PitchEdit : public QSpinBox {
bool deltaMode;
protected:
- virtual QString mapValueToText(int v);
- virtual int mapTextToValue(bool* ok);
+ virtual QString textFromValue(int v) const;
+ virtual int valueFromText(bool* ok) const;
virtual void keyPressEvent(QKeyEvent*);
signals:
@@ -48,6 +48,9 @@ class PitchEdit : public QSpinBox {
public:
PitchEdit(QWidget* parent);
void setDeltaMode(bool);
+
+ private slots:
+ void midiNote(int pitch, int velo);
};
}
diff --git a/muse2/awl/pitchlabel.h b/muse2/awl/pitchlabel.h
index e5c34dba..a09d1ced 100644
--- a/muse2/awl/pitchlabel.h
+++ b/muse2/awl/pitchlabel.h
@@ -30,9 +30,11 @@ namespace Awl {
//---------------------------------------------------------
class PitchLabel : public QLabel {
+ Q_OBJECT
+
bool _pitchMode;
int _value;
- Q_OBJECT
+
protected:
QSize sizeHint() const;
diff --git a/muse2/awl/sigedit.cpp b/muse2/awl/sigedit.cpp
index 984a209b..0ff40de9 100644
--- a/muse2/awl/sigedit.cpp
+++ b/muse2/awl/sigedit.cpp
@@ -159,7 +159,7 @@ QAbstractSpinBox::StepEnabled SigEdit::stepEnabled() const
// fixup
//---------------------------------------------------------
-void SigEdit::fixup(QString& input) const
+void SigEdit::fixup(QString& /*input*/) const
{
// printf("fixup <%s>\n", input.toLatin1().constData());
}
diff --git a/muse2/awl/tempolabel.h b/muse2/awl/tempolabel.h
index df9abfcd..b7df6b56 100644
--- a/muse2/awl/tempolabel.h
+++ b/muse2/awl/tempolabel.h
@@ -30,9 +30,10 @@ namespace Awl {
//---------------------------------------------------------
class TempoLabel : public QLabel {
+ Q_OBJECT
double _value;
- Q_OBJECT
+
protected:
QSize sizeHint() const;