--- a/videoplayback/videoplaybackviews/src/mpxvideoplaybackuserinputhandler.cpp Fri Feb 19 22:52:52 2010 +0200
+++ b/videoplayback/videoplaybackviews/src/mpxvideoplaybackuserinputhandler.cpp Fri Mar 12 15:43:00 2010 +0200
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: 14 %
+// Version : %version: 15 %
// INCLUDE FILES
@@ -43,8 +43,7 @@
#else
#include "mpxvideoplaybackcontainer.h"
#include "mpxvideoplaybackcontrol.h"
-#include <hal.h>
-#include <hal_data.h>
+#include <hwrmlight.h> //light status
#endif
#include "mpxvideoplaybackcontrol.hrh"
@@ -104,6 +103,8 @@
iTVOutConnected = aTvOutConnected;
+ iLight = CHWRMLight::NewL();
+
// Start the timer if TV out is connected
if ( iTVOutConnected )
{
@@ -158,6 +159,11 @@
// the view updates or deactivates
EnableBacklight();
+ if ( iLight )
+ {
+ delete iLight;
+ iLight = NULL;
+ }
}
// -------------------------------------------------------------------------------------------------
@@ -612,7 +618,11 @@
iDisplayTimer->Cancel();
// disable the backlight
- HAL::Set( HALData::EBacklightState, 0 );
+ MPX_TRAPD( err,
+ {
+ iLight->ReserveLightL( CHWRMLight::EPrimaryDisplay );
+ iLight->LightOffL( CHWRMLight::EPrimaryDisplay );
+ } );
}
// -----------------------------------------------------------------------------
@@ -624,7 +634,11 @@
MPX_ENTER_EXIT(_L("CMPXVideoPlaybackUserInputHandler::EnableBacklight"));
// enable the backlight
- HAL::Set( HALData::EBacklightState, 1 );
+ MPX_TRAPD( err,
+ {
+ iLight->LightOnL( CHWRMLight::EPrimaryDisplay );
+ iLight->ReleaseLight(CHWRMLight::EPrimaryDisplay );
+ } );
}
@@ -691,12 +705,9 @@
{
// timeout has happened and the backlight is disabled
// enable the backlight
- HAL::Set( HALData::EBacklightState, 1 );
+ EnableBacklight();
}
- TBool backlightState;
- TInt ret = HAL::Get( HALData::EBacklightState, backlightState );
-
// Re start the display backlight timer
iDisplayTimer->Start( iDisplayTimeOut, iDisplayTimeOut,
TCallBack( CMPXVideoPlaybackUserInputHandler::HandleDisplayTimeout, this ) );