summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Jung <flo@windfisch.org>2011-10-08 14:12:24 +0000
committerFlorian Jung <flo@windfisch.org>2011-10-08 14:12:24 +0000
commit80d1f99cbad08ee6b0d7076f8df80ae71857c9f3 (patch)
treee5b37534e1d86d436f8f6b23aa4a8fc64723b693
parent5367067f7a36dce8a362dcc000d41ac581bffdfe (diff)
changed mouse-click-midi-echo in dlist
-rw-r--r--muse2/muse/midiedit/dlist.cpp12
1 files changed, 8 insertions, 4 deletions
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;
}