diff options
-rw-r--r-- | muse/muse/arranger/arranger.cpp | 8 | ||||
-rw-r--r-- | muse/muse/arranger/arranger.h | 1 | ||||
-rw-r--r-- | muse/muse/arranger/tlswidget.cpp | 38 |
3 files changed, 26 insertions, 21 deletions
diff --git a/muse/muse/arranger/arranger.cpp b/muse/muse/arranger/arranger.cpp index 5f298319..c678d3de 100644 --- a/muse/muse/arranger/arranger.cpp +++ b/muse/muse/arranger/arranger.cpp @@ -675,18 +675,16 @@ void Arranger::mouseWheel(QWheelEvent* e) //--------------------------------------------------------- // appendSubtrack +// the user requests a new controller subtrack //--------------------------------------------------------- void Arranger::appendSubtrack(TLWidget* trackWidget) { - appendSubtrack(trackWidget->track()); - } + Track* t = trackWidget->track(); -void Arranger::appendSubtrack(Track* t) - { ArrangerTrack* at = new ArrangerTrack; at->h = minTrackHeight; - at->ctrl = CTRL_OTHER; + at->ctrl = CTRL_NO_CTRL; t->subtracks.push_back(at); initSubtrack(t, at); updateIndex(); diff --git a/muse/muse/arranger/arranger.h b/muse/muse/arranger/arranger.h index 47a58b59..527022fb 100644 --- a/muse/muse/arranger/arranger.h +++ b/muse/muse/arranger/arranger.h @@ -100,7 +100,6 @@ class Arranger : public QWidget { bool mixerStripVisible; void updateIndex(); - void appendSubtrack(Track*); TrackInfo* createTrackInfo(); int tlIndex(Track*) const; int tlIndex(ArrangerTrack* t) const; diff --git a/muse/muse/arranger/tlswidget.cpp b/muse/muse/arranger/tlswidget.cpp index dd300292..1285904d 100644 --- a/muse/muse/arranger/tlswidget.cpp +++ b/muse/muse/arranger/tlswidget.cpp @@ -119,10 +119,10 @@ TLSWidget::TLSWidget(Track* t, ArrangerTrack* atrack, TimeCanvas* timeC) setAttribute(Qt::WA_NoBackground); setMouseTracking(true); _tc = timeC; - state = S_NORMAL; + state = S_NORMAL; - at = atrack; - _track = t; + at = atrack; + _track = t; _ctrlTrack = t; TLSLayout* l = new TLSLayout; @@ -212,13 +212,21 @@ void TLSWidget::showControllerList() id = c->id(); else id = CTRL_NO_CTRL; - CtrlDialog cd(_ctrlTrack, id); - int rv = cd.exec(); - if (rv != 1) - return; - id = cd.curId(); - if (id == CTRL_NO_CTRL) - return; + for (;;) { + CtrlDialog cd(_ctrlTrack, id); + int rv = cd.exec(); + if (rv != 1) + return; + id = cd.curId(); + if (id == CTRL_NO_CTRL) + return; + if (id != CTRL_OTHER) + break; + ConfigMidiCtrl* mce = new ConfigMidiCtrl((MidiTrack*)_track); + mce->exec(); + updateController(); + delete mce; + } setCtrl(id); } @@ -228,13 +236,13 @@ void TLSWidget::showControllerList() void TLSWidget::setCtrl(int ctrl) { - if (ctrl == CTRL_OTHER) { // "other" -/*??*/ ConfigMidiCtrl* mce = new ConfigMidiCtrl((MidiTrack*)_track); - mce->exec(); - updateController(); - delete mce; + if (ctrl == CTRL_NO_CTRL || ctrl == CTRL_OTHER) { + // this controller subtrack is new, ask user for + // controller: + showControllerList(); return; } + if (_ctrlTrack && _ctrlTrack != _track) { disconnect(_ctrlTrack, SIGNAL(clChanged()), this, SLOT(updateController())); disconnect(_ctrlTrack, SIGNAL(controllerChanged(int)), this, SLOT(controllerListChanged(int))); |