[haiku-commits] r38671 - haiku/trunk/src/apps/mediaplayer

  • From: superstippi@xxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Thu, 16 Sep 2010 14:45:03 +0200 (CEST)

Author: stippi
Date: 2010-09-16 14:45:03 +0200 (Thu, 16 Sep 2010)
New Revision: 38671
Changeset: http://dev.haiku-os.org/changeset/38671

Modified:
   haiku/trunk/src/apps/mediaplayer/MainWin.cpp
Log:
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.


Modified: haiku/trunk/src/apps/mediaplayer/MainWin.cpp
===================================================================
--- haiku/trunk/src/apps/mediaplayer/MainWin.cpp        2010-09-16 12:43:41 UTC 
(rev 38670)
+++ haiku/trunk/src/apps/mediaplayer/MainWin.cpp        2010-09-16 12:45:03 UTC 
(rev 38671)
@@ -796,19 +796,27 @@
                                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()) {
-                               bigtime_t seekTime = 
fController->TimePosition() + howMuch;
-                               if (seekTime < 0) {
-                                       fInitialSeekPosition = seekTime;
-                                       PostMessage(M_SKIP_PREV);
-                               } else if (seekTime > 
fController->TimeDuration()) {
-                                       fInitialSeekPosition = 0;
-                                       PostMessage(M_SKIP_NEXT);
-                               } else
-                                       fController->SetTimePosition(seekTime);
+                               if (fHasVideo && !fController->IsPlaying()) {
+                                       int64 newFrame = 
fController->CurrentFrame() + frames;
+                                       fController->SetFramePosition(newFrame);
+                               } else {
+                                       bigtime_t seekTime = 
fController->TimePosition() + howMuch;
+                                       if (seekTime < 0) {
+                                               fInitialSeekPosition = seekTime;
+                                               PostMessage(M_SKIP_PREV);
+                                       } else if (seekTime > 
fController->TimeDuration()) {
+                                               fInitialSeekPosition = 0;
+                                               PostMessage(M_SKIP_NEXT);
+                                       } else
+                                               
fController->SetTimePosition(seekTime);
+                               }
                                fController->Unlock();
 
                                fAllowWinding = false;
@@ -2009,10 +2017,13 @@
                                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 @@
                                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;


Other related posts:

  • » [haiku-commits] r38671 - haiku/trunk/src/apps/mediaplayer - superstippi