diff options
author | Robert Jonsson <spamatica@gmail.com> | 2013-03-27 20:39:43 +0000 |
---|---|---|
committer | Robert Jonsson <spamatica@gmail.com> | 2013-03-27 20:39:43 +0000 |
commit | f1648fa3c8ff5399750222dd416b416ceeb0888a (patch) | |
tree | 2a87a9143738e9367b01534ae3dda51ae5cd2ad3 | |
parent | 8f0772bf78d72dd02d2f9b57696e2b9e5f9ce978 (diff) |
fixed moving drum events
-rw-r--r-- | muse2/ChangeLog | 2 | ||||
-rw-r--r-- | muse2/muse/midiedit/dcanvas.cpp | 14 |
2 files changed, 14 insertions, 2 deletions
diff --git a/muse2/ChangeLog b/muse2/ChangeLog index 1a7345a3..4ede0d3b 100644 --- a/muse2/ChangeLog +++ b/muse2/ChangeLog @@ -1,3 +1,5 @@ +27.03.2013: + - Fixed moving events with keyboard in Drum editor (rj) 10.03.2013: - Added color settings for: midi events in arranger,wave events in arranger, wave events in wave editor (rj) 05.03.2013: diff --git a/muse2/muse/midiedit/dcanvas.cpp b/muse2/muse/midiedit/dcanvas.cpp index c16375d1..ff30eb64 100644 --- a/muse2/muse/midiedit/dcanvas.cpp +++ b/muse2/muse/midiedit/dcanvas.cpp @@ -1281,7 +1281,7 @@ void DrumCanvas::modifySelected(NoteInfo::ValType type, int val, bool delta_mode case NoteInfo::VAL_PITCH: if (old_style_drummap_mode) { - int pitch = val; + int pitch = -val; if(delta_mode) pitch += event.pitch(); if (pitch > 127) @@ -1291,7 +1291,17 @@ void DrumCanvas::modifySelected(NoteInfo::ValType type, int val, bool delta_mode newEvent.setPitch(pitch); } else - printf("DrumCanvas::modifySelected - MusEWidget::NoteInfo::VAL_PITCH not implemented for new style drum editors\n"); + { + int direction = -val; + for (int i = 0; i < instrument_map.size(); ++i) { + if (instrument_map.at(i).pitch == event.pitch()) { + int nextPos = i + direction; + if (nextPos> -1 && nextPos < instrument_map.size()) + newEvent.setPitch(instrument_map.at(nextPos).pitch); + break; + } + } + } break; } MusEGlobal::song->changeEvent(event, newEvent, part); |