camerauis/cameraxui/cxengine/src/cxezoomcontrolsymbian.cpp
changeset 43 0e652f8f1fbd
parent 28 3075d9b614e6
child 45 24fd82631616
equal deleted inserted replaced
28:3075d9b614e6 43:0e652f8f1fbd
     1 /*
     1 /*
     2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
     2 * Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies).
     3 * All rights reserved.
     3 * All rights reserved.
     4 * This component and the accompanying materials are made available
     4 * This component and the accompanying materials are made available
     5 * under the terms of "Eclipse Public License v1.0"
     5 * under the terms of "Eclipse Public License v1.0"
     6 * which accompanies this distribution, and is available
     6 * which accompanies this distribution, and is available
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
   207     OstTrace0(camerax_performance, CXEZOOMCONTROLSYMBIAN_PREPAREVIDEO_IN, "msg: e_CX_PREPARE_ZOOM 1");
   207     OstTrace0(camerax_performance, CXEZOOMCONTROLSYMBIAN_PREPAREVIDEO_IN, "msg: e_CX_PREPARE_ZOOM 1");
   208 
   208 
   209     if (mCameraDeviceControl.state() == CxeCameraDeviceControl::Ready) {
   209     if (mCameraDeviceControl.state() == CxeCameraDeviceControl::Ready) {
   210         init();
   210         init();
   211         // if CxeCameraDeviceControl is ready, this pointer is valid
   211         // if CxeCameraDeviceControl is ready, this pointer is valid
   212         CX_ASSERT_ALWAYS(mCameraDevice.advancedSettings())
   212         CX_ASSERT_ALWAYS(mCameraDevice.advancedSettings());
   213         int error = KErrNone;
   213         int error = KErrNone;
   214         TRAP(error,
   214         TRAP(error,
   215                 mCameraDevice.advancedSettings()->GetDigitalZoomStepsL(mDigitalZoomValues, mDigitalZoomValueInfo);
   215                 mCameraDevice.advancedSettings()->GetDigitalZoomStepsL(mDigitalZoomValues, mDigitalZoomValueInfo);
   216             );
   216             );
   217 
   217 
   254         if ( (mMaxZoomLevel == NOT_DEFINED) || mMaxZoomLevel > cameraInfo.iMaxDigitalZoom) {
   254         if ( (mMaxZoomLevel == NOT_DEFINED) || mMaxZoomLevel > cameraInfo.iMaxDigitalZoom) {
   255             CX_DEBUG(("Fetching maximum zoom limit value from ecam"));
   255             CX_DEBUG(("Fetching maximum zoom limit value from ecam"));
   256             mMaxZoomLevel = cameraInfo.iMaxDigitalZoom;
   256             mMaxZoomLevel = cameraInfo.iMaxDigitalZoom;
   257         }
   257         }
   258         // change the state, since zoom is now ready
   258         // change the state, since zoom is now ready
   259         setState(Ready, KErrNone);
   259         setState(Ready);
   260 
   260 
   261         mCameraDevice.advancedSettings()->SetDigitalZoom(mDigitalZoomValues[mCurrentZoomLevel]);
   261         mCameraDevice.advancedSettings()->SetDigitalZoom(mDigitalZoomValues[mCurrentZoomLevel]);
   262 
   262 
   263         // emit the zoom changed signal so that clients can do any updates if necessary.
   263         // emit the zoom changed signal so that clients can do any updates if necessary.
   264         emit zoomLevelChanged(mCurrentZoomLevel);
   264         emit zoomLevelChanged(mCurrentZoomLevel);