camerauis/cameraxui/cxui/src/cxuistillprecaptureview.cpp
changeset 24 2094593137f5
parent 21 fa6d9f75d6a6
child 29 699651f2666f
equal deleted inserted replaced
21:fa6d9f75d6a6 24:2094593137f5
   354     if (!mEngine->autoFocusControl().supported()) {
   354     if (!mEngine->autoFocusControl().supported()) {
   355         // autofocus is not supported, so start capturing straight away
   355         // autofocus is not supported, so start capturing straight away
   356         capture();
   356         capture();
   357     } else {
   357     } else {
   358         // start focusing
   358         // start focusing
   359         handleAutofocusKeyPressed();
   359         // Auto-focus can only work if viewfinder is running
       
   360         if (mEngine->viewfinderControl().state() == CxeViewfinderControl::Running) {
       
   361             mEngine->autoFocusControl().start(false);
       
   362         }
   360         setCapturePending();
   363         setCapturePending();
   361     }
   364     }
   362 
   365 
   363     CX_DEBUG_EXIT_FUNCTION();
   366     CX_DEBUG_EXIT_FUNCTION();
   364 }
   367 }
   368     CX_DEBUG_ENTER_FUNCTION();
   371     CX_DEBUG_ENTER_FUNCTION();
   369     mCapturePending = false;
   372     mCapturePending = false;
   370 
   373 
   371     if (mEngine->mode() == Cxe::ImageMode) {
   374     if (mEngine->mode() == Cxe::ImageMode) {
   372         // do not start capturing, if it is already ongoing
   375         // do not start capturing, if it is already ongoing
   373         // the user might be repeatly triggering capture key
   376         // the user might be repeatedly triggering capture key
   374         if (mEngine->stillCaptureControl().state() == CxeStillCaptureControl::Ready) {
   377         if (mEngine->stillCaptureControl().state() == CxeStillCaptureControl::Ready) {
   375             // If focusing in progress, cancel it now.
   378             // If focusing in progress, cancel it now.
   376             // Set capture pending and continue once focusing is cancelled.
   379             // Set capture pending and continue once focusing is cancelled.
   377             if(mEngine->autoFocusControl().state() == CxeAutoFocusControl::InProgress) {
   380             if(mEngine->autoFocusControl().state() == CxeAutoFocusControl::InProgress) {
   378                 mEngine->autoFocusControl().cancel();
   381                 mEngine->autoFocusControl().cancel();
   392         }
   395         }
   393     }
   396     }
   394 
   397 
   395     // after capturing check what is the new amount for images left
   398     // after capturing check what is the new amount for images left
   396     updateImagesLeftLabel();
   399     updateImagesLeftLabel();
   397 
       
   398     CX_DEBUG_EXIT_FUNCTION();
   400     CX_DEBUG_EXIT_FUNCTION();
   399 }
   401 }
   400 
   402 
   401 void CxuiStillPrecaptureView::setCapturePending()
   403 void CxuiStillPrecaptureView::setCapturePending()
   402 {
   404 {