diff options
author | Robert Jonsson <spamatica@gmail.com> | 2012-12-15 21:02:48 +0000 |
---|---|---|
committer | Robert Jonsson <spamatica@gmail.com> | 2012-12-15 21:02:48 +0000 |
commit | 083de7cb49f1f7b6087f1b9512ccbe3e69ee9808 (patch) | |
tree | f94a09c42f08b59c3c656cce44e1698a42f2a013 /muse2 | |
parent | 90a75ad2160b3502d192fe4d9b5f58331a1870a3 (diff) |
avoid hanging notes when dragging notes in editors
Diffstat (limited to 'muse2')
-rw-r--r-- | muse2/ChangeLog | 1 | ||||
-rw-r--r-- | muse2/muse/midiedit/prcanvas.cpp | 21 |
2 files changed, 16 insertions, 6 deletions
diff --git a/muse2/ChangeLog b/muse2/ChangeLog index ffb4d1ea..42c3e921 100644 --- a/muse2/ChangeLog +++ b/muse2/ChangeLog @@ -1,5 +1,6 @@ 14.12.2012: - Made simpledrums ask to load another sample if a sample wasn't found during loading (rj) + - when dragging multiple notes in editors they are not played, to avoid hanging notes (rj) 12.12.2012: - Fixed some vst controls stuck. (Tim) - Added vst master timebase (sequencers should work now). WIP Not quite finished. (Tim) diff --git a/muse2/muse/midiedit/prcanvas.cpp b/muse2/muse/midiedit/prcanvas.cpp index 7670abb2..8273c8d9 100644 --- a/muse2/muse/midiedit/prcanvas.cpp +++ b/muse2/muse/midiedit/prcanvas.cpp @@ -456,8 +456,12 @@ bool PianoCanvas::moveItem(MusECore::Undo& operations, MusEGui::CItem* item, con // release note: MusECore::MidiPlayEvent ev1(0, port, channel, 0x90, event.pitch() + track()->transposition, 0); MusEGlobal::audio->msgPlayMidiEvent(&ev1); - MusECore::MidiPlayEvent ev2(0, port, channel, 0x90, npitch + track()->transposition, event.velo()); - MusEGlobal::audio->msgPlayMidiEvent(&ev2); + if (moving.size() == 1) { + MusECore::MidiPlayEvent ev2(0, port, channel, 0x90, npitch + track()->transposition, event.velo()); + MusEGlobal::audio->msgPlayMidiEvent(&ev2); + } + else + playedPitch=-1; } MusECore::Part* part = nevent->part(); @@ -1041,10 +1045,15 @@ void PianoCanvas::itemMoved(const MusEGui::CItem* item, const QPoint& pos) // release note: MusECore::MidiPlayEvent ev1(0, port, channel, 0x90, playedPitch, 0); MusEGlobal::audio->msgPlayMidiEvent(&ev1); - // play note: - MusECore::MidiPlayEvent e2(0, port, channel, 0x90, npitch + track()->transposition, event.velo()); - MusEGlobal::audio->msgPlayMidiEvent(&e2); - playedPitch = npitch + track()->transposition; + + if (moving.size() == 1) { // items moving + // play note: + MusECore::MidiPlayEvent e2(0, port, channel, 0x90, npitch + track()->transposition, event.velo()); + MusEGlobal::audio->msgPlayMidiEvent(&e2); + playedPitch = npitch + track()->transposition; + } + else + playedPitch = -1; } } |