camerauis/cameraxui/cxengine/src/cxeautofocuscontrolsymbian.cpp
changeset 46 c826656d6714
parent 40 2922f70fca82
child 52 7e18d488ac5f
equal deleted inserted replaced
42:feebad15db8c 46:c826656d6714
   399 
   399 
   400 
   400 
   401 /*
   401 /*
   402 * Image Scene mode changed, get the new autofocus value
   402 * Image Scene mode changed, get the new autofocus value
   403 */
   403 */
   404 void CxeAutoFocusControlSymbian::handleSceneChanged(CxeScene& scene)
   404 void CxeAutoFocusControlSymbian::handleSceneChanged(const QVariant& sceneData)
   405 {
   405 {
   406     CX_DEBUG_ENTER_FUNCTION();
   406     CX_DEBUG_ENTER_FUNCTION();
   407 
   407 
       
   408     CxeScene scene = sceneData.value<CxeScene>();
   408     // whenever scene mode is changed we set the state to unknown
   409     // whenever scene mode is changed we set the state to unknown
   409     setState(CxeAutoFocusControl::Unknown);
   410     setState(CxeAutoFocusControl::Unknown);
   410 
   411 
   411     // we are interested only in the AF range.
   412     // we are interested only in the AF range.
   412     if(scene.contains(CxeSettingIds::FOCAL_RANGE) && supported() ) {
   413     if(scene.contains(CxeSettingIds::FOCAL_RANGE) && supported() ) {
   440 
   441 
   441             CX_DEBUG(("CxeAutoFocusControlSymbian::handleAfEvent <> KUidECamEventCameraSettingsOptimalFocus"));
   442             CX_DEBUG(("CxeAutoFocusControlSymbian::handleAfEvent <> KUidECamEventCameraSettingsOptimalFocus"));
   442             if (KErrNone == error) {
   443             if (KErrNone == error) {
   443                 setState(CxeAutoFocusControl::Ready);
   444                 setState(CxeAutoFocusControl::Ready);
   444             } else {
   445             } else {
   445                 setState(CxeAutoFocusControl::Failed, error);
   446                 setState(CxeAutoFocusControl::Failed, CxeErrorHandlingSymbian::map(error));
   446             }
   447             }
   447          } else if (eventUid == KUidECamEventCameraSettingFocusRangeUidValue) {
   448          } else if (eventUid == KUidECamEventCameraSettingFocusRangeUidValue) {
   448              // check for error, we don't need this event for anything else
   449              // check for error, we don't need this event for anything else
   449              if (error != KErrNone) {
   450              if (error != KErrNone) {
   450                  CX_DEBUG(("CxeAutofocusControlSymbian::handleAfEvent <> "
   451                  CX_DEBUG(("CxeAutofocusControlSymbian::handleAfEvent <> "
   451                          "KUidECamEventCameraSettingFocusRangeUidValue: autofocus failed %d", error));
   452                          "KUidECamEventCameraSettingFocusRangeUidValue: autofocus failed %d", error));
   452                  setState(CxeAutoFocusControl::Failed, error);
   453                  setState(CxeAutoFocusControl::Failed, CxeErrorHandlingSymbian::map(error));
   453              }
   454              }
   454          }
   455          }
   455          break;
   456          break;
   456         }
   457         }
   457     case CxeAutoFocusControl::Canceling: {
   458     case CxeAutoFocusControl::Canceling: {