|
1 /* |
|
2 * Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: Class for managing intercommunication between Camcera UI* |
|
15 */ |
|
16 |
|
17 |
|
18 #ifndef CAMAPPCONTROLLER_H |
|
19 #define CAMAPPCONTROLLER_H |
|
20 |
|
21 |
|
22 // =========================================================================== |
|
23 // INCLUDES |
|
24 #include <e32base.h> |
|
25 |
|
26 #include <cflistener.h> // publish zoom state related |
|
27 #include <cfclient.h> |
|
28 |
|
29 #include <sensrvdatalistener.h> |
|
30 #include <sensrvchannel.h> |
|
31 #include <sensrvorientationsensor.h> |
|
32 |
|
33 #include "MCamAppController.h" |
|
34 #include "CamControllerObservers.h" |
|
35 #include "mcamsettingsmodelobserver.h" |
|
36 #include "CamSettings.hrh" |
|
37 #include "Cam.hrh" // TCamSoundId |
|
38 #include "CamSettingsInternal.hrh" |
|
39 |
|
40 #include "mcamplayerobserver.h" |
|
41 |
|
42 #include "CamImageSaveActive.h" |
|
43 #include "CamCallStateAo.h" |
|
44 #include "CamObserver.h" |
|
45 #include "CamBurstModeObserver.h" |
|
46 #include "CamPerformance.h" |
|
47 |
|
48 #ifndef __WINSCW__ |
|
49 #include <rlocationtrail.h> |
|
50 #endif |
|
51 |
|
52 #include "CamPropertyObserver.h" |
|
53 |
|
54 // <CAMERAAPP_CAPI_V2_MIGRATION> |
|
55 #include "mcamcameraobserver.h" |
|
56 #include "camcamerarequests.h" |
|
57 #include "camfolderutility.h" |
|
58 #include "camcameracontroller.h" |
|
59 #include "CamDriveChangeNotifier.h" |
|
60 #include "CamSyncRotatorAo.h" |
|
61 #include "camtvaccessorymonitor.h" |
|
62 |
|
63 // =========================================================================== |
|
64 // CONSTANTS |
|
65 |
|
66 // !Do not change the order of these without careful consideration! |
|
67 // |
|
68 enum TCamCameraState |
|
69 { |
|
70 ECamCameraIdle = 0, |
|
71 ECamCameraReserved = 1 << 0, |
|
72 ECamCameraPowerOn = 1 << 1, |
|
73 ECamCameraPreparedImage = 1 << 2, |
|
74 ECamCameraPreparedVideo = 1 << 3, |
|
75 ECamCameraStateLast // Not valid state, only marker |
|
76 }; |
|
77 |
|
78 /** |
|
79 * Flags for ongoing operations |
|
80 */ |
|
81 enum TCamBusyFlags |
|
82 { |
|
83 EBusyNone = 0, |
|
84 EBusyRequest = 1<<0, |
|
85 EBusySequence = 1<<1, |
|
86 EBusySetting = 1<<2, |
|
87 EBusyLast // Marker |
|
88 }; |
|
89 |
|
90 enum TCamHdmiEvent |
|
91 { |
|
92 ECamHdmiNoEvent, |
|
93 ECamHdmiCableConnectedBeforeRecording, |
|
94 ECamHdmiCableConnectedDuringRecording |
|
95 }; |
|
96 |
|
97 // =========================================================================== |
|
98 // FORWARD DECLARATIONS |
|
99 class CRepository; |
|
100 //class CCamSettingsModelBase; |
|
101 class MCamAppController; |
|
102 class MCamSettingsModel; |
|
103 class MCamSettingPreviewHandler; // <CAMERAAPP_CAPI_V2_MIGRATION/> |
|
104 //class CCamConstantSettingProvider; // <CAMERAAPP_CAPI_V2_MIGRATION/> |
|
105 class CCamSettingProvider; // <CAMERAAPP_CAPI_V2_MIGRATION/> |
|
106 class CCamTimer; |
|
107 class CCamObserverHandler; |
|
108 class CCamBurstCaptureArray; |
|
109 class CCamAudioPlayerController; |
|
110 class MCamStaticSettings; |
|
111 class CCamGSInterface; |
|
112 class CCameraUiConfigManager; |
|
113 class CCamPropertyWatcher; |
|
114 class CCamSnapShotRotator; |
|
115 |
|
116 |
|
117 class CCamFlashStatus; |
|
118 class CCamConfiguration; |
|
119 class CCFClient; |
|
120 |
|
121 // =========================================================================== |
|
122 // CLASS DECLARATION |
|
123 |
|
124 class TCamAppControllerInfo |
|
125 { |
|
126 public: |
|
127 TCamAppControllerInfo(); |
|
128 |
|
129 public: |
|
130 TCamActiveCamera iActiveCamera; |
|
131 |
|
132 TCamCameraMode iMode; |
|
133 TCamCameraMode iTargetMode; |
|
134 |
|
135 TCamImageCaptureMode iImageMode; // ECamImageCaptureNone in video controller mode |
|
136 TCamImageCaptureMode iTargetImageMode; |
|
137 |
|
138 TCamCaptureOperation iOperation; // Current operation |
|
139 |
|
140 // Target viewfinder state and mode |
|
141 TCamCameraTriState iTargetVfState; |
|
142 TBool iViewfinderMirror; // set when viewfinder initialized |
|
143 |
|
144 // Target image parameters |
|
145 TInt iTargetImageResolution; |
|
146 TInt iTargetImageQuality; |
|
147 |
|
148 // Target video parameters |
|
149 /** not supported yet */ |
|
150 |
|
151 // Request being handled |
|
152 TCamCameraRequestId iBusyRequestId; |
|
153 }; |
|
154 |
|
155 |
|
156 /** |
|
157 * Handle intercommunication between camcorder UI and engine. |
|
158 * |
|
159 * @since 2.8 |
|
160 */ |
|
161 class CCamAppController : public CBase, |
|
162 public MCamAppController, |
|
163 public MCamSettingsModelObserver, |
|
164 public MCamCameraObserver, |
|
165 public MCamImageSaveObserver, |
|
166 public MCamCallStateObserver, |
|
167 public MPropertyObserver, |
|
168 public MSensrvDataListener, |
|
169 public MCamPlayerObserver, |
|
170 public MCamObserver, |
|
171 public MCamBurstModeObserver, |
|
172 public MCFListener |
|
173 ,public MCamDriveChangeNotifierObserver |
|
174 ,public MBitmapRotationObserver, |
|
175 public MCamTvAccessoryObserver |
|
176 |
|
177 { |
|
178 public: // Constructors and destructor |
|
179 |
|
180 /** |
|
181 * Two-phased constructor. |
|
182 * @since 2.8 |
|
183 * @return pointer to the created CCamAppController object |
|
184 */ |
|
185 static CCamAppController* NewL(); |
|
186 |
|
187 |
|
188 /** |
|
189 * Complete construction of the engine and issue notification requests. |
|
190 * The camera engine cannot be instantiated until the application |
|
191 * orientation has been set by the CCamAppUi. This does not |
|
192 * exist when the CCamAppController is constructed. CompleteConstructionL |
|
193 * must be called in the CCamAppUi::ConstructL() |
|
194 * @since 3.0 |
|
195 */ |
|
196 void CompleteConstructionL(); |
|
197 |
|
198 |
|
199 /** |
|
200 * Destructor. |
|
201 * @since 2.8 |
|
202 */ |
|
203 virtual ~CCamAppController(); |
|
204 |
|
205 public: |
|
206 /** |
|
207 * Calls CamSettingModel to save user defined FT setting |
|
208 * @since S60 5.0 |
|
209 * @param None |
|
210 * @return None |
|
211 */ |
|
212 void StoreFaceTrackingValue(); |
|
213 |
|
214 // ------------------------------------------------------- |
|
215 // From MCamCameraObserver |
|
216 public: |
|
217 |
|
218 virtual void HandleCameraEventL( TInt aStatus, |
|
219 TCamCameraEventId aEventId, |
|
220 TAny* aEventData /*= NULL*/ ); |
|
221 |
|
222 |
|
223 |
|
224 // ------------------------------------------------------- |
|
225 // from MCamSettingsModelObserver |
|
226 public: |
|
227 |
|
228 virtual void IntSettingChangedL( TCamSettingItemIds aSettingItem, |
|
229 TInt aSettingValue ); |
|
230 virtual void TextSettingChangedL( TCamSettingItemIds aSettingItem, |
|
231 const TDesC& aSettingValue ); |
|
232 |
|
233 |
|
234 // ------------------------------------------------------- |
|
235 // from MCamBurstModeObserver |
|
236 |
|
237 /** |
|
238 * Burst mode activation has changed |
|
239 * @since 2.8 |
|
240 * @param aActive whether or not burst mode is active |
|
241 * @param aStillModeActive whether or not still capture is active |
|
242 */ |
|
243 virtual void BurstModeActiveL( TBool aActive, TBool aStillModeActive ); |
|
244 |
|
245 // ------------------------------------------------------- |
|
246 // from MCamAudioPlayerObserver |
|
247 virtual void PlayComplete( TInt aStatus, TInt aSoundId ); |
|
248 |
|
249 |
|
250 // ------------------------------------------------------- |
|
251 public: |
|
252 // From MCFListener ( Context framework for publishing zoom state. |
|
253 /** |
|
254 * Indicates a change in context for subscribed clients. |
|
255 * If client has subscribed to partial context class path, |
|
256 * only the changed context will be indicated. |
|
257 * |
|
258 * @since S60 4.0 |
|
259 * @param aIndication: Context indication. |
|
260 * @return None |
|
261 */ |
|
262 inline void ContextIndicationL( |
|
263 const CCFContextIndication& /*aChangedContext*/ ) {}; |
|
264 |
|
265 /** |
|
266 * Indicates that specified action is needed to be executed. |
|
267 * When action indication is received certain rule has been triggered |
|
268 * and action is needed to be performed. |
|
269 * |
|
270 * @since S60 4.0 |
|
271 * @param aActionToExecute Action indication. |
|
272 * @return None |
|
273 */ |
|
274 inline void ActionIndicationL( |
|
275 const CCFActionIndication& /*aActionToExecute*/ ) {}; |
|
276 |
|
277 /** |
|
278 * Indicates that error has occured. |
|
279 * @since S60 4.0 |
|
280 * @param aError Error code. |
|
281 * @return None |
|
282 */ |
|
283 inline void HandleContextFrameworkError( TCFError /*aError*/, |
|
284 const TDesC& /*aSource*/, |
|
285 const TDesC& /*aType*/ ){}; |
|
286 |
|
287 /** |
|
288 * Returns an extension interface. |
|
289 * The extension interface is mapped with the extension UID. |
|
290 * |
|
291 * If the client does not support the requested interface, |
|
292 * client must return NULL. Otherwise client needs to return |
|
293 * the correct interface combined with the UID. |
|
294 * |
|
295 * @since S60 5.0 |
|
296 * @param aExtensionUid: The identifier of the extension. |
|
297 * @return Pointer to the extension. |
|
298 */ |
|
299 inline TAny* Extension( const TUid& /*aExtensionUid*/ ) const { return NULL; }; |
|
300 |
|
301 // New Function |
|
302 |
|
303 /* |
|
304 * Method to publish the zoom key and setting the |
|
305 * value or the state to enabled or disabled. |
|
306 * @Paran aEnabled used to set the the state of zoom key |
|
307 * to be enabled or disabled. |
|
308 */ |
|
309 void PublishZoomStateL( const TBool aEnabled ); |
|
310 |
|
311 public: |
|
312 |
|
313 /** |
|
314 * Returns whether or not the current profile is silent |
|
315 * @since 3.0 |
|
316 * @return ETrue if current profile is silent |
|
317 */ |
|
318 TBool IsProfileSilent(); |
|
319 |
|
320 /** |
|
321 * Returns whether or not we have touch screen support in the device |
|
322 * @return ETrue if device supports touch screen |
|
323 */ |
|
324 TBool IsTouchScreenSupported(); |
|
325 |
|
326 /** |
|
327 * Returns whether or not we have direct screen viewfinder support in the device |
|
328 * @return ETrue if device supports direct screen viewfinder |
|
329 */ |
|
330 TBool IsDirectScreenVFSupported( TBool aPrimaryCamera = ETrue ); |
|
331 |
|
332 // --------------------------------------------------------------------------- |
|
333 //Helper function for making notification about deleted files |
|
334 //Added this method to do notification if files have been |
|
335 //deleted outside camera application and then camera is |
|
336 //put back to foreground in postcapture view. |
|
337 //Security note. Contents of the files might have been |
|
338 //changed when camera was in background. |
|
339 // --------------------------------------------------------------------------- |
|
340 // |
|
341 void MediaFileChangedNotification(); |
|
342 |
|
343 TBool EngineRequestsPending() const; |
|
344 /** |
|
345 * Set settings restore to be done at earliest |
|
346 * convenient time. |
|
347 */ |
|
348 void SetSettingsRestoreNeeded(); |
|
349 |
|
350 /** |
|
351 * Set the flag to indicate that the original values |
|
352 * of remaining images is stored |
|
353 */ |
|
354 void SetRemainingImageStored(); |
|
355 |
|
356 /** |
|
357 * Returns the flag that indicates if the original value |
|
358 * of remaing images is stored or not. |
|
359 */ |
|
360 TBool IsRemainingImageStored() const; |
|
361 |
|
362 /** |
|
363 * Return whether saving is still in progress. |
|
364 */ |
|
365 TBool IsSavingInProgress() const; |
|
366 |
|
367 /** |
|
368 * Return if settings restore is set pending. |
|
369 */ |
|
370 TBool IsSettingsRestoreNeeded() const; |
|
371 |
|
372 |
|
373 void RestartTimeLapseTimerL(); |
|
374 |
|
375 |
|
376 static TInt CamerasAvailable(); |
|
377 |
|
378 /** |
|
379 * Is time lapse supported. |
|
380 * Value read from Central Repository. |
|
381 */ |
|
382 TBool TimeLapseSupported(); |
|
383 |
|
384 /** |
|
385 * Is time lapse supported. |
|
386 * Value read from Central Repository. |
|
387 */ |
|
388 TBool AlwaysOnSupported(); |
|
389 |
|
390 /** |
|
391 * Release version number. |
|
392 * Value read from Central Repository. |
|
393 */ |
|
394 const TVersion& Version(); |
|
395 |
|
396 /*** |
|
397 * Can a new request be made to controller or not. |
|
398 * Shutdown may be requested at any moment. |
|
399 */ |
|
400 TBool Busy() const; |
|
401 |
|
402 /** |
|
403 * Returns true if the last captured image was saved |
|
404 * @since 2.8 |
|
405 * @return ETrue if the last captured image has been saved. |
|
406 */ |
|
407 TBool SavedCurrentImage() const; |
|
408 |
|
409 /** |
|
410 * Rename image/video. |
|
411 * @since 2.8 |
|
412 * @param aNewName the new name for the current capture array file. |
|
413 * @param aMode the current capture mode. |
|
414 * @return ETrue if the file has been renamed successfully. |
|
415 */ |
|
416 TBool RenameCurrentFileL( const TDesC& aNewName, |
|
417 const TCamCameraMode& aMode ); |
|
418 |
|
419 /** |
|
420 * Add a controller observer. |
|
421 * @since 2.8 |
|
422 * @param aObserver Pointer to an object implementing |
|
423 * MCamControllerObserver |
|
424 * @return ?description |
|
425 */ |
|
426 void AddControllerObserverL( const MCamControllerObserver* aObserver ); |
|
427 |
|
428 /** |
|
429 * Remove a controller observer |
|
430 * @since 2.8 |
|
431 * @param aObserver Pointer to the observer to remove. The object |
|
432 * does not have to be added as an observer. |
|
433 */ |
|
434 void RemoveControllerObserver |
|
435 ( const MCamControllerObserver* aObserver ); |
|
436 |
|
437 /** |
|
438 * Add camera observer. |
|
439 * Forwards call to CCamCameraController. |
|
440 * @see CCamCameraController for more details. |
|
441 */ |
|
442 void AddCameraObserverL( const MCamCameraObserver* aObserver, |
|
443 const TUint& aEventInterest ); |
|
444 |
|
445 /** |
|
446 * Removes camera observer. |
|
447 * Forwards call to CCamCameraController. |
|
448 * @see CCamCameraController for more details. |
|
449 */ |
|
450 void RemoveCameraObserver( const MCamCameraObserver* aObserver ); |
|
451 |
|
452 void AddSettingsObserverL( const MCamSettingsModelObserver* aObserver ); |
|
453 void RemoveSettingsObserver( const MCamSettingsModelObserver* aObserver ); |
|
454 |
|
455 TBool CameraControllerBusy() const; |
|
456 TUint CameraControllerState() const; |
|
457 |
|
458 TCamCameraState CameraState() const; |
|
459 TCamCameraMode CurrentMode() const; |
|
460 TCamCameraMode TargetMode() const; |
|
461 TCamImageCaptureMode CurrentImageModeSetup() const; |
|
462 TCamCaptureOperation CurrentOperation() const; |
|
463 TCamCaptureOperation CurrentImageOperation() const; |
|
464 TCamCaptureOperation CurrentVideoOperation() const; |
|
465 TCamImageCaptureMode CurrentImageMode() const; |
|
466 |
|
467 |
|
468 TInt CaptureLimit() const; |
|
469 TInt CaptureLimitSetting() const; |
|
470 void SetCaptureLimitL( TInt aLimit ); |
|
471 |
|
472 /** |
|
473 * From MBitmapRotationObserver |
|
474 * Notification of bitmap rotation complete events |
|
475 * @param aErr KErrNone if successful |
|
476 */ |
|
477 void RotationCompleteL( TInt aErr ); |
|
478 |
|
479 /** |
|
480 * From MCamTvaccessoryObserver |
|
481 * Handles TV Out/HDMI Cable connect Events |
|
482 */ |
|
483 void HandleTvAccessoryConnectedL(); |
|
484 |
|
485 /** |
|
486 * From MCamTvaccessoryObserver |
|
487 * Handles TV Out/HDMI Cable disconnect Events |
|
488 */ |
|
489 void HandleTvAccessoryDisconnectedL(); |
|
490 |
|
491 |
|
492 /** |
|
493 * Returns Etrue if HDMI Cable is connected |
|
494 */ |
|
495 TBool IsHdmiCableConnected(); |
|
496 |
|
497 |
|
498 /** |
|
499 * Called when exiting in secondary camera mode |
|
500 */ |
|
501 void HandleSecondaryCameraExitL(); |
|
502 |
|
503 private: |
|
504 void ReadVariantFlagsL(); |
|
505 |
|
506 |
|
507 void SetMode( const TCamCameraMode& aNewMode ); |
|
508 void SetTargetMode( const TCamCameraMode& aNewMode ); |
|
509 |
|
510 void SetImageMode( const TCamImageCaptureMode& aNewMode ); |
|
511 void SetTargetImageMode( const TCamImageCaptureMode& aNewMode ); |
|
512 |
|
513 void SetOperation( TCamCaptureOperation aNewOperation, |
|
514 TInt aError = KErrNone ); |
|
515 |
|
516 TCamCameraTriState ViewfinderTargetState() const; |
|
517 |
|
518 |
|
519 public: |
|
520 /* |
|
521 * Handle to Camera Ui Config Manager |
|
522 */ |
|
523 CCameraUiConfigManager* UiConfigManagerPtr(); |
|
524 |
|
525 /* |
|
526 * De-register harvester client events. |
|
527 */ |
|
528 void DeRegisterHarverterClientEvents(); |
|
529 |
|
530 /** |
|
531 * Return resource id for video viewfinder layout |
|
532 * @since 3.0 |
|
533 * @param aResolution for current resolution |
|
534 * @return Resource id for video viewfinder layout |
|
535 */ |
|
536 TInt VideoViewFinderResourceId( TCamVideoResolution aResolution ); |
|
537 |
|
538 /** |
|
539 * Start the viewfinder for the specified mode |
|
540 * as soon as the engine is intialised |
|
541 * @since 2.8 |
|
542 * @param aMode The viewfinder mode being entered |
|
543 */ |
|
544 void EnterViewfinderMode( const TCamCameraMode& aMode ); |
|
545 |
|
546 /** |
|
547 * ExitViewinderMode |
|
548 * @since 2.8 |
|
549 * @param aMode The viewfinder mode being exited |
|
550 */ |
|
551 void ExitViewfinderMode( const TCamCameraMode& aMode ); |
|
552 |
|
553 /** |
|
554 * FreezeViewFinder |
|
555 * @since 2.8 |
|
556 * @param aFreeze Whether or not the viewfinder is |
|
557 * being frozen after this frame |
|
558 */ |
|
559 void FreezeViewFinder( TBool aFreeze ); |
|
560 |
|
561 /** |
|
562 * Return number of images that can still be captured |
|
563 * @since 2.8 |
|
564 * @param aStorage storage location - defaults to current loation |
|
565 * @param aBurstActive - set to ETrue if burst mode is active |
|
566 * @return the number of images |
|
567 */ |
|
568 TInt ImagesRemaining( TCamMediaStorage aStorage, |
|
569 TBool aBurstActive ); |
|
570 |
|
571 /** |
|
572 * Return number of images that can still be captured for a particular |
|
573 * image quality |
|
574 * @since 2.8 |
|
575 * @param aStorage storage location - defaults to current loation |
|
576 * @param aBurstActive - set to ETrue if burst mode is active |
|
577 * @param aQualityIndex - index of the image quality |
|
578 * @return the number of images |
|
579 */ |
|
580 TInt ImagesRemaining( TCamMediaStorage aStorage, |
|
581 TBool aBurstActive, |
|
582 TInt aQualityIndex ); |
|
583 |
|
584 /** |
|
585 * Return amount of video that has been captured |
|
586 * @since 2.8 |
|
587 * @return the amount of video in micro secs |
|
588 */ |
|
589 TTimeIntervalMicroSeconds RecordTimeElapsed() const; |
|
590 |
|
591 |
|
592 /** |
|
593 * Set amount of video that has been captured |
|
594 * @param aElapsed - recorded video time. |
|
595 */ |
|
596 void RecordTimeElapsed(TTimeIntervalMicroSeconds aElapsed ); |
|
597 |
|
598 |
|
599 /* |
|
600 * Return amount of video that can still be captured |
|
601 * @since 2.8 |
|
602 * @return the amount of video in secs |
|
603 */ |
|
604 TTimeIntervalMicroSeconds RecordTimeRemaining(); |
|
605 |
|
606 /** |
|
607 * Updates the interval used in next TimeLapse capture |
|
608 * @since 3.0 |
|
609 * @param aInterval The new interval to use |
|
610 */ |
|
611 void SetTimeLapseInterval( TTimeIntervalMicroSeconds aInterval ); |
|
612 |
|
613 /** |
|
614 * Returns the interval used in next TimeLapse capture |
|
615 * @since 3.0 |
|
616 * @return The current time lapse interval in microseconds |
|
617 */ |
|
618 TTimeIntervalMicroSeconds TimeLapseInterval(); |
|
619 |
|
620 /** |
|
621 * Returns the remaining time lapse interval until the next capture |
|
622 * @since 3.0 |
|
623 * @return The remaining time to the next timelapse capture |
|
624 */ |
|
625 TTimeIntervalMicroSeconds TimeLapseCountdown(); |
|
626 |
|
627 /** |
|
628 * Start the autofocus procedure |
|
629 * @since 2.8 |
|
630 */ |
|
631 void StartAutoFocus(); |
|
632 |
|
633 /** |
|
634 * Begin the capture procedure |
|
635 * @since 2.8 |
|
636 */ |
|
637 void Capture(); |
|
638 |
|
639 /** |
|
640 * Stop the burst capture operation |
|
641 * @since 2.8 |
|
642 */ |
|
643 void StopSequenceCaptureL(); |
|
644 |
|
645 /** |
|
646 * Whether or not a still capture operation is pending |
|
647 * i.e. a request to start still capture has been made and is |
|
648 * waiting for the focus operation to complete. |
|
649 * @since 2.8 |
|
650 * @return ETrue if a still capture operation is pending |
|
651 */ |
|
652 TBool CapturePending() const; |
|
653 |
|
654 /** |
|
655 * Whether or not a capture key pressed during image saving |
|
656 * @since 2.8 |
|
657 * @return ETrue if capture key is pressed during image saving |
|
658 */ |
|
659 TBool CaptureKeyPressedWhileImageSaving() const; |
|
660 |
|
661 /** |
|
662 * Stores shutter key press during saving image |
|
663 * @since 2.8 |
|
664 */ |
|
665 void SetCaptureKeyPressedWhileImageSaving(TBool aCaptureKeyPressed); |
|
666 |
|
667 /** |
|
668 * Whether or not a video recording operation is pending |
|
669 * i.e. a request to start video recording has been made and is |
|
670 * waiting for the engine to complete a video name update operation. |
|
671 * @since 2.8 |
|
672 * @return ETrue if a record operation is pending |
|
673 */ |
|
674 TBool VideoRecordPending() const; |
|
675 |
|
676 /** |
|
677 * Whether or not a sequence capture is in progress |
|
678 * @since 2.8 |
|
679 * @return ETrue if a sequence capture is in progress |
|
680 */ |
|
681 TBool SequenceCaptureInProgress() const; |
|
682 |
|
683 /** |
|
684 * Begin the recording procedure |
|
685 * @since 2.8 |
|
686 */ |
|
687 void StartVideoRecordingL(); |
|
688 |
|
689 /** |
|
690 * End the recording procedure |
|
691 * @since 2.8 |
|
692 */ |
|
693 void StopVideoRecording(); |
|
694 |
|
695 /** |
|
696 * End the recording procedure |
|
697 * @since 5.0 |
|
698 */ |
|
699 void StopVideoRecordingAsync(); |
|
700 |
|
701 /** |
|
702 * Store the cause of the video stop |
|
703 * @since 3.0 |
|
704 */ |
|
705 void SetVideoStoppedForPhoneApp( TBool aIsPhoneApp ); |
|
706 |
|
707 /** |
|
708 * Pause the recording procedure |
|
709 * @since 2.8 |
|
710 */ |
|
711 void PauseVideoRecording(); |
|
712 |
|
713 /** |
|
714 * Continue the recording procedure |
|
715 * @since 2.8 |
|
716 */ |
|
717 void ContinueVideoRecording(); |
|
718 |
|
719 /** |
|
720 * Issue AF request. |
|
721 */ |
|
722 TBool TryAFRequest( TInt aAFRequest ); |
|
723 |
|
724 /** |
|
725 * Cancel ongoing AutoFocus. |
|
726 */ |
|
727 void CancelAFNow(); |
|
728 |
|
729 /** |
|
730 * Cancel a requested capture |
|
731 * @since 2.8 |
|
732 */ |
|
733 void CancelFocusAndCapture(); |
|
734 |
|
735 /** |
|
736 * Return the current snapshot image |
|
737 * @since 2.8 |
|
738 * @return the current snapshot image |
|
739 */ |
|
740 const CFbsBitmap* SnapshotImage(); |
|
741 |
|
742 /** |
|
743 * Sets the specified burst mode item as the current image, in |
|
744 * preparation for a Post-capture view of the image. |
|
745 * @since 2.8 |
|
746 * @param aIndex The index of the burst item in "CCamBurstCaptureArray" |
|
747 */ |
|
748 void SetAsCurrentImage( TInt aIndex ); |
|
749 |
|
750 /** |
|
751 * Get the user-visible name for next image. |
|
752 * @since 2.8 |
|
753 * @return file name for the current image or video without path or |
|
754 * extension |
|
755 */ |
|
756 const TDesC& CurrentImageName() const; |
|
757 |
|
758 /** |
|
759 * Delete the current image/video file |
|
760 * @since 2.8 |
|
761 * @param aNofity Should notification be sent to observers about |
|
762 * change in media files. When this call is made |
|
763 * several times in a row, it's worth to do the |
|
764 * notification only once. |
|
765 * @return KErrNone if delete successful, otherwise system-wide |
|
766 * error code |
|
767 */ |
|
768 TInt DeleteCurrentFile( TBool aNotify = ETrue ); |
|
769 |
|
770 /** |
|
771 * Delete the timelapse sequence files |
|
772 * @since 3.0 |
|
773 */ |
|
774 void DeleteTimeLapseFiles(); |
|
775 |
|
776 /** |
|
777 * Indicate whether or not the controller is actively engaged in still |
|
778 * or video capture - this includes paused video, saving photos/videos, |
|
779 * periods in between timelapse captures and pending captures |
|
780 * (captures that have been requested but not yet started) |
|
781 * @since 3.0 |
|
782 * @return EFalse if not currently capturing, otherwise ETrue |
|
783 */ |
|
784 TBool IsProcessingCapture(); |
|
785 |
|
786 /** |
|
787 * Complete current capture asap, then report completion to the observer |
|
788 * @since 3.0 |
|
789 * @param aObserver To be notified when the current capture process completes |
|
790 * @param aSafeCompletion ETrue if all captures should be saved. EFalse to complete |
|
791 * sooner and lose any images that have not yet begun to save |
|
792 */ |
|
793 void CompleteCaptureAndNotifyL( MCamObserver* aObserver, TBool aSafeCompletion ); |
|
794 |
|
795 /** |
|
796 * The application is closing. Complete any active operations then |
|
797 * exit the application. |
|
798 * @param aImmediateShutdown ETrue: shutdown immediately or |
|
799 * EFalse: wait for pending operations to complete. |
|
800 * @since 2.8 |
|
801 */ |
|
802 void EnterShutdownMode( TBool aImmediateShutdown ); |
|
803 |
|
804 /** |
|
805 * Whether or not the controller is in shutdown mode |
|
806 * @since 2.8 |
|
807 * @return ETrue if the controller is in shutdown mode else EFalse |
|
808 */ |
|
809 TBool IsInShutdownMode() const; |
|
810 |
|
811 /** |
|
812 * Returns true if AppUi has been constructed, and not yet |
|
813 * destructed. |
|
814 */ |
|
815 TBool IsAppUiAvailable() const; |
|
816 |
|
817 /** |
|
818 * Sets AppUi availablility (see IsAppUiAvailable()) |
|
819 */ |
|
820 void SetAppUiAvailable( TBool aAvailable ); |
|
821 |
|
822 |
|
823 /** |
|
824 * Called to return the range of supported zoom values |
|
825 * @since 2.8 |
|
826 * @param aMinZoom on return contains the minimum zoom value |
|
827 * @param aMaxZoom on return contains the maximum zoom value |
|
828 */ |
|
829 void GetZoomRange( TInt& aMinZoom, TInt& aMaxZoom ) const; |
|
830 |
|
831 /** |
|
832 * Called to return current zoom value |
|
833 * @since 2.8 |
|
834 * @return the current zoom value |
|
835 */ |
|
836 TInt ZoomValue() const; |
|
837 |
|
838 /** |
|
839 * Sets the current zoom value |
|
840 * @since 2.8 |
|
841 * @param aValue the new zoom value to be used |
|
842 */ |
|
843 void SetZoomValue( TInt aValue ); |
|
844 |
|
845 /** |
|
846 * Resets all user scene settings to their defaults. |
|
847 * @since 2.8 |
|
848 */ |
|
849 void ResetUserSceneL(); |
|
850 |
|
851 /** |
|
852 * Previews a new value for the specified integer setting |
|
853 * @param aSettingItem specifies which setting item that want |
|
854 * to preview. |
|
855 * @param aSettingValue the new integer value for the specified |
|
856 * setting item to be previewed. |
|
857 * @since 2.8 |
|
858 */ |
|
859 void PreviewSettingChangeL( TInt aSettingItem, TInt aSettingValue ); |
|
860 |
|
861 /** |
|
862 * Cancels all preview changes, since last commit/cancel. |
|
863 * @since 2.8 |
|
864 */ |
|
865 void CancelPreviewChangesL(); |
|
866 |
|
867 /** |
|
868 * Commits last preview change. |
|
869 * @since 2.8 |
|
870 */ |
|
871 void CommitPreviewChanges(); |
|
872 |
|
873 /** |
|
874 * Re-prepare video after e.g. a setting change requires this. |
|
875 */ |
|
876 void RePrepareVideoL(); |
|
877 |
|
878 /** |
|
879 * Returns the current integer value for the specified setting |
|
880 * @return the current integer setting value |
|
881 * @param aSettingItem specifies which setting item that want |
|
882 * the value of. |
|
883 * @since 2.8 |
|
884 */ |
|
885 TInt IntegerSettingValue( TInt aSettingItem ) const; |
|
886 |
|
887 /** |
|
888 * Returns the current integer value for the specified setting |
|
889 * without the filtering usually performed on storage location. |
|
890 * This is neccesary to allow the video/photo settings list to show |
|
891 * the selected storage location rather than the forced storage location. |
|
892 * @return the current integer setting value |
|
893 * @param aSettingItem specifies which setting item that want the value of. |
|
894 * @since 2.8 |
|
895 */ |
|
896 TInt IntegerSettingValueUnfiltered( TInt aSettingItem ) const; |
|
897 |
|
898 /** |
|
899 * Sets a new value for the specified integer setting |
|
900 * @param aSettingItem specifies which setting item that want |
|
901 * to set the value of. |
|
902 * @param aSettingValue the new integer value for the specified |
|
903 * setting item. |
|
904 * @since 2.8 |
|
905 */ |
|
906 void SetIntegerSettingValueL( TInt aSettingItem, TInt aSettingValue ); |
|
907 |
|
908 /** |
|
909 * Sets pathnames for video and image files to point to the specified storage |
|
910 * @param aMediaStorage specifies phone memory or MMC |
|
911 * @since 2.8 |
|
912 */ |
|
913 void SetPathnamesToNewStorageL( TCamMediaStorage aMediaStorage ); |
|
914 |
|
915 /** |
|
916 * Sets a new text value for the specified setting |
|
917 * @param aSettingItem specifies which setting item that want to set |
|
918 * the text value of. |
|
919 * @param aSettingValue the new text value for the specified setting |
|
920 * item. |
|
921 * @since 2.8 |
|
922 */ |
|
923 void SetTextSettingValueL( TInt aSettingItem, |
|
924 const TDesC& aSettingValue ); |
|
925 |
|
926 |
|
927 /** |
|
928 * Returns the current text value for the specified setting |
|
929 * @return the current text setting value |
|
930 * @param aSettingItem specifies which setting item that want |
|
931 * the text value of. |
|
932 * @since 2.8 |
|
933 */ |
|
934 TPtrC TextSettingValue( TInt aSettingItem ) const; |
|
935 |
|
936 /** |
|
937 * Returns whether a particular setting value can be set or not. |
|
938 * @return ETrue if can be set. Otherwise, EFalse. |
|
939 * @param aSettingItem the setting item in question. |
|
940 * @param aSettingValue the value in question. |
|
941 * @since 2.8 |
|
942 */ |
|
943 TBool SettingValueEnabled( TInt aSettingItem, TInt aSettingValue ) const; |
|
944 |
|
945 /** |
|
946 * Loads the settings from shared data, or if unable to from the |
|
947 * resource file. |
|
948 * @param aIsEmbedded whether or not the application is running in |
|
949 * embedded mode. |
|
950 * @since 2.8 |
|
951 */ |
|
952 void LoadStaticSettingsL( TBool aIsEmbedded ); |
|
953 |
|
954 /** |
|
955 * Get the default value for a setting item. |
|
956 * @param aSettingId The id of the setting. |
|
957 * @return The default value for setting item or KErrNotFound if not found. |
|
958 */ |
|
959 TInt DynamicSettingDefaultValue( TInt aSettingId ) const; |
|
960 |
|
961 /** |
|
962 * Sets all dynamic settings to their defaults. |
|
963 * @since 2.8 |
|
964 */ |
|
965 void SetDynamicSettingsToDefaults(); |
|
966 |
|
967 /** |
|
968 * Sets a single dynamic setting to its default. |
|
969 * @since 2.8 |
|
970 */ |
|
971 void SetDynamicSettingToDefault(TInt aSettingItem); |
|
972 |
|
973 /** |
|
974 * Set scene default value to a dynamic setting. |
|
975 * @param aSceneId Id of the scene to use. |
|
976 * @param aSceneField Id of scene field. |
|
977 * @param aSettingId If of the dynamic setting to set. |
|
978 * @param aVideoScene Does aSceneId refer to a video scene. |
|
979 * @return KErrNotFound, if setting could not be set. |
|
980 */ |
|
981 TInt SetDynamicSettingToSceneDefaultL( TInt aSceneId, |
|
982 TInt aSceneField, |
|
983 TInt aSettingId, |
|
984 TBool aVideoScene ); |
|
985 |
|
986 |
|
987 #ifdef PRODUCT_USES_GENERIC_SETUP_INDICATOR |
|
988 /** |
|
989 * Returns whether or not the video setup settings are set to the |
|
990 * defaults for its current scene. |
|
991 * @since 2.8 |
|
992 * @return ETrue if set to defaults. Otherwise, EFalse |
|
993 */ |
|
994 TBool VideoSceneDefaultsAreSet(); |
|
995 |
|
996 /** |
|
997 * Returns whether or not the photo setup settings are set to the |
|
998 * defaults for its current scene. |
|
999 * @since 2.8 |
|
1000 * @return ETrue if set to defaults. Otherwise, EFalse |
|
1001 */ |
|
1002 TBool PhotoSceneDefaultsAreSet(); |
|
1003 #endif // PRODUCT_USES_GENERIC_SETUP_INDICATOR |
|
1004 |
|
1005 /** |
|
1006 * Returns the file name of the most recent saved image/video clip |
|
1007 * @return Filename of most recent captured image/video |
|
1008 * @since 2.8 |
|
1009 */ |
|
1010 const TDesC& CurrentFullFileName() const; |
|
1011 |
|
1012 /** |
|
1013 * Get the current video filename. |
|
1014 */ |
|
1015 const TDesC& CurrentVideoFileName() const; |
|
1016 |
|
1017 /** |
|
1018 * Returns a pointer to an array representing the images in a burst |
|
1019 * capture |
|
1020 * @return reference to the burst capture array |
|
1021 * @since 2.8 |
|
1022 */ |
|
1023 CCamBurstCaptureArray* BurstCaptureArray() const; |
|
1024 |
|
1025 /** |
|
1026 * Returns the number of non-deleted items in the array |
|
1027 * @return count of non-deleted items |
|
1028 * @since 2.8 |
|
1029 */ |
|
1030 TInt CurrentItemCount(); |
|
1031 |
|
1032 /** |
|
1033 * Returns the number of burst capture moments that have taken |
|
1034 * place in a current burst. If no burst is active this returns |
|
1035 * 0 |
|
1036 * @return count of burst capture moments |
|
1037 * @since 3.0 |
|
1038 */ |
|
1039 TInt CurrentCapturedCount(); |
|
1040 |
|
1041 /** |
|
1042 * Returns the number of items in a timelapse sequence |
|
1043 * @return count of timelapse sequence items |
|
1044 * @since 3.0 |
|
1045 */ |
|
1046 TInt TimeLapseImageCount(); |
|
1047 |
|
1048 /** |
|
1049 * Resets the array of filenames used in timelapse capture |
|
1050 * @since 3.0 |
|
1051 */ |
|
1052 void ResetTimelapseArray(); |
|
1053 |
|
1054 /** |
|
1055 * Initiates the playing of the specified sound. |
|
1056 * @since 2.8 |
|
1057 * @param aSoundId The enum value of the sound to play |
|
1058 * @param aEnableCallback Whether we want a callback when play complete |
|
1059 */ |
|
1060 void PlaySound( TCamSoundId aSoundId, TBool aEnableCallback ); |
|
1061 |
|
1062 |
|
1063 /** |
|
1064 * Releases the camera hardware for other apps to use |
|
1065 * @since 2.8 |
|
1066 */ |
|
1067 void ReleaseCamera(); |
|
1068 |
|
1069 /** |
|
1070 * Increments the engine usage count |
|
1071 * @since 2.8 |
|
1072 */ |
|
1073 void IncCameraUsers(); |
|
1074 |
|
1075 /** |
|
1076 * Decrements the engine usage count If the engine is no longer required |
|
1077 * then it is released. If it is still processing, the engine count will |
|
1078 * be checked when the current process completes and the engine will be |
|
1079 * released if it is no longer needed. |
|
1080 * @since 2.8 |
|
1081 */ |
|
1082 void DecCameraUsers(); |
|
1083 |
|
1084 /* |
|
1085 * Gets the handle to the static settings model, which is used inturn by the |
|
1086 * plugin to call the interfaces for performing needed actions. |
|
1087 */ |
|
1088 MCamStaticSettings& StaticSettingsModel(); |
|
1089 |
|
1090 /* |
|
1091 * Check if image/video scene mode is supported |
|
1092 */ |
|
1093 TBool IsSceneSupported( const TInt aSceneId, TBool aPhotoScene = ETrue ) const; |
|
1094 |
|
1095 /** |
|
1096 * Whether a call is active, including the ringing state |
|
1097 * @since 2.8 |
|
1098 * @return ETrue if in call or ringing, else EFalse |
|
1099 */ |
|
1100 TBool InCallOrRinging() const; |
|
1101 |
|
1102 /** |
|
1103 * Whether a video call is active, including the ringing state |
|
1104 * @return ETrue if in videocall or ringing, else EFalse |
|
1105 */ |
|
1106 TBool InVideocallOrRinging(); |
|
1107 |
|
1108 /** |
|
1109 * Whether or not a video clip is currently being saved |
|
1110 * @since 2.8 |
|
1111 * @return ETrue if saving, else EFalse |
|
1112 */ |
|
1113 TBool CurrentlySavingVideo() const; |
|
1114 |
|
1115 /** |
|
1116 * Returns whether all the settings list options for a particular setting |
|
1117 * item are visible or not |
|
1118 * @since 2.8 |
|
1119 * @param aSettingItem The setting item to be checked. |
|
1120 * @param aRevisedResourceId Receives the id of a resource if the return |
|
1121 * value is EFalse. The resource contains the list of visible |
|
1122 * options. |
|
1123 * @return ETrue if all options are visible. Otherwise, EFalse. |
|
1124 */ |
|
1125 TBool AllOptionsVisibleForSettingItem( TInt aSettingItem, |
|
1126 TInt& aRevisedResourceId ); |
|
1127 |
|
1128 /** |
|
1129 * Switches the camera being used |
|
1130 * @since 2.8 |
|
1131 */ |
|
1132 void SwitchCameraL(); |
|
1133 |
|
1134 /** |
|
1135 * Returns the active camera |
|
1136 * @since 2.8 |
|
1137 * @return @return either primary, secondary or none ( if in process of switching ) |
|
1138 */ |
|
1139 TCamActiveCamera ActiveCamera() const; |
|
1140 |
|
1141 /** |
|
1142 * Whether we currently have a camera switch required |
|
1143 * @since 2.8 |
|
1144 * @return TCameraSwitchRequired a camera switch is required or not |
|
1145 */ |
|
1146 TCameraSwitchRequired CameraSwitchQueued() const; |
|
1147 |
|
1148 /** |
|
1149 * Check if exit is required |
|
1150 * @since 2.8 |
|
1151 * @return TBool True if exit is required |
|
1152 */ |
|
1153 TBool CheckExitStatus(); |
|
1154 |
|
1155 /** |
|
1156 * Informs the controller that an end key event is waiting |
|
1157 * to close the app, or has been acted upon |
|
1158 * This is used when the end key is pressed during sequence capture |
|
1159 * @since 2.8 |
|
1160 */ |
|
1161 void SetEndKeyExitWaiting( TBool aEndKeyWaiting ); |
|
1162 |
|
1163 /** |
|
1164 * Returns the status of the camera slide |
|
1165 * @since 2.8 |
|
1166 * @return the status of the camera slide |
|
1167 */ |
|
1168 TInt CameraSlideState() const; |
|
1169 |
|
1170 /** |
|
1171 * Informs the controller that a slider close event has |
|
1172 * been reacted to by 'pretending' to exit |
|
1173 * @since 2.8 |
|
1174 */ |
|
1175 void SliderCloseEventActioned(); |
|
1176 |
|
1177 /** |
|
1178 * Set camera switch to queue |
|
1179 */ |
|
1180 void SetCameraSwitchRequired( TCameraSwitchRequired aSwitchRequired ); |
|
1181 |
|
1182 /** |
|
1183 * Check slide state and schedule camera switch if required |
|
1184 * @since 2.8 |
|
1185 */ |
|
1186 void CheckSlideStatus(); |
|
1187 |
|
1188 |
|
1189 /** |
|
1190 * Return range of EV value supported for current product |
|
1191 * @since 3.0 |
|
1192 * @return TEvRange struct |
|
1193 */ |
|
1194 TCamEvCompRange EvRange() const; |
|
1195 |
|
1196 /** |
|
1197 * Switches camera to standby |
|
1198 * @since 5.1 |
|
1199 * @param aSratus Error code for Standby mode |
|
1200 * @return |
|
1201 */ |
|
1202 void SwitchToStandbyL( TInt aStatus = KErrNone ); |
|
1203 |
|
1204 public: // Derived from MCamCallStateObserver base class |
|
1205 /** |
|
1206 * Callback for when the current phone call state changes |
|
1207 * @since 3.0 |
|
1208 * @param aState The new call state |
|
1209 * @param aError An error code associated with the event |
|
1210 */ |
|
1211 void CallStateChanged( TPSCTsyCallState aState, TInt aError ); |
|
1212 |
|
1213 /** |
|
1214 * Returns the file size of the specified file |
|
1215 * @since 3.0 |
|
1216 * @param aFilename The file to retrieve the size of. |
|
1217 * @return The size of the file or KErrNotFound |
|
1218 */ |
|
1219 TInt FileSize( TDesC& aFilename ) const; |
|
1220 |
|
1221 /** |
|
1222 * Returns whether the current scene uses forced |
|
1223 * autofocus (so no AF required at capture time) |
|
1224 * @since 3.0 |
|
1225 * @return ETrue if forced, EFalse if not |
|
1226 */ |
|
1227 TBool CurrentSceneHasForcedFocus() const; |
|
1228 |
|
1229 public: |
|
1230 |
|
1231 /** |
|
1232 * Get the actual resolution (WxH) of current image quality. |
|
1233 */ |
|
1234 TSize GetCurrentImageDimensions() const; |
|
1235 |
|
1236 /** |
|
1237 * Retrieves the current image resolution, taking into account |
|
1238 * the user settings and and modifications due to zoom state. |
|
1239 * @since 2.8 |
|
1240 * @returns The current image resolution. |
|
1241 */ |
|
1242 TCamPhotoSizeId GetCurrentImageResolution() const; |
|
1243 |
|
1244 /** |
|
1245 * Retrieves the current image compression |
|
1246 * @since 2.8 |
|
1247 * @returns The current image compression. |
|
1248 */ |
|
1249 TInt GetCurrentImageCompression() const; |
|
1250 |
|
1251 /** |
|
1252 * Retrieves the current video resolution. |
|
1253 * @since 2.8 |
|
1254 * @returns The current video resolution. |
|
1255 */ |
|
1256 TCamVideoResolution GetCurrentVideoResolution() const; |
|
1257 |
|
1258 /** |
|
1259 * Force use of phone memory storage |
|
1260 * @since 2.8 |
|
1261 */ |
|
1262 void UsePhoneMemoryL() const; |
|
1263 |
|
1264 /** |
|
1265 * Sets the correct memory to be used based on settings |
|
1266 * and availability of MMC. |
|
1267 * @since 4.0 |
|
1268 * @return ETrue if memory location changed |
|
1269 */ |
|
1270 TBool CheckMemoryToUseL(); |
|
1271 |
|
1272 /** |
|
1273 * Indicate whether the phone memory is being force-used |
|
1274 * because of un-availability or errors in MMC. |
|
1275 * @since 4.0 |
|
1276 */ |
|
1277 TBool IsPhoneMemoryForced(); |
|
1278 |
|
1279 /** |
|
1280 * Retrieves the current image resolution from Settings. |
|
1281 * @since 2.8 |
|
1282 * @returns The current image from Settings |
|
1283 */ |
|
1284 TCamPhotoSizeId SettingsPhotoResolution() const; |
|
1285 |
|
1286 |
|
1287 /** |
|
1288 * Indication that a view has finished using the capture array |
|
1289 * @since 2.8 |
|
1290 * @param aForcedRelease Should the array be released even if |
|
1291 * the apparent usage count is not null. |
|
1292 */ |
|
1293 void ReleaseArray( TBool aForcedRelease = EFalse ); |
|
1294 |
|
1295 /** |
|
1296 * Restore Camera settings to default |
|
1297 * @since 3.0 |
|
1298 * @param aIsEmbedded if app is embedded |
|
1299 */ |
|
1300 void RestoreFactorySettingsL( TBool aIsEmbedded ); |
|
1301 |
|
1302 private: |
|
1303 /** |
|
1304 * Called when playback of a sound has completed |
|
1305 * @since 2.8 |
|
1306 */ |
|
1307 void PlaySoundComplete(); |
|
1308 public: |
|
1309 |
|
1310 /** |
|
1311 * Non-leaving version of StartViewFinderL() |
|
1312 * @since 2.8 |
|
1313 */ |
|
1314 void StartViewFinder(); |
|
1315 |
|
1316 /** |
|
1317 * Stop viewfinder |
|
1318 * @since 2.8 |
|
1319 */ |
|
1320 void StopViewFinder(); |
|
1321 |
|
1322 /** |
|
1323 * Stop viewfinder Ecam only |
|
1324 * Needed with async video recording stopping |
|
1325 * @since 5.0 |
|
1326 */ |
|
1327 void StopViewFinderEcam(); |
|
1328 |
|
1329 /** |
|
1330 * Sets the zoom mode of the engine |
|
1331 * @param aZoomMode The zoom mode to set |
|
1332 * @since 3.0 |
|
1333 */ |
|
1334 // Only digital mode supported currently - no need for this |
|
1335 //void SetZoomMode( const TCamZoomMode& aZoomMode ); |
|
1336 |
|
1337 /** |
|
1338 * Report whether a capture mode transition is currently in progress |
|
1339 * @since 2.8 |
|
1340 * @return TBool ETrue if transition (i.e. still/video capture prepare) is |
|
1341 * currently in progress, EFalse otherwise; |
|
1342 */ |
|
1343 TBool CaptureModeTransitionInProgress(); |
|
1344 |
|
1345 /** |
|
1346 * Check if viewfinder is active |
|
1347 * @since 2.8 |
|
1348 * @returns ETrue if viewfinding |
|
1349 */ |
|
1350 TBool IsViewFinding() const; |
|
1351 |
|
1352 /** |
|
1353 * Check if capture key needs to be released before starting |
|
1354 * new capture process. Used in post capture state to prevent |
|
1355 * image capture before viewfinder is completely shown. |
|
1356 * @since S60 v5.0 |
|
1357 * @return ETrue if waiting key release before next capture |
|
1358 */ |
|
1359 TBool IsDemandKeyRelease(); |
|
1360 |
|
1361 /** |
|
1362 * Set iDemandKeyRelease value |
|
1363 * @param aDemand Demand to release capture key |
|
1364 * @since S60 v5.0 |
|
1365 */ |
|
1366 void SetDemandKeyRelease( TBool aDemand ); |
|
1367 |
|
1368 /** |
|
1369 * Stop the idle timer |
|
1370 * @since 2.8 |
|
1371 */ |
|
1372 void StopIdleTimer(); |
|
1373 |
|
1374 /** |
|
1375 * Restart the idle timer |
|
1376 * @since 2.8 |
|
1377 */ |
|
1378 void StartIdleTimer(); |
|
1379 |
|
1380 |
|
1381 /** |
|
1382 * Flash modes supported by engine |
|
1383 * @since 3.0 |
|
1384 * @return supported flash modes |
|
1385 */ |
|
1386 TUint32 SupportedFlashModes(); |
|
1387 |
|
1388 |
|
1389 /** |
|
1390 * White balance modes supported by engine |
|
1391 * @since 3.0 |
|
1392 * @return supported white balance modes |
|
1393 */ |
|
1394 TUint32 SupportedWBModes(); |
|
1395 |
|
1396 /** |
|
1397 * EV modes supported by engine |
|
1398 * @since 3.0 |
|
1399 * @return supported EV modes |
|
1400 */ |
|
1401 TUint32 SupportedEVModes(); |
|
1402 |
|
1403 /** |
|
1404 * Capture state |
|
1405 * @return TInt capture state |
|
1406 */ |
|
1407 TInt CaptureState(); |
|
1408 |
|
1409 /** |
|
1410 * Returns the current capture-tone id |
|
1411 * @since 3.0 |
|
1412 * @return the current capture-tone id |
|
1413 */ |
|
1414 TCamSoundId CaptureToneId( ); |
|
1415 |
|
1416 #ifdef CAMERAAPP_PERFORMANCE_MEASUREMENT |
|
1417 public: |
|
1418 void SetPerformanceState( TCamPerformanceState aState ); |
|
1419 #endif |
|
1420 |
|
1421 /** |
|
1422 * Set pointer to settings plug-in. Takes ownership! |
|
1423 * @param aPlugin Pointer to settings plug-in. This object |
|
1424 * takes ownership. |
|
1425 * @since S60 v5.0 |
|
1426 */ |
|
1427 void SetSettingsPlugin( CCamGSInterface* aPlugin ); |
|
1428 |
|
1429 /** |
|
1430 * Set viewfinder window for direct screen viewfinder. The handle must remain |
|
1431 * valid as long as viewfinder is running. |
|
1432 * @since S60 v5.0 |
|
1433 * @param aWindow Handle to viewfinder window. Must remain valid while |
|
1434 * viewfinder is running. Ownership not transferred. |
|
1435 */ |
|
1436 void SetViewfinderWindowHandle( RWindowBase* aWindow ); |
|
1437 |
|
1438 /** |
|
1439 * Notify that the viewfinder window is about to be deleted. Viewfinder |
|
1440 * will be stopped if this window handle is currently used for the |
|
1441 * viewfinder. |
|
1442 * @since S60 v5.0 |
|
1443 * @param aWindow Handle to viewfinder window. Ownership not transferred. |
|
1444 */ |
|
1445 void ViewfinderWindowDeleted( RWindowBase* aWindow ); |
|
1446 |
|
1447 protected: // New functions |
|
1448 |
|
1449 /** |
|
1450 * C++ default constructor. |
|
1451 * @since 2.8 |
|
1452 */ |
|
1453 CCamAppController(); |
|
1454 |
|
1455 /** |
|
1456 * Symbian OS 2nd phase constructor. |
|
1457 * @since 2.8 |
|
1458 */ |
|
1459 void ConstructL(); |
|
1460 |
|
1461 // ----------------------------------------------------- |
|
1462 // Burst related |
|
1463 public: |
|
1464 |
|
1465 /** |
|
1466 * Stop burst in a soft way: |
|
1467 * - if have not moved yet to long burst mode, |
|
1468 * wait until the short burst ends and do not |
|
1469 * enter long burst mode (if aFastStop is true, |
|
1470 * stop asap when atleast 2 images captured). |
|
1471 * - if long burst already entered, stop capturing |
|
1472 * after the next capture. |
|
1473 * @param aFastStop Stop also short burst asap, but so that |
|
1474 * atleast 2 images are captured. |
|
1475 */ |
|
1476 void SoftStopBurstL( TBool aFastStop = EFalse ); |
|
1477 |
|
1478 /** |
|
1479 * Set iNoBurstCancel flag which is used to prevent stopping burst |
|
1480 * when actual burst capture has started after focusing. |
|
1481 */ |
|
1482 void SetNoBurstCancel( TBool aValue ); |
|
1483 |
|
1484 /** |
|
1485 * Set iKeyUPl flag which is used to prevent late |
|
1486 * activated burst timer when capturekey is up already |
|
1487 * before burstcapture has started. |
|
1488 */ |
|
1489 void SetKeyUp( TBool aValue = EFalse ); |
|
1490 |
|
1491 /** |
|
1492 * Returns amount of images captured in burst mode |
|
1493 * @return Amount of captured images |
|
1494 * |
|
1495 */ |
|
1496 TInt CapturedImages() const; |
|
1497 |
|
1498 private: |
|
1499 |
|
1500 /** |
|
1501 * Start the burst timer for changing to long burst mode. |
|
1502 */ |
|
1503 void StartBurstTimerL(); |
|
1504 |
|
1505 /* |
|
1506 * Stop the burst timer. |
|
1507 */ |
|
1508 void StopBurstTimer(); |
|
1509 |
|
1510 /** |
|
1511 * Callback for short burst timer. |
|
1512 * @param aController Pointer to app controller instance. |
|
1513 * @return Always zero, implies no repeated callbacks wanted. |
|
1514 */ |
|
1515 static TInt ShortBurstTimeout( TAny* aController ); |
|
1516 |
|
1517 /** |
|
1518 * Helper method for short burst timer callback. |
|
1519 */ |
|
1520 void DoShortBurstTimeoutL(); |
|
1521 |
|
1522 |
|
1523 // ----------------------------------------------------- |
|
1524 private: |
|
1525 |
|
1526 /** |
|
1527 * Return number of images that can still be captured for a particular |
|
1528 * image photo resolution |
|
1529 * @since 2.8 |
|
1530 * @param aStorage storage location - defaults to current loation |
|
1531 * @param aBurstActive - set to ETrue if burst mode is active |
|
1532 * @param aSize - the id of the photo resolution |
|
1533 * @return the number of images |
|
1534 */ |
|
1535 TInt ImagesRemaining( TCamMediaStorage aStorage, |
|
1536 TBool aBurstActive, |
|
1537 TCamPhotoSizeId aSize ); |
|
1538 |
|
1539 /** |
|
1540 * Change the controller's current state |
|
1541 * Notifies controller observers of change |
|
1542 * @since 2.8 |
|
1543 * @param aNewState new state code |
|
1544 */ |
|
1545 void ChangeState( const TCamCameraState& aNewState ); |
|
1546 |
|
1547 /** |
|
1548 * Change the controller's target state. The state will not be |
|
1549 * altered if the controller is already in shutdown mode. |
|
1550 * @since 2.8 |
|
1551 * @param aNewState new state code |
|
1552 */ |
|
1553 void ChangeTargetState( const TCamCameraState& aNewState ); |
|
1554 |
|
1555 /** |
|
1556 * Change the controller's current operation |
|
1557 * Notifies controller observers of change |
|
1558 * @since 2.8 |
|
1559 * @param aNewOperation new operation code |
|
1560 * @param aError error code associated with new state (if any) |
|
1561 */ |
|
1562 void ChangeOperation( TCamCaptureOperation aNewOperation, |
|
1563 TInt aError = KErrNone ); |
|
1564 |
|
1565 public: |
|
1566 /** |
|
1567 * Notify controller observers of an event. |
|
1568 * @since 2.8 |
|
1569 * @param aEvent event code |
|
1570 * @param aError error code |
|
1571 */ |
|
1572 void NotifyControllerObservers( TCamControllerEvent aEvent, |
|
1573 TInt aError = KErrNone ) const; |
|
1574 private: |
|
1575 |
|
1576 /** |
|
1577 * Starts the viewfinder if the engine has been prepared for the |
|
1578 * current mode. |
|
1579 * @since 2.8 |
|
1580 */ |
|
1581 void StartViewFinderL(); |
|
1582 |
|
1583 /** |
|
1584 * Initiate image capture |
|
1585 * @since 2.8 |
|
1586 * @return ETrue if the capture was initiated otherwise EFalse |
|
1587 */ |
|
1588 TBool DoCaptureL(); |
|
1589 |
|
1590 /** |
|
1591 * Initiate video recording |
|
1592 * @since 2.8 |
|
1593 */ |
|
1594 void DoRecord(); |
|
1595 |
|
1596 /** |
|
1597 * Make a local copy of the viewfinder frame to use when |
|
1598 * the viewfinder is frozen |
|
1599 * @since 2.8 |
|
1600 */ |
|
1601 void CopyFrameL( const CFbsBitmap& aBitmap ); |
|
1602 |
|
1603 /** |
|
1604 * Reserve a set of file names for the current capture |
|
1605 * Store the reserved name(s) in iCaptureArray |
|
1606 * @since 2.8 |
|
1607 * @param aCaptureMode still, burst or video mode |
|
1608 * @param aForcePhoneMem force path to use Phone memory (C:) |
|
1609 */ |
|
1610 void ReserveFileNamesL( |
|
1611 const TCamCameraMode& aCaptureMode, |
|
1612 const TCamImageCaptureMode& aImageMode, |
|
1613 TBool aForcePhoneMem = EFalse ); |
|
1614 |
|
1615 /** |
|
1616 * Create a file ready for saving captured image into |
|
1617 * @since 2.8 |
|
1618 * @param aFs: Handle to RFs |
|
1619 * @param aFullPath: Full path including drive and extension |
|
1620 * @return error code from file creation |
|
1621 */ |
|
1622 TInt CreateDummyFileL( RFs& aFs, const TDesC& aFullPath ); |
|
1623 |
|
1624 |
|
1625 /** |
|
1626 * Store file name and full file name (incl. path) |
|
1627 * to burst capture array |
|
1628 * @since 2.8 |
|
1629 * @param aFullPath: Full path including drive and extension |
|
1630 */ |
|
1631 void StoreNextFileNameL( const TDesC& aFullPath ); |
|
1632 |
|
1633 /** |
|
1634 * Generate a new file name and full path for saving the next video |
|
1635 * according to the specified mode (unless specified otherwise) |
|
1636 * @since 2.8 |
|
1637 * @param aForcePhoneMem force path to use Phone memory (C:) |
|
1638 */ |
|
1639 void GenerateNextVideoFilePathL( TBool aForcePhoneMem = EFalse ); |
|
1640 |
|
1641 /** |
|
1642 * Generate a new path for saving the next image |
|
1643 * @since 3.0 |
|
1644 */ |
|
1645 void GenerateNextValidImagesPathL(); |
|
1646 |
|
1647 /** |
|
1648 * Generate a new file name and full path for saving the next video |
|
1649 * according to the specified mode. File will always be |
|
1650 * available. |
|
1651 * @since 2.8 |
|
1652 */ |
|
1653 void GenerateNextValidVideoPathL(); |
|
1654 |
|
1655 /** |
|
1656 * Handle a notification from the autofocus custom extension |
|
1657 * @since 2.8 |
|
1658 */ |
|
1659 void HandleAutoFocusNotification( TCamExtAutoFocus aNotification ); |
|
1660 |
|
1661 /** |
|
1662 * Static callback function for idle timer expiry |
|
1663 * @since 2.8 |
|
1664 * @param aPtr Pointer to an instance of the CCamAppController |
|
1665 * @return TInt to indicate if function should be called again |
|
1666 */ |
|
1667 static TInt IdleTimeoutL( TAny* aPtr ); |
|
1668 |
|
1669 /** |
|
1670 * Static callback function for time lapse timer expiry |
|
1671 * @since 3.0 |
|
1672 * @param aPtr Pointer to an instance of the CCamAppController |
|
1673 * @return TInt to indicate if function should be called again |
|
1674 */ |
|
1675 static TInt TimeLapseTimeoutL( TAny* aPtr ); |
|
1676 |
|
1677 private: // Deep sleep timer |
|
1678 /** |
|
1679 * Static callback function for camera deep sleep |
|
1680 * @since S60 5.0 |
|
1681 * @param aPtr Pointer to an instance of the CCamAppController |
|
1682 * @return TInt dummy |
|
1683 */ |
|
1684 static TInt DeepSleepTimeout( TAny* aPtr ); |
|
1685 |
|
1686 /** |
|
1687 * Deep sleep timeout handler |
|
1688 */ |
|
1689 void DoDeepSleepTimeout(); |
|
1690 |
|
1691 public: // Deep sleep timer |
|
1692 /** |
|
1693 * Start deep sleep timer |
|
1694 */ |
|
1695 void DeepSleepTimerStart(); |
|
1696 |
|
1697 /** |
|
1698 * Cancel deep sleep timer |
|
1699 */ |
|
1700 void DeepSleepTimerCancel(); |
|
1701 |
|
1702 private: |
|
1703 /** |
|
1704 * Set video length (max or short) |
|
1705 * @param aLength Length of video |
|
1706 * @since 2.8 |
|
1707 */ |
|
1708 void SetVideoLengthL( TInt aLength ); |
|
1709 |
|
1710 /** |
|
1711 * Returns the current photo storage location. |
|
1712 * @return the photo storage location |
|
1713 * @since 2.8 |
|
1714 */ |
|
1715 TInt CurrentPhotoStorageLocation() const; |
|
1716 |
|
1717 /** |
|
1718 * Returns the current video storage location. |
|
1719 * @return the video storage location |
|
1720 * @since 2.8 |
|
1721 */ |
|
1722 TInt CurrentVideoStorageLocation() const; |
|
1723 |
|
1724 /** |
|
1725 * Returns ETrue if the supplied toneId should be silent if the profile is |
|
1726 * set to silent. Does *not* take into account network variant forcing |
|
1727 * sounds on. |
|
1728 * @since 3.0 |
|
1729 * @param aSoundId The tone to check |
|
1730 * @return ETrue if sound should always be played, else EFalse |
|
1731 */ |
|
1732 TBool ToneShouldBeSilent( TCamSoundId aSoundId ); |
|
1733 |
|
1734 /** |
|
1735 * Report to any observers that capture processing has completed |
|
1736 * @since 3.0 |
|
1737 */ |
|
1738 void HandleCaptureCompletion(); |
|
1739 |
|
1740 /** |
|
1741 * Tries to autofocus, will do nothing if camera in use is not |
|
1742 * primary camera, or focus range has not been set first |
|
1743 * @since 3.0 |
|
1744 * @return Whether or not auto focus has been initiated |
|
1745 */ |
|
1746 TBool TryAutoFocus(); |
|
1747 |
|
1748 /** |
|
1749 * Checks the current scene, and where required, updates the autofocus |
|
1750 * mode in use. Called when the photo scene or based-on-scene change |
|
1751 * @since 3.0 |
|
1752 * @param aForceAFReset Whether to force a ResetToIdle independant of scene mode |
|
1753 */ |
|
1754 void CheckAfModeForScene( TBool aForceAFReset = EFalse ); |
|
1755 |
|
1756 /** |
|
1757 * Initalises the AutoFocus interface, if needed |
|
1758 * @since 3.0 |
|
1759 */ |
|
1760 void InitAutoFocusL(); |
|
1761 |
|
1762 /** |
|
1763 * Timeout to play capture tone after delay (to match |
|
1764 * capture tone to actual capture event) |
|
1765 * @since 3.0 |
|
1766 * @param aPtr TAny* ptr (cast to CCamAppController) |
|
1767 * @return Error code retruned by function |
|
1768 */ |
|
1769 static TInt CaptureToneDelayTimeout( TAny* aPtr ); |
|
1770 |
|
1771 /** |
|
1772 * Play the capture tone (called from capture delay timeout) |
|
1773 * @since 3.0 |
|
1774 */ |
|
1775 void PlayDelayedCaptureTone(); |
|
1776 |
|
1777 /** |
|
1778 * Copy Snapshot if needed. Helper function for McaeoSnapImageReady |
|
1779 * @since 3.0 |
|
1780 * @param aSnapshot the snapshot to copy |
|
1781 * @param aError Error code KErrNone to indicate success or a |
|
1782 * standard Symbian OS error code. |
|
1783 */ |
|
1784 void CopySnapshotIfNeeded(const CFbsBitmap& aSnapshot, TInt aError); |
|
1785 |
|
1786 |
|
1787 /** |
|
1788 * Checks whether flash is required for taking a picture. |
|
1789 * @return true if flash is required current mode |
|
1790 */ |
|
1791 TBool FlashRequired() const; |
|
1792 |
|
1793 |
|
1794 private: // Functions from base classes |
|
1795 |
|
1796 /** |
|
1797 * From MCamImageSaveObserver, image save has completed |
|
1798 * @since 2.8 |
|
1799 */ |
|
1800 void HandleSaveEvent( TCamSaveEvent aEvent ); |
|
1801 |
|
1802 /** |
|
1803 * From MCamImageSaveObserver, image save has completed |
|
1804 * @since 2.8 |
|
1805 */ |
|
1806 void HandleFileHarvestingComplete(); |
|
1807 |
|
1808 /** |
|
1809 * Idle timeout expiry - invoke switch to standby mode |
|
1810 * @since 2.8 |
|
1811 * @return TInt to indicate if function should be called again |
|
1812 */ |
|
1813 TInt DoIdleTimeoutL(); |
|
1814 |
|
1815 /** |
|
1816 * Time lapse timeout expiry - update the remaining time countdown |
|
1817 * or initiate the next capture if the full period has expired |
|
1818 * @return TInt to indicate if function should be called again |
|
1819 */ |
|
1820 TInt DoTimeLapseTimeoutL(); |
|
1821 |
|
1822 /** |
|
1823 * Force the application to use phone memory for Video and Image saving. |
|
1824 * Typically called when attempting to access MMC fails. |
|
1825 * @since 2.8 |
|
1826 */ |
|
1827 void ForceUsePhoneMemoryL( TBool aEnable = ETrue ); |
|
1828 |
|
1829 /** |
|
1830 * Complete the burst operation |
|
1831 * @since 2.8 |
|
1832 */ |
|
1833 void CompleteBurstOperation(); |
|
1834 |
|
1835 /** |
|
1836 * Complete the time lapse operation |
|
1837 * @since 3.0 |
|
1838 */ |
|
1839 void CompleteTimeLapseOperation(); |
|
1840 |
|
1841 |
|
1842 /** |
|
1843 * Whether or not the engine is currently processing a capture |
|
1844 * still, video or sequence. |
|
1845 * @since 2.8 |
|
1846 * @return ETrue if the engine is performing a capture operation |
|
1847 */ |
|
1848 TBool EngineProcessingCapture() const; |
|
1849 |
|
1850 /** |
|
1851 * Handle an arriving call. Stops video and cancels sequence capture |
|
1852 * in early stages. |
|
1853 * @since 2.8 |
|
1854 */ |
|
1855 void HandleIncomingCall(); |
|
1856 |
|
1857 /** |
|
1858 * Cleans up the controller active camera state |
|
1859 * @param aAny Pointer to the object which is the target |
|
1860 * of the cleanup operation |
|
1861 * @since 2.8 |
|
1862 */ |
|
1863 static void Cleanup( TAny* aAny ); |
|
1864 |
|
1865 /** |
|
1866 * Immediately cancels a still capture at any stage. |
|
1867 * @since 2.8 |
|
1868 */ |
|
1869 void CancelStillCaptureNow(); |
|
1870 |
|
1871 /** |
|
1872 * Attempt to cleanup capture array if burst capture fails |
|
1873 * @since 2.8 |
|
1874 * @param aImageCountDelivered number of images delivered |
|
1875 * @param aError error returned from burst capture operation |
|
1876 */ |
|
1877 void TidyCaptureArray( TInt aImageCountDelivered, |
|
1878 TInt aError ); |
|
1879 |
|
1880 /** |
|
1881 * Load 2ndary caera specifc settings (on construction or camera switch) |
|
1882 * @since 3.0 |
|
1883 */ |
|
1884 void LoadSecondaryCameraSettingsL(); |
|
1885 |
|
1886 // ------------------------------------------------------- |
|
1887 // Orientation sensor / rotation related |
|
1888 public: |
|
1889 |
|
1890 /** |
|
1891 * Get current orientation to be used on image rotation. |
|
1892 * Always ECamOrientation0 if rotation setting is OFF. |
|
1893 * @return Current image orientation value. |
|
1894 */ |
|
1895 TCamImageOrientation ImageOrientation() const; |
|
1896 |
|
1897 /** |
|
1898 * Checks if mass storage exist in current phone. |
|
1899 * @ return True if Mass storage exist |
|
1900 */ |
|
1901 TBool ExistMassStorage() const; |
|
1902 |
|
1903 /** |
|
1904 * Checks if a memory type is available on the phone. |
|
1905 * @param aStorage TCamMediaStorage enum specifiying the type of storage; |
|
1906 * default=ECamMediaStorageCurrent |
|
1907 * @return ETrue if the Memory type is available |
|
1908 */ |
|
1909 TBool IsMemoryAvailable( const TCamMediaStorage aStorage = |
|
1910 ECamMediaStorageCurrent, TBool aIgnoreUsbPersonality = EFalse ) const; |
|
1911 |
|
1912 public: |
|
1913 |
|
1914 /** |
|
1915 * Update the sensor api object |
|
1916 * @since 3.0 |
|
1917 * @param aStartupApi eTrue if we need to recreate the Api |
|
1918 */ |
|
1919 void UpdateSensorApiL( TBool aStartupApi ); |
|
1920 |
|
1921 /** |
|
1922 * Forces a refresh of the local copy of the back slide status |
|
1923 * @since 2.8 |
|
1924 */ |
|
1925 void RefreshSlideStatus(); |
|
1926 |
|
1927 private: |
|
1928 |
|
1929 /** |
|
1930 * From MSensrvDataListener receive Sensor Data |
|
1931 * |
|
1932 * Indicates data is available in the receiving buffer. A client can read |
|
1933 * the data through GetData()-function in the related channel object. Data |
|
1934 * is valid until the data received notification occurs again. |
|
1935 * |
|
1936 * @since 5.0 |
|
1937 * @param[in] aChannel Reference to the related channel object |
|
1938 * @param[in] aCount Data object count in receiving buffer. |
|
1939 * @param[in] aDataLost Number of lost data items. Data loss can occur if |
|
1940 * the client does not request new data from server fast enough. This |
|
1941 * can happen |
|
1942 * when system is under heavy load and the client process has lower |
|
1943 * priority than sensor server process. If data loss is a problem, |
|
1944 * consider using higher object count in data listening, which will reduce |
|
1945 * number of expensive IPC calls used in data transmission. |
|
1946 */ |
|
1947 void DataReceived( CSensrvChannel& aChannel, |
|
1948 TInt aCount, |
|
1949 TInt aDataLost ); |
|
1950 /** |
|
1951 * From MSensrvDataListener receive data error notice |
|
1952 * |
|
1953 * Data listening failed. |
|
1954 * If error was fatal, channel has also been closed and sensor server session |
|
1955 * terminated. If error was minor, some data has potentially been lost. |
|
1956 * |
|
1957 * @since 5.0 |
|
1958 * @param[in] aChannel Reference to the related channel object |
|
1959 * @param[in] aError Error code. |
|
1960 */ |
|
1961 void DataError( CSensrvChannel& aChannel, |
|
1962 TSensrvErrorSeverity aError ); |
|
1963 |
|
1964 /** |
|
1965 * From MSensrvDataListener |
|
1966 * |
|
1967 * Returns a pointer to a specified interface - to allow future extension |
|
1968 * of this class without breaking binary compatibility |
|
1969 * |
|
1970 * @since S60 5.0 |
|
1971 * @param aInterfaceUid Identifier of the interface to be retrieved |
|
1972 * @param aInterface A reference to a pointer that retrieves the specified interface. |
|
1973 */ |
|
1974 void GetDataListenerInterfaceL( TUid aInterfaceUid, |
|
1975 TAny*& aInterface ); |
|
1976 |
|
1977 /** |
|
1978 * Set image rotation parameters |
|
1979 * @since 3.0 |
|
1980 */ |
|
1981 void SetImageOrientationL(); |
|
1982 |
|
1983 /** |
|
1984 * Mapping from Sensor orientation data type to our own |
|
1985 * image orientation type. |
|
1986 * @param aSensorOrientation Orientation Sensor device orientation value. |
|
1987 * @return Camera orientation value. |
|
1988 */ |
|
1989 static TCamImageOrientation MapSensorOrientatio2CamOrientation( |
|
1990 const TSensrvOrientationData::TSensrvDeviceOrientation& aSensorOrientation, |
|
1991 TCamImageOrientation aLastImageOrientation, |
|
1992 TCamActiveCamera aActiveCamera ); |
|
1993 |
|
1994 /** |
|
1995 * Mapping from camera orientation data type to bitmap orientation type. |
|
1996 * @param camera orientation value. |
|
1997 * @return CBitmapRotator::TRotationAngle. |
|
1998 */ |
|
1999 static CBitmapRotator::TRotationAngle MapCamOrientation2RotationAngle( |
|
2000 const TCamImageOrientation aOrientation ); |
|
2001 |
|
2002 // ------------------------------------------------------- |
|
2003 |
|
2004 private: |
|
2005 |
|
2006 /** |
|
2007 * From MPropertyObserver Handle change in a watched property |
|
2008 * @since 2.8 |
|
2009 * @param aCategory The type of property |
|
2010 * @param aKey The property that has changed |
|
2011 */ |
|
2012 void HandlePropertyChangedL( const TUid& aCategory, const TUint aKey ); |
|
2013 |
|
2014 private: |
|
2015 |
|
2016 /** |
|
2017 * Callback function that is called when lens cover state changes. |
|
2018 * Used to implement delayed handling of lens cover events. |
|
2019 * @param aPtr Pointer to CCamAppController |
|
2020 * @return |
|
2021 */ |
|
2022 static TInt LensCoverUpdateL( TAny* aPtr ); |
|
2023 |
|
2024 /** |
|
2025 * Handles the slide closed event |
|
2026 * @since 2.8 |
|
2027 */ |
|
2028 void HandleSlideClosedL(); |
|
2029 |
|
2030 /** |
|
2031 * Handles the slide open event |
|
2032 * @since 2.8 |
|
2033 */ |
|
2034 void HandleSlideOpenedL(); |
|
2035 |
|
2036 |
|
2037 private: // Functions from base classes |
|
2038 |
|
2039 /** |
|
2040 * From MCamObserver |
|
2041 * Receives event codes from observables |
|
2042 * @since 3.0 |
|
2043 * @param aEvent The event code |
|
2044 */ |
|
2045 void HandleObservedEvent( TCamObserverEvent aEvent ); |
|
2046 |
|
2047 /** |
|
2048 * Returns whether or not the current profile is silent |
|
2049 * @since 3.0 |
|
2050 * @return ETrue if current profile is silent |
|
2051 */ |
|
2052 TBool IsProfileSilentL(); |
|
2053 |
|
2054 /** |
|
2055 * Static callback function for backlight timer reset |
|
2056 * since 3.0 |
|
2057 * @param aPtr Pointer to an instance of the CCamAppController |
|
2058 * @return TInt to indicate if function should be called again |
|
2059 */ |
|
2060 static TInt ResetInactivityTimer( TAny* aPtr ); |
|
2061 |
|
2062 /** |
|
2063 * Enable or disable the system screensaver |
|
2064 * @since 3.0 |
|
2065 * @param aEnable ETrue if the screensaver is enabled |
|
2066 * else EFalse |
|
2067 */ |
|
2068 void EnableScreenSaver( TBool aEnable ); |
|
2069 |
|
2070 /** |
|
2071 * Static callback function for timer callback for closing |
|
2072 * location trail. |
|
2073 * @since S60 v5.0 |
|
2074 * @param aPtr Pointer to an instance of the CCamAppController |
|
2075 * @return TInt to indicate if function should be called again |
|
2076 */ |
|
2077 static TInt RetryStopLocationTrail( TAny* aPtr ); |
|
2078 |
|
2079 public: |
|
2080 void StartLocationTrailL(); |
|
2081 void StopLocationTrail( TBool aCloseSession = EFalse ); |
|
2082 |
|
2083 public: |
|
2084 /** |
|
2085 * Returns a pointer to flash status object. Never NULL if |
|
2086 * ConstructL has been executed successfully. |
|
2087 * @return flashStatusPointer |
|
2088 */ |
|
2089 CCamFlashStatus* FlashStatus() const; |
|
2090 |
|
2091 /** |
|
2092 * Returns false, if a picture cannot be taken, due to flash being |
|
2093 * required and recharged, true otherwise. |
|
2094 * @return flashstatus |
|
2095 */ |
|
2096 TBool CheckFlash() const; |
|
2097 |
|
2098 /** |
|
2099 * Called when about to switch to burst or timelapse mode. Stores |
|
2100 * the current flash mode and scene. |
|
2101 */ |
|
2102 void SaveFlashMode(); |
|
2103 |
|
2104 /** |
|
2105 * Called when switching to single image capture mode. Restores |
|
2106 * flash mode, if using same scene mode as was used when the |
|
2107 * flash mode was stored. Otherwise clears the stored info. |
|
2108 */ |
|
2109 void RestoreFlashMode(); |
|
2110 |
|
2111 public: |
|
2112 /** |
|
2113 * Returns a pointer to dynamic Configuration Manager. |
|
2114 * |
|
2115 * Never NULL if ConstructL has been executed successfully. |
|
2116 * @return Pointer to Configuration Manager |
|
2117 */ |
|
2118 CCamConfiguration* Configuration() const; |
|
2119 |
|
2120 |
|
2121 /** |
|
2122 * Returns whether or not the keylock is on |
|
2123 * @since 5.0 |
|
2124 * @return ETrue if keylock is on, otherwise EFalse |
|
2125 */ |
|
2126 TBool IsKeyLockOn(); |
|
2127 |
|
2128 /** |
|
2129 * Used to get whether user is sliding in the self timer preview. |
|
2130 * @return ETrue if user is sliding in the self timer preview. |
|
2131 */ |
|
2132 inline TBool IsSlideInSelfTimerPreview() const { return iSlideInSelfTimerPreview; }; |
|
2133 |
|
2134 /** |
|
2135 * Used to set whether user is sliding in the self timer preview. |
|
2136 * @param aValue the value to indicate whether user is sliding in the self timer preview. |
|
2137 */ |
|
2138 inline void SetSlideInSelfTimerPreview( TBool aValue ) { iSlideInSelfTimerPreview = aValue; }; |
|
2139 |
|
2140 /** |
|
2141 * Used to get the current storage. |
|
2142 * @return the current storage. |
|
2143 */ |
|
2144 TCamMediaStorage CurrentStorage(); |
|
2145 |
|
2146 /** |
|
2147 * Returns whether autofocus is still needed before capturing. |
|
2148 * @return ETrue if it's necessary to try autofocus one more time before the capture. |
|
2149 */ |
|
2150 TBool IsAfNeeded(); |
|
2151 |
|
2152 /** |
|
2153 * Sets an autofocus needed flag, so that autofocus is done after cancel and range set are finished. |
|
2154 */ |
|
2155 void SetAfNeeded( TBool aAfNeeded ); |
|
2156 |
|
2157 /** |
|
2158 * Returns whether recording was stopped because USB was connected. |
|
2159 * @return ETrue if video recording was stopped because USB was connected. |
|
2160 */ |
|
2161 TBool IsCaptureStoppedForUsb(); |
|
2162 |
|
2163 /** |
|
2164 * set the flag of iSetCaptureStoppedForUsb. |
|
2165 */ |
|
2166 void SetCaptureStoppedForUsb( TBool aCaptureStoppedForUsb ); |
|
2167 |
|
2168 /** |
|
2169 * Cancels the memory card dismount monitoring |
|
2170 */ |
|
2171 void CancelDismountMonitoring(); |
|
2172 |
|
2173 /** |
|
2174 * Start the memory card dismount monitoring |
|
2175 */ |
|
2176 void StartDismountMonitoring(); |
|
2177 |
|
2178 /** |
|
2179 * Returns whether all snapshots have been received in burst mode |
|
2180 * @return ETrue if all snapshots have been received in burst mode. |
|
2181 */ |
|
2182 TBool AllSnapshotsReceived(); |
|
2183 |
|
2184 /** |
|
2185 * Returns the last made autofocusrequest type or 0, if there are |
|
2186 * no pending autofocus requests. |
|
2187 */ |
|
2188 TInt PendingAFRequest(); |
|
2189 |
|
2190 /** |
|
2191 * Calculates the remaining video recording time based on video |
|
2192 * quality settings (instead of getting the value from camera |
|
2193 * controller) |
|
2194 * @param aStorage TCamMediaStorage enum specifying the type of storage; |
|
2195 * default=ECamMediaStorageCurrent |
|
2196 * @return remaining time |
|
2197 */ |
|
2198 TTimeIntervalMicroSeconds |
|
2199 CalculateVideoTimeRemainingL( TCamMediaStorage |
|
2200 aStorage = ECamMediaStorageCurrent); |
|
2201 /** |
|
2202 * Sets orientation of the application to CCamera |
|
2203 * |
|
2204 */ |
|
2205 void SetCameraOrientationModeL( TInt aOrientation ); |
|
2206 |
|
2207 /** |
|
2208 * Final part in constructing cameracontroller |
|
2209 * |
|
2210 */ |
|
2211 void CompleteCameraConstructionL(); |
|
2212 |
|
2213 /** |
|
2214 * Returns index of current image. |
|
2215 */ |
|
2216 TInt CurrentImageIndex(); |
|
2217 |
|
2218 /** |
|
2219 * Sets the value defining the need for CAE video init and prepare |
|
2220 */ |
|
2221 void SetVideoInitNeeded( TBool aVideoInitNeeded ); |
|
2222 |
|
2223 /** |
|
2224 * Returns the value defining the need for CAE video init and prepare |
|
2225 */ |
|
2226 TBool VideoInitNeeded(); |
|
2227 |
|
2228 /** |
|
2229 * Stores the UserScene settings |
|
2230 */ |
|
2231 void StoreUserSceneSettingsL(); |
|
2232 |
|
2233 /** |
|
2234 * Toggles between highest 16:9 and 4:3 quality levels. |
|
2235 */ |
|
2236 TBool ToggleWideScreenQuality( TBool aWide ); |
|
2237 |
|
2238 /** |
|
2239 * Returns the value of iSaveStarted |
|
2240 */ |
|
2241 TBool IsSaveStarted(); |
|
2242 |
|
2243 /** |
|
2244 * Getter for iIssueModeChangeSequenceSucceeded |
|
2245 */ |
|
2246 TBool IssueModeChangeSequenceSucceeded(); |
|
2247 |
|
2248 /** |
|
2249 * Initiates startup sequence in embedded mode |
|
2250 */ |
|
2251 void EmbeddedStartupSequence(); |
|
2252 |
|
2253 /** |
|
2254 * Called by the snapshotrotator to indicate when snapshot |
|
2255 * is rotated and ready for drawing |
|
2256 */ |
|
2257 void SnapshotRotationComplete(); |
|
2258 |
|
2259 /** |
|
2260 * Method to retrieve Remaining Recording time from CCaeEngine |
|
2261 */ |
|
2262 TTimeIntervalMicroSeconds RemainingVideoRecordingTime(); |
|
2263 |
|
2264 |
|
2265 /** |
|
2266 * Handles hdmi connect event during recording after video stop |
|
2267 */ |
|
2268 void HandlePostHdmiConnectDuringRecordingEventL(); |
|
2269 |
|
2270 /** |
|
2271 * Sets a Pending Hdmi Event |
|
2272 */ |
|
2273 void SetPendingHdmiEvent( TCamHdmiEvent aPendingHdmiEvent ); |
|
2274 |
|
2275 /** |
|
2276 * Handles the current pending Hdmi EVent |
|
2277 */ |
|
2278 void HandlePendingHdmiEvent(); |
|
2279 |
|
2280 /** |
|
2281 * Returns ETrue when scene mode is forced to |
|
2282 * "Automatic" by secondary camera |
|
2283 */ |
|
2284 TBool SceneModeForcedBySecondaryCamera(); |
|
2285 |
|
2286 /** |
|
2287 * Set value defining if capturing with touch capture button |
|
2288 */ |
|
2289 void SetTouchCapture( TBool aTouchCapture ); |
|
2290 |
|
2291 private: |
|
2292 |
|
2293 // ----------------------------------------------------- |
|
2294 // Construction parts |
|
2295 |
|
2296 void ConstructCameraControllerL( TInt aCameraIndex ); |
|
2297 |
|
2298 // ----------------------------------------------------- |
|
2299 // Helper utility methods |
|
2300 TInt GetCriticalMemoryLevelL( const TCamMediaStorage& aStorage ); |
|
2301 |
|
2302 // ----------------------------------------------------- |
|
2303 // Events and requests handling |
|
2304 void EventHandlingErrorRecovery( TInt aError ); |
|
2305 |
|
2306 void HandleSequenceEventL( TInt aStatus, |
|
2307 TCamCameraEventId aEventId, |
|
2308 TAny* aEventData ); |
|
2309 |
|
2310 void HandleRequestEventL( TInt aStatus, |
|
2311 TCamCameraEventId aEventId, |
|
2312 TAny* aEventData ); |
|
2313 |
|
2314 void HandleSettingEventL( TInt aStatus, |
|
2315 TCamCameraEventId aEventId, |
|
2316 TAny* aEventData ); |
|
2317 |
|
2318 void HandleImageCaptureEventL( TInt aStatus, |
|
2319 CCamBufferShare* aShare ); |
|
2320 void HandleImageStopEventL( TInt aStatus, |
|
2321 TInt aFullCaptureCount ); |
|
2322 |
|
2323 void HandleViewfinderFrame( TInt aStatus, CFbsBitmap* aFrame ); |
|
2324 void HandleSnapshotEvent( TInt aStatus, CFbsBitmap* aBitmap ); |
|
2325 void HandleVideoAsyncStopEvent( TInt aStatus ); |
|
2326 void HandleVideoStopEvent( TInt aStatus ); |
|
2327 |
|
2328 void IssueModeChangeSequenceL( TBool aStartup = EFalse ); |
|
2329 void GenerateModeChangeSequenceL( RCamRequestArray& aSequence ); |
|
2330 void GenerateStartupSequenceL( RCamRequestArray& aSequence ); |
|
2331 |
|
2332 void IssueRequestL( const TCamCameraRequestId& aId ); |
|
2333 void IssueDirectRequestL( const TCamCameraRequestId& aId ); |
|
2334 void IssueSettingsChangeRequestL(); |
|
2335 |
|
2336 void ProceedPendingOrNotifyReadyL(); |
|
2337 |
|
2338 void DoVideoNameRetryL( TInt aStatus ); |
|
2339 |
|
2340 /** |
|
2341 * Sets the current image/video settings from UI to camera, by calling |
|
2342 * RestoreSettingIfNecessaryL for each supported setting, and starting |
|
2343 * the setting process if any of them needs setting. |
|
2344 * This function needs to be called after camera release and switches |
|
2345 * between image/video mode. |
|
2346 */ |
|
2347 void RestoreSettingsToCameraL(); |
|
2348 |
|
2349 /** |
|
2350 * Checks if the setting needs restoring (UI setting value doesn't match |
|
2351 * the actual setting value in camera). In that case, function adds |
|
2352 * this setting to the list of pending settings. |
|
2353 * @param aSettingItem Setting item id |
|
2354 */ |
|
2355 void RestoreSettingIfNecessaryL( TCamSettingItemIds aSettingItem ); |
|
2356 |
|
2357 /** |
|
2358 * Checks if the setting needs restoring (UI setting value doesn't match |
|
2359 * the actual setting value in camera). In that case, function |
|
2360 * directly set settting to camera |
|
2361 * @param aSettingItem Setting item id |
|
2362 */ |
|
2363 void DirectRestoreSettingIfNecessaryL( TCamSettingItemIds aSettingItem ); |
|
2364 |
|
2365 /** |
|
2366 * Set internal state based on camera event. |
|
2367 */ |
|
2368 void SetStateFromEvent( TCamCameraEventId aEventId ); |
|
2369 |
|
2370 void InitCaptureLimitL(); |
|
2371 |
|
2372 static TCamCameraRequestId |
|
2373 NextRequestL( const TCamCameraState& aFrom, |
|
2374 const TCamCameraState& aTo ); |
|
2375 |
|
2376 static TCamCameraEventId |
|
2377 ResponseForRequest( const TCamCameraRequestId& aRequestId ); |
|
2378 |
|
2379 |
|
2380 /** |
|
2381 * Called when mmc is about to be dismounted |
|
2382 */ |
|
2383 TInt DriveChangeL( TCamDriveChangeType aType ); |
|
2384 |
|
2385 /** |
|
2386 * Rotate the snapshot copy before thumbnail creation |
|
2387 */ |
|
2388 void RotateSnapshotL(); |
|
2389 |
|
2390 /** |
|
2391 * Handle change in image quality setting. |
|
2392 * Handle stopping viewfinder, re-preparing quality and |
|
2393 * restarting viewfinder if viewfinder is running. |
|
2394 * Notify observers about quality change. |
|
2395 */ |
|
2396 void HandleImageQualitySettingChangeL(); |
|
2397 |
|
2398 /** |
|
2399 * Handle change in video quality setting. |
|
2400 * Handle stopping viewfinder, re-preparing quality and |
|
2401 * restarting viewfinder if viewfinder is running. |
|
2402 * Notify observers about quality change. |
|
2403 */ |
|
2404 void HandleVideoQualitySettingChangeL(); |
|
2405 |
|
2406 // ======================================================= |
|
2407 private: // Data |
|
2408 TBool iValueIsStored; |
|
2409 CCamCameraController* iCameraController; |
|
2410 CCamSettingProvider* iSettingProvider; |
|
2411 |
|
2412 TUint iBusyFlags; // TCamBusyFlags values |
|
2413 TCamAppControllerInfo iInfo; |
|
2414 |
|
2415 // Temporarily stop notifications to observers |
|
2416 TBool iMuteNotifications; |
|
2417 |
|
2418 // Observers of controller events |
|
2419 RPointerArray<MCamControllerObserver> iControllerObservers; |
|
2420 TInt iCameraReferences; |
|
2421 |
|
2422 // The settings model for dynamic and static data. |
|
2423 // CCamSettingsModelBase* iSettingsModel; |
|
2424 MCamSettingsModel* iSettingsModel; |
|
2425 MCamSettingPreviewHandler* iSettingsPreviewHandler; // Currently same object as iSettingsModel. |
|
2426 RArray<TCamSettingItemIds> iPreviewRollbacks; // Used when cancelling previews. |
|
2427 |
|
2428 // Used to indicate whether user is sliding in the self timer preview. |
|
2429 TBool iSlideInSelfTimerPreview; |
|
2430 |
|
2431 TBool iVideoPrepareNeeded; // Video re-prepare needed due to setting change |
|
2432 |
|
2433 // Boolean to record if view finder should be frozen at next frame |
|
2434 TBool iFreezeViewFinder; |
|
2435 // Boolean to indicate that the frozen frame should be updated |
|
2436 TBool iUpdateFrozenFrame; |
|
2437 |
|
2438 // name for next file, including path and extension |
|
2439 TFileName iSuggestedVideoPath; |
|
2440 // Used to indicate that the media storage has been changed tbe |
|
2441 // pathnames need to be checked |
|
2442 TCamMediaStorage iSetNewPathnamesPending; |
|
2443 // Counters used for creating multiple month folders |
|
2444 TInt iMonthFolderCounters[CCamFolderUtility::ECamFolderTypeLast]; |
|
2445 // Counter for image number. |
|
2446 // Stored locally to avoid performance problems during burst. |
|
2447 TInt iImageNumberCache; |
|
2448 |
|
2449 // Whether or not the engine is initialized for video recording |
|
2450 TBool iVideoRecorderInitialized; |
|
2451 |
|
2452 // estimate of record time elapsed |
|
2453 TTimeIntervalMicroSeconds iVideoTimeElapsed; |
|
2454 // estimate of record time remaining |
|
2455 TTimeIntervalMicroSeconds iVideoTimeRemaining; |
|
2456 |
|
2457 // Whether or not a capture mode transition is in progress |
|
2458 TBool iCaptureModeTransitionInProgress; |
|
2459 |
|
2460 // Active object for saving images to file asynchronously |
|
2461 CCamImageSaveActive* iImageSaveActive; |
|
2462 // Array containing data that represents the images in a burst capture |
|
2463 CCamBurstCaptureArray* iCaptureArray; |
|
2464 // Index into burst capture array used to determine current image for |
|
2465 // SnapshotImage(), CurrentImageName(), CurrentFullFileName() and |
|
2466 // DeleteCurrentFile(). Set by call to SetAsCurrentImage(). |
|
2467 // Single capture and video always use index 0. |
|
2468 TInt iCurrentImageIndex; |
|
2469 // Filenames for a timelapse sequence used for the delete sequence option |
|
2470 CDesCArray* iSequenceFilenameArray; |
|
2471 // Tracks usage of the capture array, for timely release of memory |
|
2472 TInt iArrayUsageCount; |
|
2473 // Capture count requested. |
|
2474 // Used in burst and self-timer+timelapse modes. |
|
2475 TInt iRequestedCaptureCount; |
|
2476 // Indicates wheter autofocuscancel requests should be handled or not.. |
|
2477 // Used in CancelFocusAndCapture. |
|
2478 TBool iNoBurstCancel; |
|
2479 |
|
2480 // Indicates if capturekey has been raised or not. This is used to |
|
2481 // determine if bursttimer should be activated or not. |
|
2482 TBool iKeyUP; |
|
2483 |
|
2484 // Timer to control when short burst is changed to press and hold burst. |
|
2485 CCamTimer* iBurstTimer; |
|
2486 // Timer for switch to standby mode |
|
2487 CCamTimer* iIdleTimer; |
|
2488 // Timer for initiating Time Lapse captures |
|
2489 CCamTimer* iTimeLapseTimer; |
|
2490 |
|
2491 // Status variable for location trail |
|
2492 TBool iLocationTrailStarted; |
|
2493 |
|
2494 // Timer for stopping location trail |
|
2495 CCamTimer* iLocationTrailTimer; |
|
2496 |
|
2497 // Whether or not a capture key pressed during image saving |
|
2498 TBool iCaptureKeyPressedWhileImageSaving; |
|
2499 // flag to indicate current VF status |
|
2500 TBool iViewFinding; |
|
2501 // timer to keep backlight active while VF is running |
|
2502 CPeriodic* iBacklightTimer; |
|
2503 // Class for playing sounds |
|
2504 CCamAudioPlayerController* iSoundPlayer; |
|
2505 CRepository* iRepository; |
|
2506 TInt iDiskCriticalLevel; // critical threshold for card storage |
|
2507 TInt iRamDiskCriticalLevel; // critical threshold for phone memory storage |
|
2508 // Whether we are currently in a call or ringing |
|
2509 TBool iInCallOrRinging; |
|
2510 // Keep track of whether we are currently saving a video clip or image |
|
2511 TBool iSaving; |
|
2512 TBool iSaveStarted; |
|
2513 // Keep track of whether a ReleaseEngine call has been made while an Init call has been made |
|
2514 TBool iPendingRelease; |
|
2515 TBool iEndKeyWaiting; |
|
2516 TBool iCompleteTimeLapsePending; |
|
2517 TBool iAutoFocusRequested; |
|
2518 TBool iCaptureRequested; |
|
2519 TBool iVideoRequested; |
|
2520 TBool iAfNeeded; |
|
2521 |
|
2522 TBool iDemandKeyRelease; // Demand to release capture key |
|
2523 |
|
2524 // Keep track of the camera that the next switch will activate |
|
2525 TInt iNextSwitchIsToPrimaryCamera; |
|
2526 |
|
2527 // Flag for queued Camera switch operation |
|
2528 TCameraSwitchRequired iCameraSwitchRequired; |
|
2529 |
|
2530 TBool iForceUseOfPhoneMemory; |
|
2531 |
|
2532 // Keeps track of the number of times we have attempted to set the video name |
|
2533 TInt iVideoNameRetries; |
|
2534 |
|
2535 // Specified whether an image save request is pending. That is, |
|
2536 // we are waiting for the engine to return with an image that can be saved. |
|
2537 // Required to let post-capture know whether an image has been saved yet. |
|
2538 TBool iImageSaveRequestPending; |
|
2539 |
|
2540 // Keeps track of the camera slider state so that |
|
2541 // we don't have to keep accessing the shared data file |
|
2542 TInt iSlideState; |
|
2543 TInt iNewSlideState; |
|
2544 |
|
2545 // callback used for delayed slider update |
|
2546 CPeriodic* iSliderCallBack; |
|
2547 |
|
2548 // Slider event flag |
|
2549 TBool iSliderCloseEvent; |
|
2550 |
|
2551 // The period between each timelapse capture |
|
2552 TTimeIntervalMicroSeconds iTimeLapseInterval; |
|
2553 // The time at which the previous timelapse capture was initiated |
|
2554 TTime iTimeLapseStartTime; |
|
2555 |
|
2556 |
|
2557 |
|
2558 CSensrvChannel* iAccSensorChannel; |
|
2559 TBool iAccSensorListening; |
|
2560 TBool iAccSensorInfoInitialized; |
|
2561 // Flag to allow delayed re-preparation of engine |
|
2562 TBool iOrientationChangeOccured; |
|
2563 |
|
2564 // Outside flags, as available for Camera Controller at all times. |
|
2565 TCamImageOrientation iImageOrientation; |
|
2566 TCamImageOrientation iLastImageOrientation; |
|
2567 |
|
2568 // Property watcher to report changes in the slide state |
|
2569 CCamPropertyWatcher* iSlideStateWatcher; |
|
2570 // Property watcher to report changes in the keylock state |
|
2571 CCamPropertyWatcher* iKeyLockStatusWatcher; |
|
2572 // Property watcher to report changes in the profile state |
|
2573 CCamPropertyWatcher* iProfileStatusWatcher; |
|
2574 // Set to ETrue if shutter sound always played |
|
2575 // otherwise playing shutter sound depends on |
|
2576 // current profile |
|
2577 TBool iShutterSndAlwaysOn; |
|
2578 // Active object to listen to the call state. |
|
2579 CCamCallStateAo* iCallStateAo; |
|
2580 // Organises notifications to observers of capture completion |
|
2581 CCamObserverHandler* iCaptureCompletionObserverHandler; |
|
2582 TInt iActualBurst; |
|
2583 CCamTimer* iCaptureToneDelayTimer; |
|
2584 // Whether or not the video was stopped due to the phone app |
|
2585 // having the foreground |
|
2586 TBool iVideoStoppedForPhoneApp; |
|
2587 // used to simulate the receipt of a viewfinder frame when |
|
2588 // timelapse capturing. |
|
2589 CFbsBitmap* iSnapShotCopy; |
|
2590 // estimated snapshot size in bytes - used when monitoring free |
|
2591 // RAM during burst capture |
|
2592 TInt iSnapshotDataSize; |
|
2593 // array of estimated jpeg sizes in bytes for different image |
|
2594 // resolutions - used when monitoring free RAM during burst capture |
|
2595 RArray<TInt> iJpegDataSizes; |
|
2596 // array of estimated post capture sizes required in bytes for |
|
2597 // different image resolutions - used when monitoring free RAM |
|
2598 // during burst capture |
|
2599 RArray<TInt> iSequencePostProcessDataSizes; |
|
2600 // Array of CameraEventInterested observers which wanted to be camera |
|
2601 // observers when camera wasn't yet created. When camera is created |
|
2602 // Observers from this array should be attached first and array should |
|
2603 // be cleared. |
|
2604 RArray<const MCamCameraObserver*> iPendingObserversArray; |
|
2605 RArray<TUint> iCameraEventInterested; |
|
2606 |
|
2607 // Used to wake the camera hardware approximately 2-3 seconds before |
|
2608 // a timelapse capture |
|
2609 TBool iCameraWoken; |
|
2610 TBool iZoomWaitingForCamera; |
|
2611 TBool iNewZoomPending; |
|
2612 TInt iDesiredZoomVal; |
|
2613 |
|
2614 TBool iSequenceCaptureInProgress; |
|
2615 TInt iLongSequenceLimit; |
|
2616 |
|
2617 // Boolean to determine whether filename has already been |
|
2618 // reserved for the image being currently captured. Reserving |
|
2619 // is done when either the image's snapshot snapshot or |
|
2620 // image data arrives. (But not again when the other one comes) |
|
2621 TBool iFilenameReserved; |
|
2622 TCamEvCompRange iEvRange; |
|
2623 |
|
2624 #if defined(RD_MDS_2_5) && !defined(__WINSCW__) |
|
2625 RLocationTrail iLocationUtility; |
|
2626 TBool iLocationUtilityConnected; |
|
2627 #endif // __WINSCW__ |
|
2628 |
|
2629 #ifdef CAMERAAPP_PERFORMANCE_MEASUREMENT |
|
2630 TCamPerformanceState iPerformanceState; |
|
2631 #endif |
|
2632 |
|
2633 TBool iAppUiAvailable; |
|
2634 // If this boolean is set to true, the next focus successful |
|
2635 // or focus failed event should be ignored as it's resulted by |
|
2636 // moving lens to hyperfocal position when cancelling AF. |
|
2637 TBool iAFCancelInProgress; |
|
2638 // Holds last made autofocusrequest type or 0, if there are no |
|
2639 // pending autofocus requests. |
|
2640 TInt iPendingAFRequest; |
|
2641 // AFrequest currently in processing. |
|
2642 TInt iCurrentAFRequest; |
|
2643 CCamFlashStatus* iFlashStatus; |
|
2644 TBool iFlashModeSaved; |
|
2645 TCamSceneId iSavedFlashScene; |
|
2646 TCamFlashId iSavedFlashMode; |
|
2647 TBool iSettingsRestoreNeeded; |
|
2648 CCamConfiguration* iConfiguration; //< Configuration Manager. *owned* |
|
2649 CCFClient* iContextFwClient; |
|
2650 TBool iDefineContextSuccessful; |
|
2651 TBool iStorageChangeProcessOngoing; |
|
2652 // own. |
|
2653 CCamGSInterface* iPlugin; |
|
2654 TBool iSilentProfile; |
|
2655 TInt iTimeLapseCaptureCount; |
|
2656 RFs iFs; |
|
2657 CCamDriveChangeNotifier* iDriveChangeNotifier; |
|
2658 TCamMediaStorage iCurrentStorage; |
|
2659 TCamMediaStorage iPreferredStorageLocation; |
|
2660 TCamMediaStorage iForcedStorageLocation; |
|
2661 TCamMediaStorage iInitialVideoStorageLocation; |
|
2662 TBool iCaptureStoppedForUsb; |
|
2663 TBool iDismountPending; |
|
2664 TBool iAllSnapshotsReceived; |
|
2665 CCamTimer* iDeepSleepTimer; // own |
|
2666 TBool iDeepSleepTimerExpired; |
|
2667 // not owned by camappcontroller |
|
2668 CCameraUiConfigManager* iConfigManager; |
|
2669 TBool iVideoInitNeeded; // Used to decide if the need to call CAE video init |
|
2670 CCamSyncRotatorAo* iRotatorAo; |
|
2671 CFbsBitmap* iRotatedSnapshot; |
|
2672 CCamBurstCaptureArray* iRotationArray; |
|
2673 CCamSnapShotRotator* iSnapShotRotator; |
|
2674 // orientation at capture time |
|
2675 TCamImageOrientation iCaptureOrientation; |
|
2676 |
|
2677 TBool iIssueModeChangeSequenceSucceeded; |
|
2678 |
|
2679 CCamTvAccessoryMonitor* iTvAccessoryMonitor; |
|
2680 |
|
2681 TBool iHdmiCableConnectedDuringRecording; |
|
2682 |
|
2683 TBool iSnapshotRedrawNeeded; |
|
2684 |
|
2685 TCamHdmiEvent iPendingHdmiEvent; |
|
2686 |
|
2687 TBool iSceneModeForcedBySecondaryCamera; |
|
2688 |
|
2689 TBool iTouchCapture; |
|
2690 |
|
2691 }; |
|
2692 |
|
2693 #endif // CAMAPPCONTROLLER_H |
|
2694 |
|
2695 // End of File |