74 mSessionDurationTimerId(0), |
74 mSessionDurationTimerId(0), |
75 mMainCamera(true), |
75 mMainCamera(true), |
76 mUiEngine( uiEngine ), |
76 mUiEngine( uiEngine ), |
77 mIsMinimized(false), |
77 mIsMinimized(false), |
78 mFirstForegroundSwitch(true), |
78 mFirstForegroundSwitch(true), |
79 mViewReadySimulationTimerId(0), |
|
80 mCurrentView(0), |
79 mCurrentView(0), |
81 mActivityManager(0) |
80 mActivityManager(0) |
82 { |
81 { |
83 LC_QDEBUG( "livecomms [UI] -> LcUiEnginePrivate::LcUiEnginePrivate()" ) |
82 LC_QDEBUG( "livecomms [UI] -> LcUiEnginePrivate::LcUiEnginePrivate()" ) |
84 |
83 |
560 if ( event->timerId() == mSessionDurationTimerId ) { |
559 if ( event->timerId() == mSessionDurationTimerId ) { |
561 QTime curr(0, 0, 0, 0); |
560 QTime curr(0, 0, 0, 0); |
562 curr = curr.addSecs( |
561 curr = curr.addSecs( |
563 mSessionDurationStartTime.secsTo( QTime::currentTime() ) ); |
562 mSessionDurationStartTime.secsTo( QTime::currentTime() ) ); |
564 emit mUiEngine.sessionDurationChanged(curr.toString()); |
563 emit mUiEngine.sessionDurationChanged(curr.toString()); |
565 } else if ( event->timerId() == mViewReadySimulationTimerId ){ |
564 } |
566 LC_QDEBUG( "livecomms [UI] -> LcUiEnginePrivate::timerEvent(), viewReady simulation" ) |
565 } |
567 handleEngineForegroundStatus(); |
566 |
568 } |
|
569 } |
|
570 // ----------------------------------------------------------------------------- |
567 // ----------------------------------------------------------------------------- |
571 // LcUiEnginePrivate::startReceiving |
568 // LcUiEnginePrivate::startReceiving |
572 // ----------------------------------------------------------------------------- |
569 // ----------------------------------------------------------------------------- |
573 // |
570 // |
574 void LcUiEnginePrivate::startReceiving() |
571 void LcUiEnginePrivate::startReceiving() |
1371 // |
1368 // |
1372 void LcUiEnginePrivate::handleEngineForegroundStatus() |
1369 void LcUiEnginePrivate::handleEngineForegroundStatus() |
1373 { |
1370 { |
1374 bool foreground = !mIsMinimized; |
1371 bool foreground = !mIsMinimized; |
1375 LC_QDEBUG_2( "livecomms [UI] -> LcUiEnginePrivate::handleEngineForegroundStatus(), fg:", |
1372 LC_QDEBUG_2( "livecomms [UI] -> LcUiEnginePrivate::handleEngineForegroundStatus(), fg:", |
1376 foreground ) |
1373 foreground ) |
|
1374 HbMainWindow *mainWindow = HbInstance::instance()->allMainWindows().at(0); |
|
1375 |
1377 if ( mLiveCommsEngine ){ |
1376 if ( mLiveCommsEngine ){ |
1378 bool setStatusToEngine(true); |
1377 bool setStatusToEngine(true); |
1379 if ( foreground && mFirstForegroundSwitch ){ |
1378 if ( foreground && mFirstForegroundSwitch ){ |
1380 // Have to wait that first paint has occured, otherwise video |
1379 // Have to wait that first paint has occured, otherwise video |
1381 // windows are shown too early. |
1380 // windows are shown too early. |
1382 // TODO: wk8 does not yet have viewReady signal so simulate it |
1381 // TODO: wk8 does not yet have viewReady signal so simulate it |
1383 // by using timer. Timer can be removed later. |
1382 // by using timer. Timer can be removed later. |
1384 if ( mCurrentView ){ |
1383 if ( mCurrentView ){ |
1385 LC_QDEBUG( "livecomms [UI] Wait for first paint" ) |
1384 LC_QDEBUG( "livecomms [UI] Wait for first paint" ) |
1386 connect( mCurrentView, SIGNAL(viewReady()), |
1385 connect( mainWindow, SIGNAL(viewReady()), |
1387 this, SLOT(handleEngineForegroundStatus()) ); |
1386 this, SLOT(handleEngineForegroundStatus()) ); |
1388 const int viewReadySimulationInMs = 2000; |
|
1389 mViewReadySimulationTimerId = startTimer( viewReadySimulationInMs ); |
|
1390 setStatusToEngine = false; |
1387 setStatusToEngine = false; |
1391 } |
1388 } |
1392 |
1389 |
1393 } |
1390 } |
1394 if ( setStatusToEngine ) { |
1391 if ( setStatusToEngine ) { |
1395 LC_QDEBUG( "livecomms [UI] Set fg status to engine plugin" ) |
1392 LC_QDEBUG( "livecomms [UI] Set fg status to engine plugin" ) |
1396 session().SetForegroundStatus(foreground); |
1393 session().SetForegroundStatus(foreground); |
1397 |
1394 disconnect( mainWindow, SIGNAL(viewReady()), |
1398 disconnect( mCurrentView, SIGNAL(viewReady()), |
|
1399 this, SLOT(handleEngineForegroundStatus()) ); |
1395 this, SLOT(handleEngineForegroundStatus()) ); |
1400 killTimer( mViewReadySimulationTimerId ); |
|
1401 mViewReadySimulationTimerId = 0; |
|
1402 } |
1396 } |
1403 mFirstForegroundSwitch = false; |
1397 mFirstForegroundSwitch = false; |
1404 } |
1398 } |
1405 LC_QDEBUG( "livecomms [UI] <- LcUiEnginePrivate::handleEngineForegroundStatus()" ) |
1399 LC_QDEBUG( "livecomms [UI] <- LcUiEnginePrivate::handleEngineForegroundStatus()" ) |
1406 } |
1400 } |