diff options
author | Florian Jung <flo@windfisch.org> | 2012-03-15 18:21:23 +0000 |
---|---|---|
committer | Florian Jung <flo@windfisch.org> | 2012-03-15 18:21:23 +0000 |
commit | 27b7bf6815cda7abb67026c37b3e44daee1803cb (patch) | |
tree | 0b9d1c0bc84ac7ff8032e707f2b5fb4e0aaabb5c /muse2/muse/arranger/tlist.cpp | |
parent | 2d6f113a10eb485694e20a78500f650776d701e3 (diff) |
merged with trunk
Diffstat (limited to 'muse2/muse/arranger/tlist.cpp')
-rw-r--r-- | muse2/muse/arranger/tlist.cpp | 225 |
1 files changed, 74 insertions, 151 deletions
diff --git a/muse2/muse/arranger/tlist.cpp b/muse2/muse/arranger/tlist.cpp index 0ed201bf..b5fa2a1a 100644 --- a/muse2/muse/arranger/tlist.cpp +++ b/muse2/muse/arranger/tlist.cpp @@ -20,13 +20,10 @@ // //========================================================= -//#include "config.h" - #include <cmath> #include <QKeyEvent> #include <QLineEdit> -//#include <QMenu> #include <QMessageBox> #include <QMouseEvent> #include <QPainter> @@ -95,7 +92,7 @@ TList::TList(Header* hdr, QWidget* parent, const char* name) ypos = 0; editMode = false; editJustFinished=false; - setFocusPolicy(Qt::StrongFocus); + setFocusPolicy(Qt::NoFocus); setMouseTracking(true); header = hdr; @@ -106,7 +103,7 @@ TList::TList(Header* hdr, QWidget* parent, const char* name) ctrl_edit = NULL; mode = NORMAL; - //setBackgroundMode(Qt::NoBackground); // ORCAN - FIXME + //setBackgroundMode(Qt::NoBackground); // ORCAN - FIXME. DELETETHIS? //setAttribute(Qt::WA_OpaquePaintEvent); resizeFlag = false; @@ -312,7 +309,6 @@ void TList::paint(const QRect& r) pm = addtrack_auxsendIcon; break; case MusECore::Track::AUDIO_SOFTSYNTH: - //pm = waveIcon; pm = synthIcon; break; } @@ -401,7 +397,6 @@ void TList::paint(const QRect& r) if (cl->isVisible()) countVisible++; } - //int count = ((MusECore::AudioTrack*)track)->controller()->size(); //commented out by flo: gives a "unused variable" warning s.sprintf(" %d(%d) %s",countVisible, countAll, tr("visible").toAscii().data()); } @@ -512,18 +507,14 @@ void TList::returnPressed() } } - //MusECore::Track* track = editTrack->clone(false); - //editTrack->setName(editor->text()); - //MusEGlobal::audio->msgChangeTrack(track, editTrack); - // p4.0.46 Tim... MusEGlobal::song->startUndo(); MusEGlobal::song->addUndo(MusECore::UndoOp(MusECore::UndoOp::ModifyTrackName, editTrack, editTrack->name().toLatin1().constData(), editor->text().toLatin1().constData())); editTrack->setName(editor->text()); - //MusEGlobal::song->update(SC_TRACK_MODIFIED); - MusEGlobal::song->endUndo(-1); + //MusEGlobal::song->update(SC_TRACK_MODIFIED); //DELETETHIS + MusEGlobal::song->endUndo(-1); //uagh, why "-1", why no proper flags? } } @@ -532,7 +523,7 @@ void TList::returnPressed() editMode = false; editJustFinished = true; - if(editor->isVisible()) + if(editor && editor->isVisible()) { editor->blockSignals(true); editor->hide(); @@ -541,13 +532,6 @@ void TList::returnPressed() setFocus(); } -void TList::chanValueChanged(int /*val*/) -{ - //MusECore::Track* track = editTrack->clone(false); - //((MusECore::MidiTrack*)editTrack)->setOutChannel(val-1); - //MusEGlobal::audio->msgChangeTrack(track, editTrack); -} - void TList::chanValueFinished() { if(editTrack) @@ -569,7 +553,7 @@ void TList::chanValueFinished() editTrack, mt->outChannel(), channel)); - //mt->setOutChannel(channel); + //mt->setOutChannel(channel); DELETETHIS 10 (only the comments of course) MusEGlobal::audio->msgIdle(true); //MusEGlobal::audio->msgSetTrackOutChannel(mt, channel); mt->setOutChanAndUpdate(channel); @@ -750,15 +734,11 @@ void TList::mouseDoubleClickEvent(QMouseEvent* ev) editTrack = t; if (editor == 0) { editor = new QLineEdit(this); - /*connect(editor, SIGNAL(returnPressed()), - SLOT(returnPressed()));*/ - editor->setFrame(true); + editor->setFrame(false); connect(editor, SIGNAL(editingFinished()), SLOT(returnPressed())); } - //editor->blockSignals(true); editor->setText(editTrack->name()); - //editor->blockSignals(false); - editor->end(false); + editor->selectAll(); editor->setGeometry(colx, coly, colw, colh); editMode = true; editor->show(); @@ -772,16 +752,21 @@ void TList::mouseDoubleClickEvent(QMouseEvent* ev) return; } - //if(t->type() != MusECore::Track::DRUM && t->type() != MusECore::Track::AUDIO_SOFTSYNTH) + // A disabled spinbox up or down button will pass the event to the parent! Causes pseudo 'wrapping'. Eat it up. + if(chan_edit && chan_edit->hasFocus()) + { + ev->accept(); + return; + } + else { editTrack=t; if (chan_edit==0) { chan_edit=new QSpinBox(this); + chan_edit->setFrame(false); chan_edit->setMinimum(1); - //connect(chan_edit, SIGNAL(valueChanged(int)), SLOT(chanValueChanged(int))); connect(chan_edit, SIGNAL(editingFinished()), SLOT(chanValueFinished())); } - //chan_edit->blockSignals(true); if (t->isMidiTrack()) { chan_edit->setMaximum(MIDI_CHANNELS); @@ -792,10 +777,10 @@ void TList::mouseDoubleClickEvent(QMouseEvent* ev) chan_edit->setMaximum(MAX_CHANNELS); chan_edit->setValue(((MusECore::AudioTrack*)editTrack)->channels()); } - //chan_edit->blockSignals(false); int w=colw; if (w < chan_edit->sizeHint().width()) w=chan_edit->sizeHint().width(); chan_edit->setGeometry(colx, coly, w, colh); + chan_edit->selectAll(); editMode = true; chan_edit->show(); chan_edit->setFocus(); @@ -855,13 +840,11 @@ void TList::portsPopupMenu(MusECore::Track* t, int x, int y) { MusECore::MidiTrack* track = (MusECore::MidiTrack*)t; - //QPopupMenu* p = MusECore::midiPortsPopup(0); MusECore::MidiDevice* md = 0; int potential_new_port_no=-1; int port = -1; if(t->type() == MusECore::Track::AUDIO_SOFTSYNTH) { - //MusECore::MidiDevice* md = dynamic_cast<MusECore::MidiDevice*>((MusECore::SynthI*)t); md = dynamic_cast<MusECore::MidiDevice*>(t); if(md) port = md->midiPort(); @@ -869,7 +852,7 @@ void TList::portsPopupMenu(MusECore::Track* t, int x, int y) else port = track->outPort(); - QMenu* p = MusECore::midiPortsPopup(this, port); // 0, port); + QMenu* p = MusECore::midiPortsPopup(this, port); if (t->isMidiTrack()) { @@ -1021,8 +1004,10 @@ void TList::portsPopupMenu(MusECore::Track* t, int x, int y) MusEGlobal::midiSeq->msgSetMidiDevice(&MusEGlobal::midiPorts[potential_new_port_no], sdev); n=potential_new_port_no; + + MusEGlobal::song->update(); } - // Changed by T356. + // Changed by T356. DELETETHIS 5 //track->setOutPort(n); //MusEGlobal::audio->msgSetTrackOutPort(track, n); @@ -1035,27 +1020,23 @@ void TList::portsPopupMenu(MusECore::Track* t, int x, int y) if (!change) { // Delete all port controller events. - //MusEGlobal::audio->msgChangeAllPortDrumCtrlEvents(false); MusEGlobal::song->changeAllPortDrumCtrlEvents(false); track->setOutPort(n); for (int i=0; i<DRUM_MAPSIZE; i++) //Remap all drum instruments to this port MusEGlobal::drumMap[i].port = track->outPort(); // Add all port controller events. - //MusEGlobal::audio->msgChangeAllPortDrumCtrlEvents(true); MusEGlobal::song->changeAllPortDrumCtrlEvents(true); } else { - //MusEGlobal::audio->msgSetTrackOutPort(track, n); track->setOutPortAndUpdate(n); } MusEGlobal::audio->msgIdle(false); MusEGlobal::audio->msgUpdateSoloStates(); // (p4.0.14) p4.0.17 MusEGlobal::song->update(); } - else - if (t->type() == MusECore::Track::AUDIO_SOFTSYNTH) + else if (t->type() == MusECore::Track::AUDIO_SOFTSYNTH) { if(md != 0) { @@ -1066,17 +1047,14 @@ void TList::portsPopupMenu(MusECore::Track* t, int x, int y) MusEGlobal::midiSeq->msgSetMidiDevice(&MusEGlobal::midiPorts[n], (MusEGlobal::midiPorts[n].device() == md) ? 0 : md); MusEGlobal::muse->changeConfig(true); // save configuration file - //MusEGlobal::audio->msgIdle(false); MusEGlobal::song->update(); } } else { MusEGlobal::audio->msgIdle(true); - //MusEGlobal::audio->msgSetTrackOutPort(track, n); track->setOutPortAndUpdate(n); MusEGlobal::audio->msgIdle(false); - //MusEGlobal::song->update(); MusEGlobal::audio->msgUpdateSoloStates(); // (p4.0.14) p4.0.17 MusEGlobal::song->update(SC_MIDI_TRACK_PROP); // } @@ -1103,22 +1081,13 @@ void TList::oportPropertyPopupMenu(MusECore::Track* t, int x, int y) MusECore::SynthI* synth = (MusECore::SynthI*)t; QMenu* p = new QMenu; - //QAction* act = p->addAction(tr("Show Gui")); QAction* gact = p->addAction(tr("show gui")); - //act->setCheckable(true); gact->setCheckable(true); - //printf("synth hasgui %d, gui visible %d\n",synth->hasGui(), synth->guiVisible()); - //act->setEnabled(synth->hasGui()); - //act->setChecked(synth->guiVisible()); gact->setEnabled(synth->hasGui()); gact->setChecked(synth->guiVisible()); QAction* nact = p->addAction(tr("show native gui")); - //act->setCheckable(true); nact->setCheckable(true); - //printf("synth hasgui %d, gui visible %d\n",synth->hasGui(), synth->guiVisible()); - //act->setEnabled(synth->hasGui()); - //act->setChecked(synth->guiVisible()); nact->setEnabled(synth->hasNativeGui()); nact->setChecked(synth->nativeGuiVisible()); @@ -1127,8 +1096,6 @@ void TList::oportPropertyPopupMenu(MusECore::Track* t, int x, int y) #ifdef DSSI_SUPPORT if(dynamic_cast<MusECore::DssiSynthIF*>(synth->sif())) { - //act->setChecked(false); - //act->setEnabled(false); nact->setChecked(false); nact->setEnabled(false); } @@ -1136,15 +1103,12 @@ void TList::oportPropertyPopupMenu(MusECore::Track* t, int x, int y) #endif QAction* ract = p->exec(mapToGlobal(QPoint(x, y)), 0); - //if (ract == act) { if (ract == gact) { bool show = !synth->guiVisible(); - //MusEGlobal::audio->msgShowInstrumentGui(synth, show); synth->showGui(show); } else if (ract == nact) { bool show = !synth->nativeGuiVisible(); - //MusEGlobal::audio->msgShowInstrumentNativeGui(synth, show); synth->showNativeGui(show); } delete p; @@ -1158,19 +1122,13 @@ void TList::oportPropertyPopupMenu(MusECore::Track* t, int x, int y) MusECore::MidiPort* port = &MusEGlobal::midiPorts[oPort]; QMenu* p = new QMenu; - //QAction* act = p->addAction(tr("Show Gui")); QAction* gact = p->addAction(tr("show gui")); - //act->setCheckable(true); gact->setCheckable(true); - //printf("synth hasgui %d, gui visible %d\n",port->hasGui(), port->guiVisible()); - //act->setEnabled(port->hasGui()); - //act->setChecked(port->guiVisible()); gact->setEnabled(port->hasGui()); gact->setChecked(port->guiVisible()); QAction* nact = p->addAction(tr("show native gui")); nact->setCheckable(true); - //printf("synth hasgui %d, gui visible %d\n",synth->hasGui(), synth->guiVisible()); nact->setEnabled(port->hasNativeGui()); nact->setChecked(port->nativeGuiVisible()); @@ -1180,8 +1138,6 @@ void TList::oportPropertyPopupMenu(MusECore::Track* t, int x, int y) MusECore::MidiDevice* dev = port->device(); if(dev && dev->isSynti() && (dynamic_cast<MusECore::DssiSynthIF*>(((MusECore::SynthI*)dev)->sif()))) { - //act->setChecked(false); - //act->setEnabled(false); nact->setChecked(false); nact->setEnabled(false); } @@ -1189,15 +1145,12 @@ void TList::oportPropertyPopupMenu(MusECore::Track* t, int x, int y) #endif QAction* ract = p->exec(mapToGlobal(QPoint(x, y)), 0); - //if (ract == act) { if (ract == gact) { bool show = !port->guiVisible(); - //MusEGlobal::audio->msgShowInstrumentGui(port->instrument(), show); port->instrument()->showGui(show); } else if (ract == nact) { bool show = !port->nativeGuiVisible(); - //MusEGlobal::audio->msgShowInstrumentNativeGui(port->instrument(), show); port->instrument()->showNativeGui(show); } delete p; @@ -1219,16 +1172,14 @@ void TList::tracklistChanged() void TList::keyPressEvent(QKeyEvent* e) { + if ( e->key() == Qt::Key_Return || e->key() == Qt::Key_Enter) + { + e->accept(); + return; + } + if (editMode) { - // First time we get a keypress event when lineedit is open is on the return key: - // -- Not true for Qt4. Modifier keys also send key events - Orcan - //if ( e->key() == Qt::Key_Return || e->key() == Qt::Key_Enter) // Removed p4.0.46 Tim. - // { - // returnPressed(); - // return; - // } - //else if ( e->key() == Qt::Key_Escape ) { if(editor && editor->isVisible()) @@ -1254,6 +1205,7 @@ void TList::keyPressEvent(QKeyEvent* e) setFocus(); return; } + return; } else if (!editJustFinished) { @@ -1263,24 +1215,24 @@ void TList::keyPressEvent(QKeyEvent* e) editJustFinished=false; - // p4.0.10 Removed by Tim. keyPressExt are sent to part canvas, where they are - // ignored *only* if necessary. - //e->ignore(); - + // Works OK (if focusing allowed). But instead we won't allow focus. Part canvas has Ctrl+up/down which moves selected track only. /* int key = e->key(); switch (key) { - case Key_Up: + case Qt::Key_Up: moveSelection(-1); - break; - case Key_Down: + return; + case Qt::Key_Down: moveSelection(1); - break; + return; default: - break; - } - */ + } */ + + // keyPressExt are sent to part canvas, where they are ignored *only* if necessary. + //e->ignore(); + + emit keyPressExt(e); //redirect keypress events to main app } //--------------------------------------------------------- @@ -1302,7 +1254,6 @@ void TList::moveSelection(int n) for (MusECore::iTrack t = tracks->begin(); t != tracks->end(); ++t) { MusECore::iTrack s = t; if ((*t)->selected()) { - selTrack = *t; if (n > 0) { while (n--) { ++t; @@ -1313,7 +1264,10 @@ void TList::moveSelection(int n) // skip over hidden tracks if (!(*t)->isVisible()) { n++; + continue; } + selTrack = *t; + break; } } else { @@ -1324,40 +1278,42 @@ void TList::moveSelection(int n) // skip over hidden tracks if (!(*t)->isVisible()) { n--; + continue; } + selTrack = *t; + break; } } - (*s)->setSelected(false); - (*t)->setSelected(true); - - // rec enable track if expected - MusECore::TrackList recd = getRecEnabledTracks(); - if (recd.size() == 1 && MusEGlobal::config.moveArmedCheckBox) { // one rec enabled track, move rec enabled with selection - MusEGlobal::song->setRecordFlag((MusECore::Track*)recd.front(),false); - MusEGlobal::song->setRecordFlag((*t),true); - } + if(selTrack) + { + (*s)->setSelected(false); + selTrack->setSelected(true); + + // rec enable track if expected + MusECore::TrackList recd = getRecEnabledTracks(); + if (recd.size() == 1 && MusEGlobal::config.moveArmedCheckBox) { // one rec enabled track, move rec enabled with selection + MusEGlobal::song->setRecordFlag((MusECore::Track*)recd.front(),false); + MusEGlobal::song->setRecordFlag((selTrack),true); + } - if (editTrack && editTrack != *t) - returnPressed(); - - redraw(); - break; + if (editTrack && editTrack != selTrack) + returnPressed(); + redraw(); } + break; + } } - ///emit selectionChanged(); - emit selectionChanged(selTrack); + if(selTrack) + emit selectionChanged(selTrack); } MusECore::TrackList TList::getRecEnabledTracks() { - //printf("getRecEnabledTracks\n"); MusECore::TrackList recEnabled; MusECore::TrackList* tracks = MusEGlobal::song->tracks(); for (MusECore::iTrack t = tracks->begin(); t != tracks->end(); ++t) { - if ((*t)->recordFlag()) { - //printf("rec enabled track\n"); + if ((*t)->recordFlag()) recEnabled.push_back(*t); - } } return recEnabled; } @@ -1368,7 +1324,6 @@ MusECore::TrackList TList::getRecEnabledTracks() void TList::changeAutomation(QAction* act) { - //printf("changeAutomation %d\n", act->data().toInt()); if ( (editAutomation->type() == MusECore::Track::MIDI) || (editAutomation->type() == MusECore::Track::DRUM) || (editAutomation->type() == MusECore::Track::NEW_DRUM) ) { printf("this is wrong, we can't edit automation for midi tracks from arranger yet!\n"); return; @@ -1407,8 +1362,6 @@ void TList::changeAutomationColor(QAction* act) // one of these days I'll rewrite this so it's understandable // this is just to get it up and running... - //printf("change automation color %d %d\n", id, colindex); - MusECore::CtrlListList* cll = ((MusECore::AudioTrack*)editAutomation)->controller(); for(MusECore::CtrlListList::iterator icll =cll->begin();icll!=cll->end();++icll) { MusECore::CtrlList *cl = icll->second; @@ -1421,12 +1374,9 @@ void TList::changeAutomationColor(QAction* act) //--------------------------------------------------------- // colorMenu //--------------------------------------------------------- -//QMenu* TList::colorMenu(QColor c, int id) PopupMenu* TList::colorMenu(QColor c, int id, QWidget* parent) { - //QMenu * m = new QMenu(this); - //PopupMenu * m = new PopupMenu(this); //, true); TODO - PopupMenu * m = new PopupMenu(parent); //, true); // + PopupMenu * m = new PopupMenu(parent); //, true); //TODO for (int i = 0; i< 6; i++) { QPixmap pix(10,10); QPainter p(&pix); @@ -1490,7 +1440,7 @@ void TList::mousePressEvent(QMouseEvent* ev) //delete synp; delete p; } - /*else if (button == Qt::LeftButton) { + /*else if (button == Qt::LeftButton) { DELETETHIS if (!ctrl) { MusEGlobal::song->deselectTracks(); @@ -1514,7 +1464,7 @@ void TList::mousePressEvent(QMouseEvent* ev) ty += h; if (y >= (ty-2)) { - if ( (*it) == tracks->back() && y > ty ) { + if ( (*it) == tracks->back() && y > ty ) { // DELETETHIS, only retain if(foo) break;? //printf("tracks->back() && y > ty\n"); } else if ( y > (ty+2) ) { @@ -1527,7 +1477,7 @@ void TList::mousePressEvent(QMouseEvent* ev) } - //&& y < (ty)) + //&& y < (ty)) DELETETHIS // break; } } @@ -1578,7 +1528,6 @@ void TList::mousePressEvent(QMouseEvent* ev) QAction* act = 0; for(MusECore::CtrlListList::iterator icll =cll->begin();icll!=cll->end();++icll) { MusECore::CtrlList *cl = icll->second; - //printf("id = %d", cl->id()); if (cl->dontShow()) continue; act = p->addAction(cl->name()); @@ -1587,8 +1536,6 @@ void TList::mousePressEvent(QMouseEvent* ev) int data = cl->id() * 256; // shift 8 bits data += 150; // illegal color > 100 act->setData(data); - //QMenu *m = colorMenu(cl->color(), cl->id()); - //PopupMenu *m = colorMenu(cl->color(), cl->id()); PopupMenu *m = colorMenu(cl->color(), cl->id(), p); act->setMenu(m); } @@ -1649,7 +1596,7 @@ void TList::mousePressEvent(QMouseEvent* ev) classesPopupMenu(t, x, t->y() - ypos); break; case COL_OPORT: - // Changed by Tim. p3.3.9 + // Changed by Tim. p3.3.9 DELETETHIS 15 // Reverted. if (button == Qt::LeftButton) portsPopupMenu(t, x, t->y() - ypos); @@ -1703,13 +1650,11 @@ void TList::mousePressEvent(QMouseEvent* ev) t->setSelected(!t->selected()); if (editTrack && editTrack != t) returnPressed(); - ///emit selectionChanged(); emit selectionChanged(t->selected() ? t : 0); } else if (button == Qt::RightButton) { mode = NORMAL; QMenu* p = new QMenu; - //p->clear(); // Leave room for normal track IDs - base these at AUDIO_SOFTSYNTH. p->addAction(QIcon(*automation_clear_dataIcon), tr("Delete Track"))->setData(1001); p->addAction(QIcon(*track_commentIcon), tr("Track Comment"))->setData(1002); @@ -1753,7 +1698,6 @@ void TList::mousePressEvent(QMouseEvent* ev) { TrackComment* tc = new TrackComment(t, 0); tc->show(); - //QToolTip::add( this, "FOOOOOOOOOOOOO" ); } break; @@ -1845,16 +1789,14 @@ void TList::mousePressEvent(QMouseEvent* ev) channel = MIDI_CHANNELS - 1; if(channel < 0) channel = 0; - //if (channel != ((MusECore::MidiTrack*)t)->outChannel()) if (channel != mt->outChannel()) { // Changed by T356. - //mt->setOutChannel(channel); MusEGlobal::audio->msgIdle(true); - //MusEGlobal::audio->msgSetTrackOutChannel(mt, channel); mt->setOutChanAndUpdate(channel); MusEGlobal::audio->msgIdle(false); + // DELETETHIS 15? /* --- I really don't like this, you can mess up the whole map "as easy as dell" if (mt->type() == MusECore::MidiTrack::DRUM) {//Change channel on all drum instruments for (int i=0; i<DRUM_MAPSIZE; i++) @@ -2179,7 +2121,7 @@ void TList::mouseMoveEvent(QMouseEvent* ev) int h = (*it)->height(); ty += h; if (y >= (ty-2)) { - if ( (*it) == tracks->back() && y >= ty ) { + if ( (*it) == tracks->back() && y >= ty ) { // DELETETHIS and cleanup // outside last track don't change to splitVCursor } else if ( y > (ty+2) ) { @@ -2267,7 +2209,7 @@ void TList::mouseReleaseEvent(QMouseEvent* ev) if (editTrack && editor && editor->isVisible()) editor->setFocus(); //else // DELETETHIS or add the same for ctrl_edit! - //if (editTrack && chan_edit && chan_edit->isVisible()) // p4.0.46 + //if (editTrack && chan_edit && chan_edit->isVisible()) // p4.0.46 DELETETHIS? // chan_edit->setFocus(); adjustScrollbar(); } @@ -2329,15 +2271,11 @@ void TList::wheelEvent(QWheelEvent* ev) else if (port < 0) port = 0; if (port != ((MusECore::MidiTrack*)t)->outPort()) { - // Changed by T356. - //mt->setOutPort(port); MusEGlobal::audio->msgIdle(true); - //MusEGlobal::audio->msgSetTrackOutPort(mt, port); mt->setOutPortAndUpdate(port); MusEGlobal::audio->msgIdle(false); MusEGlobal::audio->msgUpdateSoloStates(); // p4.0.14 - //MusEGlobal::song->update(SC_ROUTE); MusEGlobal::song->update(SC_MIDI_TRACK_PROP); // p4.0.17 } } @@ -2356,10 +2294,7 @@ void TList::wheelEvent(QWheelEvent* ev) else if (channel < 0) channel = 0; if (channel != ((MusECore::MidiTrack*)t)->outChannel()) { - // Changed by T356. - //mt->setOutChannel(channel); MusEGlobal::audio->msgIdle(true); - //MusEGlobal::audio->msgSetTrackOutChannel(mt, channel); mt->setOutChanAndUpdate(channel); MusEGlobal::audio->msgIdle(false); @@ -2473,15 +2408,6 @@ void TList::setYPos(int y) } //--------------------------------------------------------- -// resizeEvent -//--------------------------------------------------------- - -//void TList::resizeEvent(QResizeEvent* /*ev*/) -// { -// -// } - -//--------------------------------------------------------- // classesPopupMenu //--------------------------------------------------------- @@ -2514,7 +2440,7 @@ void TList::classesPopupMenu(MusECore::Track* t, int x, int y) int pitch = ev.pitch(); // Changed by T356. // Tested: Notes were being mixed up switching back and forth between midi and drum. - //pitch = MusEGlobal::drumMap[pitch].anote; + //pitch = MusEGlobal::drumMap[pitch].anote; DELETETHIS pitch = MusEGlobal::drumMap[pitch].enote; ev.setPitch(pitch); @@ -2546,7 +2472,6 @@ void TList::classesPopupMenu(MusECore::Track* t, int x, int y) MusEGlobal::audio->msgIdle(true); // Delete all port controller events. - //MusEGlobal::audio->msgChangeAllPortDrumCtrlEvents(false); MusEGlobal::song->changeAllPortDrumCtrlEvents(false); if (!change) { @@ -2557,7 +2482,6 @@ void TList::classesPopupMenu(MusECore::Track* t, int x, int y) } } - //MusEGlobal::audio->msgIdle(true); MusECore::PartList* pl = t->parts(); MusECore::MidiTrack* m = (MusECore::MidiTrack*) t; for (MusECore::iPart ip = pl->begin(); ip != pl->end(); ++ip) { @@ -2589,7 +2513,6 @@ void TList::classesPopupMenu(MusECore::Track* t, int x, int y) t->setType(MusECore::Track::DRUM); // Add all port controller events. - //MusEGlobal::audio->msgChangeAllPortDrumCtrlEvents(true); MusEGlobal::song->changeAllPortDrumCtrlEvents(true); MusEGlobal::audio->msgIdle(false); MusEGlobal::song->update(SC_EVENT_MODIFIED); |