36 class MCameraBuffer; |
36 class MCameraBuffer; |
37 class CxeStillImageSymbian; |
37 class CxeStillImageSymbian; |
38 class CxeImageDataQueue; |
38 class CxeImageDataQueue; |
39 class CxeImageDataQueueSymbian; |
39 class CxeImageDataQueueSymbian; |
40 class CxeViewfinderControl; |
40 class CxeViewfinderControl; |
|
41 class CxeSnapshotControl; |
41 class CxeSensorEventHandler; |
42 class CxeSensorEventHandler; |
42 class CxeCameraDeviceControl; |
43 class CxeCameraDeviceControl; |
43 class CxeAutoFocusControl; |
44 class CxeAutoFocusControl; |
44 class CxeSettings; |
45 class CxeSettings; |
45 class CxeQualityPresets; |
46 class CxeQualityPresets; |
57 |
58 |
58 public: // constructors |
59 public: // constructors |
59 |
60 |
60 CxeStillCaptureControlSymbian(CxeCameraDevice &cameraDevice, |
61 CxeStillCaptureControlSymbian(CxeCameraDevice &cameraDevice, |
61 CxeViewfinderControl &viewfinderControl, |
62 CxeViewfinderControl &viewfinderControl, |
|
63 CxeSnapshotControl &snapshotControl, |
62 CxeCameraDeviceControl &cameraDeviceControl, |
64 CxeCameraDeviceControl &cameraDeviceControl, |
63 CxeFilenameGenerator &nameGenerator, |
65 CxeFilenameGenerator &nameGenerator, |
64 CxeSensorEventHandler &sensorEventHandler, |
66 CxeSensorEventHandler &sensorEventHandler, |
65 CxeAutoFocusControl &autoFocusControl, |
67 CxeAutoFocusControl &autoFocusControl, |
66 CxeSettings &settings, |
68 CxeSettings &settings, |
91 signals: |
93 signals: |
92 void imagePrepareComplete(CxeError::Id error); |
94 void imagePrepareComplete(CxeError::Id error); |
93 void prepareZoomForStill(int ecamStillResolutionIndex); |
95 void prepareZoomForStill(int ecamStillResolutionIndex); |
94 |
96 |
95 protected: // from CxeStateMachine |
97 protected: // from CxeStateMachine |
96 void handleStateChanged( int newStateId, CxeError::Id error ); |
98 void handleStateChanged(int newStateId, CxeError::Id error); |
97 |
99 |
98 |
100 |
99 protected slots: |
101 protected slots: |
100 // notifications when camera reference is changed |
102 // notifications when camera reference is changed |
101 void prepareForCameraDelete(); |
103 void prepareForCameraDelete(); |
102 void handleCameraAllocated(CxeError::Id error); |
104 void handleCameraAllocated(CxeError::Id error); |
103 |
105 |
104 // notification for when camera is released |
106 // notification for when camera is released |
105 void prepareForRelease(); |
107 void prepareForRelease(); |
106 |
108 |
107 // ECam events |
109 // ECAM events |
108 void handleCameraEvent( int eventUid, int error ); |
110 void handleCameraEvent(int eventUid, int error); |
109 void handleImageData( MCameraBuffer *buffer, int error ); |
111 |
|
112 // Image data event |
|
113 void handleImageData(MCameraBuffer *buffer, int error); |
|
114 |
|
115 // Snapshot event |
|
116 void handleSnapshotReady(CxeError::Id status, const QImage &snapshot); |
110 |
117 |
111 // settings call back |
118 // settings call back |
112 void handleSettingValueChanged(const QString& settingId,QVariant newValue); |
119 void handleSettingValueChanged(const QString& settingId,QVariant newValue); |
113 |
120 |
114 // Disk space change |
121 // Disk space change |
126 void setOrientation(QVariant sensorData); |
133 void setOrientation(QVariant sensorData); |
127 CxeStillImageSymbian* getImageForIndex(int index); |
134 CxeStillImageSymbian* getImageForIndex(int index); |
128 CCamera::TFormat supportedStillFormat(Cxe::CameraIndex cameraIndex); |
135 CCamera::TFormat supportedStillFormat(Cxe::CameraIndex cameraIndex); |
129 int prepareStillSnapshot(); |
136 int prepareStillSnapshot(); |
130 CxeError::Id getImageQualityDetails(CxeImageDetails &imageInfo); |
137 CxeError::Id getImageQualityDetails(CxeImageDetails &imageInfo); |
131 TSize getSnapshotSize() const; |
|
132 void handleSnapshotEvent(CxeError::Id error); |
138 void handleSnapshotEvent(CxeError::Id error); |
133 QPixmap extractSnapshot(); |
|
134 void initializeStates(); |
139 void initializeStates(); |
135 void prepare(); |
140 void prepare(); |
136 void updateRemainingImagesCounter(); |
141 void updateRemainingImagesCounter(); |
137 int calculateRemainingImages(int estimatedImagesize); |
142 int calculateRemainingImages(int estimatedImagesize); |
138 |
143 |
139 private: // private data |
144 private: // private data |
140 |
145 |
141 CxeImageDataQueueSymbian *mImageDataQueue; // own |
146 CxeImageDataQueueSymbian *mImageDataQueue; // own |
142 CxeCameraDevice &mCameraDevice; |
147 CxeCameraDevice &mCameraDevice; |
143 CxeViewfinderControl &mViewfinderControl; |
148 CxeViewfinderControl &mViewfinderControl; |
|
149 CxeSnapshotControl &mSnapshotControl; |
144 CxeCameraDeviceControl &mCameraDeviceControl; |
150 CxeCameraDeviceControl &mCameraDeviceControl; |
145 CxeFilenameGenerator &mFilenameGenerator; //! @todo could be shared with video capture control? |
151 CxeFilenameGenerator &mFilenameGenerator; //! @todo could be shared with video capture control? |
146 CxeSensorEventHandler &mSensorEventHandler; |
152 CxeSensorEventHandler &mSensorEventHandler; |
147 CxeAutoFocusControl &mAutoFocusControl; |
153 CxeAutoFocusControl &mAutoFocusControl; |
148 CxeSettings &mSettings; |
154 CxeSettings &mSettings; |
160 QList<CxeImageDetails> mIcmSupportedImageResolutions; |
166 QList<CxeImageDetails> mIcmSupportedImageResolutions; |
161 //still resolutions supported by ecam |
167 //still resolutions supported by ecam |
162 QList<TSize> mECamSupportedImageResolutions; |
168 QList<TSize> mECamSupportedImageResolutions; |
163 //current image quality details in use |
169 //current image quality details in use |
164 CxeImageDetails mCurrentImageDetails; |
170 CxeImageDetails mCurrentImageDetails; |
165 |
|
166 private: // Helper class |
|
167 |
|
168 class CxeCameraBufferCleanup |
|
169 { |
|
170 public: |
|
171 CxeCameraBufferCleanup(MCameraBuffer* buffer) : mBuffer(buffer) {} |
|
172 ~CxeCameraBufferCleanup() { if (mBuffer) { mBuffer->Release(); } } |
|
173 |
|
174 private: |
|
175 Q_DISABLE_COPY(CxeCameraBufferCleanup) |
|
176 |
|
177 MCameraBuffer* mBuffer; |
|
178 }; |
|
179 }; |
171 }; |
180 |
172 |
181 #endif // CXESTILLCAPTURECONTROLSYMBIAN_H |
173 #endif // CXESTILLCAPTURECONTROLSYMBIAN_H |