From 80d1f99cbad08ee6b0d7076f8df80ae71857c9f3 Mon Sep 17 00:00:00 2001 From: Florian Jung Date: Sat, 8 Oct 2011 14:12:24 +0000 Subject: changed mouse-click-midi-echo in dlist --- muse2/muse/midiedit/dlist.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'muse2') diff --git a/muse2/muse/midiedit/dlist.cpp b/muse2/muse/midiedit/dlist.cpp index 0e1f8986..c6cd9b2e 100644 --- a/muse2/muse/midiedit/dlist.cpp +++ b/muse2/muse/midiedit/dlist.cpp @@ -322,8 +322,8 @@ void DList::viewMousePressEvent(QMouseEvent* ev) dm->anote = val; MusEGlobal::song->update(SC_DRUMMAP); } - int velocity = 127 * float(ev->x()) / width(); - emit keyPressed(pitch, velocity);//(dm->anote, shift); + + emit keyPressed(pitch, 100); } break; case COL_CHANNEL: @@ -390,9 +390,13 @@ void DList::viewMousePressEvent(QMouseEvent* ev) dm->lv4 = val; break; case COL_NAME: - emit keyPressed(pitch, 100); //Mapping done on other side, send index + { + int velo = 127 * (ev->x() - header->sectionPosition(COL_NAME)) / (header->sectionSize(COL_NAME) - 10); + if (velo < 0) velo = 0; + if (velo > 127 ) velo = 127; + emit keyPressed(pitch, velo); //Mapping done on other side, send index break; - + } default: break; } -- cgit v1.2.3