aboutsummaryrefslogtreecommitdiff
path: root/visualization/qmpvisualization.cpp
diff options
context:
space:
mode:
authorGravatar Chris Xiong <chirs241097@gmail.com> 2016-05-24 19:52:08 +0800
committerGravatar Chris Xiong <chirs241097@gmail.com> 2016-05-24 19:52:08 +0800
commitded6dd1c8f7cbe2991e90f69f95730b39eaa95cf (patch)
tree46f55ade709960f4407b836432b76901d00aa693 /visualization/qmpvisualization.cpp
parentb059dd6fa25ad50f549cb1384042b07b6cfe06bf (diff)
downloadQMidiPlayer-ded6dd1c8f7cbe2991e90f69f95730b39eaa95cf.tar.xz
Add seeking with arrow buttons in visualization.
Diffstat (limited to 'visualization/qmpvisualization.cpp')
-rw-r--r--visualization/qmpvisualization.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/visualization/qmpvisualization.cpp b/visualization/qmpvisualization.cpp
index 4042a24..e9d1977 100644
--- a/visualization/qmpvisualization.cpp
+++ b/visualization/qmpvisualization.cpp
@@ -247,6 +247,10 @@ bool qmpVisualization::update()
if(sm->smGetKeyState(SMK_O))rot[2]-=1;
//printf("pos: %f %f %f\n",pos[0],pos[1],pos[2]);
//printf("rot: %f %f %f\n",rot[0],rot[1],rot[2]);
+ if(sm->smGetKeyState(SMK_RIGHT)==SMKST_HIT)
+ api->playerSeek(api->getCurrentPlaybackPercentage()+(sm->smGetKeyState(SMK_SHIFT)?5:1));
+ if(sm->smGetKeyState(SMK_LEFT)==SMKST_HIT)
+ api->playerSeek(api->getCurrentPlaybackPercentage()-(sm->smGetKeyState(SMK_SHIFT)?5:1));
double lpt=(double)notestretch/api->getDivision()/10.*(horizontal?0.25:1);
memset(notestatus,0,sizeof(notestatus));
for(uint32_t i=elb;i<pool.size();++i)