|
1 /* |
|
2 * Copyright (c) 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: |
|
15 * |
|
16 */ |
|
17 /* |
|
18 * Symbian specific settings handling |
|
19 */ |
|
20 |
|
21 #include <QVariant> |
|
22 #include <QFile> |
|
23 #include <QList> |
|
24 #include <QMultiMap> |
|
25 #include <QMetaType> |
|
26 |
|
27 #include "cxesettingsmodelimp.h" |
|
28 #include "cxesettingscenrepstore.h" |
|
29 #include "cxesettings.h" |
|
30 #include "cxutils.h" |
|
31 #include "cxenamespace.h" |
|
32 #include "cxeerror.h" |
|
33 #include "cxeautofocuscontrol.h" |
|
34 |
|
35 |
|
36 using namespace Cxe; |
|
37 |
|
38 |
|
39 /* |
|
40 * CxeSettingsModel::CxeSettingsModel |
|
41 */ |
|
42 CxeSettingsModelImp::CxeSettingsModelImp(CxeSettingsStore *settingsStore) |
|
43 { |
|
44 CX_DEBUG_ENTER_FUNCTION(); |
|
45 CX_ASSERT_ALWAYS(settingsStore); |
|
46 // we take ownership of the settings store. |
|
47 mSettingStore = settingsStore; |
|
48 init(); |
|
49 |
|
50 CX_DEBUG_EXIT_FUNCTION(); |
|
51 } |
|
52 |
|
53 |
|
54 /* |
|
55 * CxeSettingsModelImp::init |
|
56 */ |
|
57 void CxeSettingsModelImp::init() |
|
58 { |
|
59 CX_DEBUG_ENTER_FUNCTION(); |
|
60 |
|
61 loadRuntimeSettings(); |
|
62 loadImageScenes(); |
|
63 loadVideoScenes(); |
|
64 |
|
65 // TODO: for now the current image scene when we start camera is SceneAuto |
|
66 mCameraMode = Cxe::ImageMode; |
|
67 setImageScene(CxeSettingIds::IMAGE_SCENE_AUTO); |
|
68 setVideoScene(CxeSettingIds::VIDEO_SCENE_AUTO); |
|
69 |
|
70 CX_DEBUG_EXIT_FUNCTION(); |
|
71 } |
|
72 |
|
73 |
|
74 |
|
75 /* |
|
76 * CxeSettingsModelImp::~CxeSettingsModelImp() |
|
77 */ |
|
78 CxeSettingsModelImp::~CxeSettingsModelImp() |
|
79 { |
|
80 CX_DEBUG_ENTER_FUNCTION(); |
|
81 |
|
82 delete mSettingStore; |
|
83 |
|
84 mCurrentImgScene.clear(); |
|
85 mCurrentVidScene.clear(); |
|
86 |
|
87 mImageSceneModes.clear(); |
|
88 mVideoSceneModes.clear(); |
|
89 |
|
90 mRuntimeSettings.clear(); |
|
91 |
|
92 CX_DEBUG_EXIT_FUNCTION(); |
|
93 } |
|
94 |
|
95 |
|
96 |
|
97 /* |
|
98 * Loads all run-time settings |
|
99 */ |
|
100 void CxeSettingsModelImp::loadRuntimeSettings() |
|
101 { |
|
102 CX_DEBUG_ENTER_FUNCTION(); |
|
103 CX_DEBUG_ASSERT( mSettingStore ); |
|
104 |
|
105 QList<QString> runtimeKeys; |
|
106 // all supported runtime keys are fetched from here. |
|
107 supportedKeys(runtimeKeys); |
|
108 // load all run-time setting values from cenrep. |
|
109 mRuntimeSettings = mSettingStore->loadRuntimeSettings(runtimeKeys); |
|
110 |
|
111 CX_DEBUG_EXIT_FUNCTION(); |
|
112 } |
|
113 |
|
114 |
|
115 /* |
|
116 * Get setting value associated with the key. |
|
117 * @Param key - Setting key Id ( refer to CxeSettingIds in cxenums.h ) |
|
118 * @Param value - contains the value associated with the key. |
|
119 * @returns CxeError::None if successful or any CxeError specific error code. |
|
120 */ |
|
121 CxeError::Id CxeSettingsModelImp::getSettingValue(const QString &key, QVariant &value) |
|
122 { |
|
123 CX_DEBUG_ENTER_FUNCTION(); |
|
124 CX_DEBUG_ASSERT(mSettingStore); |
|
125 |
|
126 // Try first to find the item from scene settings. |
|
127 // These need to override the common setting values. |
|
128 CxeError::Id err = sceneSettingValue(key, value); |
|
129 CX_DEBUG(( "status reading from scene data: %d", err)); |
|
130 |
|
131 // If scene does not control this setting, read it from settings store. |
|
132 if (err == CxeError::NotFound) { |
|
133 // setting not found in setting store, try finding if its scene specific setting. |
|
134 CX_DEBUG(( "fetching value from settings store" )); |
|
135 err = mSettingStore->get(key, value); |
|
136 } |
|
137 CX_DEBUG_EXIT_FUNCTION(); |
|
138 |
|
139 return err; |
|
140 } |
|
141 |
|
142 |
|
143 |
|
144 |
|
145 /* |
|
146 * Get setting value associated with the key. |
|
147 * @param uid - UID of component that owns the setting key |
|
148 * @Param key - key id of the setting |
|
149 * @param type - the type of key |
|
150 * @Param value - contains the value associated with the key. |
|
151 */ |
|
152 void CxeSettingsModelImp::getSettingValue(long int uid, |
|
153 unsigned long int key, |
|
154 Cxe::SettingKeyType type, |
|
155 QVariant &value) |
|
156 { |
|
157 CX_DEBUG_ENTER_FUNCTION(); |
|
158 CX_DEBUG_ASSERT(mSettingStore); |
|
159 |
|
160 mSettingStore->get(uid, key, type, value); |
|
161 |
|
162 CX_DEBUG_EXIT_FUNCTION(); |
|
163 } |
|
164 |
|
165 |
|
166 |
|
167 |
|
168 /* |
|
169 * Set a value to the key. |
|
170 * @Param key - Setting key Id ( refer to CxeSettingIds in cxenums.h ) |
|
171 * @Param value - contains the value associated with the key. |
|
172 * @returns CxeError::None if successful or any CxeError specific error code. |
|
173 */ |
|
174 CxeError::Id CxeSettingsModelImp::set(const QString &key, const QVariant newValue) |
|
175 { |
|
176 CX_DEBUG_ENTER_FUNCTION(); |
|
177 CX_DEBUG_ASSERT(mSettingStore); |
|
178 |
|
179 // If this is one of scene settings, |
|
180 // store it as modification of current scene. |
|
181 CxeError::Id err = setSceneSettingValue(key, newValue.toInt()); |
|
182 CX_DEBUG(( "status storing to scene data: %d", err)); |
|
183 |
|
184 // If not scene specific, store the setting value. |
|
185 if (err == CxeError::NotFound) { |
|
186 CX_DEBUG(( "writing value to settings store" )); |
|
187 err = mSettingStore->set(key, newValue); |
|
188 } |
|
189 |
|
190 CX_DEBUG_EXIT_FUNCTION(); |
|
191 |
|
192 return err; |
|
193 } |
|
194 |
|
195 |
|
196 /* |
|
197 * Reset all settings |
|
198 */ |
|
199 void CxeSettingsModelImp::reset() |
|
200 { |
|
201 CX_DEBUG_ENTER_FUNCTION(); |
|
202 CX_DEBUG_ASSERT(mSettingStore); |
|
203 mSettingStore->reset(); |
|
204 CX_DEBUG_EXIT_FUNCTION(); |
|
205 } |
|
206 |
|
207 |
|
208 /* |
|
209 * Get the configured run-time value associated with the key. |
|
210 * @Param key - Setting key Id ( refer to CxeSettingIds in cxenums.h ) |
|
211 * @Param value - contains the value associated with the key. |
|
212 * @returns CxeError::None if successful or any CxeError specific error code. |
|
213 */ |
|
214 CxeError::Id CxeSettingsModelImp::getRuntimeValue(const QString &key, QVariant &value) |
|
215 { |
|
216 CX_DEBUG_ENTER_FUNCTION(); |
|
217 |
|
218 CxeError::Id err = CxeError::None; |
|
219 |
|
220 // read run-time configuration value |
|
221 if ( mRuntimeSettings.contains(key) ) { |
|
222 value = qVariantFromValue<QVariantList > (mRuntimeSettings.value(key)); |
|
223 } else { |
|
224 err = CxeError::NotFound; |
|
225 } |
|
226 |
|
227 CX_DEBUG_EXIT_FUNCTION(); |
|
228 |
|
229 return err; |
|
230 } |
|
231 |
|
232 |
|
233 /* |
|
234 * Set new Image scene mode. |
|
235 * @returns CxeError::None if successful or any CxeError specific error code. |
|
236 */ |
|
237 CxeError::Id CxeSettingsModelImp::setImageScene(const QString &newScene) |
|
238 { |
|
239 CX_DEBUG_ENTER_FUNCTION(); |
|
240 |
|
241 CxeError::Id err = CxeError::None; |
|
242 |
|
243 mCurrentImgScene.clear(); |
|
244 |
|
245 // load the scene setting default values for the new scene id = "newScene" |
|
246 CxeScene sceneSettings; |
|
247 err = imageScene(newScene, sceneSettings); |
|
248 |
|
249 // create of copy of the new scene as we use it for accessing the scene settings later. |
|
250 if (CxeError::None == err) { |
|
251 loadSceneData(mCurrentImgScene, sceneSettings); |
|
252 } |
|
253 |
|
254 CX_DEBUG_EXIT_FUNCTION(); |
|
255 |
|
256 return err; |
|
257 } |
|
258 |
|
259 |
|
260 /* |
|
261 * Set new video scene mode. |
|
262 * @returns CxeError::None if successful or any CxeError specific error code. |
|
263 */ |
|
264 CxeError::Id CxeSettingsModelImp::setVideoScene(const QString &newScene) |
|
265 { |
|
266 CX_DEBUG_ENTER_FUNCTION(); |
|
267 |
|
268 CxeError::Id err = CxeError::None; |
|
269 |
|
270 mCurrentVidScene.clear(); |
|
271 |
|
272 // load the scene setting default values for the new scene id = "newScene" |
|
273 CxeScene sceneSettings; |
|
274 err = videoScene(newScene, sceneSettings); |
|
275 |
|
276 // create of copy of the new scene as we use it for accessing the scene settings later. |
|
277 if (CxeError::None == err) { |
|
278 loadSceneData(mCurrentVidScene, sceneSettings); |
|
279 } |
|
280 |
|
281 CX_DEBUG_EXIT_FUNCTION(); |
|
282 |
|
283 return err; |
|
284 } |
|
285 |
|
286 |
|
287 |
|
288 /* |
|
289 * Loads Image scene settings for the given Scene ID |
|
290 */ |
|
291 CxeError::Id CxeSettingsModelImp::imageScene(const QString &sceneId, CxeScene &sceneSettings) |
|
292 { |
|
293 CX_DEBUG_ENTER_FUNCTION(); |
|
294 |
|
295 CxeError::Id err = CxeError::None; |
|
296 |
|
297 if(mImageSceneModes.contains(sceneId)) { |
|
298 sceneSettings = mImageSceneModes[sceneId]; |
|
299 } else { |
|
300 err = CxeError::NotFound; |
|
301 } |
|
302 |
|
303 CX_DEBUG_EXIT_FUNCTION(); |
|
304 |
|
305 return err; |
|
306 } |
|
307 |
|
308 |
|
309 /* |
|
310 * Loads Video scene settings for the given Scene ID |
|
311 */ |
|
312 CxeError::Id CxeSettingsModelImp::videoScene(const QString &sceneId, CxeScene &sceneSettings) |
|
313 { |
|
314 CX_DEBUG_ENTER_FUNCTION(); |
|
315 |
|
316 CxeError::Id err = CxeError::None; |
|
317 |
|
318 if(mVideoSceneModes.contains(sceneId)) { |
|
319 sceneSettings = mVideoSceneModes[sceneId]; |
|
320 } else { |
|
321 err = CxeError::NotFound; |
|
322 } |
|
323 |
|
324 CX_DEBUG_EXIT_FUNCTION(); |
|
325 |
|
326 return err; |
|
327 } |
|
328 |
|
329 |
|
330 /* |
|
331 * Creates a copy of the selected scene that we use for accessing specific scene settings. |
|
332 */ |
|
333 void CxeSettingsModelImp::loadSceneData(CxeScene ¤tScene, CxeScene &sceneDefaultSettings) |
|
334 { |
|
335 CX_DEBUG_ENTER_FUNCTION(); |
|
336 |
|
337 // creating a deep copy of the scene mode selected. |
|
338 |
|
339 CxeScene::const_iterator scene = sceneDefaultSettings.constBegin(); |
|
340 while (scene != sceneDefaultSettings.constEnd()) { |
|
341 currentScene.insert(scene.key(), scene.value()); |
|
342 ++scene; |
|
343 } |
|
344 |
|
345 CX_DEBUG_EXIT_FUNCTION(); |
|
346 } |
|
347 |
|
348 |
|
349 /* |
|
350 * returns value associated with the key |
|
351 */ |
|
352 CxeError::Id CxeSettingsModelImp::sceneSettingValue(const QString &key, QVariant &value) |
|
353 { |
|
354 CX_DEBUG_ENTER_FUNCTION(); |
|
355 |
|
356 CxeScene scene; |
|
357 CxeError::Id err = CxeError::None; |
|
358 |
|
359 if(mCameraMode == Cxe::ImageMode) { |
|
360 CX_DEBUG(( "CxeSettingsModelImp::sceneSettingValue - Image mode Setting")); |
|
361 scene = mCurrentImgScene; |
|
362 } else { |
|
363 CX_DEBUG(( "CxeSettingsModelImp::sceneSettingValue - Video mode Setting")); |
|
364 scene = mCurrentVidScene; |
|
365 } |
|
366 |
|
367 if (scene.contains(key)) { |
|
368 value = scene[key]; |
|
369 } else { |
|
370 err = CxeError::NotFound; |
|
371 } |
|
372 |
|
373 |
|
374 CX_DEBUG_EXIT_FUNCTION(); |
|
375 |
|
376 return err; |
|
377 } |
|
378 |
|
379 |
|
380 /* |
|
381 * set scene setting value associated with the key |
|
382 */ |
|
383 CxeError::Id CxeSettingsModelImp::setSceneSettingValue(const QString &key, int newValue) |
|
384 { |
|
385 CX_DEBUG_ENTER_FUNCTION(); |
|
386 |
|
387 CxeError::Id err = CxeError::None; |
|
388 |
|
389 if(mCameraMode == Cxe::ImageMode) { |
|
390 CX_DEBUG(( "CxeSettingsModelImp::setSceneSettingValue - Image mode Setting")); |
|
391 if(mCurrentImgScene.contains(key)) { |
|
392 mCurrentImgScene[key] = newValue; |
|
393 } else { |
|
394 err = CxeError::NotFound; |
|
395 } |
|
396 } else { |
|
397 CX_DEBUG(( "CxeSettingsModelImp::setSceneSettingValue - Video mode Setting")); |
|
398 if(mCurrentVidScene.contains(key)) { |
|
399 mCurrentVidScene[key] = newValue; |
|
400 } else { |
|
401 err = CxeError::NotFound; |
|
402 } |
|
403 } |
|
404 |
|
405 CX_DEBUG_EXIT_FUNCTION(); |
|
406 |
|
407 return err; |
|
408 } |
|
409 |
|
410 |
|
411 // appending the run-time keys to an array |
|
412 void CxeSettingsModelImp::supportedKeys(QList<QString>& runtimeKeys) |
|
413 { |
|
414 CX_DEBUG_ENTER_FUNCTION(); |
|
415 |
|
416 runtimeKeys.append(CxeRuntimeKeys::PRIMARY_CAMERA_CAPTURE_KEYS); |
|
417 runtimeKeys.append(CxeRuntimeKeys::PRIMARY_CAMERA_AUTOFOCUS_KEYS); |
|
418 runtimeKeys.append(CxeRuntimeKeys::SECONDARY_CAMERA_CAPTURE_KEYS); |
|
419 runtimeKeys.append(CxeRuntimeKeys::CONTRAST_ITEMS); |
|
420 runtimeKeys.append(CxeRuntimeKeys::STILL_MAX_ZOOM_LIMITS); |
|
421 runtimeKeys.append(CxeRuntimeKeys::VIDEO_MAX_ZOOM_LIMITS); |
|
422 |
|
423 CX_DEBUG_EXIT_FUNCTION(); |
|
424 } |
|
425 |
|
426 |
|
427 /* |
|
428 * Loads all video scene modes |
|
429 */ |
|
430 void CxeSettingsModelImp::loadVideoScenes() |
|
431 { |
|
432 CX_DEBUG_ENTER_FUNCTION(); |
|
433 |
|
434 mVideoSceneModes.clear(); |
|
435 |
|
436 CxeScene vidSceneAuto; |
|
437 |
|
438 vidSceneAuto.insert(CxeSettingIds::SCENE_ID, CxeSettingIds::VIDEO_SCENE_AUTO); |
|
439 vidSceneAuto.insert(CxeSettingIds::FOCAL_RANGE, CxeAutoFocusControl::Hyperfocal); |
|
440 vidSceneAuto.insert(CxeSettingIds::WHITE_BALANCE, WhitebalanceAutomatic); |
|
441 vidSceneAuto.insert(CxeSettingIds::EXPOSURE_MODE, ExposureAuto); |
|
442 vidSceneAuto.insert(CxeSettingIds::COLOR_TONE, ColortoneNormal); |
|
443 vidSceneAuto.insert(CxeSettingIds::CONTRAST, 0); |
|
444 vidSceneAuto.insert(CxeSettingIds::FRAME_RATE, 0); |
|
445 vidSceneAuto.insert(CxeSettingIds::EV_COMPENSATION_VALUE, 0); |
|
446 |
|
447 mVideoSceneModes.insert(CxeSettingIds::VIDEO_SCENE_AUTO,vidSceneAuto); |
|
448 |
|
449 |
|
450 CxeScene vidSceneNight; |
|
451 |
|
452 vidSceneNight.insert(CxeSettingIds::SCENE_ID, CxeSettingIds::VIDEO_SCENE_NIGHT); |
|
453 vidSceneNight.insert(CxeSettingIds::FOCAL_RANGE, CxeAutoFocusControl::Hyperfocal); |
|
454 vidSceneNight.insert(CxeSettingIds::WHITE_BALANCE, WhitebalanceAutomatic); |
|
455 vidSceneNight.insert(CxeSettingIds::EXPOSURE_MODE, ExposureNight); |
|
456 vidSceneNight.insert(CxeSettingIds::COLOR_TONE, ColortoneNormal); |
|
457 vidSceneNight.insert(CxeSettingIds::CONTRAST, 0); |
|
458 vidSceneNight.insert(CxeSettingIds::FRAME_RATE, 0); |
|
459 vidSceneNight.insert(CxeSettingIds::EV_COMPENSATION_VALUE, 0); |
|
460 |
|
461 mVideoSceneModes.insert(CxeSettingIds::VIDEO_SCENE_NIGHT, vidSceneNight); |
|
462 |
|
463 |
|
464 CxeScene vidSceneLowLight; |
|
465 |
|
466 vidSceneLowLight.insert(CxeSettingIds::SCENE_ID, CxeSettingIds::VIDEO_SCENE_LOWLIGHT); |
|
467 vidSceneLowLight.insert(CxeSettingIds::FOCAL_RANGE, CxeAutoFocusControl::Hyperfocal); |
|
468 vidSceneLowLight.insert(CxeSettingIds::WHITE_BALANCE, WhitebalanceAutomatic); |
|
469 vidSceneLowLight.insert(CxeSettingIds::EXPOSURE_MODE, ExposureNight); |
|
470 vidSceneLowLight.insert(CxeSettingIds::COLOR_TONE, ColortoneNormal); |
|
471 vidSceneLowLight.insert(CxeSettingIds::CONTRAST, 0); |
|
472 vidSceneLowLight.insert(CxeSettingIds::FRAME_RATE, 15); //fps |
|
473 vidSceneLowLight.insert(CxeSettingIds::EV_COMPENSATION_VALUE, 0); |
|
474 |
|
475 mVideoSceneModes.insert(CxeSettingIds::VIDEO_SCENE_LOWLIGHT, vidSceneLowLight); |
|
476 |
|
477 |
|
478 CX_DEBUG_EXIT_FUNCTION(); |
|
479 } |
|
480 |
|
481 |
|
482 /* |
|
483 * Loads all Image Scene Modes |
|
484 */ |
|
485 void CxeSettingsModelImp::loadImageScenes() |
|
486 { |
|
487 CX_DEBUG_ENTER_FUNCTION(); |
|
488 |
|
489 mImageSceneModes.clear(); |
|
490 |
|
491 CxeScene imgSceneAuto; |
|
492 |
|
493 imgSceneAuto.insert(CxeSettingIds::SCENE_ID, CxeSettingIds::IMAGE_SCENE_AUTO); |
|
494 imgSceneAuto.insert(CxeSettingIds::FOCAL_RANGE, CxeAutoFocusControl::Auto); |
|
495 imgSceneAuto.insert(CxeSettingIds::WHITE_BALANCE, WhitebalanceAutomatic); |
|
496 imgSceneAuto.insert(CxeSettingIds::EXPOSURE_MODE, ExposureAuto); |
|
497 imgSceneAuto.insert(CxeSettingIds::COLOR_TONE, ColortoneNormal); |
|
498 imgSceneAuto.insert(CxeSettingIds::CONTRAST, 0); |
|
499 imgSceneAuto.insert(CxeSettingIds::SHARPNESS, SharpnessNormal); |
|
500 imgSceneAuto.insert(CxeSettingIds::LIGHT_SENSITIVITY, LightSensitivityAutomatic); |
|
501 imgSceneAuto.insert(CxeSettingIds::EV_COMPENSATION_VALUE, 0); |
|
502 imgSceneAuto.insert(CxeSettingIds::BRIGHTNESS, 0); |
|
503 imgSceneAuto.insert(CxeSettingIds::FLASH_MODE, FlashAuto); |
|
504 |
|
505 mImageSceneModes.insert(CxeSettingIds::IMAGE_SCENE_AUTO, imgSceneAuto); |
|
506 |
|
507 |
|
508 CxeScene imgSceneSports; |
|
509 |
|
510 imgSceneSports.insert(CxeSettingIds::SCENE_ID, CxeSettingIds::IMAGE_SCENE_SPORTS); |
|
511 imgSceneSports.insert(CxeSettingIds::FOCAL_RANGE, CxeAutoFocusControl::Hyperfocal); |
|
512 imgSceneSports.insert(CxeSettingIds::WHITE_BALANCE, WhitebalanceAutomatic); |
|
513 imgSceneSports.insert(CxeSettingIds::EXPOSURE_MODE, ExposureSport); |
|
514 imgSceneSports.insert(CxeSettingIds::COLOR_TONE, ColortoneNormal); |
|
515 imgSceneSports.insert(CxeSettingIds::CONTRAST, 0); |
|
516 imgSceneSports.insert(CxeSettingIds::SHARPNESS, SharpnessNormal); |
|
517 imgSceneSports.insert(CxeSettingIds::LIGHT_SENSITIVITY, LightSensitivityAutomatic); |
|
518 imgSceneSports.insert(CxeSettingIds::EV_COMPENSATION_VALUE, 0); |
|
519 imgSceneSports.insert(CxeSettingIds::BRIGHTNESS, 0); |
|
520 imgSceneSports.insert(CxeSettingIds::FLASH_MODE, FlashOff); |
|
521 |
|
522 mImageSceneModes.insert(CxeSettingIds::IMAGE_SCENE_SPORTS, imgSceneSports); |
|
523 |
|
524 |
|
525 CxeScene imgSceneCloseUp; |
|
526 |
|
527 imgSceneCloseUp.insert(CxeSettingIds::SCENE_ID, CxeSettingIds::IMAGE_SCENE_MACRO); |
|
528 imgSceneCloseUp.insert(CxeSettingIds::FOCAL_RANGE, CxeAutoFocusControl::Macro); |
|
529 imgSceneCloseUp.insert(CxeSettingIds::WHITE_BALANCE, WhitebalanceAutomatic); |
|
530 imgSceneCloseUp.insert(CxeSettingIds::EXPOSURE_MODE, ExposureAuto); |
|
531 imgSceneCloseUp.insert(CxeSettingIds::COLOR_TONE, ColortoneNormal); |
|
532 imgSceneCloseUp.insert(CxeSettingIds::CONTRAST, 0); |
|
533 imgSceneCloseUp.insert(CxeSettingIds::SHARPNESS, SharpnessNormal); |
|
534 imgSceneCloseUp.insert(CxeSettingIds::LIGHT_SENSITIVITY, LightSensitivityAutomatic); |
|
535 imgSceneCloseUp.insert(CxeSettingIds::EV_COMPENSATION_VALUE, 0); |
|
536 imgSceneCloseUp.insert(CxeSettingIds::BRIGHTNESS, 0); |
|
537 imgSceneCloseUp.insert(CxeSettingIds::FLASH_MODE, FlashAuto); |
|
538 |
|
539 mImageSceneModes.insert(CxeSettingIds::IMAGE_SCENE_MACRO, imgSceneCloseUp); |
|
540 |
|
541 CxeScene imgPortraitscene; |
|
542 |
|
543 imgPortraitscene.insert(CxeSettingIds::SCENE_ID, CxeSettingIds::IMAGE_SCENE_PORTRAIT); |
|
544 imgPortraitscene.insert(CxeSettingIds::FOCAL_RANGE, CxeAutoFocusControl::Portrait); |
|
545 imgPortraitscene.insert(CxeSettingIds::WHITE_BALANCE, WhitebalanceAutomatic); |
|
546 imgPortraitscene.insert(CxeSettingIds::EXPOSURE_MODE, ExposureBacklight); |
|
547 imgPortraitscene.insert(CxeSettingIds::COLOR_TONE, ColortoneNormal); |
|
548 imgPortraitscene.insert(CxeSettingIds::CONTRAST, 0); |
|
549 imgPortraitscene.insert(CxeSettingIds::SHARPNESS, SharpnessSoft); |
|
550 imgPortraitscene.insert(CxeSettingIds::LIGHT_SENSITIVITY, LightSensitivityAutomatic); |
|
551 imgPortraitscene.insert(CxeSettingIds::EV_COMPENSATION_VALUE, 0); |
|
552 imgPortraitscene.insert(CxeSettingIds::BRIGHTNESS, 0); |
|
553 imgPortraitscene.insert(CxeSettingIds::FLASH_MODE, FlashAntiRedEye); |
|
554 |
|
555 mImageSceneModes.insert(CxeSettingIds::IMAGE_SCENE_PORTRAIT, imgPortraitscene); |
|
556 |
|
557 CxeScene imglandscapescene; |
|
558 |
|
559 imglandscapescene.insert(CxeSettingIds::SCENE_ID, CxeSettingIds::IMAGE_SCENE_SCENERY); |
|
560 imglandscapescene.insert(CxeSettingIds::FOCAL_RANGE, CxeAutoFocusControl::Infinity); |
|
561 imglandscapescene.insert(CxeSettingIds::WHITE_BALANCE, WhitebalanceSunny); |
|
562 imglandscapescene.insert(CxeSettingIds::EXPOSURE_MODE, ExposureAuto); |
|
563 imglandscapescene.insert(CxeSettingIds::COLOR_TONE, ColortoneNormal); |
|
564 imglandscapescene.insert(CxeSettingIds::CONTRAST, 0); |
|
565 imglandscapescene.insert(CxeSettingIds::SHARPNESS, SharpnessHard); |
|
566 imglandscapescene.insert(CxeSettingIds::LIGHT_SENSITIVITY, LightSensitivityAutomatic); |
|
567 imglandscapescene.insert(CxeSettingIds::EV_COMPENSATION_VALUE, 0); |
|
568 imglandscapescene.insert(CxeSettingIds::BRIGHTNESS, 0); |
|
569 imglandscapescene.insert(CxeSettingIds::FLASH_MODE, FlashOff); |
|
570 |
|
571 mImageSceneModes.insert(CxeSettingIds::IMAGE_SCENE_SCENERY, imglandscapescene); |
|
572 |
|
573 |
|
574 CxeScene imgNightscene; |
|
575 |
|
576 imgNightscene.insert(CxeSettingIds::SCENE_ID, CxeSettingIds::IMAGE_SCENE_NIGHT); |
|
577 imgNightscene.insert(CxeSettingIds::FOCAL_RANGE, CxeAutoFocusControl::Auto); |
|
578 imgNightscene.insert(CxeSettingIds::WHITE_BALANCE, WhitebalanceAutomatic); |
|
579 imgNightscene.insert(CxeSettingIds::EXPOSURE_MODE, ExposureNight); |
|
580 imgNightscene.insert(CxeSettingIds::COLOR_TONE, ColortoneNormal); |
|
581 imgNightscene.insert(CxeSettingIds::CONTRAST, 0); |
|
582 imgNightscene.insert(CxeSettingIds::SHARPNESS, SharpnessNormal); |
|
583 imgNightscene.insert(CxeSettingIds::LIGHT_SENSITIVITY, LightSensitivityAutomatic); |
|
584 imgNightscene.insert(CxeSettingIds::EV_COMPENSATION_VALUE, 0); |
|
585 imgNightscene.insert(CxeSettingIds::BRIGHTNESS, 0); |
|
586 imgNightscene.insert(CxeSettingIds::FLASH_MODE, FlashOff); |
|
587 |
|
588 mImageSceneModes.insert(CxeSettingIds::IMAGE_SCENE_NIGHT, imgNightscene); |
|
589 |
|
590 CxeScene imgNightpotraitscene; |
|
591 |
|
592 imgNightpotraitscene.insert(CxeSettingIds::SCENE_ID, CxeSettingIds::IMAGE_SCENE_NIGHTPORTRAIT); |
|
593 imgNightpotraitscene.insert(CxeSettingIds::FOCAL_RANGE, CxeAutoFocusControl::Portrait); |
|
594 imgNightpotraitscene.insert(CxeSettingIds::WHITE_BALANCE, WhitebalanceAutomatic); |
|
595 imgNightpotraitscene.insert(CxeSettingIds::EXPOSURE_MODE, ExposureNight); |
|
596 imgNightpotraitscene.insert(CxeSettingIds::COLOR_TONE, ColortoneNormal); |
|
597 imgNightpotraitscene.insert(CxeSettingIds::CONTRAST, 0); |
|
598 imgNightpotraitscene.insert(CxeSettingIds::SHARPNESS, SharpnessNormal); |
|
599 imgNightpotraitscene.insert(CxeSettingIds::LIGHT_SENSITIVITY, LightSensitivityAutomatic); |
|
600 imgNightpotraitscene.insert(CxeSettingIds::EV_COMPENSATION_VALUE, 0); |
|
601 imgNightpotraitscene.insert(CxeSettingIds::BRIGHTNESS, 0); |
|
602 imgNightpotraitscene.insert(CxeSettingIds::FLASH_MODE, FlashAntiRedEye); |
|
603 |
|
604 mImageSceneModes.insert(CxeSettingIds::IMAGE_SCENE_NIGHTPORTRAIT, imgNightpotraitscene); |
|
605 |
|
606 CX_DEBUG_EXIT_FUNCTION(); |
|
607 } |
|
608 |
|
609 /* |
|
610 * Returns the current image scene mode. |
|
611 */ |
|
612 CxeScene& CxeSettingsModelImp::currentImageScene() |
|
613 { |
|
614 CX_DEBUG_ENTER_FUNCTION(); |
|
615 CX_DEBUG_EXIT_FUNCTION(); |
|
616 |
|
617 return mCurrentImgScene; |
|
618 } |
|
619 |
|
620 |
|
621 /* |
|
622 * Returns the current video scene mode. |
|
623 */ |
|
624 CxeScene& CxeSettingsModelImp::currentVideoScene() |
|
625 { |
|
626 CX_DEBUG_ENTER_FUNCTION(); |
|
627 CX_DEBUG_EXIT_FUNCTION(); |
|
628 |
|
629 return mCurrentVidScene; |
|
630 } |
|
631 |
|
632 |
|
633 /* |
|
634 * Updating settings model whenever mode is changed from image to video and vice-versa. |
|
635 */ |
|
636 void CxeSettingsModelImp::cameraModeChanged(Cxe::CameraMode newMode) |
|
637 { |
|
638 CX_DEBUG_ENTER_FUNCTION(); |
|
639 mCameraMode = newMode; |
|
640 CX_DEBUG_EXIT_FUNCTION(); |
|
641 } |
|
642 |
|
643 // end of file |