videoplayback/videoplaybackviews/src/mpxvideoplaybackuserinputhandler.cpp
branchRCL_3
changeset 26 67eb01668b0e
parent 16 7f2b2a65da29
child 54 315810614048
--- a/videoplayback/videoplaybackviews/src/mpxvideoplaybackuserinputhandler.cpp	Tue May 25 12:44:54 2010 +0300
+++ b/videoplayback/videoplaybackviews/src/mpxvideoplaybackuserinputhandler.cpp	Wed Jun 09 09:44:23 2010 +0300
@@ -15,7 +15,8 @@
 *
 */
 
-// Version : %version: 18 %
+
+// Version : %version: 19 %
 
 
 // INCLUDE FILES
@@ -51,8 +52,6 @@
 #include "mpxvideo_debug.h"
 
 
-
-
 // ======== MEMBER FUNCTIONS =======================================================================
 
 // -------------------------------------------------------------------------------------------------
@@ -61,7 +60,10 @@
 //
 CMPXVideoPlaybackUserInputHandler::CMPXVideoPlaybackUserInputHandler(
         CMPXVideoPlaybackContainer* aContainer)
-   : iContainer(aContainer)
+   : iProcessingInputType(EMpxVideoNone),
+     iForeground(ETrue),
+     iBlockPdlInputs(EFalse),
+     iContainer(aContainer)
 {
 }
 
@@ -98,9 +100,6 @@
 
     // not detrimental if Media Keys dont work - so ignore any errors here
     TRAP_IGNORE( iInterfaceSelector->OpenTargetL() );
-
-    iProcessingInputType = EMpxVideoNone;
-    iForeground = ETrue;
 }
 
 // -------------------------------------------------------------------------------------------------
@@ -117,7 +116,6 @@
         delete iVolumeRepeatTimer;
     }
 
-
     if ( iInterfaceSelector )
     {
         delete iInterfaceSelector;
@@ -238,7 +236,6 @@
     }
 }
 
-
 // -------------------------------------------------------------------------------------------------
 // CMPXVideoPlaybackUserInputHandler::HandleRewind()
 // -------------------------------------------------------------------------------------------------
@@ -302,7 +299,6 @@
     }
 }
 
-
 // -------------------------------------------------------------------------------------------------
 // CMPXVideoPlaybackUserInputHandler::HandleVolumeDown()
 // -------------------------------------------------------------------------------------------------
@@ -347,7 +343,6 @@
     }
 }
 
-
 // -------------------------------------------------------------------------------------------------
 // CMPXVideoPlaybackUserInputHandler::ProcessPointerEvent()
 // -------------------------------------------------------------------------------------------------
@@ -365,7 +360,7 @@
     {
         case EMpxVideoNone:
         {
-            if ( aPointerEvent.iType == TPointerEvent::EButton1Down && iForeground )
+            if ( aPointerEvent.iType == TPointerEvent::EButton1Down && IsUserInputAllowed() )
             {
                 iProcessingInputType = EMpxVideoTouch;
 
@@ -411,7 +406,7 @@
                 if ( aPointerEvent.iType == TPointerEvent::EButton1Up )
                 {
                     //
-                    //  Reroute button up event to active control and end current 
+                    //  Reroute button up event to active control and end current
                     //  control processing
                     //
                     ReRoutePointerEventL( iActiveControlPtr, aPointerEvent, iActiveControlType );
@@ -459,7 +454,7 @@
     {
         case EMpxVideoNone:
         {
-            if ( aType == EEventKeyDown && iForeground )
+            if ( aType == EEventKeyDown && IsUserInputAllowed() )
             {
                 iProcessingInputType = EMpxVideoKeyboard;
                 iLastPressedKeyCode = aKeyEvent.iCode;
@@ -504,7 +499,7 @@
     {
         case EMpxVideoNone:
         {
-            if ( iForeground )
+            if ( IsUserInputAllowed() )
             {
                 if ( aButtonAct == ERemConCoreApiButtonPress )
                 {
@@ -598,5 +593,28 @@
     }
 }
 
+// -------------------------------------------------------------------------------------------------
+//   CMPXVideoPlaybackUserInputHandler::BlockPdlUserInputs()
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackUserInputHandler::BlockPdlUserInputs( TBool aBlockInputs )
+{
+    MPX_DEBUG(_L("CMPXVideoPlaybackUserInputHandler::BlockPdlUserInputs(%d)"), aBlockInputs);
+
+    iBlockPdlInputs = aBlockInputs;
+}
+
+// -------------------------------------------------------------------------------------------------
+//   CMPXVideoPlaybackUserInputHandler::IsUserInputAllowed()
+// -------------------------------------------------------------------------------------------------
+//
+TBool CMPXVideoPlaybackUserInputHandler::IsUserInputAllowed()
+{
+    TBool allowInput = ( iForeground && ! iBlockPdlInputs );
+
+    MPX_DEBUG(_L("CMPXVideoPlaybackUserInputHandler::IsUserInputAllowed(%d)"), allowInput);
+
+    return allowInput;
+}
 
 // EOF