camerauis/cameraapp/generic/src/CamAppui.cpp
branchRCL_3
changeset 35 e32fcfe0045f
parent 31 8f559c47d7fd
child 49 289bbfdb6627
--- a/camerauis/cameraapp/generic/src/CamAppui.cpp	Wed Jun 09 09:21:41 2010 +0300
+++ b/camerauis/cameraapp/generic/src/CamAppui.cpp	Mon Jun 21 15:19:37 2010 +0300
@@ -1230,6 +1230,7 @@
         {
         iTargetMode = ECamControllerImage;
         }
+      SubmergeToolbar(); //Fix flickering when switching modes.
       TrySwitchViewL();
       
 
@@ -1410,6 +1411,7 @@
       iTargetMode = ECamControllerVideo;
       SetSuppressUIRiseOnViewfinderStart( EFalse );
       PRINT( _L("Camera => CCamAppUi::HandleCommandL Try switch to video mode"));
+      SubmergeToolbar();
       TrySwitchViewL();
       }
       break;
@@ -1872,6 +1874,28 @@
       }
       break;
     // -----------------------------------------------------
+    case ECamCmdRedrawVideoTime:
+      {
+      if( !iProcessingScreenRedraw && iView )
+        {
+        iProcessingScreenRedraw = ETrue;
+        iView->HandleCommandL(ECamCmdRedrawVideoTime);
+        iProcessingScreenRedraw = EFalse;
+        }
+      }
+      break;      
+    // -----------------------------------------------------
+    case ECamCmdRedrawZoom:
+      {
+      if( !iProcessingScreenRedraw && iView )
+        {
+        iProcessingScreenRedraw = ETrue;
+        iView->HandleCommandL(ECamCmdRedrawZoom);
+        iProcessingScreenRedraw = EFalse;
+        }
+      }
+      break;            
+    // -----------------------------------------------------
     case ECamCmdShootSetup: // fall through
     case ECamCmdFlash:      // fall through
     case ECamCmdAddAudio:   // fall through
@@ -3063,6 +3087,12 @@
         case EEventFocusGained:
           {            
           PRINT( _L("Camera <> CCamAppUi::HandleWsEventL: case EEventFocusGained") );
+          RAknUiServer* capServ = CAknSgcClient::AknSrv();
+          CleanupStack::PushL( TCleanupItem( CleanupBlankScreen, this ) );
+          if ( iPretendExit ) 
+            {
+            capServ->BlankScreen();
+            }
           iReturningFromPretendExit = iPretendExit; 
           
           TBool uiOverride = iController.UiConfigManagerPtr() && iController.UiConfigManagerPtr()->IsUIOrientationOverrideSupported();
@@ -3128,6 +3158,8 @@
                    StandbyStatus() == KErrInUse )
                   { 
                   // We call the base class and return
+                  capServ->UnblankScreen();
+                  CleanupStack::Pop();
                   CAknAppUi::HandleWsEventL( aEvent, aDestination );
                   return;
                   }
@@ -3143,6 +3175,8 @@
                       }
                   iPretendExit = EFalse; 	
                   // Go to standby with error	
+                  capServ->UnblankScreen();
+                  CleanupStack::Pop();
                   HandleStandbyEventL( KErrInUse );
                   // We call the base class and return
                   CAknAppUi::HandleWsEventL( aEvent, aDestination );
@@ -3197,6 +3231,8 @@
               {
               ActivateLocalViewL ( iViaPlayerUid );
               // We call the base class and return
+              capServ->UnblankScreen();
+              CleanupStack::Pop();
               CAknAppUi::HandleWsEventL( aEvent, aDestination );
               return;
               }
@@ -3214,6 +3250,8 @@
               // iPretendExit flag needs to be reset before returning, otherwise
               // views think we are still in exit state and will not reserve camera
               iPretendExit = EFalse;
+              capServ->UnblankScreen();
+              CleanupStack::Pop();
               CAknAppUi::HandleWsEventL( aEvent, aDestination );
               return;
               }
@@ -3235,6 +3273,8 @@
                   iTargetViewState = ECamViewStateSettings;
                   }
               TrySwitchViewL();
+              capServ->UnblankScreen();
+              CleanupStack::Pop();
               CAknAppUi::HandleWsEventL( aEvent, aDestination );
               return;
               }
@@ -3273,6 +3313,8 @@
           if ( memError && freeMemory < iController.UiConfigManagerPtr()->CriticalLevelRamMemoryFocusGained() )
               {
               PRINT( _L("Camera <> CCamAppUi::HandleWsEvent ECamEventFocusGained memory too low. Exiting") );
+              capServ->UnblankScreen();
+              CleanupStack::Pop();
               CloseAppL();
               PRINT( _L("Camera <= CCamAppUi::HandleWsEvent ECamEventFocusGained memory too low. Exiting") );
               return;
@@ -3302,6 +3344,8 @@
               // check if exit is required
               if ( iController.CheckExitStatus() )
                   {
+                  capServ->UnblankScreen();
+                  CleanupStack::Pop();
                   InternalExitL();
                   PRINT( _L("Camera <= CCamAppUi::HandleWsEventL, internal exit") )
                   return;
@@ -3400,7 +3444,8 @@
           if ( ECamViewStatePreCapture == iViewState &&
                ECamPreCapViewfinder == iPreCaptureMode && 
                ( !( iSelfTimer && iSelfTimer->IsActive() ) ) &&
-               iController.CurrentOperation() != ECamCapturing )  
+               iController.CurrentOperation() != ECamCapturing &&
+               iController.CurrentOperation() != ECamPaused )
             {
             SetToolbarVisibility(); 
             }          
@@ -3429,6 +3474,8 @@
                  }
               }
 
+          capServ->UnblankScreen();
+          CleanupStack::Pop();
           if (iStartupLogoController && iReturningFromPretendExit)
               {
               iStartupLogoController->ShowLogo();
@@ -3439,7 +3486,13 @@
         case EEventFocusLost:
           {
           PRINT( _L("Camera <> CCamAppUi::HandleWsEventL: case EEventFocusLost") );
-
+          // Stop VF early to reduce load
+          if( AppInBackground( EFalse )
+              && iViewState == ECamViewStatePreCapture
+              && iMode == ECamControllerVideo )
+              {
+              iController.StopViewFinder(); 
+              }
           //When go to background from video post caputure view, we need to hide the toolbar to avoid icons overlap
           if( AppInBackground( EFalse )
               && iViewState == ECamViewStatePostCapture
@@ -5468,6 +5521,7 @@
         {
         iStartupLogoController->ShowLogo();
         }
+    SubmergeToolbar(); //For preventing toolbar to show up when starting camera again.
 
     PRINT( _L("Camera <= CCamAppUi::InternalExitL") );
     OstTrace0( CAMERAAPP_PERFORMANCE_DETAIL, DUP_CCAMAPPUI_INTERNALEXITL, "e_CCamAppUi_InternalExitL 0" );
@@ -7121,7 +7175,7 @@
     
   if ( aRedraw && IsDirectViewfinderActive() )
         {
-        TRAP_IGNORE(HandleCommandL(ECamCmdRedrawScreen));
+        TRAP_IGNORE(HandleCommandL(ECamCmdRedrawZoom));
         }
   PRINT( _L("Camera <= CCamAppUi::ShowZoomPane" ))
     }
@@ -7147,7 +7201,7 @@
         
   if ( aRedraw && IsDirectViewfinderActive() )
         {
-        TRAP_IGNORE( HandleCommandL(ECamCmdRedrawScreen ) );
+        TRAP_IGNORE( HandleCommandL(ECamCmdRedrawZoom ) );
         }
   PRINT( _L("Camera <= CCamAppUi::HideZoomPane" ))
     }
@@ -8578,7 +8632,7 @@
     PRINT( _L("Camera <> call CCamAppController::LoadStaticSettingsL..") )
     iController.LoadStaticSettingsL( IsEmbedded() );
     
-    iInternalStorage = static_cast<TCamMediaStorage>(iController.IntegerSettingValue( ECamSettingItemPhotoMediaStorage ));
+    iInternalStorage = static_cast<TCamMediaStorage>(iController.IntegerSettingValueUnfiltered( ECamSettingItemPhotoMediaStorage ));
     // store the userscene settings
     iController.StoreUserSceneSettingsL();
 
@@ -8909,4 +8963,27 @@
     
     }
 
+// -----------------------------------------------------------------------------
+// CCamAppUi::NaviProgressBarModel 
+// -----------------------------------------------------------------------------
+//
+CCamNaviProgressBarModel* CCamAppUi::NaviProgressBarModel()
+    {
+    return iNaviProgressBarModel;    
+    }
+
+
+void CCamAppUi::CleanupBlankScreen( TAny* aAny )
+    {
+    PRINT(_L("Camera => CCamAppUi::CleanupBlankScreen."));
+    CCamAppUi* appui = static_cast<CCamAppUi*>( aAny );
+    RAknUiServer* capServ = CAknSgcClient::AknSrv();
+    if( capServ )
+        {
+        capServ->UnblankScreen();
+        appui->Exit();
+        }
+    PRINT(_L("Camera <= CCamAppUi::CleanupBlankScreen."));
+    }
+
 //  End of File