camerauis/cameraapp/generic/src/CamAppui.cpp
branchRCL_3
changeset 31 8f559c47d7fd
parent 27 53c8aa5d97a3
child 35 e32fcfe0045f
equal deleted inserted replaced
27:53c8aa5d97a3 31:8f559c47d7fd
  1729       break;
  1729       break;
  1730      // -----------------------------------------------------
  1730      // -----------------------------------------------------
  1731      case ECamCmdSwitchCamera:
  1731      case ECamCmdSwitchCamera:
  1732          {
  1732          {
  1733          PRINT( _L("Camera => CCamAppUi::HandleCommandL ECamCmdSwitchCamera" ))
  1733          PRINT( _L("Camera => CCamAppUi::HandleCommandL ECamCmdSwitchCamera" ))
       
  1734          
       
  1735          // By now it safe to assume that we are no longer returning from a pretended exit.
       
  1736          PRINT( _L("Camera <> Set iReturningFromPretendExit = EFalse") )
       
  1737          iReturningFromPretendExit = EFalse;
       
  1738          
  1734          //If modechange sequence going on ignore switching...
  1739          //If modechange sequence going on ignore switching...
  1735          if( iController.CaptureModeTransitionInProgress() ||
  1740          if( iController.CaptureModeTransitionInProgress() ||
  1736              iController.CaptureState() != ECamCaptureOff || 
  1741              iController.CaptureState() != ECamCaptureOff || 
  1737              iController.IsSavingInProgress() )
  1742              iController.IsSavingInProgress() )
  1738              {
  1743              {
  3392           
  3397           
  3393           //We hiden toolbar when keylock was set to on in pre-capture view and camera lost focus, 
  3398           //We hiden toolbar when keylock was set to on in pre-capture view and camera lost focus, 
  3394           //so we need to display toolbar when keylock is set to off and camera gain focus again.
  3399           //so we need to display toolbar when keylock is set to off and camera gain focus again.
  3395           if ( ECamViewStatePreCapture == iViewState &&
  3400           if ( ECamViewStatePreCapture == iViewState &&
  3396                ECamPreCapViewfinder == iPreCaptureMode && 
  3401                ECamPreCapViewfinder == iPreCaptureMode && 
       
  3402                ( !( iSelfTimer && iSelfTimer->IsActive() ) ) &&
  3397                iController.CurrentOperation() != ECamCapturing )  
  3403                iController.CurrentOperation() != ECamCapturing )  
  3398             {
  3404             {
  3399             SetToolbarVisibility(); 
  3405             SetToolbarVisibility(); 
  3400             }          
  3406             }          
  3401           
  3407           
  3789   //always sets target mode to precaptrueview and current view could already be in precapture view. This is fine
  3795   //always sets target mode to precaptrueview and current view could already be in precapture view. This is fine
  3790   //but In some postcaptureview cases current view and targetview is postcapture.
  3796   //but In some postcaptureview cases current view and targetview is postcapture.
  3791   //In those cases view switching is not needed unless current mode also changes.
  3797   //In those cases view switching is not needed unless current mode also changes.
  3792   if( (iViewState==iTargetViewState) && ( iViewState==ECamViewStatePostCapture) && (iMode==iTargetMode) )
  3798   if( (iViewState==iTargetViewState) && ( iViewState==ECamViewStatePostCapture) && (iMode==iTargetMode) )
  3793       {
  3799       {
  3794       PRINT(_L("Camera <> CCamAppUi::TrySwitchViewL, CALLED WITHOUT PURPOSE"));      
  3800       PRINT(_L("Camera <= CCamAppUi::TrySwitchViewL, CALLED WITHOUT PURPOSE"));      
  3795       return;
  3801       return;
  3796       }  
  3802       }  
  3797   
  3803   
  3798   if( iZoomUsingVolumeKeys && !iVolumeKeyObserver &&
  3804   if( iZoomUsingVolumeKeys && !iVolumeKeyObserver &&
  3799       ECamViewStatePreCapture == iTargetViewState )
  3805       ECamViewStatePreCapture == iTargetViewState )
  3828   // when we get the foreground again. This stops the app coming back to
  3834   // when we get the foreground again. This stops the app coming back to
  3829   // the foreground when the view switch occurs.
  3835   // the foreground when the view switch occurs.
  3830   // If keylock is enabled, view switching is allowed in order to avoid 
  3836   // If keylock is enabled, view switching is allowed in order to avoid 
  3831   // flickering
  3837   // flickering
  3832   
  3838   
  3833   if ( AppInBackground( ETrue ) && ECamViewStateStandby != iTargetViewState )  
  3839   if ( iPretendExit || ( AppInBackground( ETrue ) && ECamViewStateStandby != iTargetViewState ) )  
  3834     {          
  3840     {          
  3835     PRINT( _L("Camera <> app in background set pending view switch") )
  3841     PRINT( _L("Camera <> app in background set pending view switch") )
  3836     if ( aDeactivateFirst )
  3842     if ( aDeactivateFirst )
  3837       {
  3843       {
  3838       PRINT( _L("Camera <> setting iPendingViewSwitch = EPendingViewSwitchDeactivateFirst") )
  3844       PRINT( _L("Camera <> setting iPendingViewSwitch = EPendingViewSwitchDeactivateFirst") )
  4485 				supportedMemTypes |= AknCommonDialogsDynMem::EMemoryTypePhone;
  4491 				supportedMemTypes |= AknCommonDialogsDynMem::EMemoryTypePhone;
  4486 				}
  4492 				}
  4487 			if(currentLocation != ECamMediaStorageCard && 
  4493 			if(currentLocation != ECamMediaStorageCard && 
  4488 				!IsMemoryFullOrUnavailable(ECamMediaStorageCard))
  4494 				!IsMemoryFullOrUnavailable(ECamMediaStorageCard))
  4489 				{
  4495 				{
  4490 				supportedMemTypes |= AknCommonDialogsDynMem::EMemoryTypeMMCExternal;
  4496 				supportedMemTypes |= AknCommonDialogsDynMem::EMemoryTypeMMCExternalInDevice;
  4491 				}
  4497 				}
  4492 			if(currentLocation != ECamMediaStorageMassStorage && 
  4498 			if(currentLocation != ECamMediaStorageMassStorage && 
  4493 				!IsMemoryFullOrUnavailable(ECamMediaStorageMassStorage))
  4499 				!IsMemoryFullOrUnavailable(ECamMediaStorageMassStorage))
  4494 				{
  4500 				{
  4495                     supportedMemTypes |= 
  4501                     supportedMemTypes |= 
  5010         if ( callType == EPSCTsyCallTypeH324Multimedia || !iController.IsViewFinding() || !CheckMemoryL() )
  5016         if ( callType == EPSCTsyCallTypeH324Multimedia || !iController.IsViewFinding() || !CheckMemoryL() )
  5011             {
  5017             {
  5012             PRINT( _L("Camera <= CCamAppUi::StartCaptureL, video no memory") );
  5018             PRINT( _L("Camera <= CCamAppUi::StartCaptureL, video no memory") );
  5013             return EKeyWasNotConsumed;
  5019             return EKeyWasNotConsumed;
  5014             }
  5020             }
       
  5021         else if( iController.IntegerSettingValue( ECamSettingItemStopRecordingInHdmiMode) &&
       
  5022                 iController.IsHdmiCableConnected() )
       
  5023             {
       
  5024             iController.SetPendingHdmiEvent( ECamHdmiCableConnectedBeforeRecording );
       
  5025             PRINT( _L("Camera <= CCamAppUi::StartCaptureL, HDMI Cable connected") );
       
  5026             return EKeyWasNotConsumed;
       
  5027             }
       
  5028         
  5015         PERF_EVENT_END_L1( EPerfEventKeyToCapture );
  5029         PERF_EVENT_END_L1( EPerfEventKeyToCapture );
  5016         PERF_EVENT_START_L1( EPerfEventStartVideoRecording );    
  5030         PERF_EVENT_START_L1( EPerfEventStartVideoRecording );    
  5017         static_cast<CCamViewBase*>( iView )->UnsetCourtesySoftKeysL();
  5031         static_cast<CCamViewBase*>( iView )->UnsetCourtesySoftKeysL();
  5018         iController.StartVideoRecordingL();
  5032         iController.StartVideoRecordingL();
  5019         PRINT( _L("Camera <= CCamAppUi::StartCaptureL, video capture requested") );
  5033         PRINT( _L("Camera <= CCamAppUi::StartCaptureL, video capture requested") );
  5191 void CCamAppUi::CloseAppL()  
  5205 void CCamAppUi::CloseAppL()  
  5192     {
  5206     {
  5193     OstTrace0( CAMERAAPP_PERFORMANCE_DETAIL, CCAMAPPUI_CLOSEAPPL, "e_CCamAppUi_CloseAppL 1" );
  5207     OstTrace0( CAMERAAPP_PERFORMANCE_DETAIL, CCAMAPPUI_CLOSEAPPL, "e_CCamAppUi_CloseAppL 1" );
  5194     
  5208     
  5195     PRINT( _L("Camera => CCamAppUi::CloseAppL") )
  5209     PRINT( _L("Camera => CCamAppUi::CloseAppL") )
  5196 
  5210     
       
  5211     // Special considerations needed for secondary camera
       
  5212     // regarding scene mode and face tracking state
       
  5213     if ( IsSecondCameraEnabled() && !IsEmbedded() )
       
  5214         {
       
  5215         // This includes storing the face tracking value
       
  5216         iController.HandleSecondaryCameraExitL();
       
  5217         }
       
  5218     else
       
  5219         {
       
  5220         iController.StoreFaceTrackingValue(); // store the current FT setting
       
  5221         }
       
  5222     
  5197     // cancel the self timer if active - can be active
  5223     // cancel the self timer if active - can be active
  5198     // if closing the slide while counting down
  5224     // if closing the slide while counting down
  5199     if ( iInSelfTimerMode != ECamSelfTimerDisabled )
  5225     if ( iInSelfTimerMode != ECamSelfTimerDisabled )
  5200         {
  5226         {
  5201         SelfTimerEnableL( ECamSelfTimerDisabled );
  5227         SelfTimerEnableL( ECamSelfTimerDisabled );
  5396                     }
  5422                     }
  5397                 else
  5423                 else
  5398                     {
  5424                     {
  5399                     SetSoftKeysL( R_CAM_SOFTKEYS_OPTIONS_EXIT__CAPTURE_SECONDARY );      
  5425                     SetSoftKeysL( R_CAM_SOFTKEYS_OPTIONS_EXIT__CAPTURE_SECONDARY );      
  5400                     }
  5426                     }
       
  5427                 // Special considerations needed for secondary camera
       
  5428                 // regarding scene mode and face tracking state
       
  5429                 iController.HandleSecondaryCameraExitL();
  5401                 }
  5430                 }
  5402               }
  5431               }
  5403             }
  5432             }
  5404 
  5433 
  5405         // Cancel delayed sensor initialization, in case it's still pending when 
  5434         // Cancel delayed sensor initialization, in case it's still pending when 
  8478 		return (availableMemoryUnits <= 0);
  8507 		return (availableMemoryUnits <= 0);
  8479 		}
  8508 		}
  8480 	else if(iMode == ECamControllerVideo)
  8509 	else if(iMode == ECamControllerVideo)
  8481 		{
  8510 		{
  8482 		TTimeIntervalMicroSeconds timeLeft = 0;
  8511 		TTimeIntervalMicroSeconds timeLeft = 0;
  8483 		TRAPD(err,timeLeft =
  8512 		
  8484 					iController.
  8513 		TInt err(KErrNone);
  8485 					CalculateVideoTimeRemainingL(aStorageLocation););
  8514 		if( iController.CurrentOperation() == ECamNoOperation )
       
  8515 		    {
       
  8516             TRAP(err,timeLeft =
       
  8517                     iController.
       
  8518                     CalculateVideoTimeRemainingL(aStorageLocation) );
       
  8519             }
       
  8520 		else
       
  8521 		    {
       
  8522             TRAP(err,timeLeft =
       
  8523                     iController.
       
  8524                     RemainingVideoRecordingTime() );
       
  8525             }
       
  8526 		
  8486 		if(err)
  8527 		if(err)
  8487 		    timeLeft = 0;
  8528 		    timeLeft = 0;
  8488 		return (timeLeft < KMemoryFullVideoRemaining);
  8529 		return (timeLeft < KMemoryFullVideoRemaining);
  8489 		}
  8530 		}
  8490 	return ETrue;
  8531 	return ETrue;
  8834     iVideoClipPlayInProgress = EFalse;
  8875     iVideoClipPlayInProgress = EFalse;
  8835     
  8876     
  8836     PRINT(_L("Camera <= CCamAppUi::HandleServerAppExit."));
  8877     PRINT(_L("Camera <= CCamAppUi::HandleServerAppExit."));
  8837     }
  8878     }
  8838 
  8879 
  8839 
  8880 // -----------------------------------------------------------------------------
       
  8881 // CCamAppUi::HandleHdmiEventL 
       
  8882 // -----------------------------------------------------------------------------
       
  8883 //
       
  8884 void CCamAppUi::HandleHdmiEventL( TCamHdmiEvent aEvent )
       
  8885     {
       
  8886     HBufC* noteString = NULL;
       
  8887     CAknWarningNote* note = NULL;
       
  8888     switch( aEvent )
       
  8889         {
       
  8890         case ECamHdmiCableConnectedBeforeRecording:
       
  8891             {
       
  8892             noteString = StringLoader::LoadLC( R_QTN_LCAM_HDMI_REMOVE_CABLE );
       
  8893             note = new (ELeave) CAknWarningNote();
       
  8894             note->ExecuteLD( *noteString );
       
  8895             CleanupStack::PopAndDestroy( noteString );
       
  8896             }
       
  8897             break;
       
  8898         case ECamHdmiCableConnectedDuringRecording:
       
  8899             {
       
  8900             noteString = StringLoader::LoadLC( R_QTN_LCAM_HDMI_CABLE_DETECTED );
       
  8901             note = new (ELeave) CAknWarningNote();
       
  8902             note->ExecuteLD( *noteString );
       
  8903             CleanupStack::PopAndDestroy( noteString );
       
  8904             }
       
  8905             break;
       
  8906         default:
       
  8907             break;
       
  8908         }
       
  8909     
       
  8910     }
  8840 
  8911 
  8841 //  End of File
  8912 //  End of File