--- a/videoplayback/videoplaybackviews/src/mpxvideoplaybackuserinputhandler.cpp Fri Mar 12 15:43:00 2010 +0200
+++ b/videoplayback/videoplaybackviews/src/mpxvideoplaybackuserinputhandler.cpp Mon Mar 15 12:40:47 2010 +0200
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: 15 %
+// Version : %version: ou1cpsw#16 %
// INCLUDE FILES
@@ -31,9 +31,7 @@
#include <remconcoreapitarget.h>
#include <remconinterfaceselector.h> // Side volume key
#include <mpxplaybackframeworkdefs.h>
-#include <centralrepository.h> // for peripheral display timeout setting
-#include <settingsinternalcrkeys.h> // display timeout setting keys
-#include <hwrmlightdomaincrkeys.h>
+
#include <e32std.h>
#ifdef __USERINPUTHANDLERSTIF__
@@ -43,7 +41,6 @@
#else
#include "mpxvideoplaybackcontainer.h"
#include "mpxvideoplaybackcontrol.h"
-#include <hwrmlight.h> //light status
#endif
#include "mpxvideoplaybackcontrol.hrh"
@@ -54,8 +51,6 @@
#include "mpxvideo_debug.h"
-// CONSTANTS
-const TInt KMPXMicroSecondsInASecond = 1000000;
// ======== MEMBER FUNCTIONS =======================================================================
@@ -75,14 +70,14 @@
// -------------------------------------------------------------------------------------------------
//
CMPXVideoPlaybackUserInputHandler* CMPXVideoPlaybackUserInputHandler::NewL(
- CMPXVideoPlaybackContainer* aContainer, TBool aTvOutConnected)
+ CMPXVideoPlaybackContainer* aContainer )
{
MPX_DEBUG(_L("CMPXVideoPlaybackUserInputHandler::NewL()"));
CMPXVideoPlaybackUserInputHandler* self =
new (ELeave) CMPXVideoPlaybackUserInputHandler( aContainer );
CleanupStack::PushL( self );
- self->ConstructL(aTvOutConnected);
+ self->ConstructL();
CleanupStack::Pop();
return self;
}
@@ -92,37 +87,15 @@
// Symbian 2nd phase constructor can leave.
// -------------------------------------------------------------------------------------------------
//
-void CMPXVideoPlaybackUserInputHandler::ConstructL( TBool aTvOutConnected )
+void CMPXVideoPlaybackUserInputHandler::ConstructL()
{
MPX_ENTER_EXIT(_L("CMPXVideoPlaybackUserInputHandler::ConstructL()"));
iVolumeRepeatTimer = CPeriodic::NewL( CActive::EPriorityStandard );
- iDisplayTimer = CPeriodic::NewL( CPeriodic::EPriorityStandard );
+
iInterfaceSelector = CRemConInterfaceSelector::NewL();
iCoreTarget = CRemConCoreApiTarget::NewL( *iInterfaceSelector, *this );
- iTVOutConnected = aTvOutConnected;
-
- iLight = CHWRMLight::NewL();
-
- // Start the timer if TV out is connected
- if ( iTVOutConnected )
- {
- // Get the display light time-out value from CenRep
- CRepository* repository = CRepository::NewLC( KCRUidLightSettings );
-
- // What's the timeout value (in seconds ) for the display light?
- repository->Get( KDisplayLightsTimeout, iDisplayTimeOut );
- MPX_DEBUG(_L("CMPXVideoPlaybackUserInputHandler::ConstructL Display Timeout( %d )"), iDisplayTimeOut);
-
- CleanupStack::PopAndDestroy( repository );
-
- // Convert the timeout value to microseconds
- iDisplayTimeOut *= KMPXMicroSecondsInASecond;
-
- RestartDisplayTimer();
- }
-
// not detrimental if Media Keys dont work - so ignore any errors here
TRAP_IGNORE( iInterfaceSelector->OpenTargetL() );
@@ -142,11 +115,6 @@
delete iVolumeRepeatTimer;
}
- if ( iDisplayTimer )
- {
- iDisplayTimer->Cancel();
- delete iDisplayTimer;
- }
if ( iInterfaceSelector )
{
@@ -155,15 +123,6 @@
iInterfaceSelector = NULL;
}
- // make sure that backlight enabled when
- // the view updates or deactivates
- EnableBacklight();
-
- if ( iLight )
- {
- delete iLight;
- iLight = NULL;
- }
}
// -------------------------------------------------------------------------------------------------
@@ -398,10 +357,7 @@
if (aPointerEvent.iType == TPointerEvent::EButton1Down && iForeground)
{
iProcessingInputType = EMpxVideoTouch;
- if ( iTVOutConnected )
- {
- RestartDisplayTimer();
- }
+
ReRoutePointerEventL(aControl, aPointerEvent, aMPXControl);
}
break;
@@ -447,10 +403,7 @@
iProcessingInputType = EMpxVideoKeyboard;
iLastPressedKeyCode = aKeyEvent.iCode;
iLastPressedKeyScanCode = aKeyEvent.iScanCode;
- if ( iTVOutConnected )
- {
- RestartDisplayTimer();
- }
+
iContainer->DoHandleKeyEventL(aKeyEvent, aType);
}
break;
@@ -498,18 +451,10 @@
iProcessingInputType = EMpxVideoMediaKeys;
iLastMediaKeyPressed = aOperationId;
DoHandleMediaKey(aOperationId, aButtonAct);
- if ( iTVOutConnected )
- {
- RestartDisplayTimer();
- }
}
else if (aButtonAct == ERemConCoreApiButtonClick && iForeground)
{
DoHandleMediaKey(aOperationId, aButtonAct);
- if ( iTVOutConnected )
- {
- RestartDisplayTimer();
- }
// reset on click AND/OR release
iProcessingInputType = EMpxVideoNone;
}
@@ -606,111 +551,5 @@
}
}
-// -----------------------------------------------------------------------------
-// CMPXVideoPlaybackUserInputHandler::DisableBacklight()
-// -----------------------------------------------------------------------------
-//
-void CMPXVideoPlaybackUserInputHandler::DisableBacklight()
-{
- MPX_ENTER_EXIT(_L("CMPXVideoPlaybackUserInputHandler::DisableBacklight"));
-
- // cancel the timer
- iDisplayTimer->Cancel();
-
- // disable the backlight
- MPX_TRAPD( err,
- {
- iLight->ReserveLightL( CHWRMLight::EPrimaryDisplay );
- iLight->LightOffL( CHWRMLight::EPrimaryDisplay );
- } );
-}
-
-// -----------------------------------------------------------------------------
-// CMPXVideoPlaybackUserInputHandler::EnableBacklight()
-// -----------------------------------------------------------------------------
-//
-void CMPXVideoPlaybackUserInputHandler::EnableBacklight()
-{
- MPX_ENTER_EXIT(_L("CMPXVideoPlaybackUserInputHandler::EnableBacklight"));
-
- // enable the backlight
- MPX_TRAPD( err,
- {
- iLight->LightOnL( CHWRMLight::EPrimaryDisplay );
- iLight->ReleaseLight(CHWRMLight::EPrimaryDisplay );
- } );
-}
-
-
-// -------------------------------------------------------------------------------------------------
-// CMPXVideoPlaybackUserInputHandler::HandleTVOutEvent()
-// -------------------------------------------------------------------------------------------------
-//
-void CMPXVideoPlaybackUserInputHandler::HandleTVOutEvent(TBool aTVOutConnected)
-{
- MPX_ENTER_EXIT(_L("CMPXVideoPlaybackUserInputHandler::HandleTVOutEvent"));
-
- iTVOutConnected = aTVOutConnected;
-
- if ( iTVOutConnected )
- {
- // Get the display light time-out value from CenRep
- CRepository* repository = CRepository::NewLC( KCRUidLightSettings );
-
- // What's the timeout value (in seconds ) for the display light?
- repository->Get( KDisplayLightsTimeout, iDisplayTimeOut );
- MPX_DEBUG(_L("CMPXVideoPlaybackUserInputHandler::ConstructL Display Timeout( %d )"), iDisplayTimeOut);
-
- CleanupStack::PopAndDestroy( repository );
-
- // Convert the timeout value to microseconds
- iDisplayTimeOut *= KMPXMicroSecondsInASecond;
-
- RestartDisplayTimer();
- }
- else
- {
- iDisplayTimer->Cancel();
- EnableBacklight();
- }
-}
-
-// -------------------------------------------------------------------------------------------------
-// CMPXVideoPlaybackUserInputHandler::HandleDisplayTimeout
-// -------------------------------------------------------------------------------------------------
-//
-TInt CMPXVideoPlaybackUserInputHandler::HandleDisplayTimeout( TAny* aPtr )
-{
- MPX_ENTER_EXIT(_L("CMPXVideoPlaybackUserInputHandler::HandleDisplayTimeout"));
-
- static_cast<CMPXVideoPlaybackUserInputHandler*>(aPtr)->DisableBacklight();
-
- return KErrNone;
-}
-
-// -----------------------------------------------------------------------------
-// CMPXVideoPlaybackUserInputHandler::RestartDisplayTimer
-// -----------------------------------------------------------------------------
-//
-void CMPXVideoPlaybackUserInputHandler::RestartDisplayTimer()
-{
- MPX_ENTER_EXIT(_L("CMPXVideoPlaybackUserInputHandler::RestartDisplayTimer"));
-
- // check if the display timer is running if so cancelit
- if ( iDisplayTimer->IsActive() )
- {
- iDisplayTimer->Cancel();
- }
- else
- {
- // timeout has happened and the backlight is disabled
- // enable the backlight
- EnableBacklight();
- }
-
- // Re start the display backlight timer
- iDisplayTimer->Start( iDisplayTimeOut, iDisplayTimeOut,
- TCallBack( CMPXVideoPlaybackUserInputHandler::HandleDisplayTimeout, this ) );
-}
// EOF