summaryrefslogtreecommitdiff
path: root/muse2/muse
diff options
context:
space:
mode:
authorTim E. Real <termtech@rogers.com>2011-01-05 01:54:53 +0000
committerTim E. Real <termtech@rogers.com>2011-01-05 01:54:53 +0000
commit0e39cb75d7a659322b282a79ca63f10d48fa277a (patch)
tree86f8c5b1664086212d2e8fd400744619e258fcde /muse2/muse
parent76492eaa41d25fa4e7f65f884d21e7bef9849774 (diff)
Fixed multiple velocity controllers appearing on song reload. Tested OK.
Diffstat (limited to 'muse2/muse')
-rw-r--r--muse2/muse/app.cpp18
-rw-r--r--muse2/muse/app.h4
-rw-r--r--muse2/muse/midiedit/drumedit.cpp3
-rw-r--r--muse2/muse/midiedit/drumedit.h3
-rw-r--r--muse2/muse/midiedit/pianoroll.cpp3
-rw-r--r--muse2/muse/midiedit/pianoroll.h4
6 files changed, 18 insertions, 17 deletions
diff --git a/muse2/muse/app.cpp b/muse2/muse/app.cpp
index f988a4b7..1f2edc1a 100644
--- a/muse2/muse/app.cpp
+++ b/muse2/muse/app.cpp
@@ -3093,9 +3093,9 @@ bool MusE::saveAs()
void MusE::startEditor(PartList* pl, int type)
{
switch (type) {
- case 0: startPianoroll(pl); break;
+ case 0: startPianoroll(pl, true); break;
case 1: startListEditor(pl); break;
- case 3: startDrumEditor(pl); break;
+ case 3: startDrumEditor(pl, true); break;
case 4: startWaveEditor(pl); break;
}
}
@@ -3107,7 +3107,7 @@ void MusE::startEditor(PartList* pl, int type)
void MusE::startEditor(Track* t)
{
switch (t->type()) {
- case Track::MIDI: startPianoroll(); break;
+ case Track::MIDI: startPianoroll(); break;
case Track::DRUM: startDrumEditor(); break;
case Track::WAVE: startWaveEditor(); break;
default:
@@ -3138,14 +3138,16 @@ void MusE::startPianoroll()
PartList* pl = getMidiPartsToEdit();
if (pl == 0)
return;
- startPianoroll(pl);
+ startPianoroll(pl, true);
}
-void MusE::startPianoroll(PartList* pl)
+void MusE::startPianoroll(PartList* pl, bool showDefaultCtrls)
{
PianoRoll* pianoroll = new PianoRoll(pl, this, 0, arranger->cursorValue());
pianoroll->show();
+ if(showDefaultCtrls) // p4.0.12
+ pianoroll->addCtrl();
toplevels.push_back(Toplevel(Toplevel::PIANO_ROLL, (unsigned long)(pianoroll), pianoroll));
connect(pianoroll, SIGNAL(deleted(unsigned long)), SLOT(toplevelDeleted(unsigned long)));
connect(muse, SIGNAL(configChanged()), pianoroll, SLOT(configChanged()));
@@ -3206,14 +3208,16 @@ void MusE::startDrumEditor()
PartList* pl = getMidiPartsToEdit();
if (pl == 0)
return;
- startDrumEditor(pl);
+ startDrumEditor(pl, true);
}
-void MusE::startDrumEditor(PartList* pl)
+void MusE::startDrumEditor(PartList* pl, bool showDefaultCtrls)
{
DrumEdit* drumEditor = new DrumEdit(pl, this, 0, arranger->cursorValue());
drumEditor->show();
+ if(showDefaultCtrls) // p4.0.12
+ drumEditor->addCtrl();
toplevels.push_back(Toplevel(Toplevel::DRUM, (unsigned long)(drumEditor), drumEditor));
connect(drumEditor, SIGNAL(deleted(unsigned long)), SLOT(toplevelDeleted(unsigned long)));
connect(muse, SIGNAL(configChanged()), drumEditor, SLOT(configChanged()));
diff --git a/muse2/muse/app.h b/muse2/muse/app.h
index a270a599..013f6efc 100644
--- a/muse2/muse/app.h
+++ b/muse2/muse/app.h
@@ -254,10 +254,10 @@ class MusE : public QMainWindow
void startListEditor();
void startListEditor(PartList*);
void startDrumEditor();
- void startDrumEditor(PartList*);
+ void startDrumEditor(PartList* /*pl*/, bool /*showDefaultCtrls*/ = false);
void startEditor(Track*);
void startPianoroll();
- void startPianoroll(PartList* pl);
+ void startPianoroll(PartList* /*pl*/, bool /*showDefaultCtrls*/ = false);
void startWaveEditor();
void startWaveEditor(PartList*);
void startSongInfo(bool editable=true);
diff --git a/muse2/muse/midiedit/drumedit.cpp b/muse2/muse/midiedit/drumedit.cpp
index 80eb1b6b..7bdac223 100644
--- a/muse2/muse/midiedit/drumedit.cpp
+++ b/muse2/muse/midiedit/drumedit.cpp
@@ -451,9 +451,6 @@ DrumEdit::DrumEdit(PartList* pl, QWidget* parent, const char* name, unsigned ini
if(pos > MAXINT)
pos = MAXINT;
hscroll->setOffset((int)pos);
-
- // As a final act, open a default velocity controller.
- addCtrl();
}
//---------------------------------------------------------
diff --git a/muse2/muse/midiedit/drumedit.h b/muse2/muse/midiedit/drumedit.h
index 46e3123e..5d2df9f6 100644
--- a/muse2/muse/midiedit/drumedit.h
+++ b/muse2/muse/midiedit/drumedit.h
@@ -91,7 +91,7 @@ class DrumEdit : public MidiEditor {
void setRaster(int);
void setQuant(int);
void noteinfoChanged(NoteInfo::ValType type, int val);
- CtrlEdit* addCtrl();
+ //CtrlEdit* addCtrl();
void removeCtrl(CtrlEdit* ctrl);
void cmd(int);
void clipboardChanged(); // enable/disable "Paste"
@@ -110,6 +110,7 @@ class DrumEdit : public MidiEditor {
void soloChanged(bool); // called by Solo button
void execDeliveredScript(int);
void execUserScript(int);
+ CtrlEdit* addCtrl();
virtual void updateHScrollRange();
signals:
diff --git a/muse2/muse/midiedit/pianoroll.cpp b/muse2/muse/midiedit/pianoroll.cpp
index 5c7a6761..ed5f54c5 100644
--- a/muse2/muse/midiedit/pianoroll.cpp
+++ b/muse2/muse/midiedit/pianoroll.cpp
@@ -544,9 +544,6 @@ PianoRoll::PianoRoll(PartList* pl, QWidget* parent, const char* name, unsigned i
if(pos > MAXINT)
pos = MAXINT;
hscroll->setOffset((int)pos);
-
- // As a final act, open a default velocity controller.
- addCtrl();
}
//---------------------------------------------------------
diff --git a/muse2/muse/midiedit/pianoroll.h b/muse2/muse/midiedit/pianoroll.h
index 4de0ff48..2bfa9324 100644
--- a/muse2/muse/midiedit/pianoroll.h
+++ b/muse2/muse/midiedit/pianoroll.h
@@ -154,7 +154,7 @@ class PianoRoll : public MidiEditor {
private slots:
void setSelection(int, Event&, Part*);
void noteinfoChanged(NoteInfo::ValType, int);
- CtrlEdit* addCtrl();
+ //CtrlEdit* addCtrl();
void removeCtrl(CtrlEdit* ctrl);
void soloChanged(bool flag);
//void trackInfoScroll(int);
@@ -186,6 +186,8 @@ class PianoRoll : public MidiEditor {
virtual void updateHScrollRange();
void execDeliveredScript(int id);
void execUserScript(int id);
+ CtrlEdit* addCtrl();
+
public:
PianoRoll(PartList*, QWidget* parent = 0, const char* name = 0, unsigned initPos = MAXINT);
~PianoRoll();