|
1 // Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
2 // All rights reserved. |
|
3 // This component and the accompanying materials are made available |
|
4 // under the terms of "Eclipse Public License v1.0" |
|
5 // which accompanies this distribution, and is available |
|
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // testadvancedsettings.cpp |
|
15 // |
|
16 // |
|
17 |
|
18 #include "test_advanced_settings.h" |
|
19 #include <ecamerrors.h> |
|
20 #include "ecamversion.h" |
|
21 |
|
22 CTestCamAdvSet::CTestCamAdvSet(CTestCamera& aOwner): iOwner(aOwner) |
|
23 { |
|
24 Init(); |
|
25 } |
|
26 |
|
27 CTestCamAdvSet::~CTestCamAdvSet() |
|
28 { |
|
29 iSupportedISORates.Close(); |
|
30 iSupportedApertures.Close(); |
|
31 iSupportedShutterSpeeds.Close(); |
|
32 |
|
33 CDataGlobal* globalData = static_cast <CDataGlobal*> (Dll::Tls()); |
|
34 if(globalData != NULL) |
|
35 { |
|
36 if(!globalData->iTestCamPresets && !globalData->iTestCamSnapshot && !globalData->iTestCamImgProc) |
|
37 { |
|
38 delete globalData; |
|
39 Dll::FreeTls(); |
|
40 } |
|
41 else |
|
42 { |
|
43 globalData->iTestCamAdvSet = NULL; |
|
44 Dll::SetTls(globalData); |
|
45 } |
|
46 } |
|
47 } |
|
48 |
|
49 CTestCamAdvSet* CTestCamAdvSet::NewL(CTestCamera& aOwner) |
|
50 { |
|
51 CDataGlobal* globalData = static_cast <CDataGlobal*> (Dll::Tls()); |
|
52 |
|
53 if(globalData == NULL) |
|
54 { |
|
55 globalData = new (ELeave) CDataGlobal; |
|
56 CleanupStack::PushL(globalData); |
|
57 globalData->iAdvSetReferenceCount = 0; |
|
58 globalData->iTestCamAdvSet = new (ELeave) CTestCamAdvSet(aOwner); |
|
59 CleanupStack::PushL(globalData->iTestCamAdvSet); |
|
60 globalData->iTestCamAdvSet->ConstructL(); |
|
61 globalData->iTestCamAdvSet->iRefCount = 1; |
|
62 User::LeaveIfError(Dll::SetTls(globalData)); |
|
63 CleanupStack::Pop(globalData->iTestCamAdvSet); |
|
64 CleanupStack::Pop(globalData); |
|
65 return globalData->iTestCamAdvSet; |
|
66 } |
|
67 else |
|
68 { |
|
69 if(globalData->iTestCamAdvSet == NULL) |
|
70 { |
|
71 globalData->iAdvSetReferenceCount = 0; |
|
72 globalData->iTestCamAdvSet = new (ELeave) CTestCamAdvSet(aOwner); |
|
73 CleanupStack::PushL(globalData->iTestCamAdvSet); |
|
74 globalData->iTestCamAdvSet->ConstructL(); |
|
75 globalData->iTestCamAdvSet->iRefCount = 1; |
|
76 User::LeaveIfError(Dll::SetTls(globalData)); |
|
77 CleanupStack::Pop(globalData->iTestCamAdvSet); |
|
78 return globalData->iTestCamAdvSet; |
|
79 } |
|
80 |
|
81 CTestCamAdvSet* self = globalData->iTestCamAdvSet; |
|
82 |
|
83 globalData->iAdvSetReferenceCount++; |
|
84 self->iRefCount = globalData->iAdvSetReferenceCount + 1; |
|
85 if (globalData->iAdvSetReferenceCount == KNumOfAdvSetExtensions-1 ) |
|
86 { |
|
87 globalData->iTestCamAdvSet = NULL; |
|
88 if(!globalData->iTestCamPresets && !globalData->iTestCamSnapshot && !globalData->iTestCamImgProc) |
|
89 { |
|
90 delete globalData; |
|
91 Dll::FreeTls(); |
|
92 } |
|
93 else |
|
94 { |
|
95 User::LeaveIfError(Dll::SetTls(globalData)); |
|
96 } |
|
97 } |
|
98 else |
|
99 { |
|
100 User::LeaveIfError(Dll::SetTls(globalData)); |
|
101 } |
|
102 return self; |
|
103 } |
|
104 } |
|
105 |
|
106 void CTestCamAdvSet::Release() |
|
107 { |
|
108 iRefCount--; |
|
109 if(iRefCount == 0) |
|
110 { |
|
111 iOwner.iAdvSettingsImpl = NULL; |
|
112 delete this; |
|
113 } |
|
114 } |
|
115 |
|
116 void CTestCamAdvSet::Init() |
|
117 { |
|
118 for(TUint i=0; i< KNumAvailableCameras; i++) |
|
119 { |
|
120 iCameraTypes[i] = CCamera::CCameraAdvancedSettings::ECameraPluggable; |
|
121 } |
|
122 |
|
123 iFocusDistance = KDefaultFocusDistance; |
|
124 iIsoRate = KDefaultIsoRate; |
|
125 iISORateType = CCamera::CCameraAdvancedSettings::EISOManual; |
|
126 iAperture = KDefaultAperture; |
|
127 iShutterSpeed = KDefaultShutterSpeed; |
|
128 } |
|
129 |
|
130 void CTestCamAdvSet::ConstructL() |
|
131 { |
|
132 iSupportedISORates.Reset(); |
|
133 iSupportedISORates.AppendL(KDefaultIsoRate); |
|
134 |
|
135 iSupportedApertures.Reset(); |
|
136 iSupportedApertures.AppendL(KDefaultAperture); |
|
137 |
|
138 iSupportedShutterSpeeds.Reset(); |
|
139 iSupportedShutterSpeeds.AppendL(KDefaultShutterSpeed); |
|
140 } |
|
141 |
|
142 CCamera::CCameraAdvancedSettings::TCameraType CTestCamAdvSet::CameraType() const |
|
143 { |
|
144 return CCamera::CCameraAdvancedSettings::ECameraPluggable; |
|
145 } |
|
146 |
|
147 CCamera::CCameraAdvancedSettings::TCameraType CTestCamAdvSet::CameraType(TInt aCameraIndex) const |
|
148 { |
|
149 if (aCameraIndex >= KNumAvailableCameras || aCameraIndex < 0) |
|
150 { |
|
151 return CCamera::CCameraAdvancedSettings::ECameraUnknown; |
|
152 } |
|
153 else |
|
154 { |
|
155 return iCameraTypes[aCameraIndex]; |
|
156 } |
|
157 } |
|
158 |
|
159 TBool CTestCamAdvSet::IsCameraPresent() const |
|
160 { |
|
161 return ETrue; |
|
162 } |
|
163 |
|
164 TBool CTestCamAdvSet::IsCameraPresent(TInt aCameraIndex) const |
|
165 { |
|
166 if (aCameraIndex >= KNumAvailableCameras || aCameraIndex < 0) |
|
167 { |
|
168 return EFalse; |
|
169 } |
|
170 else |
|
171 { |
|
172 return ETrue; |
|
173 } |
|
174 } |
|
175 |
|
176 TInt CTestCamAdvSet::CameraIndex() const |
|
177 { |
|
178 return iOwner.iCameraIndex; |
|
179 } |
|
180 |
|
181 TInt CTestCamAdvSet::SupportedStabilizationModes() const |
|
182 { |
|
183 return KFeatureNotSupported; |
|
184 } |
|
185 |
|
186 CCamera::CCameraAdvancedSettings::TStabilizationMode CTestCamAdvSet::StabilizationMode() const |
|
187 { |
|
188 return CCamera::CCameraAdvancedSettings::EStabilizationModeOff; |
|
189 } |
|
190 |
|
191 void CTestCamAdvSet::SetStabilizationMode(CCamera::CCameraAdvancedSettings::TStabilizationMode aStabilizationMode) |
|
192 { |
|
193 TInt eventError = KErrNotSupported; |
|
194 if(aStabilizationMode == CCamera::CCameraAdvancedSettings::EStabilizationModeOff) |
|
195 { |
|
196 eventError = KErrAlreadyExists; |
|
197 } |
|
198 |
|
199 TECAMEvent ecamevent(KUidECamEventCameraSettingStabilizationMode, eventError); |
|
200 |
|
201 iOwner.iECamEvent = ecamevent; |
|
202 iOwner.iHandleEventAsync.CallBack(); |
|
203 } |
|
204 |
|
205 TInt CTestCamAdvSet::SupportedFocusModes() const |
|
206 { |
|
207 return KFeatureNotSupported; |
|
208 } |
|
209 |
|
210 CCamera::CCameraAdvancedSettings::TFocusMode CTestCamAdvSet::FocusMode() const |
|
211 { |
|
212 return CCamera::CCameraAdvancedSettings::EFocusModeAuto; |
|
213 } |
|
214 |
|
215 void CTestCamAdvSet::SetFocusMode(CCamera::CCameraAdvancedSettings::TFocusMode aFocusMode) |
|
216 { |
|
217 TInt eventError = KErrNotSupported; |
|
218 if(aFocusMode == CCamera::CCameraAdvancedSettings::EFocusModeAuto) |
|
219 { |
|
220 eventError = KErrAlreadyExists; |
|
221 } |
|
222 |
|
223 TECAMEvent ecamevent(KUidECamEventCameraSettingFocusMode, eventError); |
|
224 |
|
225 iOwner.iECamEvent = ecamevent; |
|
226 iOwner.iHandleEventAsync.CallBack(); |
|
227 } |
|
228 |
|
229 TInt CTestCamAdvSet::SupportedFocusRanges() const |
|
230 { |
|
231 return KFeatureNotSupported; |
|
232 } |
|
233 |
|
234 CCamera::CCameraAdvancedSettings::TFocusRange CTestCamAdvSet::FocusRange() const |
|
235 { |
|
236 return CCamera::CCameraAdvancedSettings::EFocusRangeAuto; |
|
237 } |
|
238 |
|
239 void CTestCamAdvSet::SetFocusRange(CCamera::CCameraAdvancedSettings::TFocusRange aFocusRange) |
|
240 { |
|
241 TInt eventError = KErrNotSupported; |
|
242 if(aFocusRange == CCamera::CCameraAdvancedSettings::EFocusRangeAuto) |
|
243 { |
|
244 eventError = KErrAlreadyExists; |
|
245 } |
|
246 |
|
247 TECAMEvent ecamevent1(KUidECamEventCameraSettingFocusRange2, eventError); |
|
248 TECAMEvent ecamevent2(KUidECamEventCameraSettingFocusRange, eventError); |
|
249 |
|
250 iOwner.iECamEvent = ecamevent1; |
|
251 iOwner.iHandleEventAsync.CallBack(); |
|
252 |
|
253 iOwner.iECamEvent = ecamevent2; |
|
254 iOwner.iHandleEventAsync.CallBack(); |
|
255 } |
|
256 |
|
257 TInt CTestCamAdvSet::SupportedAutoFocusTypes() const |
|
258 { |
|
259 return KFeatureNotSupported; |
|
260 } |
|
261 |
|
262 CCamera::CCameraAdvancedSettings::TAutoFocusType CTestCamAdvSet::AutoFocusType() const |
|
263 { |
|
264 return CCamera::CCameraAdvancedSettings::EAutoFocusTypeOff; |
|
265 } |
|
266 |
|
267 void CTestCamAdvSet::SetAutoFocusType(CCamera::CCameraAdvancedSettings::TAutoFocusType aAutoFocusType) |
|
268 { |
|
269 TInt eventError = KErrNotSupported; |
|
270 if(aAutoFocusType == CCamera::CCameraAdvancedSettings::EAutoFocusTypeOff) |
|
271 { |
|
272 eventError = KErrAlreadyExists; |
|
273 } |
|
274 |
|
275 TECAMEvent ecamevent1(KUidECamEventCameraSettingAutoFocusType2, eventError); |
|
276 TECAMEvent ecamevent2(KUidECamEventCameraSettingAutoFocusType, eventError); |
|
277 |
|
278 iOwner.iECamEvent = ecamevent1; |
|
279 iOwner.iHandleEventAsync.CallBack(); |
|
280 |
|
281 iOwner.iECamEvent = ecamevent2; |
|
282 iOwner.iHandleEventAsync.CallBack(); |
|
283 } |
|
284 |
|
285 TInt CTestCamAdvSet::SupportedAutoFocusAreas() const |
|
286 { |
|
287 return KFeatureNotSupported; |
|
288 } |
|
289 |
|
290 CCamera::CCameraAdvancedSettings::TAutoFocusArea CTestCamAdvSet::AutoFocusArea() const |
|
291 { |
|
292 return CCamera::CCameraAdvancedSettings::EAutoFocusTypeAuto; |
|
293 } |
|
294 |
|
295 void CTestCamAdvSet::SetAutoFocusArea(CCamera::CCameraAdvancedSettings::TAutoFocusArea aAutoFocusArea) |
|
296 { |
|
297 TInt eventError = KErrNotSupported; |
|
298 if(aAutoFocusArea == CCamera::CCameraAdvancedSettings::EAutoFocusTypeAuto) |
|
299 { |
|
300 eventError = KErrAlreadyExists; |
|
301 } |
|
302 |
|
303 TECAMEvent ecamevent(KUidECamEventCameraSettingAutoFocusArea, eventError); |
|
304 |
|
305 iOwner.iECamEvent = ecamevent; |
|
306 iOwner.iHandleEventAsync.CallBack(); |
|
307 } |
|
308 |
|
309 TInt CTestCamAdvSet::FocusDistance() const |
|
310 { |
|
311 return iFocusDistance; |
|
312 } |
|
313 |
|
314 void CTestCamAdvSet::SetFocusDistance(TInt aDistance) |
|
315 { |
|
316 TInt eventError = KErrNone; |
|
317 if(aDistance < 0) |
|
318 { |
|
319 eventError = KErrNotSupported; |
|
320 } |
|
321 else |
|
322 { |
|
323 iFocusDistance = aDistance; |
|
324 } |
|
325 |
|
326 TECAMEvent ecamevent(KUidECamEventCameraSettingFocusDistance, eventError); |
|
327 |
|
328 iOwner.iECamEvent = ecamevent; |
|
329 iOwner.iHandleEventAsync.CallBack(); |
|
330 } |
|
331 |
|
332 TInt CTestCamAdvSet::GetMinFocalLength() const |
|
333 { |
|
334 return KErrNotSupported; |
|
335 } |
|
336 |
|
337 void CTestCamAdvSet::GetSupportedIsoRatesL(RArray<TInt>& aSupportedIsoRates) const |
|
338 { |
|
339 if(iSupportedISORates.Count() == 0) |
|
340 { |
|
341 User::Leave(KErrNotSupported); |
|
342 } |
|
343 |
|
344 for(TInt index=0; index < iSupportedISORates.Count(); index++) |
|
345 { |
|
346 aSupportedIsoRates.AppendL(iSupportedISORates[index]); |
|
347 } |
|
348 } |
|
349 |
|
350 TInt CTestCamAdvSet::IsoRate() const |
|
351 { |
|
352 return iIsoRate; |
|
353 } |
|
354 |
|
355 void CTestCamAdvSet::SetIsoRate(TInt aRate) |
|
356 { |
|
357 TInt eventError = KErrNone; |
|
358 if(iSupportedISORates.Find(aRate) == KErrNotFound) |
|
359 { |
|
360 eventError = KErrECamParameterNotInRange; |
|
361 } |
|
362 else |
|
363 { |
|
364 //set the ISO type to Manual |
|
365 iISORateType = CCamera::CCameraAdvancedSettings::EISOManual; |
|
366 iIsoRate = aRate; |
|
367 } |
|
368 |
|
369 TECAMEvent ecamevent(KUidECamEventCameraSettingIsoRate, eventError); |
|
370 |
|
371 iOwner.iECamEvent = ecamevent; |
|
372 iOwner.iHandleEventAsync.CallBack(); |
|
373 } |
|
374 |
|
375 void CTestCamAdvSet::GetSupportedISORateTypeL(TInt& aSupportedISORateTypes) const |
|
376 { |
|
377 aSupportedISORateTypes = KSupportedISORateTypes; |
|
378 } |
|
379 |
|
380 void CTestCamAdvSet::SetISORate(CCamera::CCameraAdvancedSettings::TISORateType aISORateType, TInt aParam) |
|
381 { |
|
382 TInt eventError = KErrNone; |
|
383 |
|
384 if(!(aISORateType & KSupportedISORateTypes) || iSupportedISORates.Count() == 0) |
|
385 { |
|
386 eventError = KErrNotSupported; |
|
387 } |
|
388 else |
|
389 { |
|
390 switch(aISORateType) |
|
391 { |
|
392 case CCamera::CCameraAdvancedSettings::EISOManual: |
|
393 { |
|
394 if(iSupportedISORates.Find(aParam) == KErrNotFound) |
|
395 { |
|
396 eventError = KErrECamParameterNotInRange; |
|
397 } |
|
398 else |
|
399 { |
|
400 iISORateType = aISORateType; |
|
401 if(aParam == iIsoRate) |
|
402 { |
|
403 eventError = KErrAlreadyExists; |
|
404 } |
|
405 else |
|
406 { |
|
407 iIsoRate = aParam; |
|
408 } |
|
409 } |
|
410 break; |
|
411 } |
|
412 case CCamera::CCameraAdvancedSettings::EISOAutoUnPrioritised: |
|
413 { |
|
414 eventError = KErrNotSupported; |
|
415 break; |
|
416 } |
|
417 case CCamera::CCameraAdvancedSettings::EISOAutoISOPrioritised: |
|
418 { |
|
419 eventError = KErrNotSupported; |
|
420 break; |
|
421 } |
|
422 case CCamera::CCameraAdvancedSettings::EISOAutoShutterSpeedPrioritised: |
|
423 { |
|
424 eventError = KErrNotSupported; |
|
425 break; |
|
426 } |
|
427 case CCamera::CCameraAdvancedSettings::EISOAutoAperturePrioritised: |
|
428 { |
|
429 eventError = KErrNotSupported; |
|
430 break; |
|
431 } |
|
432 default: |
|
433 eventError = KErrNotSupported; |
|
434 } |
|
435 } |
|
436 |
|
437 TECAMEvent ecamevent(KUidECamEventCameraSettingIsoRateType, eventError); |
|
438 |
|
439 iOwner.iECamEvent = ecamevent; |
|
440 iOwner.iHandleEventAsync.CallBack(); |
|
441 } |
|
442 |
|
443 void CTestCamAdvSet::GetISORateL(CCamera::CCameraAdvancedSettings::TISORateType& aISORateType, TInt& /*aParam*/, TInt& aISORate) const |
|
444 { |
|
445 //If camera has no ISO rate supported, then leave |
|
446 if(iSupportedISORates.Count() == 0) |
|
447 { |
|
448 User::Leave(KErrNotSupported); |
|
449 } |
|
450 |
|
451 aISORateType = iISORateType; |
|
452 aISORate = iIsoRate; |
|
453 // aParam is redundant for manual ISO. |
|
454 } |
|
455 |
|
456 void CTestCamAdvSet::GetAperturesL(RArray<TInt>& aFStops, TValueInfo& aInfo) const |
|
457 { |
|
458 if(iSupportedApertures.Count() == 0) |
|
459 { |
|
460 aFStops.Reset(); |
|
461 aInfo = ENotActive; |
|
462 } |
|
463 |
|
464 for(TInt index=0; index < iSupportedApertures.Count(); index++) |
|
465 { |
|
466 aFStops.AppendL(iSupportedApertures[index]); |
|
467 } |
|
468 |
|
469 aInfo = EDiscreteSteps; |
|
470 } |
|
471 |
|
472 TInt CTestCamAdvSet::Aperture() const |
|
473 { |
|
474 return iAperture; |
|
475 } |
|
476 |
|
477 void CTestCamAdvSet::SetAperture(TInt aFStop) |
|
478 { |
|
479 TInt eventError = KErrNone; |
|
480 if(iSupportedApertures.Find(aFStop) == KErrNotFound) |
|
481 { |
|
482 eventError = KErrECamParameterNotInRange; |
|
483 } |
|
484 else |
|
485 { |
|
486 iAperture = aFStop; |
|
487 } |
|
488 |
|
489 TECAMEvent ecamevent(KUidECamEventCameraSettingAperture, eventError); |
|
490 |
|
491 iOwner.iECamEvent = ecamevent; |
|
492 iOwner.iHandleEventAsync.CallBack(); |
|
493 } |
|
494 |
|
495 void CTestCamAdvSet::GetShutterSpeedsL(RArray<TInt>& aShutterSpeeds, TValueInfo& aInfo) const |
|
496 { |
|
497 if(iSupportedShutterSpeeds.Count() == 0) |
|
498 { |
|
499 aShutterSpeeds.Reset(); |
|
500 aInfo = ENotActive; |
|
501 } |
|
502 |
|
503 for(TInt index=0; index < iSupportedShutterSpeeds.Count(); index++) |
|
504 { |
|
505 aShutterSpeeds.AppendL(iSupportedShutterSpeeds[index]); |
|
506 aInfo = EDiscreteSteps; |
|
507 } |
|
508 } |
|
509 |
|
510 TInt CTestCamAdvSet::ShutterSpeed() const |
|
511 { |
|
512 return iShutterSpeed; |
|
513 } |
|
514 |
|
515 void CTestCamAdvSet::SetShutterSpeed(TInt aShutterSpeed) |
|
516 { |
|
517 TInt eventError = KErrNone; |
|
518 if(iSupportedShutterSpeeds.Find(aShutterSpeed) == KErrNotFound) |
|
519 { |
|
520 eventError = KErrECamParameterNotInRange; |
|
521 } |
|
522 else |
|
523 { |
|
524 iShutterSpeed = aShutterSpeed; |
|
525 } |
|
526 |
|
527 TECAMEvent ecamevent(KUidECamEventCameraSettingShutterSpeed, eventError); |
|
528 |
|
529 iOwner.iECamEvent = ecamevent; |
|
530 iOwner.iHandleEventAsync.CallBack(); |
|
531 } |
|
532 |
|
533 TInt CTestCamAdvSet::SupportedMeteringModes() const |
|
534 { |
|
535 return KFeatureNotSupported; |
|
536 } |
|
537 |
|
538 CCamera::CCameraAdvancedSettings::TMeteringMode CTestCamAdvSet::MeteringMode() const |
|
539 { |
|
540 return CCamera::CCameraAdvancedSettings::EMeteringModeAuto; |
|
541 } |
|
542 |
|
543 void CTestCamAdvSet::SetMeteringMode(CCamera::CCameraAdvancedSettings::TMeteringMode aMeteringMode) |
|
544 { |
|
545 TInt eventError = KErrNotSupported; |
|
546 if(aMeteringMode == CCamera::CCameraAdvancedSettings::EMeteringModeAuto) |
|
547 { |
|
548 eventError = KErrAlreadyExists; |
|
549 } |
|
550 |
|
551 TECAMEvent ecamevent(KUidECamEventCameraSettingMeteringMode, eventError); |
|
552 |
|
553 iOwner.iECamEvent = ecamevent; |
|
554 iOwner.iHandleEventAsync.CallBack(); |
|
555 } |
|
556 |
|
557 TInt CTestCamAdvSet::SupportedDriveModes() const |
|
558 { |
|
559 return KSupportedDriveModes; |
|
560 } |
|
561 |
|
562 CCamera::CCameraAdvancedSettings::TDriveMode CTestCamAdvSet::DriveMode() const |
|
563 { |
|
564 return iOwner.iDriveMode; |
|
565 } |
|
566 |
|
567 void CTestCamAdvSet::SetDriveMode(CCamera::CCameraAdvancedSettings::TDriveMode aDriveMode) |
|
568 { |
|
569 TInt eventError = KErrNone; |
|
570 if(iOwner.iVideoCaptureActive || iOwner.iImageCaptureActive) |
|
571 { |
|
572 eventError = KErrNotReady; |
|
573 } |
|
574 else |
|
575 { |
|
576 if(!(aDriveMode & KSupportedDriveModes)) |
|
577 { |
|
578 eventError = KErrNotSupported; |
|
579 } |
|
580 else |
|
581 { |
|
582 if(eventError == KErrNone) |
|
583 { |
|
584 iOwner.iDriveMode = aDriveMode; |
|
585 } |
|
586 } |
|
587 } |
|
588 |
|
589 TECAMEvent ecamevent(KUidECamEventCameraSettingDriveMode, eventError); |
|
590 |
|
591 iOwner.iECamEvent = ecamevent; |
|
592 iOwner.iHandleEventAsync.CallBack(); |
|
593 } |
|
594 |
|
595 TInt CTestCamAdvSet::SupportedBracketModes() const |
|
596 { |
|
597 return KFeatureNotSupported; |
|
598 } |
|
599 |
|
600 CCamera::CCameraAdvancedSettings::TBracketMode CTestCamAdvSet::BracketMode() const |
|
601 { |
|
602 return CCamera::CCameraAdvancedSettings::EBracketModeOff; |
|
603 } |
|
604 |
|
605 void CTestCamAdvSet::SetBracketMode(CCamera::CCameraAdvancedSettings::TBracketMode aBracketMode) |
|
606 { |
|
607 TInt eventError = KErrNotSupported; |
|
608 if(aBracketMode == CCamera::CCameraAdvancedSettings::EBracketModeOff) |
|
609 { |
|
610 eventError = KErrAlreadyExists; |
|
611 } |
|
612 |
|
613 TECAMEvent ecamevent(KUidECamEventCameraSettingBracketMode, eventError); |
|
614 |
|
615 iOwner.iECamEvent = ecamevent; |
|
616 iOwner.iHandleEventAsync.CallBack(); |
|
617 } |
|
618 |
|
619 TInt CTestCamAdvSet::SupportedBracketParameters() const |
|
620 { |
|
621 return KFeatureNotSupported; |
|
622 } |
|
623 |
|
624 CCamera::CCameraAdvancedSettings::TBracketParameter CTestCamAdvSet::BracketParameter() const |
|
625 { |
|
626 return CCamera::CCameraAdvancedSettings::EBracketParameterNone; |
|
627 } |
|
628 |
|
629 void CTestCamAdvSet::SetBracketParameter(CCamera::CCameraAdvancedSettings::TBracketParameter aBracketParameter) |
|
630 { |
|
631 TInt eventError = KErrNotSupported; |
|
632 if(aBracketParameter == CCamera::CCameraAdvancedSettings::EBracketParameterNone) |
|
633 { |
|
634 eventError = KErrAlreadyExists; |
|
635 } |
|
636 |
|
637 TECAMEvent ecamevent(KUidECamEventCameraSettingBracketParameter, eventError); |
|
638 |
|
639 iOwner.iECamEvent = ecamevent; |
|
640 iOwner.iHandleEventAsync.CallBack(); |
|
641 } |
|
642 |
|
643 TInt CTestCamAdvSet::SupportedBracketSteps() const |
|
644 { |
|
645 return KFeatureNotSupported; |
|
646 } |
|
647 |
|
648 CCamera::CCameraAdvancedSettings::TBracketStep CTestCamAdvSet::BracketStep() const |
|
649 { |
|
650 return CCamera::CCameraAdvancedSettings::EBracketStepNonConfig; |
|
651 } |
|
652 |
|
653 void CTestCamAdvSet::SetBracketStep(CCamera::CCameraAdvancedSettings::TBracketStep aBracketStep) |
|
654 { |
|
655 TInt eventError = KErrNotSupported; |
|
656 if(aBracketStep == CCamera::CCameraAdvancedSettings::EBracketStepNonConfig) |
|
657 { |
|
658 eventError = KErrAlreadyExists; |
|
659 } |
|
660 |
|
661 TECAMEvent ecamevent(KUidECamEventCameraSettingBracketStep, eventError); |
|
662 |
|
663 iOwner.iECamEvent = ecamevent; |
|
664 iOwner.iHandleEventAsync.CallBack(); |
|
665 } |
|
666 |
|
667 void CTestCamAdvSet::GetBracketMerge(TInt& aStartIndex, TInt& aFrames) const |
|
668 { |
|
669 aStartIndex = KFeatureNotSupported; |
|
670 aFrames = KFeatureNotSupported; |
|
671 } |
|
672 |
|
673 void CTestCamAdvSet::SetBracketMerge(TInt /*aStartIndex*/ , TInt /*aFrames*/) |
|
674 { |
|
675 TECAMEvent ecamevent(KUidECamEventBracketMerge, KErrNotSupported); |
|
676 |
|
677 iOwner.iECamEvent = ecamevent; |
|
678 iOwner.iHandleEventAsync.CallBack(); |
|
679 } |
|
680 |
|
681 TInt CTestCamAdvSet::SupportedFlashModes() const |
|
682 { |
|
683 return KFeatureNotSupported; |
|
684 } |
|
685 |
|
686 CCamera::TFlash CTestCamAdvSet::FlashMode() const |
|
687 { |
|
688 return CCamera::EFlashNone; |
|
689 } |
|
690 |
|
691 void CTestCamAdvSet::SetFlashMode(CCamera::TFlash /*aMode*/) |
|
692 { |
|
693 TECAMEvent ecamevent(KUidECamEventCameraSettingFlashMode, KErrNotSupported); |
|
694 |
|
695 iOwner.iECamEvent = ecamevent; |
|
696 iOwner.iHandleEventAsync.CallBack(); |
|
697 } |
|
698 |
|
699 TBool CTestCamAdvSet::RedEyeReduceOn() const |
|
700 { |
|
701 return KDefaultRedEyeReduce; |
|
702 } |
|
703 |
|
704 void CTestCamAdvSet::SetRedEyeReduceOn(TBool /*aState*/) |
|
705 { |
|
706 TECAMEvent ecamevent(KUidECamEventCameraSettingFlashRedEyeReduce, KErrNotSupported); |
|
707 |
|
708 iOwner.iECamEvent = ecamevent; |
|
709 iOwner.iHandleEventAsync.CallBack(); |
|
710 } |
|
711 |
|
712 void CTestCamAdvSet::GetFlashCompensationStepsL(RArray<TInt>& aFlashCompensationSteps, TValueInfo& aInfo) const |
|
713 { |
|
714 aFlashCompensationSteps.Reset(); |
|
715 aInfo = ENotActive; |
|
716 } |
|
717 |
|
718 TInt CTestCamAdvSet::FlashCompensationStep() const |
|
719 { |
|
720 return KFlashCompensationStep; |
|
721 } |
|
722 |
|
723 TInt CTestCamAdvSet::GetFlashCompensationStep(TInt& aFlashCompensationStep) const |
|
724 { |
|
725 aFlashCompensationStep = KFlashCompensationStep; |
|
726 return KErrNone; |
|
727 } |
|
728 |
|
729 void CTestCamAdvSet::GetFlashCompensationRangeInSteps(TInt& aNegativeCompensation, TInt& aPositiveCompensation) const |
|
730 { |
|
731 aNegativeCompensation = KFlashCompensationStep; |
|
732 aPositiveCompensation = KFlashCompensationStep; |
|
733 } |
|
734 |
|
735 void CTestCamAdvSet::SetFlashCompensationStep(TInt /*aFlashCompensationStep*/) |
|
736 { |
|
737 TECAMEvent ecamevent(KUidECamEventCameraSettingFlashCompensationStep, KErrNotSupported); |
|
738 |
|
739 iOwner.iECamEvent = ecamevent; |
|
740 iOwner.iHandleEventAsync.CallBack(); |
|
741 } |
|
742 |
|
743 TInt CTestCamAdvSet::FlashCompensation() const |
|
744 { |
|
745 return KFlashCompensationStep; |
|
746 } |
|
747 |
|
748 TInt CTestCamAdvSet::GetFlashCompensation(TInt& aFlashCompensation) const |
|
749 { |
|
750 aFlashCompensation = KFlashCompensationStep; |
|
751 return KErrNone; |
|
752 } |
|
753 |
|
754 void CTestCamAdvSet::SetFlashCompensation(TInt /*aFlashCompensation*/) |
|
755 { |
|
756 TECAMEvent ecamevent(KUidECamEventCameraSettingFlashCompensation, KErrNotSupported); |
|
757 |
|
758 iOwner.iECamEvent = ecamevent; |
|
759 iOwner.iHandleEventAsync.CallBack(); |
|
760 } |
|
761 |
|
762 TBool CTestCamAdvSet::IsExternalFlashPresent() const |
|
763 { |
|
764 return KExternalFlashPresentState; |
|
765 } |
|
766 |
|
767 void CTestCamAdvSet::GetManualFlashPowerLevelsL(RArray<TInt>& aManualFlashPowerLevels, TValueInfo& aInfo) const |
|
768 { |
|
769 aManualFlashPowerLevels.Reset(); |
|
770 aInfo = ENotActive; |
|
771 } |
|
772 |
|
773 TInt CTestCamAdvSet::ManualFlashPowerLevel() const |
|
774 { |
|
775 return KErrNotSupported; |
|
776 } |
|
777 |
|
778 void CTestCamAdvSet::SetManualFlashPowerLevel(TInt /*aManualFlashPowerLevel*/) |
|
779 { |
|
780 TECAMEvent ecamevent(KUidECamEventCameraSettingFlashManualPower, KErrNotSupported); |
|
781 |
|
782 iOwner.iECamEvent = ecamevent; |
|
783 iOwner.iHandleEventAsync.CallBack(); |
|
784 } |
|
785 |
|
786 TInt CTestCamAdvSet::SupportedExposureModes() const |
|
787 { |
|
788 return CCamera::EExposureAuto; |
|
789 } |
|
790 |
|
791 CCamera::TExposure CTestCamAdvSet::ExposureMode() const |
|
792 { |
|
793 return CCamera::EExposureAuto; |
|
794 } |
|
795 |
|
796 void CTestCamAdvSet::SetExposureMode(CCamera::TExposure aExposureMode) |
|
797 { |
|
798 TInt eventError = KErrNotSupported; |
|
799 if(aExposureMode == CCamera::EExposureAuto) |
|
800 { |
|
801 eventError = KErrAlreadyExists; |
|
802 } |
|
803 |
|
804 TECAMEvent ecamevent(KUidECamEventCameraSettingExposureMode, eventError); |
|
805 |
|
806 iOwner.iECamEvent = ecamevent; |
|
807 iOwner.iHandleEventAsync.CallBack(); |
|
808 } |
|
809 |
|
810 void CTestCamAdvSet::GetExposureCompensationStepsL(RArray<TInt>& aExposureCompensationSteps, TValueInfo& aInfo) const |
|
811 { |
|
812 aExposureCompensationSteps.Reset(); |
|
813 aInfo = ENotActive; |
|
814 } |
|
815 |
|
816 void CTestCamAdvSet::GetExposureCompensationRangeInSteps(TInt& aNegativeCompensation, TInt& aPositiveCompensation) const |
|
817 { |
|
818 aNegativeCompensation = KExposureCompensationStep; |
|
819 aPositiveCompensation = KExposureCompensationStep; |
|
820 } |
|
821 |
|
822 TInt CTestCamAdvSet::ExposureCompensationStep() const |
|
823 { |
|
824 return KExposureCompensationStep; |
|
825 } |
|
826 |
|
827 TInt CTestCamAdvSet::GetExposureCompensationStep(TInt& aExposureCompensationStep) const |
|
828 { |
|
829 aExposureCompensationStep = KExposureCompensationStep; |
|
830 return KErrNone; |
|
831 } |
|
832 |
|
833 void CTestCamAdvSet::SetExposureCompensationStep(TInt /*aExposureCompensationStep*/) |
|
834 { |
|
835 TECAMEvent ecamevent(KUidECamEventCameraSettingExposureCompensationStep, KErrNotSupported); |
|
836 |
|
837 iOwner.iECamEvent = ecamevent; |
|
838 iOwner.iHandleEventAsync.CallBack(); |
|
839 } |
|
840 |
|
841 TInt CTestCamAdvSet::ExposureCompensation() const |
|
842 { |
|
843 return KExposureCompensationStep; |
|
844 } |
|
845 |
|
846 TInt CTestCamAdvSet::GetExposureCompensation(TInt& aExposureCompensation) const |
|
847 { |
|
848 aExposureCompensation = KExposureCompensationStep; |
|
849 return KErrNone; |
|
850 } |
|
851 |
|
852 void CTestCamAdvSet::SetExposureCompensation(TInt /*aExposureCompensation*/) |
|
853 { |
|
854 TECAMEvent ecamevent(KUidECamEventCameraSettingExposureCompensation, KErrNotSupported); |
|
855 |
|
856 iOwner.iECamEvent = ecamevent; |
|
857 iOwner.iHandleEventAsync.CallBack(); |
|
858 } |
|
859 |
|
860 TInt CTestCamAdvSet::SupportedWhiteBalanceModes() const |
|
861 { |
|
862 return KFeatureNotSupported; |
|
863 } |
|
864 |
|
865 CCamera::TWhiteBalance CTestCamAdvSet::WhiteBalanceMode() const |
|
866 { |
|
867 return CCamera::EWBAuto; |
|
868 } |
|
869 |
|
870 void CTestCamAdvSet::SetWhiteBalanceMode(CCamera::TWhiteBalance aWhiteBalanceMode) |
|
871 { |
|
872 TInt eventError = KErrNotSupported; |
|
873 if(aWhiteBalanceMode == CCamera::EWBAuto) |
|
874 { |
|
875 eventError = KErrAlreadyExists; |
|
876 } |
|
877 |
|
878 TECAMEvent ecamevent(KUidECamEventCameraSettingWhiteBalanceMode, eventError); |
|
879 |
|
880 iOwner.iECamEvent = ecamevent; |
|
881 iOwner.iHandleEventAsync.CallBack(); |
|
882 } |
|
883 |
|
884 TBool CTestCamAdvSet::ApertureExposureLockOn() const |
|
885 { |
|
886 return KApertureExposureLockOn; |
|
887 } |
|
888 |
|
889 void CTestCamAdvSet::SetApertureExposureLockOn(TBool /*aAELock*/) |
|
890 { |
|
891 TECAMEvent ecamevent(KUidECamEventAELock, KErrNotSupported); |
|
892 |
|
893 iOwner.iECamEvent = ecamevent; |
|
894 iOwner.iHandleEventAsync.CallBack(); |
|
895 } |
|
896 |
|
897 TBool CTestCamAdvSet::ShootClickOn() const |
|
898 { |
|
899 return KShootClickOn; |
|
900 } |
|
901 |
|
902 void CTestCamAdvSet::SetShootClickOn(TBool /*aShootClickOn*/) |
|
903 { |
|
904 TECAMEvent ecamevent(KUidECamEventSoundClick, KErrNotSupported); |
|
905 |
|
906 iOwner.iECamEvent = ecamevent; |
|
907 iOwner.iHandleEventAsync.CallBack(); |
|
908 } |
|
909 |
|
910 void CTestCamAdvSet::GetTimerIntervalsL(RArray<TInt>& aTimerIntervals, TValueInfo& aInfo) const |
|
911 { |
|
912 aTimerIntervals.Reset(); |
|
913 aInfo = ENotActive; |
|
914 } |
|
915 |
|
916 TInt CTestCamAdvSet::TimerInterval() const |
|
917 { |
|
918 return KErrNotSupported; |
|
919 } |
|
920 |
|
921 void CTestCamAdvSet::SetTimerInterval(TInt /*aTimerInterval*/) |
|
922 { |
|
923 TECAMEvent ecamevent(KUidECamEventCameraSettingTimerInterval, KErrNotSupported); |
|
924 |
|
925 iOwner.iECamEvent = ecamevent; |
|
926 iOwner.iHandleEventAsync.CallBack(); |
|
927 } |
|
928 |
|
929 void CTestCamAdvSet::GetTimeLapsePeriodRange(TTime& aTimeLapseMin, TTime& aTimeLapseMax) const |
|
930 { |
|
931 TTime timeLapse(KTimeLapse); |
|
932 aTimeLapseMin = aTimeLapseMax = timeLapse; |
|
933 } |
|
934 |
|
935 void CTestCamAdvSet::GetTimeLapse(TTime& aStart, TTime& aEnd, TTime& aInterval) const |
|
936 { |
|
937 TTime timeLapse(KTimeLapse); |
|
938 aStart = aEnd = aInterval = timeLapse; |
|
939 } |
|
940 |
|
941 void CTestCamAdvSet::SetTimeLapse(const TTime& /*aStart*/, const TTime& /*aEnd*/, const TTime& /*aInterval*/) |
|
942 { |
|
943 TECAMEvent ecamevent(KUidECamEventCameraSettingTimeLapse, KErrNotSupported); |
|
944 |
|
945 iOwner.iECamEvent = ecamevent; |
|
946 iOwner.iHandleEventAsync.CallBack(); |
|
947 } |
|
948 |
|
949 CCamera::CCameraAdvancedSettings::TPictureOrientation CTestCamAdvSet::PictureOrientation() const |
|
950 { |
|
951 return CCamera::CCameraAdvancedSettings::EPictureOrientationUnknown; |
|
952 } |
|
953 |
|
954 void CTestCamAdvSet::SetPictureOrientation(CCamera::CCameraAdvancedSettings::TPictureOrientation aOrientation) |
|
955 { |
|
956 TInt eventError = KErrNotSupported; |
|
957 |
|
958 if(iOwner.iVideoCaptureActive || iOwner.iImageCaptureActive) |
|
959 { |
|
960 eventError = KErrNotReady; |
|
961 } |
|
962 else |
|
963 { |
|
964 if(aOrientation == CCamera::CCameraAdvancedSettings::EPictureOrientationUnknown) |
|
965 { |
|
966 eventError = KErrAlreadyExists; |
|
967 } |
|
968 } |
|
969 |
|
970 TECAMEvent ecamevent(KUidECamEventCameraSettingPictureOrientation, eventError); |
|
971 |
|
972 iOwner.iECamEvent = ecamevent; |
|
973 iOwner.iHandleEventAsync.CallBack(); |
|
974 } |
|
975 |
|
976 TInt CTestCamAdvSet::SupportedPixelAspectRatios() const |
|
977 { |
|
978 return KSupportedPixelAspectRatio; |
|
979 } |
|
980 |
|
981 CCamera::CCameraAdvancedSettings::TPixelAspectRatio CTestCamAdvSet::PixelAspectRatio() const |
|
982 { |
|
983 return CCamera::CCameraAdvancedSettings::EPixelAspectUnknown; |
|
984 } |
|
985 |
|
986 void CTestCamAdvSet::SetPixelAspectRatio(CCamera::CCameraAdvancedSettings::TPixelAspectRatio aPixelAspectRatio) |
|
987 { |
|
988 TInt eventError = KErrNotSupported; |
|
989 |
|
990 if(aPixelAspectRatio == CCamera::CCameraAdvancedSettings::EPixelAspectUnknown) |
|
991 { |
|
992 eventError = KErrAlreadyExists; |
|
993 } |
|
994 |
|
995 TECAMEvent ecamevent(KUidECamEventPixelAspectRatio, eventError); |
|
996 |
|
997 iOwner.iECamEvent = ecamevent; |
|
998 iOwner.iHandleEventAsync.CallBack(); |
|
999 } |
|
1000 |
|
1001 TInt CTestCamAdvSet::SupportedYuvRanges() const |
|
1002 { |
|
1003 return KSupportedYuvRange; |
|
1004 } |
|
1005 |
|
1006 CCamera::CCameraAdvancedSettings::TYuvRange CTestCamAdvSet::YuvRange() const |
|
1007 { |
|
1008 return CCamera::CCameraAdvancedSettings::EYuvRangeUnknown; |
|
1009 } |
|
1010 |
|
1011 void CTestCamAdvSet::SetYuvRange(CCamera::CCameraAdvancedSettings::TYuvRange aYuvRange) |
|
1012 { |
|
1013 TInt eventError = KErrNotSupported; |
|
1014 |
|
1015 if(aYuvRange == CCamera::CCameraAdvancedSettings::EYuvRangeUnknown) |
|
1016 { |
|
1017 eventError = KErrAlreadyExists; |
|
1018 } |
|
1019 |
|
1020 TECAMEvent ecamevent(KUidECamEventYuvRange, eventError); |
|
1021 |
|
1022 iOwner.iECamEvent = ecamevent; |
|
1023 iOwner.iHandleEventAsync.CallBack(); |
|
1024 } |
|
1025 |
|
1026 TInt CTestCamAdvSet::BurstImages() const |
|
1027 { |
|
1028 return iOwner.iBurstImages; |
|
1029 } |
|
1030 |
|
1031 void CTestCamAdvSet::SetBurstImages(TInt aImages) |
|
1032 { |
|
1033 TInt eventError = iOwner.CheckReserveAndPower(); |
|
1034 |
|
1035 if(eventError == KErrNone) |
|
1036 { |
|
1037 if(aImages == iOwner.iBurstImages) |
|
1038 { |
|
1039 eventError = KErrAlreadyExists; |
|
1040 } |
|
1041 else |
|
1042 { |
|
1043 if(aImages<1) |
|
1044 { |
|
1045 eventError = KErrArgument; |
|
1046 } |
|
1047 } |
|
1048 } |
|
1049 |
|
1050 if(eventError != KErrNone) |
|
1051 { |
|
1052 TECAMEvent ecamevent(KUidECamEventBurstImages, eventError); |
|
1053 |
|
1054 iOwner.iECamEvent = ecamevent; |
|
1055 iOwner.iHandleEventAsync.CallBack(); |
|
1056 return; |
|
1057 } |
|
1058 |
|
1059 if(aImages > KMaxBurstImages) |
|
1060 { |
|
1061 iOwner.iBurstImages = KMaxBurstImages; |
|
1062 } |
|
1063 else |
|
1064 { |
|
1065 iOwner.iBurstImages = aImages; |
|
1066 } |
|
1067 |
|
1068 TECAMEvent ecamevent(KUidECamEventBurstImages, eventError); |
|
1069 |
|
1070 iOwner.iECamEvent = ecamevent; |
|
1071 iOwner.iHandleEventAsync.CallBack(); |
|
1072 } |
|
1073 |
|
1074 void CTestCamAdvSet::GetOpticalZoomStepsL(RArray<TInt>& aOpticalZoomSteps, TValueInfo& aInfo) const |
|
1075 { |
|
1076 aOpticalZoomSteps.Reset(); |
|
1077 aOpticalZoomSteps.AppendL(KECamFineResolutionFactor); |
|
1078 aInfo = EDiscreteSteps; |
|
1079 } |
|
1080 |
|
1081 TInt CTestCamAdvSet::OpticalZoom() const |
|
1082 { |
|
1083 return KECamFineResolutionFactor; |
|
1084 } |
|
1085 |
|
1086 void CTestCamAdvSet::SetOpticalZoom(TInt aOpticalZoom) |
|
1087 { |
|
1088 TInt eventError = KErrNotSupported; |
|
1089 |
|
1090 if(aOpticalZoom == KECamFineResolutionFactor) |
|
1091 { |
|
1092 eventError = KErrAlreadyExists; |
|
1093 } |
|
1094 |
|
1095 TECAMEvent ecamevent(KUidECamEventCameraSettingOpticalZoom, eventError); |
|
1096 |
|
1097 iOwner.iECamEvent = ecamevent; |
|
1098 iOwner.iHandleEventAsync.CallBack(); |
|
1099 } |
|
1100 |
|
1101 void CTestCamAdvSet::GetDigitalZoomStepsL(RArray<TInt>& aDigitalZoomSteps, |
|
1102 TValueInfo& aInfo) const |
|
1103 { |
|
1104 aDigitalZoomSteps.Reset(); |
|
1105 aDigitalZoomSteps.AppendL(KECamFineResolutionFactor); |
|
1106 aInfo = EDiscreteSteps; |
|
1107 } |
|
1108 |
|
1109 void CTestCamAdvSet::GetDigitalZoomStepsForStillL(RArray<TInt>& aDigitalZoomSteps, TValueInfo& aInfo, TInt /*aSizeIndex*/, |
|
1110 CCamera::TFormat /*aFormat*/, TBool& /*aIsInfluencePossible*/) const |
|
1111 { |
|
1112 aDigitalZoomSteps.Reset(); |
|
1113 aDigitalZoomSteps.AppendL(KECamFineResolutionFactor); |
|
1114 aInfo = EDiscreteSteps; |
|
1115 } |
|
1116 |
|
1117 void CTestCamAdvSet::GetDigitalZoomStepsForVideoL(RArray<TInt>& aDigitalZoomSteps, TValueInfo& aInfo, TInt /*aFrameRateIndex*/, |
|
1118 TInt /*aSizeIndex*/, CCamera::TFormat /*aFormat*/, TBool& /*aIsInfluencePossible*/, CCamera::TExposure /*aExposure*/) const |
|
1119 { |
|
1120 aDigitalZoomSteps.Reset(); |
|
1121 aDigitalZoomSteps.AppendL(KECamFineResolutionFactor); |
|
1122 aInfo = EDiscreteSteps; |
|
1123 } |
|
1124 |
|
1125 TInt CTestCamAdvSet::DigitalZoom() const |
|
1126 { |
|
1127 return KECamFineResolutionFactor; |
|
1128 } |
|
1129 |
|
1130 void CTestCamAdvSet::SetDigitalZoom(TInt aDigitalZoom) |
|
1131 { |
|
1132 TInt eventError = KErrNotSupported; |
|
1133 |
|
1134 if(aDigitalZoom == KECamFineResolutionFactor) |
|
1135 { |
|
1136 eventError = KErrAlreadyExists; |
|
1137 } |
|
1138 |
|
1139 TECAMEvent ecamevent(KUidECamEventCameraSettingDigitalZoom, eventError); |
|
1140 |
|
1141 iOwner.iECamEvent = ecamevent; |
|
1142 iOwner.iHandleEventAsync.CallBack(); |
|
1143 } |
|
1144 |
|
1145 TBool CTestCamAdvSet::ExposureLockOn() const |
|
1146 { |
|
1147 return KExposureLockOn; |
|
1148 } |
|
1149 |
|
1150 void CTestCamAdvSet::SetExposureLockOn(TBool aState) |
|
1151 { |
|
1152 TInt eventError = KErrNotSupported; |
|
1153 |
|
1154 if(aState == KExposureLockOn) |
|
1155 { |
|
1156 eventError = KErrAlreadyExists; |
|
1157 } |
|
1158 |
|
1159 TECAMEvent ecamevent(KUidECamEventCameraSettingExposureLock, eventError); |
|
1160 |
|
1161 iOwner.iECamEvent = ecamevent; |
|
1162 iOwner.iHandleEventAsync.CallBack(); |
|
1163 } |
|
1164 |
|
1165 TBool CTestCamAdvSet::AutoFocusLockOn() const |
|
1166 { |
|
1167 return KAutoFocusLockOn; |
|
1168 } |
|
1169 |
|
1170 void CTestCamAdvSet::SetAutoFocusLockOn(TBool aState) |
|
1171 { |
|
1172 TInt eventError = KErrNotSupported; |
|
1173 |
|
1174 if(aState == KAutoFocusLockOn) |
|
1175 { |
|
1176 eventError = KErrAlreadyExists; |
|
1177 } |
|
1178 |
|
1179 TECAMEvent ecamevent(KUidECamEventCameraSettingAutoFocusLock, eventError); |
|
1180 |
|
1181 iOwner.iECamEvent = ecamevent; |
|
1182 iOwner.iHandleEventAsync.CallBack(); |
|
1183 } |
|
1184 |
|
1185 void CTestCamAdvSet::GetSupportedSettingsL(RArray<TUid>& aSettings) const |
|
1186 { |
|
1187 aSettings.Reset(); |
|
1188 User::Leave(KErrNotSupported); |
|
1189 } |
|
1190 |
|
1191 void CTestCamAdvSet::GetActiveSettingsL(RArray<TUid>& aActiveSettings) const |
|
1192 { |
|
1193 aActiveSettings.Reset(); |
|
1194 User::Leave(KErrNotSupported); |
|
1195 } |
|
1196 |
|
1197 void CTestCamAdvSet::GetDisabledSettingsL(RArray<TUid>& aDisbledSettings) const |
|
1198 { |
|
1199 aDisbledSettings.Reset(); |
|
1200 User::Leave(KErrNotSupported); |
|
1201 } |
|
1202 |
|
1203 void CTestCamAdvSet::SetAutomaticSizeSelectionChangeOn(TBool aSetOn) |
|
1204 { |
|
1205 TInt eventError = KErrNotSupported; |
|
1206 |
|
1207 if(aSetOn == KAutomaticSizeSelectionChangeOn) |
|
1208 { |
|
1209 eventError = KErrAlreadyExists; |
|
1210 } |
|
1211 |
|
1212 TECAMEvent ecamevent(KUidECamEventCameraSettingAutomaticSizeSelection, eventError); |
|
1213 |
|
1214 iOwner.iECamEvent = ecamevent; |
|
1215 iOwner.iHandleEventAsync.CallBack(); |
|
1216 } |
|
1217 |
|
1218 TBool CTestCamAdvSet::AutomaticSizeSelectionChangeOn() const |
|
1219 { |
|
1220 return KAutomaticSizeSelectionChangeOn; |
|
1221 } |
|
1222 |
|
1223 void CTestCamAdvSet::GetSupportedContinuousAutoFocusTimeoutsL(RArray<TInt>& aTimeouts, TValueInfo& aInfo) const |
|
1224 { |
|
1225 aTimeouts.Reset(); |
|
1226 aInfo = ENotActive; |
|
1227 } |
|
1228 |
|
1229 void CTestCamAdvSet::SetContinuousAutoFocusTimeout(TInt /*aTimeout*/) |
|
1230 { |
|
1231 TECAMEvent ecamevent(KUidECamEventCameraSettingsContinuousAutoFocusTimeout, KErrNotSupported); |
|
1232 |
|
1233 iOwner.iECamEvent = ecamevent; |
|
1234 iOwner.iHandleEventAsync.CallBack(); |
|
1235 } |
|
1236 |
|
1237 void CTestCamAdvSet::SetStabilizationEffect(CCamera::CCameraAdvancedSettings::TStabilizationEffect aEffect) |
|
1238 { |
|
1239 TInt eventError = KErrNotSupported; |
|
1240 |
|
1241 if(aEffect == KStabilizationEffect) |
|
1242 { |
|
1243 eventError = KErrAlreadyExists; |
|
1244 } |
|
1245 |
|
1246 TECAMEvent ecamevent(KUidECamEventCameraSettingsStabilizationEffect, eventError); |
|
1247 |
|
1248 iOwner.iECamEvent = ecamevent; |
|
1249 iOwner.iHandleEventAsync.CallBack(); |
|
1250 } |
|
1251 |
|
1252 CCamera::CCameraAdvancedSettings::TStabilizationEffect CTestCamAdvSet::StabilizationEffect() const |
|
1253 { |
|
1254 return KStabilizationEffect; |
|
1255 } |
|
1256 |
|
1257 TInt CTestCamAdvSet::SupportedStabilizationEffects() const |
|
1258 { |
|
1259 return KStabilizationEffect; |
|
1260 } |
|
1261 |
|
1262 TInt CTestCamAdvSet::SupportedStabilizationComplexityValues() const |
|
1263 { |
|
1264 return KStabilizationComplexity; |
|
1265 } |
|
1266 |
|
1267 CCamera::CCameraAdvancedSettings::TStabilizationAlgorithmComplexity CTestCamAdvSet::StabilizationComplexity() const |
|
1268 { |
|
1269 return KStabilizationComplexity; |
|
1270 } |
|
1271 |
|
1272 void CTestCamAdvSet::SetStabilizationComplexity(CCamera::CCameraAdvancedSettings::TStabilizationAlgorithmComplexity aComplexity) |
|
1273 { |
|
1274 TInt eventError = KErrNotSupported; |
|
1275 |
|
1276 if(aComplexity == KStabilizationComplexity) |
|
1277 { |
|
1278 eventError = KErrAlreadyExists; |
|
1279 } |
|
1280 |
|
1281 TECAMEvent ecamevent(KUidECamEventSettingsStabilizationAlgorithmComplexity, eventError); |
|
1282 |
|
1283 iOwner.iECamEvent = ecamevent; |
|
1284 iOwner.iHandleEventAsync.CallBack(); |
|
1285 } |
|
1286 |
|
1287 CCamera::CCameraAdvancedSettings::TWBUnits CTestCamAdvSet::SupportedWBUnits() const |
|
1288 { |
|
1289 return KSupportedWBUnits; |
|
1290 } |
|
1291 |
|
1292 void CTestCamAdvSet::SetWBRgbValue(const TRgb& /*aValue*/) |
|
1293 { |
|
1294 TECAMEvent ecamevent(KUidECamEventCameraSettingsWBValue, KErrNotSupported); |
|
1295 |
|
1296 iOwner.iECamEvent = ecamevent; |
|
1297 iOwner.iHandleEventAsync.CallBack(); |
|
1298 } |
|
1299 |
|
1300 void CTestCamAdvSet::GetWBRgbValue(TRgb& aValue) const |
|
1301 { |
|
1302 aValue = KRgbWhite; |
|
1303 } |
|
1304 |
|
1305 void CTestCamAdvSet::GetWBSupportedColorTemperaturesL(RArray<TInt>& aWBColorTemperatures, TValueInfo& aInfo) const |
|
1306 { |
|
1307 aWBColorTemperatures.Reset(); |
|
1308 aInfo = ENotActive; |
|
1309 } |
|
1310 |
|
1311 void CTestCamAdvSet::SetWBColorTemperature(TInt /*aColorTemperature*/) |
|
1312 { |
|
1313 TECAMEvent ecamevent(KUidECamEventCameraSettingsWBValue, KErrNotSupported); |
|
1314 |
|
1315 iOwner.iECamEvent = ecamevent; |
|
1316 iOwner.iHandleEventAsync.CallBack(); |
|
1317 } |
|
1318 |
|
1319 TInt CTestCamAdvSet::WBColorTemperature() const |
|
1320 { |
|
1321 return KErrNotSupported; |
|
1322 } |
|
1323 |
|
1324 TInt CTestCamAdvSet::ContinuousAutoFocusTimeout() const |
|
1325 { |
|
1326 return KErrNotSupported; |
|
1327 } |
|
1328 |
|
1329 TInt CTestCamAdvSet::IsFlashReady(TBool& aReady) const |
|
1330 { |
|
1331 aReady = KFlashReadyState; |
|
1332 return KErrNone; |
|
1333 } |
|
1334 |
|
1335 void CTestCamAdvSet::GetCurrentFocusModeStepsL(RArray<TInt>& aFocusModeSteps, TValueInfo& aInfo) const |
|
1336 { |
|
1337 aFocusModeSteps.Reset(); |
|
1338 aInfo = ENotActive; |
|
1339 } |
|
1340 |
|
1341 void CTestCamAdvSet::SetReferenceScreen(CWsScreenDevice& /*aScreenDevice*/) |
|
1342 { |
|
1343 TECAMEvent ecamevent(KUidECamEventCameraSettingReferenceScreen, KErrNotSupported); |
|
1344 |
|
1345 iOwner.iECamEvent = ecamevent; |
|
1346 iOwner.iHandleEventAsync.CallBack(); |
|
1347 } |
|
1348 |
|
1349 void CTestCamAdvSet::GetPreCaptureWarningSupportedL(CCamera::CCameraAdvancedSettings::TCameraMode /*aCameraMode*/, TInt& aPreCaptureWarningSupported) const |
|
1350 { |
|
1351 aPreCaptureWarningSupported = KPreCaptureWarning; |
|
1352 } |
|
1353 |
|
1354 void CTestCamAdvSet::SubscribeToPreCaptureWarningL(TInt /*aPreCaptureWarning*/) |
|
1355 { |
|
1356 User::Leave(KErrNotSupported); |
|
1357 } |
|
1358 |
|
1359 void CTestCamAdvSet::UnSubscribePreCaptureWarningL() |
|
1360 { |
|
1361 User::Leave(KErrNotSupported); |
|
1362 } |
|
1363 |
|
1364 void CTestCamAdvSet::GetPreCaptureWarningL(TInt& /*aPreCaptureWarning*/) const |
|
1365 { |
|
1366 User::Leave(KErrNotSupported); |
|
1367 } |
|
1368 |
|
1369 void CTestCamAdvSet::GetSupportedAFAssistantLightL(TInt& aSupportedAFAssistantLight) const |
|
1370 { |
|
1371 aSupportedAFAssistantLight = KAFAssisstantLight; |
|
1372 } |
|
1373 |
|
1374 void CTestCamAdvSet::GetAFAssistantLightL(CCamera::CCameraAdvancedSettings::TAFAssistantLight& /*aAFAssistantLight*/) const |
|
1375 { |
|
1376 User::Leave(KErrNotSupported); |
|
1377 } |
|
1378 |
|
1379 void CTestCamAdvSet::SetAFAssistantLight(CCamera::CCameraAdvancedSettings::TAFAssistantLight aAFAssistantLight) |
|
1380 { |
|
1381 TInt eventError = KErrNotSupported; |
|
1382 |
|
1383 if(aAFAssistantLight == KAFAssisstantLight) |
|
1384 { |
|
1385 eventError = KErrAlreadyExists; |
|
1386 } |
|
1387 |
|
1388 TECAMEvent ecamevent(KUidECamEventCameraSettingAFAssistantLight, eventError); |
|
1389 |
|
1390 iOwner.iECamEvent = ecamevent; |
|
1391 iOwner.iHandleEventAsync.CallBack(); |
|
1392 } |
|
1393 |
|
1394 /**********************************************************************************************************/ |
|
1395 /* CTestCamPresets */ |
|
1396 /**********************************************************************************************************/ |
|
1397 |
|
1398 CTestCamPresets::CTestCamPresets(CTestCamera& aOwner): iOwner(aOwner),iCurrentPreset(KNullUid) |
|
1399 {} |
|
1400 |
|
1401 CTestCamPresets::~CTestCamPresets() |
|
1402 { |
|
1403 iSupportedPresets.Close(); |
|
1404 iFactoryPresetAffectSettings.Close(); |
|
1405 |
|
1406 CDataGlobal* globalData = static_cast <CDataGlobal*> (Dll::Tls()); |
|
1407 if(globalData != NULL) |
|
1408 { |
|
1409 if(!globalData->iTestCamAdvSet && !globalData->iTestCamSnapshot && !globalData->iTestCamImgProc) |
|
1410 { |
|
1411 delete globalData; |
|
1412 Dll::FreeTls(); |
|
1413 } |
|
1414 else |
|
1415 { |
|
1416 globalData->iTestCamPresets = NULL; |
|
1417 Dll::SetTls(globalData); |
|
1418 } |
|
1419 } |
|
1420 } |
|
1421 |
|
1422 CTestCamPresets* CTestCamPresets::NewL(CTestCamera& aOwner) |
|
1423 { |
|
1424 CDataGlobal* globalData = static_cast <CDataGlobal*> (Dll::Tls()); |
|
1425 |
|
1426 if(globalData == NULL) |
|
1427 { |
|
1428 globalData = new (ELeave) CDataGlobal; |
|
1429 CleanupStack::PushL(globalData); |
|
1430 globalData->iPresetsReferenceCount = 0; |
|
1431 globalData->iTestCamPresets = new (ELeave) CTestCamPresets(aOwner); |
|
1432 globalData->iTestCamPresets->ConstructL(); |
|
1433 globalData->iTestCamPresets->iRefCount = 1; |
|
1434 User::LeaveIfError(Dll::SetTls(globalData)); |
|
1435 CleanupStack::Pop(globalData); |
|
1436 return globalData->iTestCamPresets; |
|
1437 } |
|
1438 else |
|
1439 { |
|
1440 if(globalData->iTestCamPresets == NULL) |
|
1441 { |
|
1442 globalData->iPresetsReferenceCount = 0; |
|
1443 globalData->iTestCamPresets = new (ELeave) CTestCamPresets(aOwner); |
|
1444 CleanupStack::PushL(globalData->iTestCamPresets); |
|
1445 globalData->iTestCamPresets->ConstructL(); |
|
1446 globalData->iTestCamPresets->iRefCount = 1; |
|
1447 User::LeaveIfError(Dll::SetTls(globalData)); |
|
1448 CleanupStack::Pop(globalData->iTestCamPresets); |
|
1449 return globalData->iTestCamPresets; |
|
1450 } |
|
1451 |
|
1452 CTestCamPresets* self = globalData->iTestCamPresets; |
|
1453 |
|
1454 globalData->iPresetsReferenceCount++; |
|
1455 self->iRefCount = globalData->iPresetsReferenceCount + 1; |
|
1456 if (globalData->iPresetsReferenceCount == KNumOfPresetExtensions-1 ) |
|
1457 { |
|
1458 globalData->iTestCamPresets = NULL; |
|
1459 if(!globalData->iTestCamAdvSet && !globalData->iTestCamSnapshot && !globalData->iTestCamImgProc) |
|
1460 { |
|
1461 delete globalData; |
|
1462 Dll::FreeTls(); |
|
1463 } |
|
1464 else |
|
1465 { |
|
1466 User::LeaveIfError(Dll::SetTls(globalData)); |
|
1467 } |
|
1468 } |
|
1469 else |
|
1470 { |
|
1471 User::LeaveIfError(Dll::SetTls(globalData)); |
|
1472 } |
|
1473 return self; |
|
1474 } |
|
1475 } |
|
1476 |
|
1477 void CTestCamPresets::Release() |
|
1478 { |
|
1479 iRefCount--; |
|
1480 if(iRefCount == 0) |
|
1481 { |
|
1482 delete this; |
|
1483 } |
|
1484 } |
|
1485 |
|
1486 void CTestCamPresets::ConstructL() |
|
1487 { |
|
1488 iSupportedPresets.Reset(); |
|
1489 iSupportedPresets.AppendL(KUidECamPresetFactoryDefault); |
|
1490 |
|
1491 iFactoryPresetAffectSettings.Reset(); |
|
1492 iFactoryPresetAffectSettings.AppendL(KUidECamEventCameraSettingDriveMode); |
|
1493 iFactoryPresetAffectSettings.AppendL(KUidECamEventBurstImages); |
|
1494 } |
|
1495 |
|
1496 void CTestCamPresets::GetSupportedPresetsL(RArray<TUid>& aPresets) const |
|
1497 { |
|
1498 aPresets.Reset(); |
|
1499 for (TInt index=0; index < iSupportedPresets.Count(); index++) |
|
1500 { |
|
1501 User::LeaveIfError(aPresets.Append(iSupportedPresets[index])); |
|
1502 } |
|
1503 } |
|
1504 |
|
1505 void CTestCamPresets::SetPreset(TUid aPreset) |
|
1506 { |
|
1507 TInt eventError = iOwner.CheckReserveAndPower(); |
|
1508 if(eventError == KErrNone) |
|
1509 { |
|
1510 if(aPreset == iSupportedPresets[0]) |
|
1511 { |
|
1512 //ResetBrightness, Contrast, Drivemode, No. of burst mode images |
|
1513 iOwner.iBrightness = 0; |
|
1514 iOwner.iContrast = 0; |
|
1515 iOwner.iImgProcBrightness = 0; |
|
1516 iOwner.iImgProcContrast = 0; |
|
1517 iOwner.iDriveMode = KDefaultDriveMode; |
|
1518 iOwner.iBurstImages = KBurstImages; |
|
1519 } |
|
1520 else |
|
1521 { |
|
1522 eventError = KErrNotSupported; |
|
1523 } |
|
1524 } |
|
1525 |
|
1526 TECAMEvent ecamevent(aPreset, eventError); |
|
1527 |
|
1528 iOwner.iECamEvent = ecamevent; |
|
1529 iOwner.iHandleEventAsync.CallBack(); |
|
1530 } |
|
1531 |
|
1532 TUid CTestCamPresets::Preset() const |
|
1533 { |
|
1534 return iCurrentPreset; |
|
1535 } |
|
1536 |
|
1537 void CTestCamPresets::GetAffectedSettingsL(RArray<TUid>& aSettings) const |
|
1538 { |
|
1539 aSettings.Reset(); |
|
1540 |
|
1541 if(iCurrentPreset == iSupportedPresets[0]) |
|
1542 { |
|
1543 for (TInt index=0; index < iFactoryPresetAffectSettings.Count(); index++) |
|
1544 { |
|
1545 User::LeaveIfError(aSettings.Append(iFactoryPresetAffectSettings[index])); |
|
1546 } |
|
1547 } |
|
1548 } |
|
1549 |
|
1550 void CTestCamPresets::GetAssociatedSettingsL(TUid aPreset, RArray<TUid>& aSettings) const |
|
1551 { |
|
1552 switch(aPreset.iUid) |
|
1553 { |
|
1554 case KUidECamPresetFactoryDefaultUidValue: |
|
1555 { |
|
1556 aSettings.Reset(); |
|
1557 for (TInt index=0; index < iFactoryPresetAffectSettings.Count(); index++) |
|
1558 { |
|
1559 User::LeaveIfError(aSettings.Append(iFactoryPresetAffectSettings[index])); |
|
1560 } |
|
1561 break; |
|
1562 } |
|
1563 |
|
1564 //fall through |
|
1565 case KUidECamPresetOutdoorUidValue: |
|
1566 case KUidECamPresetOutdoorSportUidValue: |
|
1567 case KUidECamPresetSnowUidValue: |
|
1568 case KUidECamPresetBeachUidValue: |
|
1569 case KUidECamPresetNightPortraitUidValue: |
|
1570 case KUidECamPresetNightFireworksUidValue: |
|
1571 case KUidECamPresetFogUidValue: |
|
1572 case KUidECamPresetIndoorUidValue: |
|
1573 case KUidECamPresetIndoorSportUidValue: |
|
1574 { |
|
1575 User::Leave(KErrNotSupported); |
|
1576 } |
|
1577 //fall through |
|
1578 case KUidECamPresetNightPartyIndoorUidValue: |
|
1579 case KUidECamPresetNightCloseUpUidValue: |
|
1580 case KUidECamPresetNightMacroUidValue: |
|
1581 case KUidECamPresetTextDocumentUidValue: |
|
1582 case KUidECamPresetBarcodeUidValue: |
|
1583 case KUidECamPresetAutoUidValue: |
|
1584 case KUidECamPresetPortraitUidValue: |
|
1585 case KUidECamPresetLandscapeUidValue: |
|
1586 case KUidECamPresetAmbienceMoodUidValue: |
|
1587 { |
|
1588 if(iOwner.CameraVersion() == KCameraDefaultVersion) |
|
1589 { |
|
1590 User::Leave(KErrArgument); |
|
1591 } |
|
1592 else |
|
1593 { |
|
1594 User::Leave(KErrNotSupported); |
|
1595 } |
|
1596 } |
|
1597 |
|
1598 default: |
|
1599 User::Leave(KErrArgument); |
|
1600 |
|
1601 } |
|
1602 } |