camerauis/cameraxui/cxengine/src/cxestillcapturecontrolsymbian.cpp
changeset 40 2922f70fca82
parent 39 c5025ea871a1
child 41 67457b2ffb33
--- a/camerauis/cameraxui/cxengine/src/cxestillcapturecontrolsymbian.cpp	Thu Jul 15 01:46:05 2010 +0300
+++ b/camerauis/cameraxui/cxengine/src/cxestillcapturecontrolsymbian.cpp	Thu Jul 15 01:49:11 2010 +0300
@@ -382,8 +382,9 @@
     return err;
 }
 
-/**
+/*!
  * Command to start image capture now.
+ * @sa handleCameraEvent
  */
 void CxeStillCaptureControlSymbian::capture()
 {
@@ -392,10 +393,10 @@
 
     // Start the image capture as fast as possible to minimize lag.
     // Check e.g. space available *after* this.
+    // Capture sound will be played when we receive "image capture event" from ECAM.
     mCameraDevice.camera()->CaptureImage();
 
     if (imagesLeft() > 0) {
-        mCaptureSoundPlayer->play();
         setState(Capturing);
 
         //! @todo: NOTE: This call may not stay here. It can move depending on the implementation for burst capture.
@@ -472,6 +473,23 @@
     CX_DEBUG_EXIT_FUNCTION();
 }
 
+/*!
+* Handle ECAM events.
+* Needed only for capture sound synchronization.
+* @param eventUid ECAM event id.
+* @param error Error code. KErrNone if operation has been successful.
+*/
+void CxeStillCaptureControlSymbian::handleCameraEvent(int eventUid, int error)
+{
+    if (eventUid == KUidECamEventImageCaptureEventUidValue && error == KErrNone) {
+        CX_DEBUG(("CxeStillCaptureControlSymbian::handleCameraEvent - image capture event"));
+        if (state() == CxeStillCaptureControl::Capturing) {
+            mCaptureSoundPlayer->play();
+        }
+    }
+}
+
+
 /**
  * handleImageData: Image data received from ECam
  */