summaryrefslogtreecommitdiff
path: root/muse2/muse/arranger/pcanvas.cpp
diff options
context:
space:
mode:
authorTim E. Real <termtech@rogers.com>2011-01-02 07:53:30 +0000
committerTim E. Real <termtech@rogers.com>2011-01-02 07:53:30 +0000
commit2b6b35d94ace955c3a2d468ee761fa3afe59d5d9 (patch)
tree440411c08e63f1843fbdc1cd71975693c0e6c21f /muse2/muse/arranger/pcanvas.cpp
parent89f610ac96d0bf1d40abe4849d9fb9d4b2ec84ba (diff)
Focussing, shortcuts, transport position snapping.
Diffstat (limited to 'muse2/muse/arranger/pcanvas.cpp')
-rw-r--r--muse2/muse/arranger/pcanvas.cpp29
1 files changed, 24 insertions, 5 deletions
diff --git a/muse2/muse/arranger/pcanvas.cpp b/muse2/muse/arranger/pcanvas.cpp
index ae0392d8..b57f524f 100644
--- a/muse2/muse/arranger/pcanvas.cpp
+++ b/muse2/muse/arranger/pcanvas.cpp
@@ -1103,16 +1103,35 @@ void PartCanvas::keyPress(QKeyEvent* event)
return;
}
else if (key == shortcuts[SHRT_POS_DEC].key) {
- int frames = pos[0] - AL::sigmap.rasterStep(pos[0], *_raster);
- if (frames < 0)
- frames = 0;
- Pos p(frames,true);
+ int spos = pos[0];
+ if(spos > 0)
+ {
+ spos -= 1; // Nudge by -1, then snap down with raster1.
+ spos = AL::sigmap.raster1(spos, *_raster);
+ }
+ if(spos < 0)
+ spos = 0;
+ Pos p(spos,true);
song->setPos(0, p, true, true, true);
return;
}
else if (key == shortcuts[SHRT_POS_INC].key) {
+ int spos = AL::sigmap.raster2(pos[0] + 1, *_raster); // Nudge by +1, then snap up with raster2.
+ Pos p(spos,true);
+ song->setPos(0, p, true, true, true);
+ return;
+ }
+ else if (key == shortcuts[SHRT_POS_DEC_NOSNAP].key) {
+ int spos = pos[0] - AL::sigmap.rasterStep(pos[0], *_raster);
+ if(spos < 0)
+ spos = 0;
+ Pos p(spos,true);
+ song->setPos(0, p, true, true, true);
+ return;
+ }
+ else if (key == shortcuts[SHRT_POS_INC_NOSNAP].key) {
Pos p(pos[0] + AL::sigmap.rasterStep(pos[0], *_raster), true);
- song->setPos(0, p, true, true, true); //CDW
+ song->setPos(0, p, true, true, true);
return;
}
else if (key == shortcuts[SHRT_TOOL_POINTER].key) {