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/muse | |
parent | 90a75ad2160b3502d192fe4d9b5f58331a1870a3 (diff) |
avoid hanging notes when dragging notes in editors
Diffstat (limited to 'muse2/muse')
-rw-r--r-- | muse2/muse/midiedit/prcanvas.cpp | 21 |
1 files changed, 15 insertions, 6 deletions
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; } } |