camerauis/cameraapp/generic/src/CamAppController.cpp
branchRCL_3
changeset 13 38fb6f7eacd5
parent 12 51dda465e618
child 15 bf64cebf4673
equal deleted inserted replaced
12:51dda465e618 13:38fb6f7eacd5
    47 #include <sensrvchannelfinder.h>
    47 #include <sensrvchannelfinder.h>
    48 
    48 
    49 #include <UsbWatcherInternalPSKeys.h>
    49 #include <UsbWatcherInternalPSKeys.h>
    50 #include <usbpersonalityids.h>
    50 #include <usbpersonalityids.h>
    51 
    51 
       
    52 #include <UikonInternalPSKeys.h>
    52 
    53 
    53 #include <cameraapp.rsg>
    54 #include <cameraapp.rsg>
    54 #include <vgacamsettings.rsg>
    55 #include <vgacamsettings.rsg>
    55 #include "CamSettingsInternal.hrh"
    56 #include "CamSettingsInternal.hrh"
    56 #include "CamProductSpecificSettings.hrh"
    57 #include "CamProductSpecificSettings.hrh"
  2141   switch( aAFRequest )
  2142   switch( aAFRequest )
  2142     {    
  2143     {    
  2143     case  ECamRequestCancelAutofocus:
  2144     case  ECamRequestCancelAutofocus:
  2144     case ECamRequestStartAutofocus:
  2145     case ECamRequestStartAutofocus:
  2145         {
  2146         {
  2146         if(iPendingAFRequest==0)
  2147         if( iPendingAFRequest == 0 ||
       
  2148           ( !iAFCancelInProgress &&
       
  2149             iPendingAFRequest == ECamRequestCancelAutofocus &&
       
  2150             iCurrentAFRequest == ECamRequestCancelAutofocus ) )
  2147             {
  2151             {
  2148             if ( !( UiConfigManagerPtr()->IsContinuosAutofocusSupported()&& ECamControllerVideo == CurrentMode() ) ) 
  2152             if ( !( UiConfigManagerPtr()->IsContinuosAutofocusSupported()&& ECamControllerVideo == CurrentMode() ) ) 
  2149                             {
       
  2150             iPendingAFRequest=aAFRequest;
       
  2151             TRAPD( err, IssueDirectRequestL( TCamCameraRequestId(aAFRequest) ) );
       
  2152             //TRAPD( err, iCameraController->DirectRequestL( aAFRequest ) );            
       
  2153             if ( err != KErrNone )
       
  2154                 {
  2153                 {
  2155                 // There is an error, we leave without focusing
  2154                 iPendingAFRequest=aAFRequest;
  2156                 iPendingAFRequest=0;
  2155                 TRAPD( err, IssueDirectRequestL( TCamCameraRequestId(aAFRequest) ) );
  2157                 return EFalse; // Not doing any autofocus request.
  2156                 //TRAPD( err, iCameraController->DirectRequestL( aAFRequest ) );            
  2158                 //This is only case where AFrequest cause EFalse to be returned.
  2157                 if ( err != KErrNone )
       
  2158                     {
       
  2159                     // There is an error, we leave without focusing
       
  2160                     iPendingAFRequest=0;
       
  2161                     return EFalse; // Not doing any autofocus request.
       
  2162                     //This is only case where AFrequest cause EFalse to be returned.
       
  2163                     }
  2159                 }
  2164                 }
  2160             }
  2165             } 
  2161             }
       
  2162         else
  2166         else
  2163             {
  2167             {
  2164             CCamAppUi* appUi = static_cast<CCamAppUi*>( CEikonEnv::Static()->AppUi() );
  2168             CCamAppUi* appUi = static_cast<CCamAppUi*>( CEikonEnv::Static()->AppUi() );
  2165             if ( appUi->AlwaysDrawPreCaptureCourtesyUI()
  2169             if ( appUi->AlwaysDrawPreCaptureCourtesyUI()
  2166                 && !CurrentSceneHasForcedFocus() )
  2170                 && !CurrentSceneHasForcedFocus() )
  2431     PRINT( _L("Camera <= CCamAppController::PlaySound") );                 
  2435     PRINT( _L("Camera <= CCamAppController::PlaySound") );                 
  2432     }
  2436     }
  2433 
  2437 
  2434 
  2438 
  2435 // ---------------------------------------------------------------------------
  2439 // ---------------------------------------------------------------------------
  2436 // CCamAppController::PlayTone
       
  2437 // Play a tone with specified frequency, period and volume
       
  2438 // ---------------------------------------------------------------------------
       
  2439 //
       
  2440 void CCamAppController::PlayTone( TInt      aToneHz, 
       
  2441                                   TInt      aLenMicSec, 
       
  2442                                   TReal32   aVolume, 
       
  2443                                   TBool     aEnableCallback )
       
  2444   {    
       
  2445   if ( !iShutterSndAlwaysOn && 
       
  2446      iSilentProfile )
       
  2447     {
       
  2448     // don't play shutter sound if we are following
       
  2449     // current profile setting and profile is silent
       
  2450     }
       
  2451   else
       
  2452     {    
       
  2453     iSoundPlayer->PlayTone( aToneHz, aLenMicSec, aVolume, aEnableCallback );
       
  2454     }
       
  2455   }
       
  2456 
       
  2457 // ---------------------------------------------------------------------------
       
  2458 // CCamAppController::AllOptionsVisibleForSettingItem
  2440 // CCamAppController::AllOptionsVisibleForSettingItem
  2459 // Returns true if all the settings list options for a particular setting
  2441 // Returns true if all the settings list options for a particular setting
  2460 // item are visible.
  2442 // item are visible.
  2461 // ---------------------------------------------------------------------------
  2443 // ---------------------------------------------------------------------------
  2462 //
  2444 //
  2999   RCamRequestArray sequence;
  2981   RCamRequestArray sequence;
  3000   CleanupClosePushL( sequence );
  2982   CleanupClosePushL( sequence );
  3001 
  2983 
  3002   if( !aStartup )
  2984   if( !aStartup )
  3003     {
  2985     {
  3004     GenerateModeChangeSequenceL( sequence );
  2986     TBool usbPersonality = 0;
  3005 	
  2987     User::LeaveIfError ( RProperty::Get (KPSUidUsbWatcher, 
  3006 	if( iCameraReferences ) 
  2988                           KUsbWatcherSelectedPersonality, usbPersonality));
  3007       {
  2989     TInt mmcInserted = 0;
  3008       SetFlags( iBusyFlags, EBusySequence );
  2990     User::LeaveIfError( RProperty::Get( KPSUidUikon, KUikMMCInserted, mmcInserted ) );
  3009       TCleanupItem clearBusy( ClearSequenceBusyFlag, &iBusyFlags );
  2991     CCamAppUi* appUi = static_cast<CCamAppUi*>( CEikonEnv::Static()->AppUi() );
  3010       CleanupStack::PushL( clearBusy );
  2992     
  3011       iCameraController->RequestSequenceL( sequence );
  2993     if(IntegerSettingValue(ECamSettingItemRemovePhoneMemoryUsage) &&
  3012       CleanupStack::Pop();
  2994             !IsMemoryAvailable(ECamMediaStorageMassStorage) &&
  3013    
  2995             !IsMemoryAvailable(ECamMediaStorageCard) &&
  3014       iCaptureModeTransitionInProgress = ETrue;
  2996             ( appUi->PreCaptureMode() == ECamPreCapViewfinder ||
  3015       
  2997               appUi->PreCaptureMode() == ECamPreCapGenericSetting ) )
  3016       }
  2998         {
  3017     else 
  2999         if( KUsbPersonalityIdMS == usbPersonality )
  3018   	  {
  3000             {
  3019       PRINT( _L("Camera <> No camera users, not requesting sequence.") );
  3001             SwitchToStandbyL( ECamErrMassStorageMode );
  3020       }
  3002             }
       
  3003         else if( !mmcInserted )
       
  3004             {
       
  3005             SwitchToStandbyL( ECamErrMemoryCardNotInserted );
       
  3006             }
       
  3007         else
       
  3008             {
       
  3009             CamPanic(ECamPanicInvalidState);
       
  3010             }
       
  3011         
       
  3012         iIssueModeChangeSequenceSucceeded = EFalse;
       
  3013         }
       
  3014     else
       
  3015         {
       
  3016         GenerateModeChangeSequenceL( sequence );
       
  3017         
       
  3018         if( iCameraReferences ) 
       
  3019             {
       
  3020             SetFlags( iBusyFlags, EBusySequence );
       
  3021             TCleanupItem clearBusy( ClearSequenceBusyFlag, &iBusyFlags );
       
  3022             CleanupStack::PushL( clearBusy );
       
  3023             iCameraController->RequestSequenceL( sequence );
       
  3024             CleanupStack::Pop();
       
  3025             
       
  3026             iCaptureModeTransitionInProgress = ETrue;
       
  3027             
       
  3028             }
       
  3029         else 
       
  3030             {
       
  3031             PRINT( _L("Camera <> No camera users, not requesting sequence.") );
       
  3032             }
       
  3033         iIssueModeChangeSequenceSucceeded = ETrue;
       
  3034         }  
  3021     }
  3035     }
  3022   else
  3036   else
  3023     {
  3037     {
  3024     GenerateStartupSequenceL( sequence );
  3038     GenerateStartupSequenceL( sequence );
  3025 	
  3039 	
  3026 	SetFlags( iBusyFlags, EBusySequence );
  3040 	SetFlags( iBusyFlags, EBusySequence );
  3027     TCleanupItem clearBusy( ClearSequenceBusyFlag, &iBusyFlags );
  3041     TCleanupItem clearBusy( ClearSequenceBusyFlag, &iBusyFlags );
  3028     CleanupStack::PushL( clearBusy );
  3042     CleanupStack::PushL( clearBusy );
  3029     iCameraController->RequestSequenceL( sequence );
  3043     iCameraController->RequestSequenceL( sequence );
  3030     CleanupStack::Pop();
  3044     CleanupStack::Pop();
       
  3045     iIssueModeChangeSequenceSucceeded = ETrue;
  3031     }
  3046     }
  3032   
  3047   
  3033   CleanupStack::PopAndDestroy(); // sequence.Close()
  3048   CleanupStack::PopAndDestroy(); // sequence.Close()
  3034   PRINT( _L( "Camera <= CCamAppController::IssueModeChangeSequenceL" ) );
  3049   PRINT( _L( "Camera <= CCamAppController::IssueModeChangeSequenceL" ) );
  3035   }
  3050   }
  3429     TRAPD( status, 
  3444     TRAPD( status, 
  3430       {
  3445       {
  3431       IssueDirectRequestL( ECamRequestVfStop    );
  3446       IssueDirectRequestL( ECamRequestVfStop    );
  3432       IssueDirectRequestL( ECamRequestSsRelease );
  3447       IssueDirectRequestL( ECamRequestSsRelease );
  3433       IssueDirectRequestL( ECamRequestImageInit );
  3448       IssueDirectRequestL( ECamRequestImageInit );
       
  3449       IssueDirectRequestL( ECamRequestVfStart   );
  3434       IssueDirectRequestL( ECamRequestSsStart   );
  3450       IssueDirectRequestL( ECamRequestSsStart   );
  3435       IssueDirectRequestL( ECamRequestVfStart   );
       
  3436       });
  3451       });
  3437       
  3452       
  3438     if( KErrNone != status )
  3453     if( KErrNone != status )
  3439       {
  3454       {
  3440       SetOperation( ECamStandby, status );
  3455       SetOperation( ECamStandby, status );
  4304   switch( aSettingItem )
  4319   switch( aSettingItem )
  4305     {
  4320     {
  4306     case ECamSettingItemPhotoMediaStorage:
  4321     case ECamSettingItemPhotoMediaStorage:
  4307     case ECamSettingItemVideoMediaStorage:
  4322     case ECamSettingItemVideoMediaStorage:
  4308       {
  4323       {
  4309       PRINT(_L("Camera SetIntegerSettingValueL calling SetPathnamesToNewStorageL" ))
  4324       PRINT1(_L("Camera SetIntegerSettingValueL calling SetPathnamesToNewStorageL %d" ), aSettingValue);
  4310       // reset iForceUseOfPhoneMemory flag when user chooses 
  4325       // reset iForceUseOfPhoneMemory flag when user chooses 
  4311       // from settings.
  4326       // from settings.
  4312       iForceUseOfPhoneMemory = EFalse;
  4327       iForceUseOfPhoneMemory = EFalse;
  4313       SetPathnamesToNewStorageL(static_cast < TCamMediaStorage > ( aSettingValue ) );
  4328       SetPathnamesToNewStorageL(static_cast < TCamMediaStorage > ( aSettingValue ) );
  4314       InitCaptureLimitL();
  4329       InitCaptureLimitL();
  6367         // This affects the thumbnails seen in Photos.
  6382         // This affects the thumbnails seen in Photos.
  6368         
  6383         
  6369         // check if snapshot bitmap needs to be rotated before creating a thumbnail from it
  6384         // check if snapshot bitmap needs to be rotated before creating a thumbnail from it
  6370         TBool rotate( ( ECamSettOn == iSettingsModel->IntegerSettingValue( ECamSettingItemImageRotation ) || 
  6385         TBool rotate( ( ECamSettOn == iSettingsModel->IntegerSettingValue( ECamSettingItemImageRotation ) || 
  6371                       iInfo.iActiveCamera == ECamActiveCameraSecondary ) &&
  6386                       iInfo.iActiveCamera == ECamActiveCameraSecondary ) &&
  6372                       ECamSettOn == IntegerSettingValue( ECamSettingItemShowCapturedPhoto ) &&
       
  6373                       iCaptureOrientation != ECamOrientation0 );
  6387                       iCaptureOrientation != ECamOrientation0 );
  6374 
  6388 
  6375         if ( ECamImageCaptureBurst != iInfo.iImageMode )
  6389         if ( ECamImageCaptureBurst != iInfo.iImageMode )
  6376           {
  6390           {
  6377           //create thumbnail or rotate first if needed
  6391           //create thumbnail or rotate first if needed
  8945               {
  8959               {
  8946               NotifyControllerObservers( ECamEventInitReady );
  8960               NotifyControllerObservers( ECamEventInitReady );
  8947               }
  8961               }
  8948           }
  8962           }
  8949 
  8963 
  8950       if ( UiConfigManagerPtr()->IsLocationSupported() )
  8964       if ( UiConfigManagerPtr()->IsLocationSupported() &&
  8951         {
  8965               ECamLocationOn == IntegerSettingValue( ECamSettingItemRecLocation ) )
  8952         if( ECamLocationOn == IntegerSettingValue( ECamSettingItemRecLocation ) )
  8966         {
  8953             {
  8967         StartLocationTrailL();
  8954             if( ECamActiveCameraPrimary == ActiveCamera())
  8968         }
  8955                 {
  8969 
  8956                 StartLocationTrailL();
       
  8957                 }
       
  8958             else // Secondary camera 
       
  8959                 {
       
  8960                 PRINT( _L("Camera: CCamAppController::HandleCameraEventL - secondary camera, stop location trail") )
       
  8961                 StopLocationTrail();
       
  8962                 }
       
  8963             }
       
  8964         }
       
  8965       //Check if profile is silent and/or camera tones are set off
  8970       //Check if profile is silent and/or camera tones are set off
  8966       IsProfileSilent();
  8971       IsProfileSilent();
  8967 
  8972 
  8968       break;
  8973       break;
  8969       }
  8974       }
 10330   // Audio recording on/muted
 10335   // Audio recording on/muted
 10331   TInt audioRec = iSettingsModel->IntegerSettingValue( 
 10336   TInt audioRec = iSettingsModel->IntegerSettingValue( 
 10332   									ECamSettingItemVideoAudioRec );
 10337   									ECamSettingItemVideoAudioRec );
 10333   TBool audioMute = ECamSettOff == audioRec;
 10338   TBool audioMute = ECamSettOff == audioRec;
 10334   
 10339   
       
 10340   TInt64 videoLimit =  KMaxTUint32; // 4G limit
 10335   // Video file size limit (MMS case)
 10341   // Video file size limit (MMS case)
 10336   TInt videoLimit = 0;
       
 10337   if( ECamVideoClipShort == level.VideoLength() )
 10342   if( ECamVideoClipShort == level.VideoLength() )
 10338     {
 10343     {
 10339     // Short video, needs to fit into MMS message
 10344     // Short video, needs to fit into MMS message
 10340     videoLimit = CamUtility::MaxMmsSizeInBytesL();  
 10345     videoLimit = CamUtility::MaxMmsSizeInBytesL();  
 10341     }
 10346     }
 10602 // ---------------------------------------------------------------------------
 10607 // ---------------------------------------------------------------------------
 10603 //
 10608 //
 10604 TInt CCamAppController::DriveChangeL( const TCamDriveChangeType aType )
 10609 TInt CCamAppController::DriveChangeL( const TCamDriveChangeType aType )
 10605   {
 10610   {
 10606   PRINT1( _L("Camera => CCamAppController::DriveChangeL aType: %d" ), aType );
 10611   PRINT1( _L("Camera => CCamAppController::DriveChangeL aType: %d" ), aType );
       
 10612   CCamAppUi* appUi = static_cast<CCamAppUi*>( CEikonEnv::Static()->AppUi() );
       
 10613   appUi->CheckMemoryAvailableForCapturing();
       
 10614   
 10607     
 10615     
 10608   TCamCameraMode mode = CurrentMode();
 10616   TCamCameraMode mode = CurrentMode();
 10609   TCamMediaStorage currentStorage;
 10617   TCamMediaStorage currentStorage;
 10610 		
 10618 		
 10611   // Photos and videos are saved onto the same media, so no need to 
 10619   // Photos and videos are saved onto the same media, so no need to 
 10622     
 10630     
 10623   if ( ECamMediaStoragePhone == iPreferredStorageLocation )
 10631   if ( ECamMediaStoragePhone == iPreferredStorageLocation )
 10624     {
 10632     {
 10625     PRINT( _L("Camera <> Phone memory is the preferred storage location. Nothing to be done here. Return KErrNone.") )
 10633     PRINT( _L("Camera <> Phone memory is the preferred storage location. Nothing to be done here. Return KErrNone.") )
 10626     PRINT( _L("Camera <= CCamAppController::DriveChangeL" ) );
 10634     PRINT( _L("Camera <= CCamAppController::DriveChangeL" ) );
 10627     return KErrNone;
 10635 
 10628     }
 10636     }
 10629    
 10637    
 10630   if  ( ( !IsMemoryAvailable( ECamMediaStorageCard, EFalse ) || 
 10638   if  ( ( !IsMemoryAvailable( ECamMediaStorageCard, EFalse ) || 
 10631           !IsMemoryAvailable( ECamMediaStorageMassStorage, EFalse ) ) ||
 10639           !IsMemoryAvailable( ECamMediaStorageMassStorage, EFalse ) ) ||
 10632         !IsMemoryAvailable( iPreferredStorageLocation, ETrue ) )
 10640         !IsMemoryAvailable( iPreferredStorageLocation, ETrue ) )
 10654     // Cancel if pending recording	
 10662     // Cancel if pending recording	
 10655     else if( iVideoRequested )
 10663     else if( iVideoRequested )
 10656       {
 10664       {
 10657       iVideoRequested = EFalse;
 10665       iVideoRequested = EFalse;
 10658       }
 10666       }
       
 10667     
       
 10668     if ( appUi->SelfTimerEnabled() && appUi->AllMemoriesFullOrUnavailable() )
       
 10669       {
       
 10670       PRINT( _L("Camera <> All storages full or unavailable. Cancel selftimer.") )
       
 10671       appUi->HandleCommandL( ECamCmdSelfTimerCancel );
       
 10672       }
       
 10673     
 10659     if ( SequenceCaptureInProgress() )
 10674     if ( SequenceCaptureInProgress() )
 10660       {
 10675       {
 10661       PRINT( _L("Camera <> Sequence capture in progress. -> Stop and skip postcapture.") )
 10676       PRINT( _L("Camera <> Sequence capture in progress. -> Stop and skip postcapture.") )
 10662             
 10677             
 10663       iCaptureStoppedForUsb = ETrue;
 10678       iCaptureStoppedForUsb = ETrue;
 10672       iDismountPending = ETrue;    
 10687       iDismountPending = ETrue;    
 10673       // Mass memory may be the forced storage location. Then it's necessary 
 10688       // Mass memory may be the forced storage location. Then it's necessary 
 10674       // to switch to (forced) phone memory
 10689       // to switch to (forced) phone memory
 10675       ForceUsePhoneMemoryL( ETrue ); 
 10690       ForceUsePhoneMemoryL( ETrue ); 
 10676       PRINT( _L("Camera <= CCamAppController::DriveChangeL dismount pending" ) );  	
 10691       PRINT( _L("Camera <= CCamAppController::DriveChangeL dismount pending" ) );  	
 10677       return KErrNotReady;
 10692 
 10678       }
 10693       }
 10679     else
 10694     else
 10680       {    	           
 10695       {    	           
 10681       // Mass memory may be the forced storage location. Then it's necessary 
 10696       // Mass memory may be the forced storage location. Then it's necessary 
 10682       // to switch to (forced) phone memory
 10697       // to switch to (forced) phone memory
 10683       ForceUsePhoneMemoryL( ETrue );
 10698       ForceUsePhoneMemoryL( ETrue );
 10684                 
       
 10685       // Make sure toolbar is visible
       
 10686       CCamAppUi* appUi = static_cast<CCamAppUi*>( 
       
 10687                                                 CEikonEnv::Static()->AppUi() );
       
 10688       CAknToolbar* fixedToolbar = appUi->CurrentFixedToolbar();
       
 10689       
       
 10690       if ( fixedToolbar && ECamNoOperation == CurrentOperation() )
       
 10691         {
       
 10692         fixedToolbar->SetToolbarVisibility( ETrue );
       
 10693         }
       
 10694         
       
 10695       PRINT( _L("Camera <= CCamAppController::DriveChangeL dismount ok" ) );  	    
 10699       PRINT( _L("Camera <= CCamAppController::DriveChangeL dismount ok" ) );  	    
 10696       return KErrNone;
 10700 
 10697       }        
 10701       }        
 10698     }
 10702     }
 10699   else if ( IsMemoryAvailable( iPreferredStorageLocation, ETrue ) &&
 10703   else if ( IsMemoryAvailable( iPreferredStorageLocation, ETrue ) &&
 10700             ( ECamMediaStorageCard == iPreferredStorageLocation ||
 10704             ( ECamMediaStorageCard == iPreferredStorageLocation ||
 10701               ECamMediaStorageMassStorage  == iPreferredStorageLocation ) )
 10705               ECamMediaStorageMassStorage  == iPreferredStorageLocation ) )
 10712       {
 10716       {
 10713       PRINT( _L("Camera <> !IsPhoneMemoryForced() -> No action.") )
 10717       PRINT( _L("Camera <> !IsPhoneMemoryForced() -> No action.") )
 10714       }
 10718       }
 10715     }
 10719     }
 10716   
 10720   
       
 10721   if( IntegerSettingValue(ECamSettingItemRemovePhoneMemoryUsage) )
       
 10722         {
       
 10723         if( aType == EDriveMount &&
       
 10724             !appUi->IsRecoverableStatus() )
       
 10725               {
       
 10726               SwitchToStandbyL( KErrNone );
       
 10727               }
       
 10728           else if( aType == EDriveDismount &&
       
 10729                   appUi->IsRecoverableStatus() )
       
 10730               {
       
 10731               TInt mmcInserted = 0;
       
 10732               User::LeaveIfError( RProperty::Get( KPSUidUikon, KUikMMCInserted, mmcInserted ) );
       
 10733               if( !IsMemoryAvailable(ECamMediaStorageMassStorage) &&
       
 10734                    !IsMemoryAvailable(ECamMediaStorageCard) )
       
 10735                   {
       
 10736                   if( mmcInserted )
       
 10737                       {
       
 10738                       SwitchToStandbyL( ECamErrMassStorageMode );
       
 10739 
       
 10740                       }
       
 10741                   else
       
 10742                       {
       
 10743                       SwitchToStandbyL( ECamErrMemoryCardNotInserted );
       
 10744 
       
 10745                       }
       
 10746                   }
       
 10747               }
       
 10748           else if ( aType == EDriveUSBMassStorageModeOn )
       
 10749               {
       
 10750               SwitchToStandbyL(ECamErrMassStorageMode);
       
 10751 
       
 10752               }
       
 10753           else if ( aType == EDriveUSBMassStorageModeOff )
       
 10754               {
       
 10755               SwitchToStandbyL( KErrNone );
       
 10756               }
       
 10757         }
       
 10758     
       
 10759 
 10717   PRINT( _L("Camera <= CCamAppController::DriveChangeL" ) );  	
 10760   PRINT( _L("Camera <= CCamAppController::DriveChangeL" ) );  	
 10718   return KErrNone;
 10761   return KErrNone;
 10719   }
 10762   }
 10720 
 10763 
 10721 // ---------------------------------------------------------------------------
 10764 // ---------------------------------------------------------------------------
 10993         {
 11036         {
 10994         iRotatorAo = CCamSyncRotatorAo::NewL( *this );
 11037         iRotatorAo = CCamSyncRotatorAo::NewL( *this );
 10995         }    
 11038         }    
 10996     iRotatorAo->RotateL( iRotatedSnapshot, MapCamOrientation2RotationAngle( iCaptureOrientation ) );
 11039     iRotatorAo->RotateL( iRotatedSnapshot, MapCamOrientation2RotationAngle( iCaptureOrientation ) );
 10997         
 11040         
 10998     CleanupStack::Pop( snapshot );
 11041     CleanupStack::PopAndDestroy(snapshot);
 10999     PRINT( _L( "Camera <= CCamAppController::RotateSnapshotL" ) );    
 11042     PRINT( _L( "Camera <= CCamAppController::RotateSnapshotL" ) );    
 11000     } 
 11043     } 
 11001     
 11044     
 11002 // ---------------------------------------------------------------------------
 11045 // ---------------------------------------------------------------------------
 11003 // CCamAppController::RotationCompleteL
 11046 // CCamAppController::RotationCompleteL
 11014         {
 11057         {
 11015         iRotationArray->ReplaceSnapshot( iRotatedSnapshot, 0 );
 11058         iRotationArray->ReplaceSnapshot( iRotatedSnapshot, 0 );
 11016         }
 11059         }
 11017     TRAP_IGNORE( iImageSaveActive->CreateThumbnailsL( *iRotationArray ) );
 11060     TRAP_IGNORE( iImageSaveActive->CreateThumbnailsL( *iRotationArray ) );
 11018             
 11061             
       
 11062     delete iRotatedSnapshot; 
       
 11063     iRotatedSnapshot = NULL;
 11019     PRINT( _L( "Camera <= CCamAppController::RotationCompleteL" ) );         
 11064     PRINT( _L( "Camera <= CCamAppController::RotationCompleteL" ) );         
 11020         }     
 11065     }     
 11021       
 11066       
 11022 // ---------------------------------------------------------------------------
 11067 // ---------------------------------------------------------------------------
 11023 // CCamAppController::StoreFaceTrackingValue
 11068 // CCamAppController::StoreFaceTrackingValue
 11024 // Calls CamSettingModel to save user defined FT setting
 11069 // Calls CamSettingModel to save user defined FT setting
 11025 // ---------------------------------------------------------------------------
 11070 // ---------------------------------------------------------------------------
 11128     
 11173     
 11129     if ( ECamControllerImage == iInfo.iMode && ECamActiveCameraPrimary == iInfo.iActiveCamera )
 11174     if ( ECamControllerImage == iInfo.iMode && ECamActiveCameraPrimary == iInfo.iActiveCamera )
 11130         {
 11175         {
 11131         PRINT( _L("Camera => CCamAppController::ToggleWideScreenQuality - image mode") );
 11176         PRINT( _L("Camera => CCamAppController::ToggleWideScreenQuality - image mode") );
 11132         TInt qualityIndex = IntegerSettingValue( ECamSettingItemPhotoQuality );
 11177         TInt qualityIndex = IntegerSettingValue( ECamSettingItemPhotoQuality );
 11133         if ( qualityIndex <= ECamImageQualityPrintW9m )
 11178         if ( qualityIndex <= EImageQualityPrint )
 11134             {
 11179             {
 11135             TCamPhotoQualitySetting imageQuality = iConfiguration->ImageQuality( qualityIndex );
 11180             if ( ( qualityIndex == EImageQualityPrintHigh &&  aWide )  
 11136             if ( ( imageQuality.iPhotoResolution == EImageResolution12MP &&  aWide ) || 
 11181                  || ( qualityIndex == EImageQualityPrint && !aWide ) )
 11137                  ( imageQuality.iPhotoResolution == EImageResolutionW9MP && !aWide ) )
       
 11138                 {
 11182                 {
 11139                 qualityIndex = (ECamImageQualityPrintW9m==qualityIndex) ? ECamImageQualityPrint12m 
 11183                 qualityIndex = (EImageQualityPrint==qualityIndex) ? EImageQualityPrintHigh 
 11140                                                                         : ECamImageQualityPrintW9m;
 11184                                                                   : EImageQualityPrint;
 11141 
 11185 
 11142                 // Ensure that the setting value is enabled/usable.
 11186                 // Ensure that the setting value is enabled/usable.
 11143                 if ( iSettingsModel->SettingValueEnabled( ECamSettingItemPhotoQuality, qualityIndex ) )
 11187                 if ( iSettingsModel->SettingValueEnabled( ECamSettingItemPhotoQuality, qualityIndex ) )
 11144                     {
 11188                     {
 11145                     SetIntegerSettingValueL( ECamSettingItemPhotoQuality, qualityIndex );
 11189                     SetIntegerSettingValueL( ECamSettingItemPhotoQuality, qualityIndex );
 11188 //
 11232 //
 11189 TBool CCamAppController::IsSaveStarted()
 11233 TBool CCamAppController::IsSaveStarted()
 11190     {
 11234     {
 11191     return iSaveStarted;    
 11235     return iSaveStarted;    
 11192     }
 11236     }
       
 11237 
       
 11238 // ---------------------------------------------------------------------------
       
 11239 // CCamAppController::SwitchToStandby
       
 11240 // 
       
 11241 // ---------------------------------------------------------------------------
       
 11242 //
       
 11243 void CCamAppController::SwitchToStandbyL( TInt aStatus )
       
 11244     {
       
 11245     PRINT( _L("Camera => CCamAppController::SwitchToStandbyL") );
       
 11246     CCamAppUi* appUi = static_cast<CCamAppUi*>( CEikonEnv::Static()->AppUi() );
       
 11247     __ASSERT_DEBUG( appUi, CamPanic( ECamPanicNullPointer ) );
       
 11248     if( !appUi->ChangeStandbyStatusL(aStatus) )
       
 11249         {
       
 11250         SetOperation( ECamStandby, aStatus );
       
 11251         iIdleTimer->Cancel();
       
 11252 
       
 11253         // Use backlight timer also with bitmap vf
       
 11254         if( iBacklightTimer )
       
 11255             {
       
 11256             if( ECamTriActive == iCameraController->ViewfinderState() )
       
 11257                 {
       
 11258                 User::ResetInactivityTime();
       
 11259                 }
       
 11260             iBacklightTimer->Cancel();
       
 11261             }
       
 11262         }
       
 11263     switch( aStatus )
       
 11264         {
       
 11265         case ECamErrMassStorageMode:
       
 11266         case ECamErrMemoryCardNotInserted:
       
 11267             {
       
 11268             iCurrentStorage = static_cast<TCamMediaStorage>(IntegerSettingValueUnfiltered( ECamSettingItemPhotoMediaStorage ));
       
 11269             }
       
 11270             break;
       
 11271         default:
       
 11272             {
       
 11273             SetIntegerSettingValueL( ECamSettingItemPhotoMediaStorage, iCurrentStorage );
       
 11274             SetIntegerSettingValueL( ECamSettingItemVideoMediaStorage, iCurrentStorage );
       
 11275             }
       
 11276             break;
       
 11277         }
       
 11278     PRINT( _L("Camera <= CCamAppController::SwitchToStandbyL") );
       
 11279     }	
       
 11280 
       
 11281 // ---------------------------------------------------------------------------
       
 11282 // CCamAppController::IssueModeChangeSequenceSucceeded
       
 11283 // 
       
 11284 // ---------------------------------------------------------------------------
       
 11285 //
       
 11286 TBool CCamAppController::IssueModeChangeSequenceSucceeded()
       
 11287     {
       
 11288     return iIssueModeChangeSequenceSucceeded;
       
 11289     }
 11193 //  End of File  
 11290 //  End of File  
 11194 
 11291