When the video is paused, use the left/right cursor keys

for single frame stepping instead of winding. One frame without
shift-modifier, five frames with shift held down.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38671 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Stephan Aßmus 2010-09-16 12:45:03 +00:00
parent 892e4f21be
commit a110536aac

View File

@ -796,10 +796,17 @@ MainWin::MessageReceived(BMessage* msg)
break;
bigtime_t howMuch;
if (msg->FindInt64("how much", &howMuch) != B_OK)
int64 frames;
if (msg->FindInt64("how much", &howMuch) != B_OK
|| msg->FindInt64("frames", &frames) != B_OK) {
break;
}
if (fController->Lock()) {
if (fHasVideo && !fController->IsPlaying()) {
int64 newFrame = fController->CurrentFrame() + frames;
fController->SetFramePosition(newFrame);
} else {
bigtime_t seekTime = fController->TimePosition() + howMuch;
if (seekTime < 0) {
fInitialSeekPosition = seekTime;
@ -809,6 +816,7 @@ MainWin::MessageReceived(BMessage* msg)
PostMessage(M_SKIP_NEXT);
} else
fController->SetTimePosition(seekTime);
}
fController->Unlock();
fAllowWinding = false;
@ -2009,10 +2017,13 @@ MainWin::_KeyDown(BMessage* msg)
PostMessage(M_SKIP_NEXT);
else if (fAllowWinding) {
BMessage windMessage(M_WIND);
if ((modifier & B_SHIFT_KEY) != 0)
if ((modifier & B_SHIFT_KEY) != 0) {
windMessage.AddInt64("how much", 30000000LL);
else
windMessage.AddInt64("frames", 5);
} else {
windMessage.AddInt64("how much", 5000000LL);
windMessage.AddInt64("frames", 1);
}
PostMessage(&windMessage);
}
return true;
@ -2022,10 +2033,13 @@ MainWin::_KeyDown(BMessage* msg)
PostMessage(M_SKIP_PREV);
else if (fAllowWinding) {
BMessage windMessage(M_WIND);
if ((modifier & B_SHIFT_KEY) != 0)
if ((modifier & B_SHIFT_KEY) != 0) {
windMessage.AddInt64("how much", -30000000LL);
else
windMessage.AddInt64("frames", -5);
} else {
windMessage.AddInt64("how much", -5000000LL);
windMessage.AddInt64("frames", -1);
}
PostMessage(&windMessage);
}
return true;