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 /muse2/muse | |
| parent | 8f0772bf78d72dd02d2f9b57696e2b9e5f9ce978 (diff) | |
fixed moving drum events
Diffstat (limited to 'muse2/muse')
| -rw-r--r-- | muse2/muse/midiedit/dcanvas.cpp | 14 | 
1 files changed, 12 insertions, 2 deletions
| 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); | 
