diff options
author | Florian Jung <flo@windfisch.org> | 2011-10-07 14:53:22 +0000 |
---|---|---|
committer | Florian Jung <flo@windfisch.org> | 2011-10-07 14:53:22 +0000 |
commit | 3e6f82d7b9b29e8df7d63658540b762203b820f6 (patch) | |
tree | 3e1a71a2bda678b1574ab88c59195b158c0a64ca /muse2/muse | |
parent | f60ddccd6d328a5cebc4d524246e33b399a8dfdd (diff) |
added new style drum tracks
atm, they aren't different from midi tracks except that they launch
a drum editor by default
added markers to help me finding the places to change
TODO: instrument muting, in-note-mapping etc...
Diffstat (limited to 'muse2/muse')
29 files changed, 190 insertions, 77 deletions
diff --git a/muse2/muse/app.cpp b/muse2/muse/app.cpp index fd024d57..c56376fe 100644 --- a/muse2/muse/app.cpp +++ b/muse2/muse/app.cpp @@ -1792,6 +1792,7 @@ void MusE::startEditor(Track* t) switch (t->type()) { case Track::MIDI: startPianoroll(); break; case Track::DRUM: startDrumEditor(); break; + case Track::NEW_DRUM: startDrumEditor(); break; case Track::WAVE: startWaveEditor(); break; default: break; diff --git a/muse2/muse/appearance.cpp b/muse2/muse/appearance.cpp index b3e89aa1..a702965c 100644 --- a/muse2/muse/appearance.cpp +++ b/muse2/muse/appearance.cpp @@ -1,5 +1,4 @@ //========================================================= -//========================================================= // MusE // Linux Music Editor // $Id: appearance.cpp,v 1.11.2.5 2009/11/14 03:37:48 terminator356 Exp $ @@ -841,7 +840,7 @@ void Appearance::colorItemSelectionChanged() case 0x300: color = &config->waveEditBackgroundColor; break; case 0x411: color = &config->trackBg; break; case 0x412: color = &config->midiTrackBg; break; - case 0x413: color = &config->drumTrackBg; break; + case 0x413: color = &config->drumTrackBg; break; //FINDMICHJETZT add newDrum... case 0x414: color = &config->waveTrackBg; break; case 0x415: color = &config->outputTrackBg; break; case 0x416: color = &config->inputTrackBg; break; @@ -855,7 +854,7 @@ void Appearance::colorItemSelectionChanged() case 0x500: color = &config->mixerBg; break; case 0x501: color = &config->midiTrackLabelBg; break; - case 0x502: color = &config->drumTrackLabelBg; break; + case 0x502: color = &config->drumTrackLabelBg; break; //FINDMICHJETZT add newDrum... case 0x503: color = &config->waveTrackLabelBg; break; case 0x504: color = &config->outputTrackLabelBg; break; case 0x505: color = &config->inputTrackLabelBg; break; diff --git a/muse2/muse/arranger/arrangerview.cpp b/muse2/muse/arranger/arrangerview.cpp index 96ce4c09..d828feeb 100644 --- a/muse2/muse/arranger/arrangerview.cpp +++ b/muse2/muse/arranger/arrangerview.cpp @@ -634,11 +634,12 @@ void ArrangerView::populateAddTrack() trackMidiAction = grp->actions()[0]; trackDrumAction = grp->actions()[1]; - trackWaveAction = grp->actions()[2]; - trackAOutputAction = grp->actions()[3]; - trackAGroupAction = grp->actions()[4]; - trackAInputAction = grp->actions()[5]; - trackAAuxAction = grp->actions()[6]; + trackNewStyleDrumAction = grp->actions()[2]; + trackWaveAction = grp->actions()[3]; + trackAOutputAction = grp->actions()[4]; + trackAGroupAction = grp->actions()[5]; + trackAInputAction = grp->actions()[6]; + trackAAuxAction = grp->actions()[7]; } void ArrangerView::addNewTrack(QAction* action) @@ -662,6 +663,7 @@ void ArrangerView::updateShortcuts() trackMidiAction->setShortcut(shortcuts[SHRT_ADD_MIDI_TRACK].key); trackDrumAction->setShortcut(shortcuts[SHRT_ADD_DRUM_TRACK].key); + trackNewStyleDrumAction->setShortcut(shortcuts[SHRT_ADD_NEW_STYLE_DRUM_TRACK].key); trackWaveAction->setShortcut(shortcuts[SHRT_ADD_WAVE_TRACK].key); trackAOutputAction->setShortcut(shortcuts[SHRT_ADD_AUDIO_OUTPUT].key); trackAGroupAction->setShortcut(shortcuts[SHRT_ADD_AUDIO_GROUP].key); diff --git a/muse2/muse/arranger/arrangerview.h b/muse2/muse/arranger/arrangerview.h index 20655840..7c273ad8 100644 --- a/muse2/muse/arranger/arrangerview.h +++ b/muse2/muse/arranger/arrangerview.h @@ -88,7 +88,7 @@ class ArrangerView : public TopWin QMenu* master; QAction *strGlobalCutAction, *strGlobalInsertAction, *strGlobalSplitAction; - QAction *trackMidiAction, *trackDrumAction, *trackWaveAction, *trackAOutputAction, *trackAGroupAction; + QAction *trackMidiAction, *trackDrumAction, *trackNewStyleDrumAction, *trackWaveAction, *trackAOutputAction, *trackAGroupAction; QAction *trackAInputAction, *trackAAuxAction; QAction *editCutAction, *editCopyAction, *editCopyRangeAction; QAction *editPasteAction, *editPasteCloneAction, *editPasteDialogAction, *editPasteCloneDialogAction; diff --git a/muse2/muse/arranger/pcanvas.cpp b/muse2/muse/arranger/pcanvas.cpp index 5b5f3a6f..eaeec291 100644 --- a/muse2/muse/arranger/pcanvas.cpp +++ b/muse2/muse/arranger/pcanvas.cpp @@ -238,6 +238,7 @@ void PartCanvas::viewMouseDoubleClickEvent(QMouseEvent* event) switch(track->type()) { case Track::MIDI: case Track::DRUM: + case Track::NEW_DRUM: { MidiPart* part = new MidiPart((MidiTrack*)track); part->setTick(pos[1]); @@ -521,6 +522,7 @@ MusEWidget::CItem* PartCanvas::newItem(const QPoint& pos, int) switch(track->type()) { case Track::MIDI: case Track::DRUM: + case Track::NEW_DRUM: pa = new MidiPart((MidiTrack*)track); pa->setTick(x); pa->setLenTick(0); @@ -659,6 +661,7 @@ QMenu* PartCanvas::genItemPopup(MusEWidget::CItem* item) act_mexport->setData(16); } break; + case Track::NEW_DRUM: case Track::DRUM: { partPopup->addAction(MusEGlobal::muse->arranger()->parentWin->startDrumEditAction); partPopup->addAction(MusEGlobal::muse->arranger()->parentWin->startListEditAction); @@ -1259,6 +1262,7 @@ void PartCanvas::keyPress(QKeyEvent* event) // else track is midi switch (track->type()) { + case Track::NEW_DRUM: case Track::DRUM: type = 3; break; @@ -2302,7 +2306,7 @@ void PartCanvas::drawMidiPart(QPainter& p, const QRect&, EventList* events, Midi using std::pair; iEvent ito(events->lower_bound(to)); - bool isdrum = (mt->type() == Track::DRUM); + bool isdrum = (mt->type() == Track::DRUM || mt->type() == Track::NEW_DRUM); // draw controllers ------------------------------------------ p.setPen(QColor(192,192,color_brightness/2)); diff --git a/muse2/muse/arranger/tlist.cpp b/muse2/muse/arranger/tlist.cpp index 68f6dceb..c4a2094a 100644 --- a/muse2/muse/arranger/tlist.cpp +++ b/muse2/muse/arranger/tlist.cpp @@ -226,6 +226,9 @@ void TList::paint(const QRect& r) case Track::DRUM: bg = MusEConfig::config.drumTrackBg; break; + case Track::NEW_DRUM: + bg = MusEConfig::config.newDrumTrackBg; + break; case Track::WAVE: bg = MusEConfig::config.waveTrackBg; break; @@ -281,6 +284,7 @@ void TList::paint(const QRect& r) case Track::MIDI: pm = addtrack_addmiditrackIcon; break; + case Track::NEW_DRUM: case Track::DRUM: pm = addtrack_drumtrackIcon; break; @@ -585,6 +589,7 @@ void TList::portsPopupMenu(Track* t, int x, int y) switch(t->type()) { case Track::MIDI: case Track::DRUM: + case Track::NEW_DRUM: case Track::AUDIO_SOFTSYNTH: { MidiTrack* track = (MidiTrack*)t; @@ -739,7 +744,7 @@ void TList::oportPropertyPopupMenu(Track* t, int x, int y) } - if (t->type() != Track::MIDI && t->type() != Track::DRUM) + if (t->type() != Track::MIDI && t->type() != Track::DRUM && t->type() != Track::NEW_DRUM) return; int oPort = ((MidiTrack*)t)->outPort(); MidiPort* port = &midiPorts[oPort]; @@ -923,7 +928,8 @@ TrackList TList::getRecEnabledTracks() void TList::changeAutomation(QAction* act) { //printf("changeAutomation %d\n", act->data().toInt()); - if (editAutomation->type() == Track::MIDI) { + if (editAutomation->type() == Track::MIDI) { //FINDMICHJETZT is this correct? or should we also + //consider DRUM and NEW_DRUM? svn blame could help printf("this is wrong, we can't edit automation for midi tracks from arranger yet!\n"); return; } @@ -949,7 +955,7 @@ void TList::changeAutomation(QAction* act) //--------------------------------------------------------- void TList::changeAutomationColor(QAction* act) { - if (editAutomation->type() == Track::MIDI) { + if (editAutomation->type() == Track::MIDI) { //FINDMICHJETZT is this correct? see above printf("this is wrong, we can't edit automation for midi tracks from arranger yet!\n"); return; } @@ -1707,13 +1713,14 @@ void TList::classesPopupMenu(Track* t, int x, int y) p.clear(); p.addAction(QIcon(*addtrack_addmiditrackIcon), tr("Midi"))->setData(Track::MIDI); p.addAction(QIcon(*addtrack_drumtrackIcon), tr("Drum"))->setData(Track::DRUM); + p.addAction(QIcon(*addtrack_drumtrackIcon), tr("New style drum"))->setData(Track::NEW_DRUM); QAction* act = p.exec(mapToGlobal(QPoint(x, y)), 0); if (!act) return; int n = act->data().toInt(); - if (Track::TrackType(n) == Track::MIDI && t->type() == Track::DRUM) { + if ((Track::TrackType(n) == Track::MIDI || Track::TrackType(n) == Track::NEW_DRUM) && t->type() == Track::DRUM) { //FINDMICHJETZT passt das? // // Drum -> Midi // @@ -1747,11 +1754,11 @@ void TList::classesPopupMenu(Track* t, int x, int y) } } - t->setType(Track::MIDI); + t->setType(Track::TrackType(n)); audio->msgIdle(false); song->update(SC_EVENT_MODIFIED); } - else if (Track::TrackType(n) == Track::DRUM && t->type() == Track::MIDI) { + else if (Track::TrackType(n) == Track::DRUM && (t->type() == Track::MIDI || t->type() == Track::NEW_DRUM)) { //FINDMICHJETZT passt das? // // Midi -> Drum // @@ -1809,6 +1816,12 @@ void TList::classesPopupMenu(Track* t, int x, int y) audio->msgIdle(false); song->update(SC_EVENT_MODIFIED); } + else // MIDI -> NEW_DRUM or vice versa. added by flo. FINDMICHJETZT does this work properly? + { + Track* t2 = t->clone(false); + t->setType(Track::TrackType(n)); + audio->msgChangeTrack(t2, t, true); + } } } // namespace MusEArranger diff --git a/muse2/muse/conf.cpp b/muse2/muse/conf.cpp index 35b96591..e1d141e7 100644 --- a/muse2/muse/conf.cpp +++ b/muse2/muse/conf.cpp @@ -786,6 +786,8 @@ void readConfiguration(Xml& xml, bool readOnlySequencer, bool doReadGlobalConfig MusEConfig::config.midiTrackLabelBg = readColor(xml); else if (tag == "drumTrackLabelBg") MusEConfig::config.drumTrackLabelBg = readColor(xml); + else if (tag == "newDrumTrackLabelBg") + MusEConfig::config.newDrumTrackLabelBg = readColor(xml); else if (tag == "waveTrackLabelBg") MusEConfig::config.waveTrackLabelBg = readColor(xml); else if (tag == "outputTrackLabelBg") @@ -805,6 +807,8 @@ void readConfiguration(Xml& xml, bool readOnlySequencer, bool doReadGlobalConfig MusEConfig::config.ctrlGraphFg = readColor(xml); else if (tag == "drumTrackBg") MusEConfig::config.drumTrackBg = readColor(xml); + else if (tag == "newDrumTrackBg") + MusEConfig::config.newDrumTrackBg = readColor(xml); else if (tag == "waveTrackBg") MusEConfig::config.waveTrackBg = readColor(xml); else if (tag == "outputTrackBg") @@ -1317,6 +1321,7 @@ void MusE::writeGlobalConfiguration(int level, Xml& xml) const xml.colorTag(level, "mixerBg", MusEConfig::config.mixerBg); xml.colorTag(level, "midiTrackLabelBg", MusEConfig::config.midiTrackLabelBg); xml.colorTag(level, "drumTrackLabelBg", MusEConfig::config.drumTrackLabelBg); + xml.colorTag(level, "newDrumTrackLabelBg", MusEConfig::config.newDrumTrackLabelBg); xml.colorTag(level, "waveTrackLabelBg", MusEConfig::config.waveTrackLabelBg); xml.colorTag(level, "outputTrackLabelBg", MusEConfig::config.outputTrackLabelBg); xml.colorTag(level, "inputTrackLabelBg", MusEConfig::config.inputTrackLabelBg); @@ -1326,7 +1331,7 @@ void MusE::writeGlobalConfiguration(int level, Xml& xml) const xml.colorTag(level, "midiTrackBg", MusEConfig::config.midiTrackBg); xml.colorTag(level, "ctrlGraphFg", MusEConfig::config.ctrlGraphFg); - xml.colorTag(level, "drumTrackBg", MusEConfig::config.drumTrackBg); + xml.colorTag(level, "newDrumTrackBg", MusEConfig::config.newDrumTrackBg); xml.colorTag(level, "waveTrackBg", MusEConfig::config.waveTrackBg); xml.colorTag(level, "outputTrackBg", MusEConfig::config.outputTrackBg); xml.colorTag(level, "inputTrackBg", MusEConfig::config.inputTrackBg); @@ -1655,6 +1660,7 @@ void MixerConfig::write(int level, Xml& xml) xml.intTag(level, "showMidiTracks", showMidiTracks); xml.intTag(level, "showDrumTracks", showDrumTracks); + xml.intTag(level, "showNewDrumTracks", showNewDrumTracks); xml.intTag(level, "showInputTracks", showInputTracks); xml.intTag(level, "showOutputTracks", showOutputTracks); xml.intTag(level, "showWaveTracks", showWaveTracks); @@ -1692,6 +1698,8 @@ void MixerConfig::read(Xml& xml) showMidiTracks = xml.parseInt(); else if (tag == "showDrumTracks") showDrumTracks = xml.parseInt(); + else if (tag == "showNewDrumTracks") + showNewDrumTracks = xml.parseInt(); else if (tag == "showInputTracks") showInputTracks = xml.parseInt(); else if (tag == "showOutputTracks") diff --git a/muse2/muse/ctrl/ctrlcanvas.cpp b/muse2/muse/ctrl/ctrlcanvas.cpp index 7c77a836..fb4816f9 100644 --- a/muse2/muse/ctrl/ctrlcanvas.cpp +++ b/muse2/muse/ctrl/ctrlcanvas.cpp @@ -535,10 +535,10 @@ void CtrlCanvas::partControllers(const MidiPart* part, int num, int* dnum, int* int di; int n; - if((mt->type() != Track::DRUM) && curDrumInstrument != -1) + if((mt->type() != Track::DRUM) && curDrumInstrument != -1) //FINDMICHJETZT was ist das? printf("keyfilter != -1 in non drum track?\n"); - if((mt->type() == Track::DRUM) && (curDrumInstrument != -1) && ((num & 0xff) == 0xff)) + if((mt->type() == Track::DRUM) && (curDrumInstrument != -1) && ((num & 0xff) == 0xff)) //FINDMICHJETZT was ist das? { di = (num & ~0xff) | curDrumInstrument; n = (num & ~0xff) | drumMap[curDrumInstrument].anote; // construct real controller number @@ -1688,7 +1688,7 @@ void CtrlCanvas::pdrawItems(QPainter& p, const QRect& rect, const MidiPart* part MidiTrack* mt = part->track(); MidiPort* mp; - if((mt->type() == Track::DRUM) && (curDrumInstrument != -1) && ((_cnum & 0xff) == 0xff)) + if((mt->type() == Track::DRUM) && (curDrumInstrument != -1) && ((_cnum & 0xff) == 0xff)) //FINDMICHJETZT was ist das? mp = &midiPorts[drumMap[curDrumInstrument].port]; else mp = &midiPorts[mt->outPort()]; diff --git a/muse2/muse/ctrl/ctrlpanel.cpp b/muse2/muse/ctrl/ctrlpanel.cpp index cb18afad..ef2196fa 100644 --- a/muse2/muse/ctrl/ctrlpanel.cpp +++ b/muse2/muse/ctrl/ctrlpanel.cpp @@ -169,7 +169,7 @@ void CtrlPanel::heartBeat() int outport; int chan; int cdi = editor->curDrumInstrument(); - if(_track->type() == Track::DRUM && ((_ctrl->num() & 0xff) == 0xff) && cdi != -1) + if(_track->type() == Track::DRUM && ((_ctrl->num() & 0xff) == 0xff) && cdi != -1) //FINDMICHJETZT was ist das? und ähnliche dinger { outport = drumMap[cdi].port; chan = drumMap[cdi].channel; @@ -560,7 +560,7 @@ void CtrlPanel::ctrlPopup() int channel = track->outChannel(); MidiPort* port = &midiPorts[track->outPort()]; int curDrumInstrument = editor->curDrumInstrument(); - bool isDrum = track->type() == Track::DRUM; + bool isDrum = track->type() == Track::DRUM; //FINDMICHJETZT ist das wichtig? QMenu* pop = new QMenu; //pop->clear(); @@ -718,7 +718,7 @@ void CtrlPanel::ctrlPopup() int channel = track->outChannel(); MidiPort* port = &midiPorts[track->outPort()]; int curDrumInstrument = editor->curDrumInstrument(); - bool isDrum = track->type() == Track::DRUM; + bool isDrum = track->type() == Track::DRUM; //FINDMICHJETZT ist das wichtig? MidiInstrument* instr = port->instrument(); MidiControllerList* mcl = instr->controller(); diff --git a/muse2/muse/gconfig.cpp b/muse2/muse/gconfig.cpp index 0a521c3a..f8334b1e 100644 --- a/muse2/muse/gconfig.cpp +++ b/muse2/muse/gconfig.cpp @@ -103,6 +103,7 @@ GlobalConfigValues config = { QColor(74, 150, 194), // midiTrackLabelBg; // Med blue QColor(74, 150, 194), // drumTrackLabelBg; // Med blue + QColor(74, 150, 194), // newDrumTrackLabelBg; // Med blue QColor(213, 128, 202), // waveTrackLabelBg; // magenta QColor(84, 185, 58), // outputTrackLabelBg; // green QColor(199, 75, 64), // inputTrackLabelBg; // red @@ -112,6 +113,7 @@ GlobalConfigValues config = { QColor(215, 220, 230), // midiTrackBg; QColor(215, 220, 230), // drumTrackBg; + QColor(215, 220, 230), // newDrumTrackBg; QColor(220, 209, 217), // waveTrackBg; QColor(197, 220, 206), // outputTrackBg; QColor(220, 214, 206), // inputTrackBg; @@ -149,13 +151,13 @@ GlobalConfigValues config = { QString("Mixer A"), QRect(0, 0, 300, 500), // Mixer1 true, true, true, true, - true, true, true, true + true, true, true, true, true }, { QString("Mixer B"), QRect(200, 200, 300, 500), // Mixer2 true, true, true, true, - true, true, true, true + true, true, true, true, true }, true, // TransportVisible; false, // BigTimeVisible; diff --git a/muse2/muse/gconfig.h b/muse2/muse/gconfig.h index dd5f10fd..0d173b26 100644 --- a/muse2/muse/gconfig.h +++ b/muse2/muse/gconfig.h @@ -45,6 +45,7 @@ struct MixerConfig { QRect geometry; bool showMidiTracks; bool showDrumTracks; + bool showNewDrumTracks; bool showInputTracks; bool showOutputTracks; bool showWaveTracks; @@ -81,6 +82,7 @@ struct GlobalConfigValues { QColor midiTrackLabelBg; QColor drumTrackLabelBg; + QColor newDrumTrackLabelBg; QColor waveTrackLabelBg; QColor outputTrackLabelBg; QColor inputTrackLabelBg; @@ -90,6 +92,7 @@ struct GlobalConfigValues { QColor midiTrackBg; QColor drumTrackBg; + QColor newDrumTrackBg; QColor waveTrackBg; QColor outputTrackBg; QColor inputTrackBg; diff --git a/muse2/muse/helper.cpp b/muse2/muse/helper.cpp index 255e8505..2c128ef3 100644 --- a/muse2/muse/helper.cpp +++ b/muse2/muse/helper.cpp @@ -285,26 +285,44 @@ QActionGroup* populateAddTrack(QMenu* addTrack) QT_TRANSLATE_NOOP("@default", "Add Midi Track")); midi->setData(Track::MIDI); grp->addAction(midi); + + QAction* drum = addTrack->addAction(QIcon(*addtrack_drumtrackIcon), QT_TRANSLATE_NOOP("@default", "Add Drum Track")); drum->setData(Track::DRUM); grp->addAction(drum); + + + QAction* newdrum = addTrack->addAction(QIcon(*addtrack_drumtrackIcon), + QT_TRANSLATE_NOOP("@default", "Add New Style Drum Track")); + newdrum->setData(Track::NEW_DRUM); + grp->addAction(newdrum); + + QAction* wave = addTrack->addAction(QIcon(*addtrack_wavetrackIcon), QT_TRANSLATE_NOOP("@default", "Add Wave Track")); wave->setData(Track::WAVE); grp->addAction(wave); + + QAction* aoutput = addTrack->addAction(QIcon(*addtrack_audiooutputIcon), QT_TRANSLATE_NOOP("@default", "Add Audio Output")); aoutput->setData(Track::AUDIO_OUTPUT); grp->addAction(aoutput); + + QAction* agroup = addTrack->addAction(QIcon(*addtrack_audiogroupIcon), QT_TRANSLATE_NOOP("@default", "Add Audio Group")); agroup->setData(Track::AUDIO_GROUP); grp->addAction(agroup); + + QAction* ainput = addTrack->addAction(QIcon(*addtrack_audioinputIcon), QT_TRANSLATE_NOOP("@default", "Add Audio Input")); ainput->setData(Track::AUDIO_INPUT); grp->addAction(ainput); + + QAction* aaux = addTrack->addAction(QIcon(*addtrack_auxsendIcon), QT_TRANSLATE_NOOP("@default", "Add Aux Send")); aaux->setData(Track::AUDIO_AUX); diff --git a/muse2/muse/importmidi.cpp b/muse2/muse/importmidi.cpp index 558ffb69..0e09ecfa 100644 --- a/muse2/muse/importmidi.cpp +++ b/muse2/muse/importmidi.cpp @@ -181,7 +181,7 @@ bool MusE::importMidi(const QString name, bool merge) MidiTrack* track = new MidiTrack(); if ((*t)->isDrumTrack) - track->setType(Track::DRUM); + track->setType(Track::DRUM); //FINDMICHJETZT track->setOutChannel(channel); track->setOutPort(port); @@ -200,7 +200,7 @@ bool MusE::importMidi(const QString name, bool merge) // Hmm. buildMidiEventList already takes care of this. // But it seems to work. How? Must test. if (channel == 9 && song->mtype() != MT_UNKNOWN) { - track->setType(Track::DRUM); + track->setType(Track::DRUM); //FINDMICHJETZT // // remap drum pitch with drumInmap // diff --git a/muse2/muse/liste/editevent.cpp b/muse2/muse/liste/editevent.cpp index e211e7f7..702e61e5 100644 --- a/muse2/muse/liste/editevent.cpp +++ b/muse2/muse/liste/editevent.cpp @@ -617,7 +617,7 @@ EditCtrlDialog::EditCtrlDialog(int tick, const Event& event, MidiTrack* track = part->track(); int portn = track->outPort(); MidiPort* port = &midiPorts[portn]; - bool isDrum = track->type() == Track::DRUM; + bool isDrum = track->type() == Track::DRUM; //FINDMICHJETZT was soll das? MidiCtrlValListList* cll = port->controller(); ctrlList->clear(); @@ -833,7 +833,7 @@ void EditCtrlDialog::updatePatch() int port = track->outPort(); int channel = track->outChannel(); MidiInstrument* instr = midiPorts[port].instrument(); - patchName->setText(instr->getPatchName(channel, val, song->mtype(), track->type() == Track::DRUM)); + patchName->setText(instr->getPatchName(channel, val, song->mtype(), track->type() == Track::DRUM)); //FINDMICHJETZT was soll das? int hb = ((val >> 16) & 0xff) + 1; if (hb == 0x100) @@ -872,7 +872,7 @@ void EditCtrlDialog::instrPopup() ///instr->populatePatchPopup(pop, channel, song->mtype(), track->type() == Track::DRUM); //QMenu* pup = new QMenu(this); MusEWidget::PopupMenu* pup = new MusEWidget::PopupMenu(this); - instr->populatePatchPopup(pup, channel, song->mtype(), track->type() == Track::DRUM); + instr->populatePatchPopup(pup, channel, song->mtype(), track->type() == Track::DRUM); //FINDMICHJETZT was soll das? ///if(pop->actions().count() == 0) /// return; diff --git a/muse2/muse/midi.cpp b/muse2/muse/midi.cpp index 39642348..5d7fe560 100644 --- a/muse2/muse/midi.cpp +++ b/muse2/muse/midi.cpp @@ -254,7 +254,7 @@ void buildMidiEventList(EventList* del, const MPEventList* el, MidiTrack* track, case ME_NOTEON: e.setType(Note); - if (track->type() == Track::DRUM) { + if (track->type() == Track::DRUM) { //FINDMICHJETZT int instr = drumInmap[ev.dataA()]; e.setPitch(instr); } @@ -268,7 +268,7 @@ void buildMidiEventList(EventList* del, const MPEventList* el, MidiTrack* track, break; case ME_NOTEOFF: e.setType(Note); - if (track->type() == Track::DRUM) { + if (track->type() == Track::DRUM) { //FINDMICHJETZT int instr = drumInmap[ev.dataA()]; e.setPitch(instr); } @@ -370,7 +370,7 @@ void buildMidiEventList(EventList* del, const MPEventList* el, MidiTrack* track, int ctl = ev.dataA(); e.setA(ctl); - if(track->type() == Track::DRUM) + if(track->type() == Track::DRUM) //FINDMICHJETZT drum controller? { // Is it a drum controller event, according to the track port's instrument? MidiController *mc = midiPorts[track->outPort()].drumController(ctl); @@ -723,7 +723,7 @@ void Audio::collectEvents(MidiTrack* track, unsigned int cts, unsigned int nts) // if (ev.type() == Meta) continue; - if (track->type() == Track::DRUM) { + if (track->type() == Track::DRUM) { //FINDMICHJETZT ignore muted int instr = ev.pitch(); // ignore muted drums if (ev.isNote() && drumMap[instr].mute) @@ -747,7 +747,7 @@ void Audio::collectEvents(MidiTrack* track, unsigned int cts, unsigned int nts) channel = drumMap[instr].channel; velo = int(double(velo) * (double(drumMap[instr].vol) / 100.0)) ; } - else { + else { //FINDMICHJETZT don't transpose for new style drum tracks // // transpose non drum notes // @@ -800,7 +800,7 @@ void Audio::collectEvents(MidiTrack* track, unsigned int cts, unsigned int nts) case Controller: { - if (track->type() == Track::DRUM) + if (track->type() == Track::DRUM) //FINDMICHJETZT was ist das? drumcontroller -_- { int ctl = ev.dataA(); // Is it a drum controller event, according to the track port's instrument? @@ -972,7 +972,7 @@ void Audio::processMidi() // //Apply drum inkey: - if (track->type() == Track::DRUM) + if (track->type() == Track::DRUM) //FINDMICHJETZT schwierig... { int pitch = event.dataA(); //Map note that is played according to drumInmap @@ -1009,7 +1009,7 @@ void Audio::processMidi() else if(event.type() == ME_CONTROLLER) { - if(track->type() == Track::DRUM) + if(track->type() == Track::DRUM) //FINDMICHJETZT was ist das? { ctl = event.dataA(); // Regardless of what port the event came from, is it a drum controller event @@ -1072,7 +1072,7 @@ void Audio::processMidi() // to the track port so buildMidiEventList will accept it. Even though // the port may have no device "<none>". // - if (track->type() == Track::DRUM) + if (track->type() == Track::DRUM) //FINDMICHJETZT was ist das? { // Is it a drum controller event? if(mc) diff --git a/muse2/muse/midiedit/scoreedit.cpp b/muse2/muse/midiedit/scoreedit.cpp index e82ab7ad..a06d2a8c 100644 --- a/muse2/muse/midiedit/scoreedit.cpp +++ b/muse2/muse/midiedit/scoreedit.cpp @@ -4591,6 +4591,14 @@ void ScoreCanvas::add_new_parts(const std::map< Part*, std::set<Part*> >& param) * from clipboard failed. ignoring this one... ) [ not reproducible ] * * CURRENT TODO + * o in appearance.cpp: add the new stuff for drumTrackLabelBg and drumTrackBg + * o find and fix FINDMICHJETZT + * o fix all segfaults and non-working stuff! + * - creating, changing types to and from, erasing NEW_DRUM tracks + * - move parts around + * - playing them. mute? + * - recording/echoing/steprec them + * - load, save them * o fix valgrind problems * * > o drum editor: channel-stuff diff --git a/muse2/muse/mixer/amixer.cpp b/muse2/muse/mixer/amixer.cpp index 18fe926f..082b9461 100644 --- a/muse2/muse/mixer/amixer.cpp +++ b/muse2/muse/mixer/amixer.cpp @@ -183,6 +183,7 @@ AudioMixerApp::AudioMixerApp(QWidget* parent, MusEConfig::MixerConfig* c) showMidiTracksId = new QAction(tr("Show Midi Tracks"), actionItems); showDrumTracksId = new QAction(tr("Show Drum Tracks"), actionItems); + showNewDrumTracksId = new QAction(tr("Show New Style Drum Tracks"), actionItems); showWaveTracksId = new QAction(tr("Show Wave Tracks"), actionItems); QAction *separator = new QAction(this); @@ -197,6 +198,7 @@ AudioMixerApp::AudioMixerApp(QWidget* parent, MusEConfig::MixerConfig* c) showMidiTracksId->setCheckable(true); showDrumTracksId->setCheckable(true); + showNewDrumTracksId->setCheckable(true); showWaveTracksId->setCheckable(true); showInputTracksId->setCheckable(true); showOutputTracksId->setCheckable(true); @@ -208,6 +210,7 @@ AudioMixerApp::AudioMixerApp(QWidget* parent, MusEConfig::MixerConfig* c) //connect(actionItems, SIGNAL(selected(QAction*)), this, SLOT(showTracksChanged(QAction*))); connect(showMidiTracksId, SIGNAL(triggered(bool)), SLOT(showMidiTracksChanged(bool))); connect(showDrumTracksId, SIGNAL(triggered(bool)), SLOT(showDrumTracksChanged(bool))); + connect(showNewDrumTracksId, SIGNAL(triggered(bool)), SLOT(showNewDrumTracksChanged(bool))); connect(showWaveTracksId, SIGNAL(triggered(bool)), SLOT(showWaveTracksChanged(bool))); connect(showInputTracksId, SIGNAL(triggered(bool)), SLOT(showInputTracksChanged(bool))); connect(showOutputTracksId, SIGNAL(triggered(bool)), SLOT(showOutputTracksChanged(bool))); @@ -349,6 +352,7 @@ void AudioMixerApp::updateMixer(UpdateAction action) showMidiTracksId->setChecked(cfg->showMidiTracks); showDrumTracksId->setChecked(cfg->showDrumTracks); + showNewDrumTracksId->setChecked(cfg->showNewDrumTracks); showInputTracksId->setChecked(cfg->showInputTracks); showOutputTracksId->setChecked(cfg->showOutputTracks); showWaveTracksId->setChecked(cfg->showWaveTracks); @@ -428,7 +432,7 @@ void AudioMixerApp::updateMixer(UpdateAction action) for (iMidiTrack i = mtl->begin(); i != mtl->end(); ++i) { MidiTrack* mt = *i; - if((mt->type() == Track::MIDI && cfg->showMidiTracks) || (mt->type() == Track::DRUM && cfg->showDrumTracks)) + if((mt->type() == Track::MIDI && cfg->showMidiTracks) || (mt->type() == Track::DRUM && cfg->showDrumTracks) || (mt->type() == Track::NEW_DRUM && cfg->showNewDrumTracks)) addStrip(*i, idx++); } @@ -485,7 +489,7 @@ void AudioMixerApp::updateMixer(UpdateAction action) for (iMidiTrack i = mtl->begin(); i != mtl->end(); ++i) { MidiTrack* mt = *i; - if((mt->type() == Track::MIDI && cfg->showMidiTracks) || (mt->type() == Track::DRUM && cfg->showDrumTracks)) + if((mt->type() == Track::MIDI && cfg->showMidiTracks) || (mt->type() == Track::DRUM && cfg->showDrumTracks) || (mt->type() == Track::NEW_DRUM && cfg->showNewDrumTracks)) addStrip(*i, idx++); } @@ -627,6 +631,8 @@ void AudioMixerApp::showTracksChanged(QAction* id) cfg->showMidiTracks = val; else if (id == showDrumTracksId) cfg->showDrumTracks = val; + else if (id == showNewDrumTracksId) + cfg->showNewDrumTracks = val; else if (id == showInputTracksId) cfg->showInputTracks = val; else if (id == showOutputTracksId) @@ -655,6 +661,12 @@ void AudioMixerApp::showDrumTracksChanged(bool v) updateMixer(UPDATE_ALL); } +void AudioMixerApp::showNewDrumTracksChanged(bool v) +{ + cfg->showNewDrumTracks = v; + updateMixer(UPDATE_ALL); +} + void AudioMixerApp::showWaveTracksChanged(bool v) { cfg->showWaveTracks = v; @@ -710,6 +722,7 @@ void AudioMixerApp::write(int level, Xml& xml) xml.intTag(level, "showMidiTracks", cfg->showMidiTracks); xml.intTag(level, "showDrumTracks", cfg->showDrumTracks); + xml.intTag(level, "showNewDrumTracks", cfg->showNewDrumTracks); xml.intTag(level, "showInputTracks", cfg->showInputTracks); xml.intTag(level, "showOutputTracks", cfg->showOutputTracks); xml.intTag(level, "showWaveTracks", cfg->showWaveTracks); diff --git a/muse2/muse/mixer/amixer.h b/muse2/muse/mixer/amixer.h index 5be12659..60a77f12 100644 --- a/muse2/muse/mixer/amixer.h +++ b/muse2/muse/mixer/amixer.h @@ -101,6 +101,7 @@ class AudioMixerApp : public QMainWindow { QAction* showMidiTracksId; QAction* showDrumTracksId; + QAction* showNewDrumTracksId; QAction* showInputTracksId; QAction* showOutputTracksId; QAction* showWaveTracksId; @@ -134,6 +135,7 @@ class AudioMixerApp : public QMainWindow { //void showTracksChanged(QAction*); void showMidiTracksChanged(bool); void showDrumTracksChanged(bool); + void showNewDrumTracksChanged(bool); void showWaveTracksChanged(bool); void showInputTracksChanged(bool); void showOutputTracksChanged(bool); diff --git a/muse2/muse/mixer/strip.cpp b/muse2/muse/mixer/strip.cpp index 59149222..67594e3a 100644 --- a/muse2/muse/mixer/strip.cpp +++ b/muse2/muse/mixer/strip.cpp @@ -150,6 +150,10 @@ void Strip::setLabelText() //c = QColor(0, 160, 255); // Med blue c = MusEConfig::config.drumTrackLabelBg; break; + case Track::NEW_DRUM: + //c = QColor(0, 160, 255); // Med blue + c = MusEConfig::config.newDrumTrackLabelBg; + break; default: return; } diff --git a/muse2/muse/part.cpp b/muse2/muse/part.cpp index 6d273c82..2d9111f7 100644 --- a/muse2/muse/part.cpp +++ b/muse2/muse/part.cpp @@ -401,7 +401,7 @@ void addPortCtrlEvents(Event& event, Part* part, bool doClones) MidiPort* mp = &midiPorts[port]; // Is it a drum controller event, according to the track port's instrument? - if(mt->type() == Track::DRUM) + if(mt->type() == Track::DRUM) //FINDMICHJETZT was ist das? { MidiController* mc = mp->drumController(cntrl); if(mc) @@ -469,7 +469,7 @@ void addPortCtrlEvents(Part* part, bool doClones) MidiPort* mp = &midiPorts[port]; // Is it a drum controller event, according to the track port's instrument? - if(mt->type() == Track::DRUM) + if(mt->type() == Track::DRUM) //FINDMICHJETZT was ist das? { MidiController* mc = mp->drumController(cntrl); if(mc) @@ -528,7 +528,7 @@ void removePortCtrlEvents(Event& event, Part* part, bool doClones) MidiPort* mp = &midiPorts[port]; // Is it a drum controller event, according to the track port's instrument? - if(mt->type() == Track::DRUM) + if(mt->type() == Track::DRUM) //FINDMICHJETZT was ist das? { MidiController* mc = mp->drumController(cntrl); if(mc) @@ -597,7 +597,7 @@ void removePortCtrlEvents(Part* part, bool doClones) MidiPort* mp = &midiPorts[port]; // Is it a drum controller event, according to the track port's instrument? - if(mt->type() == Track::DRUM) + if(mt->type() == Track::DRUM) //FINDMICHJETZT was ist das? { MidiController* mc = mp->drumController(cntrl); if(mc) @@ -913,6 +913,7 @@ void Song::cmdResizePart(Track* track, Part* oPart, unsigned int len, bool doClo break; case Track::MIDI: case Track::DRUM: + case Track::NEW_DRUM: { Undo operations; @@ -959,6 +960,7 @@ void Track::splitPart(Part* part, int tickpos, Part*& p1, Part*& p2) break; case MIDI: case DRUM: + case NEW_DRUM: l1 = tickpos - part->tick(); l2 = part->lenTick() - l1; break; @@ -982,6 +984,7 @@ void Track::splitPart(Part* part, int tickpos, Part*& p1, Part*& p2) break; case MIDI: case DRUM: + case NEW_DRUM: p1->setLenTick(l1); p2->setTick(tickpos); p2->setLenTick(l2); diff --git a/muse2/muse/remote/pyapi.cpp b/muse2/muse/remote/pyapi.cpp index 27a44e49..ff88ca23 100644 --- a/muse2/muse/remote/pyapi.cpp +++ b/muse2/muse/remote/pyapi.cpp @@ -695,7 +695,8 @@ PyObject* getAudioTrackVolume(PyObject*, PyObject* args) if (t == NULL) return NULL; - if (t->type() == Track::DRUM || t->type() == Track::MIDI) + //if (t->type() == Track::DRUM || t->type() == Track::MIDI || t->type() == Track::NEW_DRUM) + if (t->isMidiTrack()) // changed by flo. should do the same thing and is better maintainable return NULL; AudioTrack* track = (AudioTrack*) t; @@ -1089,7 +1090,8 @@ bool Song::event(QEvent* _e) if (t == NULL) return false; - if (t->type() == Track::DRUM || t->type() == Track::MIDI) + if (t->isMidiTrack()) // changed by flo. is better maintainable + //if (t->type() == Track::DRUM || t->type() == Track::NEW_DRUM || t->type() == Track::MIDI) return false; AudioTrack* track = (AudioTrack*) t; diff --git a/muse2/muse/shortcuts.cpp b/muse2/muse/shortcuts.cpp index 2270befa..a8cd8062 100644 --- a/muse2/muse/shortcuts.cpp +++ b/muse2/muse/shortcuts.cpp @@ -98,6 +98,7 @@ void initShortCuts() defShrt(SHRT_OPEN_MIDI_TRANSFORM, Qt::CTRL + Qt::Key_T, "Open midi transformer", ARRANG_SHRT, "open_midi_transform"); defShrt(SHRT_ADD_MIDI_TRACK, Qt::CTRL + Qt::Key_J, "Add midi track", ARRANG_SHRT, "add_midi_track"); defShrt(SHRT_ADD_DRUM_TRACK, 0, "Add drum track", ARRANG_SHRT, "add_drum_track"); + defShrt(SHRT_ADD_NEW_STYLE_DRUM_TRACK, 0, "Add new style drum track", ARRANG_SHRT, "add_new_style_drum_track"); defShrt(SHRT_ADD_WAVE_TRACK, 0, "Add wave track", ARRANG_SHRT, "add_wave_track"); defShrt(SHRT_ADD_AUDIO_OUTPUT, 0, "Add audio output", ARRANG_SHRT, "add_audio_output"); defShrt(SHRT_ADD_AUDIO_GROUP, 0, "Add audio group", ARRANG_SHRT, "add_audio_group"); diff --git a/muse2/muse/shortcuts.h b/muse2/muse/shortcuts.h index 451c4ec3..37e8b507 100644 --- a/muse2/muse/shortcuts.h +++ b/muse2/muse/shortcuts.h @@ -172,6 +172,7 @@ enum { SHRT_ADD_MIDI_TRACK, //Default: Ctrl+J SHRT_ADD_DRUM_TRACK, //Default: undefined + SHRT_ADD_NEW_STYLE_DRUM_TRACK, //Default: undefined SHRT_ADD_WAVE_TRACK, //Default: undefined SHRT_ADD_AUDIO_OUTPUT, //Default: undefined SHRT_ADD_AUDIO_GROUP, //Default: undefined diff --git a/muse2/muse/song.cpp b/muse2/muse/song.cpp index db2bcad5..dca43681 100644 --- a/muse2/muse/song.cpp +++ b/muse2/muse/song.cpp @@ -238,6 +238,11 @@ Track* Song::addTrack(Track::TrackType type, Track* insertAt) track = new MidiTrack(); track->setType(Track::MIDI); break; + case Track::NEW_DRUM: + track = new MidiTrack(); + track->setType(Track::NEW_DRUM); + ((MidiTrack*)track)->setOutChannel(9); + break; case Track::DRUM: track = new MidiTrack(); track->setType(Track::DRUM); @@ -315,7 +320,7 @@ Track* Song::addTrack(Track::TrackType type, Track* insertAt) { defOutFound = true; mt->setOutPort(i); - if(type != Track::DRUM) // p4.0.17 Leave drum tracks at channel 10. + if(type != Track::DRUM && type != Track::NEW_DRUM) // p4.0.17 Leave drum tracks at channel 10. mt->setOutChannel(ch); updateFlags |= SC_ROUTE; break; @@ -336,6 +341,7 @@ Track* Song::addTrack(Track::TrackType type, Track* insertAt) switch(type) { //case Track::MIDI: //case Track::DRUM: + //case Track::NEW_DRUM: //case Track::AUDIO_OUTPUT: // break; @@ -435,7 +441,7 @@ bool Song::addEvent(Event& event, Part* part) MidiPort* mp = &midiPorts[track->outPort()]; // Is it a drum controller event, according to the track port's instrument? - if(track->type() == Track::DRUM) + if(track->type() == Track::DRUM) //FINDMICHJETZT was ist das? { MidiController* mc = mp->drumController(cntrl); if(mc) @@ -508,7 +514,7 @@ void Song::changeEvent(Event& oldEvent, Event& newEvent, Part* part) int cntrl = oldEvent.dataA(); MidiPort* mp = &midiPorts[track->outPort()]; // Is it a drum controller event, according to the track port's instrument? - if(track->type() == Track::DRUM) + if(track->type() == Track::DRUM) //FINDMICHJETZT was ist das? { MidiController* mc = mp->drumController(cntrl); if(mc) @@ -535,7 +541,7 @@ void Song::changeEvent(Event& oldEvent, Event& newEvent, Part* part) int val = newEvent.dataB(); MidiPort* mp = &midiPorts[track->outPort()]; // Is it a drum controller event, according to the track port's instrument? - if(track->type() == Track::DRUM) + if(track->type() == Track::DRUM) //FINDMICHJETZT was ist das? { MidiController* mc = mp->drumController(cntrl); if(mc) @@ -569,7 +575,7 @@ void Song::deleteEvent(Event& event, Part* part) MidiPort* mp = &midiPorts[track->outPort()]; // Is it a drum controller event, according to the track port's instrument? - if(track->type() == Track::DRUM) + if(track->type() == Track::DRUM) //FINDMICHJETZT was ist das? { MidiController* mc = mp->drumController(cntrl); if(mc) @@ -610,7 +616,7 @@ void Song::remapPortDrumCtrlEvents(int mapidx, int newnote, int newchan, int new for(ciMidiTrack it = _midis.begin(); it != _midis.end(); ++it) { MidiTrack* mt = *it; - if(mt->type() != Track::DRUM) + if(mt->type() != Track::DRUM) //FINDMICHJETZT was ist das? drumcontroller? continue; MidiPort* trackmp = &midiPorts[mt->outPort()]; @@ -624,6 +630,7 @@ void Song::remapPortDrumCtrlEvents(int mapidx, int newnote, int newchan, int new { const Event& ev = ie->second; // Added by T356. Do not handle events which are past the end of the part. + //FINDMICHJETZT why not? if(ev.tick() >= len) break; @@ -680,7 +687,7 @@ void Song::changeAllPortDrumCtrlEvents(bool add, bool drumonly) for(ciMidiTrack it = _midis.begin(); it != _midis.end(); ++it) { MidiTrack* mt = *it; - if(mt->type() != Track::DRUM) + if(mt->type() != Track::DRUM) //FINDMICHJETZT was ist das? drumcontroller continue; trackmp = &midiPorts[mt->outPort()]; @@ -3351,6 +3358,7 @@ void Song::insertTrack2(Track* track, int idx) switch(track->type()) { case Track::MIDI: case Track::DRUM: + case Track::NEW_DRUM: _midis.push_back((MidiTrack*)track); // Added by T356. //((MidiTrack*)track)->addPortCtrlEvents(); @@ -3601,6 +3609,7 @@ void Song::removeTrack2(Track* track) switch(track->type()) { case Track::MIDI: case Track::DRUM: + case Track::NEW_DRUM: // Added by T356. //((MidiTrack*)track)->removePortCtrlEvents(); removePortCtrlEvents(((MidiTrack*)track)); diff --git a/muse2/muse/songfile.cpp b/muse2/muse/songfile.cpp index 344ecc89..c430ed1e 100644 --- a/muse2/muse/songfile.cpp +++ b/muse2/muse/songfile.cpp @@ -719,7 +719,7 @@ void Part::read(Xml& xml, int, bool toTrack) // int newPartOffset newPartOffset=this->tick(); int ctl = e.dataA(); - if(mt->type() == Track::DRUM) + if(mt->type() == Track::DRUM) //FINDMICHJETZT commented out: was ist das? { // Is it a drum controller event, according to the track port's instrument? MidiController* mc = mp->drumController(ctl); @@ -1403,6 +1403,12 @@ void Song::read(Xml& xml, bool isTemplate) track->read(xml); insertTrack0(track, -1); } + else if (tag == "newdrumtrack") { + MidiTrack* track = new MidiTrack(); + track->setType(Track::NEW_DRUM); + track->read(xml); + insertTrack0(track, -1); + } else if (tag == "wavetrack") { WaveTrack* track = new WaveTrack(); track->read(xml); diff --git a/muse2/muse/track.cpp b/muse2/muse/track.cpp index 90e9beec..58c53f63 100644 --- a/muse2/muse/track.cpp +++ b/muse2/muse/track.cpp @@ -43,8 +43,8 @@ bool Track::_tmpSoloChainDoIns = false; bool Track::_tmpSoloChainNoDec = false; const char* Track::_cname[] = { - "Midi", "Drum", "Wave", "AudioOut", "AudioIn", "AudioGroup", - "AudioAux", "AudioSynth" + "Midi", "Drum", "NewStyleDrum", "Wave", + "AudioOut", "AudioIn", "AudioGroup", "AudioAux", "AudioSynth" }; //--------------------------------------------------------- @@ -75,7 +75,7 @@ void addPortCtrlEvents(MidiTrack* t) MidiPort* mp = &midiPorts[t->outPort()]; // Is it a drum controller event, according to the track port's instrument? - if(t->type() == Track::DRUM) + if(t->type() == Track::DRUM) //FINDMICHJETZT was soll das? drumcontroller -_- { MidiController* mc = mp->drumController(cntrl); if(mc) @@ -123,7 +123,7 @@ void removePortCtrlEvents(MidiTrack* t) MidiPort* mp = &midiPorts[t->outPort()]; // Is it a drum controller event, according to the track port's instrument? - if(t->type() == Track::DRUM) + if(t->type() == Track::DRUM) //FINDMICHJETZT was soll das? drumcontroller... { MidiController* mc = mp->drumController(cntrl); if(mc) @@ -239,7 +239,8 @@ Track::Track(const Track& t, bool cloneParts) // A couple of schemes were conceived to deal with cloneList being invalid, but the best way is // to not alter the part list here. It's a big headache because: Either the parts in the cloneList // need to be reliably looked up replaced with the new ones, or the clipboard and cloneList must be cleared. - // Fortunately the ONLY part of muse using this function is track rename (in TrackList and TrackInfo). + // Fortunately the ONLY parts of muse using this function are track rename (in TrackList and TrackInfo) and + // changing track type from MIDI to NEW_DRUM or vice versa (NOT something -> DRUM or vice versa). // So we can get away with leaving this out: //for (iPart ip = _parts.begin(); ip != _parts.end(); ++ip) // ip->second->setTrack(this); @@ -311,6 +312,7 @@ void Track::setDefaultName() switch(_type) { case MIDI: case DRUM: + case NEW_DRUM: case WAVE: base = QString("Track"); break; @@ -469,7 +471,7 @@ MidiTrack::~MidiTrack() void MidiTrack::init() { _outPort = 0; - _outChannel = 0; + _outChannel = (type()==NEW_DRUM) ? 9 : 0; // Changed by Tim. p3.3.8 //_inPortMask = 0xffff; ///_inPortMask = 0xffffffff; @@ -643,7 +645,7 @@ void MidiTrack::addPortCtrlEvents() MidiPort* mp = &midiPorts[_outPort]; // Is it a drum controller event, according to the track port's instrument? - if(type() == DRUM) + if(type() == DRUM) //FINDMICHJETZT commented out. was soll das? { MidiController* mc = mp->drumController(cntrl); if(mc) @@ -684,7 +686,7 @@ void MidiTrack::removePortCtrlEvents() MidiPort* mp = &midiPorts[_outPort]; // Is it a drum controller event, according to the track port's instrument? - if(type() == DRUM) + if(type() == DRUM) //FINDMICHJETZT commented out: was soll das? { MidiController* mc = mp->drumController(cntrl); if(mc) @@ -941,8 +943,13 @@ void MidiTrack::write(int level, Xml& xml) const if (type() == DRUM) tag = "drumtrack"; - else + else if (type() == MIDI) tag = "miditrack"; + else if (type() == NEW_DRUM) + tag = "newdrumtrack"; + else + printf("THIS SHOULD NEVER HAPPEN: non-midi-type in MidiTrack::write()\n"); + xml.tag(level++, tag); Track::writeProperties(level, xml); diff --git a/muse2/muse/track.h b/muse2/muse/track.h index 752a79be..7ed30914 100644 --- a/muse2/muse/track.h +++ b/muse2/muse/track.h @@ -52,7 +52,7 @@ class DrumMap; class Track { public: enum TrackType { - MIDI=0, DRUM, WAVE, AUDIO_OUTPUT, AUDIO_INPUT, AUDIO_GROUP, + MIDI=0, DRUM, NEW_DRUM, WAVE, AUDIO_OUTPUT, AUDIO_INPUT, AUDIO_GROUP, AUDIO_AUX, AUDIO_SOFTSYNTH }; private: @@ -199,7 +199,7 @@ class Track { void setDefaultName(); int channels() const { return _channels; } virtual void setChannels(int n); - bool isMidiTrack() const { return type() == MIDI || type() == DRUM; } + bool isMidiTrack() const { return type() == MIDI || type() == DRUM || type() == NEW_DRUM; } virtual bool canRecord() const { return false; } virtual AutomationType automationType() const = 0; virtual void setAutomationType(AutomationType t) = 0; diff --git a/muse2/muse/widgets/mtrackinfo.cpp b/muse2/muse/widgets/mtrackinfo.cpp index 56429879..57674395 100644 --- a/muse2/muse/widgets/mtrackinfo.cpp +++ b/muse2/muse/widgets/mtrackinfo.cpp @@ -216,6 +216,7 @@ void MidiTrackInfo::heartBeat() { case Track::MIDI: case Track::DRUM: + case Track::NEW_DRUM: { MidiTrack* track = (MidiTrack*)selected; @@ -344,7 +345,7 @@ void MidiTrackInfo::heartBeat() else { MidiInstrument* instr = mp->instrument(); - QString name = instr->getPatchName(outChannel, nprogram, song->mtype(), track->type() == Track::DRUM); + QString name = instr->getPatchName(outChannel, nprogram, song->mtype(), track->type() == Track::DRUM); //FINDMICHJETZT was soll das? if(name.isEmpty()) { const QString n("???"); @@ -390,7 +391,7 @@ void MidiTrackInfo::heartBeat() //else //{ MidiInstrument* instr = mp->instrument(); - QString name = instr->getPatchName(outChannel, program, song->mtype(), track->type() == Track::DRUM); + QString name = instr->getPatchName(outChannel, program, song->mtype(), track->type() == Track::DRUM); //FINDMICHJETZT was soll das? if(iPatch->text() != name) iPatch->setText(name); @@ -567,8 +568,12 @@ void MidiTrackInfo::setLabelText() //pal.setColor(trackNameLabel->backgroundRole(), QColor(0, 160, 255)); // Med blue if(track->type() == Track::DRUM) c = MusEConfig::config.drumTrackLabelBg; - else + else if (track->type() == Track::MIDI) c = MusEConfig::config.midiTrackLabelBg; + else if (track->type() == Track::NEW_DRUM) + c = MusEConfig::config.newDrumTrackLabelBg; + else + printf("THIS SHOULD NEVER HAPPEN: track is not a MIDI track in MidiTrackInfo::setLabelText()!\n"); QLinearGradient gradient(trackNameLabel->geometry().topLeft(), trackNameLabel->geometry().bottomLeft()); //gradient.setColorAt(0, c.darker()); @@ -757,7 +762,7 @@ void MidiTrackInfo::iProgHBankChanged() audio->msgPlayMidiEvent(&ev); MidiInstrument* instr = mp->instrument(); - iPatch->setText(instr->getPatchName(channel, program, song->mtype(), track->type() == Track::DRUM)); + iPatch->setText(instr->getPatchName(channel, program, song->mtype(), track->type() == Track::DRUM)); //FINDMICHJETZT was soll das? // updateTrackInfo(); } @@ -835,7 +840,7 @@ void MidiTrackInfo::iProgLBankChanged() audio->msgPlayMidiEvent(&ev); MidiInstrument* instr = mp->instrument(); - iPatch->setText(instr->getPatchName(channel, program, song->mtype(), track->type() == Track::DRUM)); + iPatch->setText(instr->getPatchName(channel, program, song->mtype(), track->type() == Track::DRUM)); //FINDMICHJETZT was soll das? // updateTrackInfo(); } @@ -913,7 +918,7 @@ void MidiTrackInfo::iProgramChanged() audio->msgPlayMidiEvent(&ev); MidiInstrument* instr = mp->instrument(); - iPatch->setText(instr->getPatchName(channel, program, song->mtype(), track->type() == Track::DRUM)); + iPatch->setText(instr->getPatchName(channel, program, song->mtype(), track->type() == Track::DRUM)); //FINDMICHJETZT was soll das? } // updateTrackInfo(); @@ -1082,7 +1087,7 @@ void MidiTrackInfo::instrPopup() PopupMenu* pup = new PopupMenu(true); //instr->populatePatchPopup(pop, channel, song->mtype(), track->type() == Track::DRUM); - instr->populatePatchPopup(pup, channel, song->mtype(), track->type() == Track::DRUM); + instr->populatePatchPopup(pup, channel, song->mtype(), track->type() == Track::DRUM); //FINDMICHJETZT was soll das? //if(pop->actions().count() == 0) // return; @@ -1406,7 +1411,7 @@ void MidiTrackInfo::updateTrackInfo(int flags) else { MidiInstrument* instr = mp->instrument(); - iPatch->setText(instr->getPatchName(outChannel, nprogram, song->mtype(), track->type() == Track::DRUM)); + iPatch->setText(instr->getPatchName(outChannel, nprogram, song->mtype(), track->type() == Track::DRUM)); //FINDMICHJETZT was soll das? } } else @@ -1422,7 +1427,7 @@ void MidiTrackInfo::updateTrackInfo(int flags) //else //{ MidiInstrument* instr = mp->instrument(); - iPatch->setText(instr->getPatchName(outChannel, program, song->mtype(), track->type() == Track::DRUM)); + iPatch->setText(instr->getPatchName(outChannel, program, song->mtype(), track->type() == Track::DRUM)); //FINDMICHJETZT was soll das? int hb = ((program >> 16) & 0xff) + 1; if (hb == 0x100) diff --git a/muse2/muse/widgets/musewidgetsplug.cpp b/muse2/muse/widgets/musewidgetsplug.cpp index 3ebd1aa5..01cc68b3 100644 --- a/muse2/muse/widgets/musewidgetsplug.cpp +++ b/muse2/muse/widgets/musewidgetsplug.cpp @@ -131,6 +131,7 @@ GlobalConfigValues config = { QColor(0, 160, 255), // midiTrackLabelBg; // Med blue QColor(0, 160, 255), // drumTrackLabelBg; // Med blue + QColor(0, 160, 255), // newDrumTrackLabelBg; // Med blue Qt::magenta, // waveTrackLabelBg; Qt::green, // outputTrackLabelBg; Qt::red, // inputTrackLabelBg; @@ -140,6 +141,7 @@ GlobalConfigValues config = { QColor(220, 220, 220), // midiTrackBg; QColor(220, 220, 220), // drumTrackBg; + QColor(220, 220, 220), // newDrumTrackBg; QColor(220, 220, 220), // waveTrackBg; QColor(189, 220, 193), // outputTrackBg; QColor(189, 220, 193), // inputTrackBg; @@ -178,13 +180,13 @@ GlobalConfigValues config = { QString("Mixer A"), QRect(0, 0, 300, 500), // Mixer1 true, true, true, true, - true, true, true, true + true, true, true, true, true }, { QString("Mixer B"), QRect(200, 200, 300, 500), // Mixer2 true, true, true, true, - true, true, true, true + true, true, true, true, true }, true, // TransportVisible; false, // BigTimeVisible; |