camerauis/cameraapp/generic/src/CamAppController.cpp
branchRCL_3
changeset 57 2c87b2808fd7
parent 54 bac7acad7cb3
child 62 f0c0788c4de2
equal deleted inserted replaced
54:bac7acad7cb3 57:2c87b2808fd7
  1230     if( appUi->SettingsLaunchedFromCamera() || iDismountPending )
  1230     if( appUi->SettingsLaunchedFromCamera() || iDismountPending )
  1231         {
  1231         {
  1232         // In case settings plugin is being run or mmc dismount is pending
  1232         // In case settings plugin is being run or mmc dismount is pending
  1233         // due to usb activation, we calculate the remaining time here, 
  1233         // due to usb activation, we calculate the remaining time here, 
  1234         // instead of repreparing the engine and getting it from there  
  1234         // instead of repreparing the engine and getting it from there  
  1235         TRAPD( err, iVideoTimeRemaining = CalculateVideoTimeRemainingL() );
  1235         TRAPD( err, iVideoTimeRemaining = CalculateVideoTimeRemainingL( static_cast < TCamMediaStorage >(CurrentVideoStorageLocation()) ) );
  1236         if( KErrNone != err )
  1236         if( KErrNone != err )
  1237             {
  1237             {
  1238             iVideoTimeRemaining = 0;
  1238             iVideoTimeRemaining = 0;
  1239             }
  1239             }
  1240         }
  1240         }
  1249             iVideoTimeRemaining = RemainingVideoRecordingTime();  
  1249             iVideoTimeRemaining = RemainingVideoRecordingTime();  
  1250             }
  1250             }
  1251         else 
  1251         else 
  1252             {
  1252             {
  1253             PRINT( _L("Camera <> CCamAppController::RecordTimeRemaining - video mode not yet initialized" ));
  1253             PRINT( _L("Camera <> CCamAppController::RecordTimeRemaining - video mode not yet initialized" ));
  1254             TRAPD( err, iVideoTimeRemaining = CalculateVideoTimeRemainingL() );
  1254             TRAPD( err, iVideoTimeRemaining = CalculateVideoTimeRemainingL( static_cast < TCamMediaStorage >(CurrentVideoStorageLocation()) ) );
  1255             if( KErrNone != err )
  1255             if( KErrNone != err )
  1256                 {
  1256                 {
  1257                 iVideoTimeRemaining = 0;
  1257                 iVideoTimeRemaining = 0;
  1258                 }
  1258                 }
  1259             }
  1259             }
  2556   CCamAppUi* appUi = static_cast<CCamAppUi*>( CEikonEnv::Static()->AppUi() );
  2556   CCamAppUi* appUi = static_cast<CCamAppUi*>( CEikonEnv::Static()->AppUi() );
  2557   iCameraController->SwitchCameraL( (ECamActiveCameraPrimary == targetCamera) ? 0 : 1 );
  2557   iCameraController->SwitchCameraL( (ECamActiveCameraPrimary == targetCamera) ? 0 : 1 );
  2558   if( UiConfigManagerPtr()->IsUIOrientationOverrideSupported() )
  2558   if( UiConfigManagerPtr()->IsUIOrientationOverrideSupported() )
  2559       {
  2559       {
  2560       RArray<TInt> screenModeValues;
  2560       RArray<TInt> screenModeValues;
       
  2561       CleanupClosePushL( screenModeValues );
  2561       UiConfigManagerPtr()->SupportedScreenModesL( screenModeValues );
  2562       UiConfigManagerPtr()->SupportedScreenModesL( screenModeValues );
  2562       TInt landscapeScreenMode = screenModeValues[0];
  2563       TInt landscapeScreenMode = screenModeValues[0];
  2563       SetCameraOrientationModeL( landscapeScreenMode );
  2564       SetCameraOrientationModeL( landscapeScreenMode );
       
  2565       CleanupStack::PopAndDestroy( &screenModeValues );
  2564       }
  2566       }
  2565   iCameraController->CompleteSwitchCameraL();
  2567   iCameraController->CompleteSwitchCameraL();
  2566   // Force to get a sensor data after switch camera from primary to secondary 
  2568   // Force to get a sensor data after switch camera from primary to secondary 
  2567   // when always holding in camera with portrait mode. 
  2569   // when always holding in camera with portrait mode. 
  2568   if( iConfigManager 
  2570   if( iConfigManager 
  3055             {
  3057             {
  3056             SwitchToStandbyL( ECamErrMemoryCardNotInserted );
  3058             SwitchToStandbyL( ECamErrMemoryCardNotInserted );
  3057             }
  3059             }
  3058         else
  3060         else
  3059             {
  3061             {
  3060             CamPanic(ECamPanicInvalidState);
  3062             // Memory card and mass storage not accessible. Storage may be locked or corrupted.
       
  3063             PRINT1( _L("Camera <> Storage is locked/corrupted. USB personality:%d"), usbPersonality );
       
  3064             SwitchToStandbyL( ECamErrMassStorageMode );
  3061             }
  3065             }
  3062         
  3066         
  3063         iIssueModeChangeSequenceSucceeded = EFalse;
  3067         iIssueModeChangeSequenceSucceeded = EFalse;
  3064         ClearSequenceBusyFlag( &iBusyFlags );
  3068         ClearSequenceBusyFlag( &iBusyFlags );
  3065         }
  3069         }
  8511 //  
  8515 //  
  8512 void CCamAppController::HandleCaptureCompletion()
  8516 void CCamAppController::HandleCaptureCompletion()
  8513   {
  8517   {
  8514   PRINT( _L( "Camera => CCamAppController::HandleCaptureCompletion()" ) )
  8518   PRINT( _L( "Camera => CCamAppController::HandleCaptureCompletion()" ) )
  8515 
  8519 
  8516   SetOperation( ECamNoOperation );
  8520   if ( iInfo.iOperation != ECamFocused && iInfo.iOperation != ECamFocusing )
       
  8521       {
       
  8522       SetOperation( ECamNoOperation );
       
  8523       }
  8517   
  8524   
  8518   // Re-enable screensaver
  8525   // Re-enable screensaver
  8519   EnableScreenSaver( ETrue );
  8526   EnableScreenSaver( ETrue );
  8520 
  8527 
  8521   // If mmc dismount notification came while saving, allow the dismount now
  8528   // If mmc dismount notification came while saving, allow the dismount now