diff options
author | Florian Jung <flo@windfisch.org> | 2011-10-08 15:51:58 +0000 |
---|---|---|
committer | Florian Jung <flo@windfisch.org> | 2011-10-08 15:51:58 +0000 |
commit | 9cd7615aaa5bc2818ae5f9425173f08673bbc194 (patch) | |
tree | f3d9820a84fd43b4667c0222ee3ac0704c3e6eee /muse2/muse/midiedit/dlist.cpp | |
parent | 9e6dc222b92bbfba58756d3be47890dd885b8f71 (diff) | |
parent | 80d1f99cbad08ee6b0d7076f8df80ae71857c9f3 (diff) |
merged with trunk again
drum ordering is now stored in the songfile
track reading bugfix
Diffstat (limited to 'muse2/muse/midiedit/dlist.cpp')
-rw-r--r-- | muse2/muse/midiedit/dlist.cpp | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/muse2/muse/midiedit/dlist.cpp b/muse2/muse/midiedit/dlist.cpp index 1ffae02e..4ad971e7 100644 --- a/muse2/muse/midiedit/dlist.cpp +++ b/muse2/muse/midiedit/dlist.cpp @@ -398,10 +398,7 @@ void DList::viewMousePressEvent(QMouseEvent* ev) } } - { - int velocity = 127 * float(ev->x()) / width(); - emit keyPressed(instrument, velocity);//(dm->anote, shift); - } + emit keyPressed(instrument, 100); break; case COL_OUTCHANNEL: // this column isn't visible in new style drum mode val = dm->channel + incVal; @@ -468,7 +465,12 @@ void DList::viewMousePressEvent(QMouseEvent* ev) break; case COL_NAME: if (button == Qt::LeftButton) - emit keyPressed(instrument, 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(instrument, velo); //Mapping done on other side, send index + } else if (button == Qt::MidButton) // hide that instrument { QSet<MusECore::Track*>* group = &dcanvas->get_instrument_map()[instrument].tracks; @@ -510,7 +512,6 @@ void DList::viewMousePressEvent(QMouseEvent* ev) delete popup; } break; - default: break; } |