summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim E. Real <termtech@rogers.com>2010-01-07 08:13:53 +0000
committerTim E. Real <termtech@rogers.com>2010-01-07 08:13:53 +0000
commit026e6bc92bef207a4e7c0efe9c7c4d5b34d5156d (patch)
treed3cfe751025e3979c44a5494f85820168cc67ceb
parent47c0b5f833aac2d44649375beca992044e66d2a0 (diff)
Added meta type label to meta edit dialog.
-rw-r--r--muse/muse/liste/editevent.cpp26
-rw-r--r--muse/muse/liste/editevent.h2
-rw-r--r--muse/muse/widgets/editmetadialogbase.ui13
3 files changed, 40 insertions, 1 deletions
diff --git a/muse/muse/liste/editevent.cpp b/muse/muse/liste/editevent.cpp
index 8528462b..ff0e7c2f 100644
--- a/muse/muse/liste/editevent.cpp
+++ b/muse/muse/liste/editevent.cpp
@@ -31,6 +31,8 @@
#include "midiport.h"
#include "midiedit/drummap.h"
#include "instruments/minstrument.h"
+#include "midi.h"
+
//---------------------------------------------------------
// string2qhex
//---------------------------------------------------------
@@ -284,8 +286,15 @@ EditMetaDialog::EditMetaDialog(int tick, const Event& ev,
QLabel* l2 = new QLabel(tr("Meta Type"), this);
il2 = new IntLabel(-1, 0, 127, this, -1);
+ il2->setFixedWidth(100);
il2->setFrame(true);
il2->setDark();
+ typeLabel = new QLabel(this);
+ typeLabel->setAlignment(AlignLeft | AlignVCenter);
+ QHBoxLayout* typeLayout = new QHBoxLayout(this);
+ typeLayout->addWidget(il2);
+ typeLayout->addWidget(typeLabel);
+ typeLayout->addStretch();
hexButton = new QRadioButton(tr("Enter Hex"), this, "hextoggle");
hexButton->setChecked(true);
@@ -305,15 +314,30 @@ EditMetaDialog::EditMetaDialog(int tick, const Event& ev,
il2->setValue(0);
}
+ typeChanged(il2->value());
+ connect(il2, SIGNAL(valueChanged(int)), SLOT(typeChanged(int)));
+
layout1->addWidget(l1, 0, 0);
layout1->addWidget(pos, 0, 1, AlignLeft);
layout1->addWidget(l2, 1, 0);
- layout1->addWidget(il2, 1, 1, AlignLeft);
+
+ //layout1->addWidget(il2, 1, 1, AlignLeft);
+ layout1->addLayout(typeLayout, 1, 1);
+
layout1->addMultiCellWidget(hexButton, 2, 2, 0, 1);
layout1->addMultiCellWidget(edit, 3, 3, 0, 1);
}
//---------------------------------------------------------
+// typeChanged
+//---------------------------------------------------------
+
+void EditMetaDialog::typeChanged(int val)
+{
+ typeLabel->setText(midiMetaName(val));
+}
+
+//---------------------------------------------------------
// toggled
//---------------------------------------------------------
diff --git a/muse/muse/liste/editevent.h b/muse/muse/liste/editevent.h
index b6302e4e..a0a787ec 100644
--- a/muse/muse/liste/editevent.h
+++ b/muse/muse/liste/editevent.h
@@ -126,6 +126,7 @@ class EditMetaDialog : public EditEventDialog {
QMultiLineEdit* edit;
IntLabel* il2;
QRadioButton* hexButton;
+ QLabel* typeLabel;
protected:
QGridLayout* layout;
@@ -133,6 +134,7 @@ class EditMetaDialog : public EditEventDialog {
private slots:
virtual void accept();
void toggled(bool);
+ void typeChanged(int);
public:
EditMetaDialog(int tick, const Event&,
diff --git a/muse/muse/widgets/editmetadialogbase.ui b/muse/muse/widgets/editmetadialogbase.ui
index ce608cd9..573930b9 100644
--- a/muse/muse/widgets/editmetadialogbase.ui
+++ b/muse/muse/widgets/editmetadialogbase.ui
@@ -203,6 +203,19 @@
</sizepolicy>
</property>
</widget>
+ <widget class="QLabel" row="1" column="2">
+ <property name="name">
+ <cstring>metaTypeLabel</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>4</hsizetype>
+ <vsizetype>1</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ </widget>
<widget class="PosEdit" row="0" column="1">
<property name="name">
<cstring>PosEdit1</cstring>