camerauis/cameraapp/generic/src/CamSettingsModel.cpp
branchRCL_3
changeset 12 51dda465e618
parent 11 d486e5e3cc9a
child 16 53c8aa5d97a3
equal deleted inserted replaced
11:d486e5e3cc9a 12:51dda465e618
   454 // ---------------------------------------------------------------------------
   454 // ---------------------------------------------------------------------------
   455 //
   455 //
   456 TBool CCamSettingsModel::SettingValueEnabled( TInt aSettingItem, 
   456 TBool CCamSettingsModel::SettingValueEnabled( TInt aSettingItem, 
   457                                              TInt aSettingValue ) const
   457                                              TInt aSettingValue ) const
   458     {
   458     {
   459     TCamImageQualitySetting maxPhoto = static_cast<TCamImageQualitySetting>( iPhotoQualityLevels[iPhotoQualityLevels.Count() - 1].iPhotoResolution );
       
   460     // If the setting value is maximum photo size, and the current
       
   461     // scene is sports, then this setting value is disabled
       
   462     if ( ( aSettingItem == ECamSettingItemPhotoQuality ) && 
       
   463          ( aSettingValue == maxPhoto ) )
       
   464         {
       
   465         // If the current scene is sports, disable the option
       
   466         TCamSceneId scene = static_cast< TCamSceneId >
       
   467                ( IntegerSettingValue( ECamSettingItemDynamicPhotoScene ) );
       
   468         if ( scene == ECamSceneSports )
       
   469             {
       
   470             return EFalse;
       
   471             }
       
   472         // Otherwise, if the current scene is the user scene and
       
   473         // it is based on the 'Sports' scene then disable the option.
       
   474         else if ( scene == ECamSceneUser ) 
       
   475             {
       
   476             // ...Get the based on scene.
       
   477             TCamSceneId baseScene = static_cast< TCamSceneId >
       
   478                 ( IntegerSettingValue( ECamSettingItemUserSceneBasedOnScene ) );
       
   479             if ( baseScene == ECamSceneSports )
       
   480                 {
       
   481                 return EFalse;
       
   482                 }
       
   483             }
       
   484         else
       
   485             {
       
   486             // Otherwise, the option is enabled
       
   487             return ETrue;
       
   488             }       
       
   489         }
       
   490     // The high quality video setting is not supported if
   459     // The high quality video setting is not supported if
   491     // the second camera is enabled
   460     // the second camera is enabled
   492     else if ( aSettingItem == ECamSettingItemVideoQuality && 
   461     if ( aSettingItem == ECamSettingItemVideoQuality && 
   493               aSettingValue == ECamVideoQualityHigh &&
   462             aSettingValue == ECamVideoQualityHigh &&
   494               static_cast<CCamAppUiBase*>( 
   463             static_cast<CCamAppUiBase*>( 
   495                     iEnv->AppUi() )->IsSecondCameraEnabled() )
   464             iEnv->AppUi() )->IsSecondCameraEnabled() )
   496         {
   465         {
   497         return EFalse;
   466         return EFalse;
   498         }
   467         }
   499     // All other setting item values are allowed
   468     // All other setting item values are allowed
   500     else 
       
   501         {
       
   502         return ETrue;
       
   503         }
       
   504 
       
   505     return ETrue;
   469     return ETrue;
   506     }
   470     }
   507 
   471 
   508 
   472 
   509 
   473