summaryrefslogtreecommitdiff
path: root/muse2/muse/midiedit
diff options
context:
space:
mode:
authorFlorian Jung <flo@windfisch.org>2011-12-26 19:35:16 +0000
committerFlorian Jung <flo@windfisch.org>2011-12-26 19:35:16 +0000
commitb988a0a27bc175ce10bc8fa53ed131486813f3e7 (patch)
tree9bd59eda317e9979cffcaa0344f45120e8a6e7d2 /muse2/muse/midiedit
parent0d8e763949e498c1baf3a2fac7b0b3a406eb0068 (diff)
merged with release_2_0
Diffstat (limited to 'muse2/muse/midiedit')
-rw-r--r--muse2/muse/midiedit/dlist.cpp13
-rw-r--r--muse2/muse/midiedit/drummap.h2
2 files changed, 9 insertions, 6 deletions
diff --git a/muse2/muse/midiedit/dlist.cpp b/muse2/muse/midiedit/dlist.cpp
index 854fe552..80009cc7 100644
--- a/muse2/muse/midiedit/dlist.cpp
+++ b/muse2/muse/midiedit/dlist.cpp
@@ -291,8 +291,8 @@ void DList::viewMousePressEvent(QMouseEvent* ev)
val = dm->vol + incVal;
if (val < 0)
val = 0;
- else if (val > 200)
- val = 200;
+ else if (val > 999)
+ val = 999;
dm->vol = (unsigned char)val;
break;
case COL_QNT:
@@ -607,8 +607,8 @@ void DList::returnPressed()
switch (selectedColumn)
{
case COL_VOL:
- if (val > 200) //Check bounds for volume
- val = 200;
+ if (val > 999) //Check bounds for volume
+ val = 999;
if (val < 0)
val = 0;
break;
@@ -826,7 +826,10 @@ void DList::viewMouseReleaseEvent(QMouseEvent* ev)
{
if (drag == DRAG) {
int y = ev->y();
- unsigned dPitch = y / TH;
+ int dPitch = y / TH;
+ if (dPitch < 0) dPitch=0;
+ if (dPitch >= DRUM_MAPSIZE) dPitch=DRUM_MAPSIZE-1;
+
setCursor(QCursor(Qt::ArrowCursor));
currentlySelected = &MusEGlobal::drumMap[int(dPitch)];
emit curDrumInstrumentChanged(dPitch);
diff --git a/muse2/muse/midiedit/drummap.h b/muse2/muse/midiedit/drummap.h
index 60a25fad..990f8fe2 100644
--- a/muse2/muse/midiedit/drummap.h
+++ b/muse2/muse/midiedit/drummap.h
@@ -46,8 +46,8 @@ struct DrumMap {
bool mute;
// bool selected;
- //bool const operator==(const DrumMap& map) const;
bool operator==(const DrumMap& map) const;
+ bool operator!=(const DrumMap& map) const { return !operator==(map); }
};
#define DRUM_MAPSIZE 128