summaryrefslogtreecommitdiff
path: root/muse2/muse
diff options
context:
space:
mode:
authorFlorian Jung <flo@windfisch.org>2011-05-30 17:44:15 +0000
committerFlorian Jung <flo@windfisch.org>2011-05-30 17:44:15 +0000
commit175ed105f7bb2ed96c631bbe7f67830475c61572 (patch)
tree3f8395c164362c7299498f40d192b0115cd10fbe /muse2/muse
parent16268e699ace744c50a040ac4a2de40ab4a9f9d5 (diff)
added a spinbox to the arranger's "Ch:"-column
Diffstat (limited to 'muse2/muse')
-rw-r--r--muse2/muse/arranger/tlist.cpp36
-rw-r--r--muse2/muse/arranger/tlist.h4
2 files changed, 39 insertions, 1 deletions
diff --git a/muse2/muse/arranger/tlist.cpp b/muse2/muse/arranger/tlist.cpp
index bd58ad88..4f050c46 100644
--- a/muse2/muse/arranger/tlist.cpp
+++ b/muse2/muse/arranger/tlist.cpp
@@ -21,6 +21,7 @@
#include <QScrollBar>
#include <QWheelEvent>
#include <QIcon>
+#include <QSpinBox>
#include "popupmenu.h"
#include "globals.h"
@@ -438,6 +439,20 @@ void TList::returnPressed()
setFocus();
}
+void TList::chanValueChanged(int val)
+{
+ Track* track = editTrack->clone(false);
+ ((MidiTrack*)editTrack)->setOutChannel(val-1);
+ audio->msgChangeTrack(track, editTrack);
+}
+
+void TList::chanValueFinished()
+{
+ editTrack = 0;
+ chan_edit->hide();
+ setFocus();
+}
+
//---------------------------------------------------------
// adjustScrollbar
//---------------------------------------------------------
@@ -491,7 +506,7 @@ void TList::mouseDoubleClickEvent(QMouseEvent* ev)
if (section == COL_NAME) {
editTrack = t;
if (editor == 0) {
- editor = new QLineEdit(this);
+ editor = new QLineEdit(this);
/*connect(editor, SIGNAL(returnPressed()),
SLOT(returnPressed()));*/
editor->setFrame(true);
@@ -502,6 +517,25 @@ void TList::mouseDoubleClickEvent(QMouseEvent* ev)
editMode = true;
editor->show();
}
+ else if (section == COL_OCHANNEL) {
+ if (t->isMidiTrack() && t->type() != Track::DRUM)
+ {
+ editTrack=t;
+ if (chan_edit==0) {
+ chan_edit=new QSpinBox(this);
+ chan_edit->setMinimum(1);
+ chan_edit->setMaximum(16);
+ connect(chan_edit, SIGNAL(valueChanged(int)), SLOT(chanValueChanged(int)));
+ connect(chan_edit, SIGNAL(editingFinished()), SLOT(chanValueFinished()));
+ }
+ chan_edit->setValue(((MidiTrack*)editTrack)->outChannel()+1);
+ int w=colw;
+ if (w < chan_edit->sizeHint().width()) w=chan_edit->sizeHint().width();
+ chan_edit->setGeometry(colx, coly, w, colh);
+ chan_edit->show();
+ chan_edit->setFocus();
+ }
+ }
else
mousePressEvent(ev);
}
diff --git a/muse2/muse/arranger/tlist.h b/muse2/muse/arranger/tlist.h
index 15be450a..607ca8c0 100644
--- a/muse2/muse/arranger/tlist.h
+++ b/muse2/muse/arranger/tlist.h
@@ -14,6 +14,7 @@
class QKeyEvent;
class QLineEdit;
+class QSpinBox;
class QMouseEvent;
class QPaintEvent;
class QResizeEvent;
@@ -57,6 +58,7 @@ class TList : public QWidget {
Header* header;
QScrollBar* _scroll;
QLineEdit* editor;
+ QSpinBox* chan_edit;
Track* editTrack;
Track* editAutomation;
@@ -92,6 +94,8 @@ class TList : public QWidget {
private slots:
void returnPressed();
+ void chanValueChanged(int);
+ void chanValueFinished();
void songChanged(int flags);
void changeAutomation(QAction*);
void changeAutomationColor(QAction*);