camerauis/cameraxui/cxengine/src/cxesettingscontrolsymbian.cpp
changeset 43 0e652f8f1fbd
parent 28 3075d9b614e6
child 45 24fd82631616
equal deleted inserted replaced
28:3075d9b614e6 43:0e652f8f1fbd
    17 
    17 
    18 #include <ecam.h>
    18 #include <ecam.h>
    19 #include <ecamadvsettings.h>
    19 #include <ecamadvsettings.h>
    20 #include <ecamimageprocessing.h>
    20 #include <ecamimageprocessing.h>
    21 #include <ecam/ecamconstants.h>
    21 #include <ecam/ecamconstants.h>
       
    22 #include <ecamfacetrackingcustomapi.h>
    22 
    23 
    23 #include <QString>
    24 #include <QString>
    24 #include <QVariant>
    25 #include <QVariant>
    25 
    26 
    26 #include "cxutils.h"
    27 #include "cxutils.h"
    28 #include "cxecameradevice.h"
    29 #include "cxecameradevice.h"
    29 #include "cxesettings.h"
    30 #include "cxesettings.h"
    30 #include "cxesettingsmappersymbian.h"
    31 #include "cxesettingsmappersymbian.h"
    31 #include "cxesettingscontrolsymbian.h"
    32 #include "cxesettingscontrolsymbian.h"
    32 
    33 
       
    34 #include "OstTraceDefinitions.h"
       
    35 #ifdef OST_TRACE_COMPILER_IN_USE
       
    36 #include "cxesettingscontrolsymbianTraces.h"
       
    37 #endif
       
    38 
       
    39 
    33 /*!
    40 /*!
    34 * Constructor
    41 * Constructor
    35 */
    42 */
    36 CxeSettingsControlSymbian::CxeSettingsControlSymbian(CxeCameraDevice &cameraDevice, CxeSettings &settings)
    43 CxeSettingsControlSymbian::CxeSettingsControlSymbian(CxeCameraDevice &cameraDevice, CxeSettings &settings)
    37     : mCameraDevice(cameraDevice),
    44     : mCameraDevice(cameraDevice),
    57 }
    64 }
    58 
    65 
    59 /*!
    66 /*!
    60 * Handle new setting value.
    67 * Handle new setting value.
    61 * New value is set to camera.
    68 * New value is set to camera.
       
    69 * \param settingId The id of the updated setting
       
    70 * \param newValue A new value for the updated setting
    62 */
    71 */
    63 void CxeSettingsControlSymbian::handleSettingValueChanged(const QString& settingId, QVariant newValue)
    72 void CxeSettingsControlSymbian::handleSettingValueChanged(const QString& settingId, QVariant newValue)
    64 {
    73 {
    65     CX_DEBUG_ENTER_FUNCTION();
    74     CX_DEBUG_ENTER_FUNCTION();
    66     if (settingId == CxeSettingIds::COLOR_TONE) {
    75     if (settingId == CxeSettingIds::COLOR_TONE) {
    77         updateBrightnessSetting(newValue);
    86         updateBrightnessSetting(newValue);
    78     } else if (settingId == CxeSettingIds::EXPOSURE_MODE) {
    87     } else if (settingId == CxeSettingIds::EXPOSURE_MODE) {
    79         updateExposureModeSetting(newValue);
    88         updateExposureModeSetting(newValue);
    80     } else if (settingId == CxeSettingIds::EV_COMPENSATION_VALUE) {
    89     } else if (settingId == CxeSettingIds::EV_COMPENSATION_VALUE) {
    81             updateExposureCompensationSetting(newValue);
    90             updateExposureCompensationSetting(newValue);
       
    91     } else if (settingId == CxeSettingIds::FACE_TRACKING) {
       
    92             updateFaceTrackingSetting(newValue);
    82     } else {
    93     } else {
    83         // do nothing
    94         // do nothing
    84     }
    95     }
    85 
    96 
    86     // Image mode specific
    97     // Image mode specific
    91 }
   102 }
    92 
   103 
    93 /*!
   104 /*!
    94 * Handle new scene being set.
   105 * Handle new scene being set.
    95 * Scene settings are checked and new values are set to camera.
   106 * Scene settings are checked and new values are set to camera.
    96 * @param scene New scene containing scene specific settings.
   107 * \param scene New scene containing scene specific settings.
    97 */
   108 */
    98 void CxeSettingsControlSymbian::handleSceneChanged(CxeScene& scene)
   109 void CxeSettingsControlSymbian::handleSceneChanged(CxeScene& scene)
    99 {
   110 {
   100     CX_DEBUG_ENTER_FUNCTION();
   111     CX_DEBUG_ENTER_FUNCTION();
       
   112     OstTrace0(camerax_performance, CXESETTINGSCONTROL_SCENE_1, "msg: e_CX_SCENE_SETTINGS_TO_CAMERA 1");
       
   113 
   101     CX_DEBUG(("CxeSettingsControlSymbian <> new scene [%s]",
   114     CX_DEBUG(("CxeSettingsControlSymbian <> new scene [%s]",
   102               scene[CxeSettingIds::SCENE_ID].value<QString>().toAscii().constData()));
   115               scene[CxeSettingIds::SCENE_ID].value<QString>().toAscii().constData()));
   103 
   116 
   104     foreach (const QString& settingId, scene.keys()) {
   117     foreach (const QString& settingId, scene.keys()) {
   105         handleSettingValueChanged(settingId, scene[settingId]);
   118         handleSettingValueChanged(settingId, scene[settingId]);
   106     }
   119     }
   107     CX_DEBUG_EXIT_FUNCTION();
   120 
   108 }
   121     OstTrace0(camerax_performance, CXESETTINGSCONTROL_SCENE_2, "msg: e_CX_SCENE_SETTINGS_TO_CAMERA 0");
   109 
   122     CX_DEBUG_EXIT_FUNCTION();
   110 
   123 }
   111 /*!
   124 
   112 *
   125 /*!
       
   126 * Update color tone setting value to the camera device
       
   127 * \param newValue A new value for the updated setting
   113 */
   128 */
   114 void CxeSettingsControlSymbian::updateColorToneSetting(QVariant newValue)
   129 void CxeSettingsControlSymbian::updateColorToneSetting(QVariant newValue)
   115 {
   130 {
   116     CX_DEBUG_ENTER_FUNCTION();
   131     CX_DEBUG_ENTER_FUNCTION();
   117 
   132 
   134 
   149 
   135     CX_DEBUG_EXIT_FUNCTION();
   150     CX_DEBUG_EXIT_FUNCTION();
   136 }
   151 }
   137 
   152 
   138 /*!
   153 /*!
   139 *
   154 * Update white balance setting value to the camera device
       
   155 * \param newValue A new value for the updated setting
   140 */
   156 */
   141 void CxeSettingsControlSymbian::updateWhiteBalanceSetting(QVariant newValue)
   157 void CxeSettingsControlSymbian::updateWhiteBalanceSetting(QVariant newValue)
   142 {
   158 {
   143     CX_DEBUG_ENTER_FUNCTION();
   159     CX_DEBUG_ENTER_FUNCTION();
   144     CX_DEBUG_ASSERT(mCameraDevice.camera());
   160     CX_DEBUG_ASSERT(mCameraDevice.camera());
   153 
   169 
   154     CX_DEBUG_EXIT_FUNCTION();
   170     CX_DEBUG_EXIT_FUNCTION();
   155 }
   171 }
   156 
   172 
   157 /*!
   173 /*!
   158 *
   174 * Update light sensitivity (ISO) setting value to the camera device
       
   175 * \param newValue A new value for the updated setting
   159 */
   176 */
   160 void CxeSettingsControlSymbian::updateLightSensitivitySetting(QVariant newValue)
   177 void CxeSettingsControlSymbian::updateLightSensitivitySetting(QVariant newValue)
   161 {
   178 {
   162     CX_DEBUG_ENTER_FUNCTION();
   179     CX_DEBUG_ENTER_FUNCTION();
   163     CX_ASSERT_ALWAYS(mCameraDevice.advancedSettings());
   180     CX_ASSERT_ALWAYS(mCameraDevice.advancedSettings());
   178 
   195 
   179     CX_DEBUG_EXIT_FUNCTION();
   196     CX_DEBUG_EXIT_FUNCTION();
   180 }
   197 }
   181 
   198 
   182 /*!
   199 /*!
   183 *
   200 * Update sharpness setting value to the camera device
       
   201 * \param newValue A new value for the updated setting
   184 */
   202 */
   185 void CxeSettingsControlSymbian::updateSharpnessSetting(QVariant newValue)
   203 void CxeSettingsControlSymbian::updateSharpnessSetting(QVariant newValue)
   186 {
   204 {
   187     CX_DEBUG_ENTER_FUNCTION();
   205     CX_DEBUG_ENTER_FUNCTION();
   188 
   206 
   208 
   226 
   209    CX_DEBUG_EXIT_FUNCTION();
   227    CX_DEBUG_EXIT_FUNCTION();
   210 }
   228 }
   211 
   229 
   212 /*!
   230 /*!
   213 *
   231 * Update contrast setting value to the camera device
       
   232 * \param newValue A new value for the updated setting
   214 */
   233 */
   215 void CxeSettingsControlSymbian::updateContrastSetting(QVariant newValue)
   234 void CxeSettingsControlSymbian::updateContrastSetting(QVariant newValue)
   216 {
   235 {
   217     CX_DEBUG_ENTER_FUNCTION();
   236     CX_DEBUG_ENTER_FUNCTION();
   218     CX_ASSERT_ALWAYS(mCameraDevice.imageProcessor());
   237     CX_ASSERT_ALWAYS(mCameraDevice.imageProcessor());
   231 
   250 
   232     CX_DEBUG_EXIT_FUNCTION();
   251     CX_DEBUG_EXIT_FUNCTION();
   233 }
   252 }
   234 
   253 
   235 /*!
   254 /*!
   236 *
   255 * Update brightness setting value to the camera device
       
   256 * \param newValue A new value for the updated setting
   237 */
   257 */
   238 void CxeSettingsControlSymbian::updateBrightnessSetting(QVariant newValue)
   258 void CxeSettingsControlSymbian::updateBrightnessSetting(QVariant newValue)
   239 {
   259 {
   240     CX_DEBUG_ENTER_FUNCTION();
   260     CX_DEBUG_ENTER_FUNCTION();
   241     CX_ASSERT_ALWAYS(mCameraDevice.imageProcessor());
   261     CX_ASSERT_ALWAYS(mCameraDevice.imageProcessor());
   254 
   274 
   255     CX_DEBUG_EXIT_FUNCTION();
   275     CX_DEBUG_EXIT_FUNCTION();
   256 }
   276 }
   257 
   277 
   258 /*!
   278 /*!
   259 *
   279 * Update Exposure mode to the camera device
       
   280 * \param newValue A new value for the updated setting
   260 */
   281 */
   261 void CxeSettingsControlSymbian::updateExposureModeSetting(QVariant newValue)
   282 void CxeSettingsControlSymbian::updateExposureModeSetting(QVariant newValue)
   262 {
   283 {
   263     CX_DEBUG_ENTER_FUNCTION();
   284     CX_DEBUG_ENTER_FUNCTION();
   264     CX_DEBUG_ASSERT(mCameraDevice.advancedSettings());
   285     CX_DEBUG_ASSERT(mCameraDevice.advancedSettings());
   273 
   294 
   274     CX_DEBUG_EXIT_FUNCTION();
   295     CX_DEBUG_EXIT_FUNCTION();
   275 }
   296 }
   276 
   297 
   277 /*!
   298 /*!
   278 *
   299 * Update Exposure Compensation mode to the camera device
       
   300 * \param newValue A new value for the updated setting
   279 */
   301 */
   280 void CxeSettingsControlSymbian::updateExposureCompensationSetting(QVariant newValue)
   302 void CxeSettingsControlSymbian::updateExposureCompensationSetting(QVariant newValue)
   281 {
   303 {
   282     CX_DEBUG_ENTER_FUNCTION();
   304     CX_DEBUG_ENTER_FUNCTION();
   283     CX_ASSERT_ALWAYS(mCameraDevice.advancedSettings());
   305     CX_ASSERT_ALWAYS(mCameraDevice.advancedSettings());
   295 
   317 
   296     CX_DEBUG_EXIT_FUNCTION();
   318     CX_DEBUG_EXIT_FUNCTION();
   297 }
   319 }
   298 
   320 
   299 /*!
   321 /*!
   300 *
   322 * Update flash mode to the camera device
       
   323 * \param newValue A new value for the updated setting
   301 */
   324 */
   302 void CxeSettingsControlSymbian::updateFlashSetting(QVariant newValue)
   325 void CxeSettingsControlSymbian::updateFlashSetting(QVariant newValue)
   303 {
   326 {
   304     CX_DEBUG_ENTER_FUNCTION();
   327     CX_DEBUG_ENTER_FUNCTION();
   305     CX_ASSERT_ALWAYS(mCameraDevice.camera());
   328     CX_ASSERT_ALWAYS(mCameraDevice.camera());
   313     }
   336     }
   314 
   337 
   315     CX_DEBUG_EXIT_FUNCTION();
   338     CX_DEBUG_EXIT_FUNCTION();
   316 }
   339 }
   317 
   340 
       
   341 /*!
       
   342 * Update face tracking mode to the camera device
       
   343 * \param newValue A new value for the updated setting
       
   344 */
       
   345 void CxeSettingsControlSymbian::updateFaceTrackingSetting(QVariant newValue)
       
   346 {
       
   347     CX_DEBUG_ENTER_FUNCTION();
       
   348     MCameraFaceTracking *faceTracking = mCameraDevice.faceTracking();
       
   349     if(faceTracking) {
       
   350         TRAP_IGNORE(faceTracking->SetFaceTrackingL(newValue.toInt()));
       
   351     }
       
   352     CX_DEBUG_EXIT_FUNCTION();
       
   353 }
       
   354 
   318 // end of file
   355 // end of file