camerauis/cameraapp/generic/src/CamSettingsModel.cpp
changeset 2 e8773a61782d
parent 1 f5ec9446e5bf
child 12 8c55c525d5d7
--- a/camerauis/cameraapp/generic/src/CamSettingsModel.cpp	Mon Jan 18 20:06:55 2010 +0200
+++ b/camerauis/cameraapp/generic/src/CamSettingsModel.cpp	Tue Jan 26 11:44:00 2010 +0200
@@ -1445,21 +1445,31 @@
 // That is, it updates the rest of the video dynamic setings.
 // ---------------------------------------------------------------------------
 //
-void CCamSettingsModel::VideoSceneHasChangedL( TInt /*aSettingValue*/ )
+void CCamSettingsModel::VideoSceneHasChangedL( TInt aSettingValue )
     {
     // Set all the video capture setup values to their defaults,
     // except for the scene setting.
     TInt settingsCount = iDynamicVideoIntSettings.Count();
     TInt i;
     for ( i = 0; i < settingsCount; ++i )
+      {
+      //video light is used for LED flash not for xenon flash
+      if ( iDynamicVideoIntSettings[i]->iItemId == ECamSettingItemDynamicVideoFlash )
         {
-        // If the setting item is not the scene change it's value.
-        if ( iDynamicVideoIntSettings[i]->iItemId != ECamSettingItemDynamicVideoScene )
-            {
-            SetIntegerSettingValueL( iDynamicVideoIntSettings[i]->iItemId, 
-                iDynamicVideoIntDefaults[i] );
-            }
+        if ( iUiConfigManager->IsVideoLightSupported() && !iUiConfigManager->IsXenonFlashSupported() )
+          {
+          // Set the capture setup flash setting to that of the new scene.
+          TInt sceneFlash = DefaultSettingValueForVideoScene( aSettingValue, ECamSettingItemSceneFlashMode );      
+          SetIntegerSettingValueL( ECamSettingItemDynamicVideoFlash, sceneFlash );          
+          }
         }
+      // If the setting item is not the scene change it's value.
+      else if ( iDynamicVideoIntSettings[i]->iItemId != ECamSettingItemDynamicVideoScene ) 
+        {
+        SetIntegerSettingValueL( iDynamicVideoIntSettings[i]->iItemId, 
+              iDynamicVideoIntDefaults[i] );
+        }
+      }
 
     // Update the engine with the scene settings.
     //UpdateEngineWithSceneSettingsL( iVideoScenes, aSettingValue );
@@ -1467,6 +1477,22 @@
 
 
 // ---------------------------------------------------------------------------
+// CCamSettingsModel::DefaultSettingValueForVideoScene
+// Returns the default value of a setting for a video scene item.
+// ---------------------------------------------------------------------------
+//
+TInt CCamSettingsModel::DefaultSettingValueForVideoScene( TInt aSceneId, TInt aSettingId ) const
+    {
+    TInt sceneIndex = FindSceneInSceneList( aSceneId, iVideoScenes );
+   
+    TInt settingIndex = SearchInSettingsListFor( 
+        iVideoScenes[sceneIndex]->iSettings, aSettingId );
+    
+    return iVideoScenes[sceneIndex]->iSettings[settingIndex]->iValueId;
+    }
+
+
+// ---------------------------------------------------------------------------
 // CCamSettingsModel::PhotoSceneMaximumQuality
 // Returns the highest allowed quality for the current photo scene.
 // ---------------------------------------------------------------------------