diff options
author | Florian Jung <flo@windfisch.org> | 2011-10-10 12:00:09 +0000 |
---|---|---|
committer | Florian Jung <flo@windfisch.org> | 2011-10-10 12:00:09 +0000 |
commit | 182474fce42414f8f8c5545c4ce822aa5ce73c2c (patch) | |
tree | 72190d062480fdcedeb0079aeb269f3246731a6d /muse2/muse/midiedit/dlist.cpp | |
parent | 0e67ba1af056a0df0b6b01c70bb6cb12063479a8 (diff) |
steprec and dlist-enote-changing fixes
steprec now works for new style drum tracks
Diffstat (limited to 'muse2/muse/midiedit/dlist.cpp')
-rw-r--r-- | muse2/muse/midiedit/dlist.cpp | 34 |
1 files changed, 33 insertions, 1 deletions
diff --git a/muse2/muse/midiedit/dlist.cpp b/muse2/muse/midiedit/dlist.cpp index 3399b78e..1d8436b6 100644 --- a/muse2/muse/midiedit/dlist.cpp +++ b/muse2/muse/midiedit/dlist.cpp @@ -372,8 +372,25 @@ void DList::viewMousePressEvent(QMouseEvent* ev) //TODO: Set all the notes on the track with instrument=dm->enote to instrument=val MusEGlobal::drumInmap[val] = instrument; } + else + { + //Check if there is any other drumMap with the same inmap value (there should be one (and only one):-) + //If so, switch the inmap between the instruments + for (QSet<MusECore::Track*>::iterator it = dcanvas->get_instrument_map()[instrument].tracks.begin(); it!=dcanvas->get_instrument_map()[instrument].tracks.end(); it++) + { + MusECore::MidiTrack* mt = dynamic_cast<MusECore::MidiTrack*>(*it); + mt->drummap()[mt->map_drum_in(val)].enote=dm->enote; + } + // propagating this is unneccessary as it's already done. + // updating the drumInmap is unneccessary, as the propagate call below + // does this for us. + // updating ourDrumMap is unneccessary because the song->update(SC_DRUMMAP) + // does this for us. + } + dm->enote = val; break; + case COL_NOTELENGTH: val = dm->len + incVal; if (val < 0) @@ -844,7 +861,22 @@ void DList::pitchEdited() } //TODO: Set all the notes on the track with instrument=dm->enote to instrument=val MusEGlobal::drumInmap[val] = instrument; - } + } + else + { + //Check if there is any other drumMap with the same inmap value (there should be one (and only one):-) + //If so, switch the inmap between the instruments + for (QSet<MusECore::Track*>::iterator it = dcanvas->get_instrument_map()[instrument].tracks.begin(); it!=dcanvas->get_instrument_map()[instrument].tracks.end(); it++) + { + MusECore::MidiTrack* mt = dynamic_cast<MusECore::MidiTrack*>(*it); + mt->drummap()[mt->map_drum_in(val)].enote=editEntry->enote; + } + // propagating this is unneccessary as it's already done. + // updating the drumInmap is unneccessary, as the propagate call below + // does this for us. + // updating ourDrumMap is unneccessary because the song->update(SC_DRUMMAP) + // does this for us. + } editEntry->enote = val; break; |