49 #include <mpxvideoplaybackdefs.h> |
50 #include <mpxvideoplaybackdefs.h> |
50 #include "mpxcommonvideoplaybackview.hrh" |
51 #include "mpxcommonvideoplaybackview.hrh" |
51 #include "mpxvideo_debug.h" |
52 #include "mpxvideo_debug.h" |
52 |
53 |
53 |
54 |
54 |
|
55 |
|
56 // ======== MEMBER FUNCTIONS ======================================================================= |
55 // ======== MEMBER FUNCTIONS ======================================================================= |
57 |
56 |
58 // ------------------------------------------------------------------------------------------------- |
57 // ------------------------------------------------------------------------------------------------- |
59 // MPXVideoPlaybackUserInputHandler::CMPXVideoPlaybackUserInputHandler() |
58 // MPXVideoPlaybackUserInputHandler::CMPXVideoPlaybackUserInputHandler() |
60 // ------------------------------------------------------------------------------------------------- |
59 // ------------------------------------------------------------------------------------------------- |
61 // |
60 // |
62 CMPXVideoPlaybackUserInputHandler::CMPXVideoPlaybackUserInputHandler( |
61 CMPXVideoPlaybackUserInputHandler::CMPXVideoPlaybackUserInputHandler( |
63 CMPXVideoPlaybackContainer* aContainer) |
62 CMPXVideoPlaybackContainer* aContainer) |
64 : iContainer(aContainer) |
63 : iProcessingInputType(EMpxVideoNone), |
|
64 iForeground(ETrue), |
|
65 iBlockPdlInputs(EFalse), |
|
66 iContainer(aContainer) |
65 { |
67 { |
66 } |
68 } |
67 |
69 |
68 // ------------------------------------------------------------------------------------------------- |
70 // ------------------------------------------------------------------------------------------------- |
69 // CMPXVideoPlaybackUserInputHandler::NewL() |
71 // CMPXVideoPlaybackUserInputHandler::NewL() |
96 iInterfaceSelector = CRemConInterfaceSelector::NewL(); |
98 iInterfaceSelector = CRemConInterfaceSelector::NewL(); |
97 iCoreTarget = CRemConCoreApiTarget::NewL( *iInterfaceSelector, *this ); |
99 iCoreTarget = CRemConCoreApiTarget::NewL( *iInterfaceSelector, *this ); |
98 |
100 |
99 // not detrimental if Media Keys dont work - so ignore any errors here |
101 // not detrimental if Media Keys dont work - so ignore any errors here |
100 TRAP_IGNORE( iInterfaceSelector->OpenTargetL() ); |
102 TRAP_IGNORE( iInterfaceSelector->OpenTargetL() ); |
101 |
|
102 iProcessingInputType = EMpxVideoNone; |
|
103 iForeground = ETrue; |
|
104 } |
103 } |
105 |
104 |
106 // ------------------------------------------------------------------------------------------------- |
105 // ------------------------------------------------------------------------------------------------- |
107 // CMPXVideoPlaybackUserInputHandler::~CMPXVideoPlaybackUserInputHandler() |
106 // CMPXVideoPlaybackUserInputHandler::~CMPXVideoPlaybackUserInputHandler() |
108 // ------------------------------------------------------------------------------------------------- |
107 // ------------------------------------------------------------------------------------------------- |
235 else if ( aButtonAct == ERemConCoreApiButtonRelease ) |
233 else if ( aButtonAct == ERemConCoreApiButtonRelease ) |
236 { |
234 { |
237 TRAP_IGNORE( iContainer->HandleCommandL( EMPXPbvCmdEndSeek ) ); |
235 TRAP_IGNORE( iContainer->HandleCommandL( EMPXPbvCmdEndSeek ) ); |
238 } |
236 } |
239 } |
237 } |
240 |
|
241 |
238 |
242 // ------------------------------------------------------------------------------------------------- |
239 // ------------------------------------------------------------------------------------------------- |
243 // CMPXVideoPlaybackUserInputHandler::HandleRewind() |
240 // CMPXVideoPlaybackUserInputHandler::HandleRewind() |
244 // ------------------------------------------------------------------------------------------------- |
241 // ------------------------------------------------------------------------------------------------- |
245 // |
242 // |
300 break; |
297 break; |
301 } |
298 } |
302 } |
299 } |
303 } |
300 } |
304 |
301 |
305 |
|
306 // ------------------------------------------------------------------------------------------------- |
302 // ------------------------------------------------------------------------------------------------- |
307 // CMPXVideoPlaybackUserInputHandler::HandleVolumeDown() |
303 // CMPXVideoPlaybackUserInputHandler::HandleVolumeDown() |
308 // ------------------------------------------------------------------------------------------------- |
304 // ------------------------------------------------------------------------------------------------- |
309 // |
305 // |
310 void CMPXVideoPlaybackUserInputHandler::HandleVolumeDown( TRemConCoreApiButtonAction aButtonAct ) |
306 void CMPXVideoPlaybackUserInputHandler::HandleVolumeDown( TRemConCoreApiButtonAction aButtonAct ) |
409 // end the current active control pointer processing |
404 // end the current active control pointer processing |
410 // |
405 // |
411 if ( aPointerEvent.iType == TPointerEvent::EButton1Up ) |
406 if ( aPointerEvent.iType == TPointerEvent::EButton1Up ) |
412 { |
407 { |
413 // |
408 // |
414 // Reroute button up event to active control and end current |
409 // Reroute button up event to active control and end current |
415 // control processing |
410 // control processing |
416 // |
411 // |
417 ReRoutePointerEventL( iActiveControlPtr, aPointerEvent, iActiveControlType ); |
412 ReRoutePointerEventL( iActiveControlPtr, aPointerEvent, iActiveControlType ); |
418 iProcessingInputType = EMpxVideoNone; |
413 iProcessingInputType = EMpxVideoNone; |
419 iActiveControlPtr = NULL; |
414 iActiveControlPtr = NULL; |
457 |
452 |
458 switch ( iProcessingInputType ) |
453 switch ( iProcessingInputType ) |
459 { |
454 { |
460 case EMpxVideoNone: |
455 case EMpxVideoNone: |
461 { |
456 { |
462 if ( aType == EEventKeyDown && iForeground ) |
457 if ( aType == EEventKeyDown && IsUserInputAllowed() ) |
463 { |
458 { |
464 iProcessingInputType = EMpxVideoKeyboard; |
459 iProcessingInputType = EMpxVideoKeyboard; |
465 iLastPressedKeyCode = aKeyEvent.iCode; |
460 iLastPressedKeyCode = aKeyEvent.iCode; |
466 iLastPressedKeyScanCode = aKeyEvent.iScanCode; |
461 iLastPressedKeyScanCode = aKeyEvent.iScanCode; |
467 |
462 |
596 iVolumeRepeatTimer->Cancel(); |
591 iVolumeRepeatTimer->Cancel(); |
597 } |
592 } |
598 } |
593 } |
599 } |
594 } |
600 |
595 |
|
596 // ------------------------------------------------------------------------------------------------- |
|
597 // CMPXVideoPlaybackUserInputHandler::BlockPdlUserInputs() |
|
598 // ------------------------------------------------------------------------------------------------- |
|
599 // |
|
600 void CMPXVideoPlaybackUserInputHandler::BlockPdlUserInputs( TBool aBlockInputs ) |
|
601 { |
|
602 MPX_DEBUG(_L("CMPXVideoPlaybackUserInputHandler::BlockPdlUserInputs(%d)"), aBlockInputs); |
|
603 |
|
604 iBlockPdlInputs = aBlockInputs; |
|
605 } |
|
606 |
|
607 // ------------------------------------------------------------------------------------------------- |
|
608 // CMPXVideoPlaybackUserInputHandler::IsUserInputAllowed() |
|
609 // ------------------------------------------------------------------------------------------------- |
|
610 // |
|
611 TBool CMPXVideoPlaybackUserInputHandler::IsUserInputAllowed() |
|
612 { |
|
613 TBool allowInput = ( iForeground && ! iBlockPdlInputs ); |
|
614 |
|
615 MPX_DEBUG(_L("CMPXVideoPlaybackUserInputHandler::IsUserInputAllowed(%d)"), allowInput); |
|
616 |
|
617 return allowInput; |
|
618 } |
601 |
619 |
602 // EOF |
620 // EOF |