camerauis/cameraapp/generic/src/CamSettingsModel.cpp
branchRCL_3
changeset 27 53c8aa5d97a3
parent 18 51dda465e618
equal deleted inserted replaced
25:bf64cebf4673 27:53c8aa5d97a3
  1219 // That is, it updates the rest of the photo dynamic setings.
  1219 // That is, it updates the rest of the photo dynamic setings.
  1220 // ---------------------------------------------------------------------------
  1220 // ---------------------------------------------------------------------------
  1221 //
  1221 //
  1222 void CCamSettingsModel::PhotoSceneHasChangedL( TInt aSceneId )
  1222 void CCamSettingsModel::PhotoSceneHasChangedL( TInt aSceneId )
  1223     {
  1223     {
       
  1224     PRINT( _L("Camera => CCamSettingsModel::PhotoSceneHasChangedL") )
  1224     // If the scene has changed to a scene other than the "User" scene
  1225     // If the scene has changed to a scene other than the "User" scene
  1225     // set capture setup values to defaults and the flash to scene flash.
  1226     // set capture setup values to defaults and the flash to scene flash.
  1226     if ( aSceneId != ECamSceneUser )
  1227     if ( aSceneId != ECamSceneUser )
  1227         {
  1228         {
  1228         // Set all the photo capture setup values to their defaults, except
  1229         // Set all the photo capture setup values to their defaults, except
  1253         SetIntegerSettingValueL( ECamSettingItemDynamicPhotoImageSharpness, sharpness );
  1254         SetIntegerSettingValueL( ECamSettingItemDynamicPhotoImageSharpness, sharpness );
  1254 
  1255 
  1255         // Set the user setup contrast to that of the new scene
  1256         // Set the user setup contrast to that of the new scene
  1256         TInt contrast = DefaultSettingValueForScene( aSceneId, ECamSettingItemSceneContrast );
  1257         TInt contrast = DefaultSettingValueForScene( aSceneId, ECamSettingItemSceneContrast );
  1257         SetIntegerSettingValueL( ECamSettingItemDynamicPhotoBrightness, contrast );
  1258         SetIntegerSettingValueL( ECamSettingItemDynamicPhotoBrightness, contrast );
  1258                  
  1259 
  1259 	    if ( iUiConfigManager->IsFaceTrackingSupported() ) // FT supported
  1260         // Update the engine with the scene settings.
  1260          {      
  1261         //UpdateEngineWithSceneSettingsL( iPhotoScenes, aSceneId );
  1261          if ( ECamSceneScenery == aSceneId ||
  1262         }
  1262               ECamSceneSports == aSceneId ||
  1263 
  1263               ECamSceneMacro == aSceneId)
  1264     // Otherwise, activate the user scene settings
       
  1265     else
       
  1266         {
       
  1267         ActivateUserSceneSettingsL();
       
  1268         }
       
  1269         
       
  1270       
       
  1271 	  if ( iUiConfigManager->IsFaceTrackingSupported() ) // FT supported
       
  1272         {
       
  1273         PRINT( _L("Camera <> Face tracking supported") ) 
       
  1274         if ( ECamSceneScenery == aSceneId ||
       
  1275              ECamSceneSports == aSceneId ||
       
  1276              ECamSceneMacro == aSceneId)
  1264             {
  1277             {
       
  1278             PRINT( _L("Camera <> New scene mode is scenery, sports or macro") )
  1265             if ( ECamSceneScenery != iPreviousSceneMode && 
  1279             if ( ECamSceneScenery != iPreviousSceneMode && 
  1266                  ECamSceneSports != iPreviousSceneMode &&
  1280                  ECamSceneSports != iPreviousSceneMode &&
  1267                  ECamSceneMacro != iPreviousSceneMode )
  1281                  ECamSceneMacro != iPreviousSceneMode )
  1268                {	
  1282                 {	
  1269                iPreviousFaceTrack = TCamSettingsOnOff( IntegerSettingValue( ECamSettingItemFaceTracking ) );	
  1283                 PRINT( _L("Camera <> Previous scene mode is not scenery, sports or macro -> Set iPreviousFaceTrack to current value") )
  1270                }
  1284                 iPreviousFaceTrack = TCamSettingsOnOff( IntegerSettingValue( ECamSettingItemFaceTracking ) );	
       
  1285                 }
       
  1286             PRINT( _L("Camera <> Switch face tracking OFF") )
  1271             SetIntegerSettingValueL( ECamSettingItemFaceTracking, ECamSettOff );	
  1287             SetIntegerSettingValueL( ECamSettingItemFaceTracking, ECamSettOff );	
  1272             }
  1288             }
  1273          else if ( ( ECamSceneScenery == iPreviousSceneMode ||
  1289         else if ( ( ECamSceneScenery == iPreviousSceneMode ||
  1274                      ECamSceneSports == iPreviousSceneMode ||
  1290                      ECamSceneSports == iPreviousSceneMode ||
  1275                      ECamSceneMacro == iPreviousSceneMode ) &&
  1291                      ECamSceneMacro == iPreviousSceneMode ) &&
  1276                    ( ECamSettOff == TCamSettingsOnOff( IntegerSettingValue( ECamSettingItemFaceTracking ) ) ) )
  1292                    ( ECamSettOff == TCamSettingsOnOff( IntegerSettingValue( ECamSettingItemFaceTracking ) ) ) )
  1277              {
  1293             {
  1278              SetIntegerSettingValueL( ECamSettingItemFaceTracking, iPreviousFaceTrack );
  1294             PRINT( _L("Camera <> Previous scene mode was scenery, sports or macro AND face tracking is OFF") )
  1279              iPreviousFaceTrack = TCamSettingsOnOff( IntegerSettingValue( ECamSettingItemFaceTracking ) );
  1295             PRINT( _L("Camera <> Set face tracking to iPreviousFaceTrack") )
  1280              CCamAppUiBase* appUi = static_cast<CCamAppUiBase*>( iEnv->AppUi() );
  1296             SetIntegerSettingValueL( ECamSettingItemFaceTracking, iPreviousFaceTrack );
  1281              TRAP_IGNORE( appUi->APHandler()->UpdateActivePaletteL() );
  1297             PRINT( _L("Camera <> Set iPreviousFaceTrack to current face tracking state") )
  1282              }
  1298             iPreviousFaceTrack = TCamSettingsOnOff( IntegerSettingValue( ECamSettingItemFaceTracking ) );
  1283          }              
  1299             CCamAppUiBase* appUi = static_cast<CCamAppUiBase*>( iEnv->AppUi() );
  1284 
  1300             TRAP_IGNORE( appUi->APHandler()->UpdateActivePaletteL() );
  1285         // Update the engine with the scene settings.
  1301             }
  1286         //UpdateEngineWithSceneSettingsL( iPhotoScenes, aSceneId );
  1302         }              
  1287         }
  1303           
  1288 
  1304 
  1289     // Otherwise, activate the user scene settings
       
  1290     else
       
  1291         {
       
  1292         ActivateUserSceneSettingsL();
       
  1293         }
       
  1294     iPreviousSceneMode = TCamSceneId( aSceneId ); // store scene mode setting
  1305     iPreviousSceneMode = TCamSceneId( aSceneId ); // store scene mode setting
       
  1306     PRINT( _L("Camera <= CCamSettingsModel::PhotoSceneHasChangedL()") )
  1295     }
  1307     }
  1296 
  1308 
  1297 // ---------------------------------------------------------------------------
  1309 // ---------------------------------------------------------------------------
  1298 // CCamSettingsModel::CopyUserSceneSettingToCaptureSettingL
  1310 // CCamSettingsModel::CopyUserSceneSettingToCaptureSettingL
  1299 // Copies a user scene setting across to the capture setup settings.
  1311 // Copies a user scene setting across to the capture setup settings.
  1601     {
  1613     {
  1602     PRINT( _L("Camera => CCamSettingsModel::StorePrimaryCameraSettingsL"))
  1614     PRINT( _L("Camera => CCamSettingsModel::StorePrimaryCameraSettingsL"))
  1603     iStaticModel->StorePrimaryCameraSettingsL();
  1615     iStaticModel->StorePrimaryCameraSettingsL();
  1604     CopySettingsL(iDynamicPhotoIntSettings, iDynamicPhotoIntSettingsBackup);
  1616     CopySettingsL(iDynamicPhotoIntSettings, iDynamicPhotoIntSettingsBackup);
  1605     CopySettingsL(iDynamicVideoIntSettings, iDynamicVideoIntSettingsBackup);
  1617     CopySettingsL(iDynamicVideoIntSettings, iDynamicVideoIntSettingsBackup);
       
  1618     PRINT( _L("Camera <= CCamSettingsModel::StorePrimaryCameraSettingsL"))
  1606     }
  1619     }
  1607 
  1620 
  1608 // ---------------------------------------------------------------------------
  1621 // ---------------------------------------------------------------------------
  1609 // CCamSettingsModel::RestorePrimaryCameraSettingsL
  1622 // CCamSettingsModel::RestorePrimaryCameraSettingsL
  1610 // Restores the primary camera settings when
  1623 // Restores the primary camera settings when
  2282    if ( ECamSceneScenery == activeScene ||
  2295    if ( ECamSceneScenery == activeScene ||
  2283         ECamSceneSports == activeScene ||
  2296         ECamSceneSports == activeScene ||
  2284         ECamSceneMacro == activeScene) 	
  2297         ECamSceneMacro == activeScene) 	
  2285       {
  2298       {
  2286       PRINT( _L("Camera <> CCamSettingsModel::StoreFaceTrackingValue(), Scenery or Sports mode" ) )		      	      	
  2299       PRINT( _L("Camera <> CCamSettingsModel::StoreFaceTrackingValue(), Scenery or Sports mode" ) )		      	      	
  2287       if ( iPreviousFaceTrack != TCamSettingsOnOff( IntegerSettingValue( ECamSettingItemFaceTracking ) ) )
  2300       SetIntegerSettingValueL( ECamSettingItemFaceTracking, iPreviousFaceTrack );   
  2288          {	
       
  2289          PRINT1( _L("Camera <> CCamSettingsModel::StoreFaceTrackingValue(), iPreviousFaceTrack [%d]" ), iPreviousFaceTrack )		      	      		
       
  2290          SetIntegerSettingValueL( ECamSettingItemFaceTracking, iPreviousFaceTrack );
       
  2291          }      	      	      
       
  2292       }
  2301       }
       
  2302       
       
  2303       
       
  2304       
  2293    PRINT( _L("Camera <= CamSettingsModel::StoreFaceTrackingValue()" ) )	
  2305    PRINT( _L("Camera <= CamSettingsModel::StoreFaceTrackingValue()" ) )	
  2294    }
  2306    }
  2295 
  2307 
  2296 // ---------------------------------------------------------------------------
  2308 // ---------------------------------------------------------------------------
  2297 // CCamSettingsModel::CopySettingsL
  2309 // CCamSettingsModel::CopySettingsL
  2383          }
  2395          }
  2384        }
  2396        }
  2385     
  2397     
  2386     PRINT( _L("Camera <= CCamSettingsModel::SetUserSceneDefault ") );
  2398     PRINT( _L("Camera <= CCamSettingsModel::SetUserSceneDefault ") );
  2387     }
  2399     }
       
  2400 
       
  2401 // ---------------------------------------------------------------------------
       
  2402 // CCamSettingsModel::GetPreviousFaceTrack
       
  2403 //
       
  2404 // Returns the face tracking state as it was before the latest scene mode change
       
  2405 // ---------------------------------------------------------------------------
       
  2406 //
       
  2407 TCamSettingsOnOff CCamSettingsModel::GetPreviousFaceTrack()
       
  2408     {
       
  2409     return iPreviousFaceTrack;
       
  2410     }
       
  2411     
       
  2412 // ---------------------------------------------------------------------------
       
  2413 // CCamSettingsModel::SetPreviousFaceTrack
       
  2414 // ---------------------------------------------------------------------------    
       
  2415 //
       
  2416 void CCamSettingsModel::SetPreviousFaceTrack( TCamSettingsOnOff aPreviousFaceTrack )
       
  2417     {
       
  2418     iPreviousFaceTrack = aPreviousFaceTrack;
       
  2419     }  
       
  2420     
       
  2421 // ---------------------------------------------------------------------------
       
  2422 // CCamSettingsModel::GetPreviousSceneMode
       
  2423 //
       
  2424 // Returns the scene mode that was in use before the current scene mode was selected
       
  2425 // ---------------------------------------------------------------------------    
       
  2426 //
       
  2427 TCamSceneId CCamSettingsModel::GetPreviousSceneMode()
       
  2428     {
       
  2429     return iPreviousSceneMode;
       
  2430     }
       
  2431     
       
  2432 // ---------------------------------------------------------------------------
       
  2433 // CCamSettingsModel::SetPreviousSceneMode
       
  2434 // ---------------------------------------------------------------------------    
       
  2435 //
       
  2436 void CCamSettingsModel::SetPreviousSceneMode( TCamSceneId aPreviousSceneMode )
       
  2437     {
       
  2438     iPreviousSceneMode = aPreviousSceneMode;
       
  2439     }      
       
  2440     
       
  2441     
  2388 // ===========================================================================
  2442 // ===========================================================================
  2389 // end of File  
  2443 // end of File