--- a/camerauis/cameraxui/camerax.pri Thu Jul 15 01:55:05 2010 +0300
+++ b/camerauis/cameraxui/camerax.pri Fri Jul 23 11:35:41 2010 +0300
@@ -16,8 +16,13 @@
INCLUDEPATH += $$APP_LAYER_SYSTEMINCLUDE
+
# FORCE_SECONDARY_CAMERA
# Configuration flag for forcing secondary camera hw to be used also for primary camera ui.
-# To be removed
-#DEFINES += FORCE_SECONDARY_CAMERA
-#DEFINES = $$unique(DEFINES)
\ No newline at end of file
+
+# DEFINES += FORCE_SECONDARY_CAMERA
+# DEFINES = $$unique(DEFINES)
+
+!symbian {
+ DEFINES += CAMERAX_ENGINE_NO_LIBRARY
+}
--- a/camerauis/cameraxui/cxengine/cxengine.pro Thu Jul 15 01:55:05 2010 +0300
+++ b/camerauis/cameraxui/cxengine/cxengine.pro Fri Jul 23 11:35:41 2010 +0300
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies).
# All rights reserved.
# This component and the accompanying materials are made available
# under the terms of "Eclipse Public License v1.0"
@@ -15,9 +15,17 @@
#
include(../camerax.pri)
+!symbian {
+ CONFIG += staticlib
+ CONFIG += HB
+ HB += hbcore hbwidgets
+} else {
+ CONFIG += dll
+ DEFINES += CAMERAX_ENGINE_LIBRARY
+}
TEMPLATE = lib
-TARGET =
+TARGET =
DEPENDPATH += inc inc/api src/dummyengine
INCLUDEPATH += inc \
inc/sensor \
@@ -27,7 +35,6 @@
../extensions/inc
VPATH += src
-CONFIG += dll
MOC_DIR = tmp
symbian {
@@ -36,40 +43,39 @@
# Fix for QMake translating INCLUDEPATH to SYSTEMINCLUDE
# and TraceCompiler needing USERINCLUDE.
MMP_RULES += "USERINCLUDE traces"
-}
+ MMP_RULES += SMPSAFE
-# Libs
-LIBS += -lecam
-LIBS += -lecamadvsettings
-LIBS += -lecamsnapshot
-LIBS += -lfbscli
-LIBS += -lbitgdi
-LIBS += -lgdi
-LIBS += -lws32
-LIBS += -lcone
-LIBS += -lecamdirectviewfinder
-LIBS += -lmediaclientvideo
-LIBS += -lefsrv
-LIBS += -lsysutil
-LIBS += -lbafl
-LIBS += -lmediaclientaudio
-LIBS += -lecom
-LIBS += -lecampluginsupport
-LIBS += -lmmfcontrollerframework
-LIBS += -lplatformenv
-LIBS += -lxqsettingsmanager
-LIBS += -lsensrvclient
-LIBS += -lsensrvutil
-LIBS += -limagingconfigmanager
-LIBS += -lharvesterclient
-LIBS += -lthumbnailmanagerqt
-LIBS += -lxqserviceutil
-LIBS += -loommonitor
-LIBS += -lhal
-LIBS += -llocationmanager
+ # Libs
+ LIBS += -lecam
+ LIBS += -lecamadvsettings
+ LIBS += -lecamsnapshot
+ LIBS += -lfbscli
+ LIBS += -lbitgdi
+ LIBS += -lgdi
+ LIBS += -lws32
+ LIBS += -lcone
+ LIBS += -lecamdirectviewfinder
+ LIBS += -lmediaclientvideo
+ LIBS += -lefsrv
+ LIBS += -lsysutil
+ LIBS += -lbafl
+ LIBS += -lmediaclientaudio
+ LIBS += -lecom
+ LIBS += -lecampluginsupport
+ LIBS += -lmmfcontrollerframework
+ LIBS += -lplatformenv
+ LIBS += -lxqsettingsmanager
+ LIBS += -lsensrvclient
+ LIBS += -lsensrvutil
+ LIBS += -limagingconfigmanager
+ LIBS += -lharvesterclient
+ LIBS += -lthumbnailmanagerqt
+ LIBS += -lxqserviceutil
+ LIBS += -loommonitor
+ LIBS += -lhal
+ LIBS += -llocationmanager
-symbian {
- TARGET.EPOCALLOWDLLDATA = 1 // TODO: check this out??
+ TARGET.EPOCALLOWDLLDATA = 1 // TODO: check this out??
}
# dependencies
@@ -101,67 +107,72 @@
# Input
-HEADERS += cxecameradevicecontrol.h \
- cxecameradevicecontrolsymbian.h \
+HEADERS += cxengine_global.h \
+ cxememorymonitor.h \
+ cxememorymonitorprivate.h \
+ cxecameradevicecontrol.h \
cxeengine.h \
- cxeenginesymbian.h \
- cxeviewfindercontrol.h \
- cxeviewfindercontrolsymbian.h \
- cxestillcapturecontrol.h \
- cxestillcapturecontrolsymbian.h \
- cxevideocapturecontrol.h \
- cxevideocapturecontrolsymbian.h \
- cxesettingscontrolsymbian.h \
- cxeautofocuscontrol.h \
- cxeautofocuscontrolsymbian.h \
- cxezoomcontrol.h \
- cxezoomcontrolsymbian.h \
- cxeimagedataqueue.h \
- cxeimagedataqueuesymbian.h \
- cxeimagedataitem.h \
- cxeimagedataitemsymbian.h \
- cxefilenamegeneratorsymbian.h \
- cxecameradevice.h \
cxutils.h \
cxeerror.h \
- cxeerrormappingsymbian.h \
- cxesoundplayersymbian.h \
cxenamespace.h \
cxesettings.h \
cxesettingsimp.h \
cxefeaturemanager.h \
cxefeaturemanagerimp.h \
- cxesettingsmodel.h \
- cxesettingsmodelimp.h \
cxestatemachine.h \
cxestate.h \
cxestatemachinebase.h \
cxestillimage.h \
- cxestillimagesymbian.h \
+ cxestillcapturecontrol.h \
+ cxefilesavethread.h \
+ cxesensoreventhandler.h \
+ cxesettingsstore.h \
+ cxequalitydetails.h \
+ cxequalitypresets.h \
+ cxeautofocuscontrol.h \
+ cxevideocapturecontrol.h \
+ cxeimagedataitem.h \
+ cxeimagedataqueue.h \
+ cxezoomcontrol.h \
+ cxeviewfindercontrol.h \
+ cxegeotaggingtrail.h \
+ cxeexception.h \
+ cxescenemodestore.h
+
+symbian {
+
+HEADERS+= cxequalitypresetssymbian.h \
+ cxecameradevicecontrolsymbian.h \
+ cxecameradevice.h \
+ cxeviewfindercontrolsymbian.h \
+ cxevideocapturecontrolsymbian.h \
+ cxesettingscontrolsymbian.h \
+ cxestillcapturecontrolsymbian.h \
+ cxeenginesymbian.h \
+ cxeautofocuscontrolsymbian.h \
+ cxezoomcontrolsymbian.h \
+ cxeimagedataqueuesymbian.h \
+ cxeimagedataitemsymbian.h \
+ cxefilenamegeneratorsymbian.h \
+ cxeerrormappingsymbian.h \
+ cxesoundplayersymbian.h \
cxevideorecorderutility.h \
cxevideorecorderutilitysymbian.h \
- cxedummycamera.h \
+ cxestillimagesymbian.h \
cxesettingsmappersymbian.h \
- cxefilesavethread.h \
cxefilesavethreadsymbian.h \
- cxesensoreventhandler.h \
cxesensoreventhandlersymbian.h \
cxesettingscenrepstore.h \
cxesysutil.h \
cxevideocontainer.h \
- cxequalitydetails.h \
- cxequalitypresets.h \
- cxequalitypresetssymbian.h \
+ cxedummycamera.h \
cxeharvestercontrolsymbian.h \
cxethumbnailmanagersymbian.h \
- cxememorymonitor.h \
- cxememorymonitorprivate.h \
cxediskmonitor.h \
cxediskmonitorprivate.h \
cxesnapshotcontrol.h \
cxesnapshotcontrolprivate.h \
- cxegeotaggingtrail.h \
- cxegeotaggingtrailprivate.h \
+ cxegeotaggingtrail_symbian_p.h \
sensor/xqsensor.h \
sensor/xqaccsensor.h \
sensor/xqdeviceorientation.h \
@@ -169,9 +180,45 @@
sensor/xqsensor_p.h \
sensor/xqaccsensor_p.h \
traces/OstTraceDefinitions.h
+
+} else {
+HEADERS += cxeautofocuscontroldesktop.h \
+ cxecameradevicecontroldesktop.h \
+ cxeviewfindercontroldesktop.h \
+ cxezoomcontroldesktop.h \
+ cxefilenamegeneratordesktop.h \
+ cxefilesavethreaddesktop.h \
+ cxeimagedataitemdesktop.h \
+ cxeimagedataqueuedesktop.h \
+ cxevideocapturecontroldesktop.h \
+ cxestillimagedesktop.h \
+ cxestillcapturecontroldesktop.h \
+ cxequalitypresets.h \
+ cxequalitypresetsdesktop.h \
+ cxesensoreventhandlerdesktop.h \
+ cxesettingsstoredesktop.h \
+ cxecameradevicedesktop.h \
+ cxeviewfinderwidgetdesktop.h \
+ cxegeotaggingtrail_desktop_p.h \
+ cxeenginedesktop.h
+}
-SOURCES += cxecameradevicecontrolsymbian.cpp \
- cxeengine.cpp \
+SOURCES += cxeengine.cpp \
+ cxefeaturemanagerimp.cpp \
+ cxememorymonitor.cpp \
+ cxememorymonitorprivate.cpp \
+ cxestatemachine.cpp \
+ cxestate.cpp \
+ cxestatemachinebase.cpp \
+ cxefilesavethread.cpp \
+ cxegeotaggingtrail.cpp \
+ cxesettingsimp.cpp \
+ cxescenemodestore.cpp
+
+symbian {
+SOURCES += cxedummycamera.cpp \
+ cxesysutil.cpp \
+ cxevideocontainer.cpp \
cxeenginesymbian.cpp \
cxeviewfindercontrolsymbian.cpp \
cxestillcapturecontrolsymbian.cpp \
@@ -184,41 +231,46 @@
cxefilenamegeneratorsymbian.cpp \
cxecameradevice.cpp \
cxesoundplayersymbian.cpp \
- cxesettingsmodelimp.cpp \
- cxesettingsimp.cpp \
- cxefeaturemanagerimp.cpp \
- cxestatemachine.cpp \
- cxestate.cpp \
- cxestatemachinebase.cpp \
+ cxecameradevicecontrolsymbian.cpp \
cxeerrormappingsymbian.cpp \
cxestillimagesymbian.cpp \
cxevideorecorderutilitysymbian.cpp \
cxesettingsmappersymbian.cpp \
- cxedummycamera.cpp \
- cxefilesavethread.cpp \
cxefilesavethreadsymbian.cpp \
cxesensoreventhandlersymbian.cpp \
cxesettingscenrepstore.cpp \
- cxesysutil.cpp \
- cxevideocontainer.cpp \
cxequalitypresetssymbian.cpp \
cxeharvestercontrolsymbian.cpp \
cxethumbnailmanagersymbian.cpp \
- cxememorymonitor.cpp \
- cxememorymonitorprivate.cpp \
cxediskmonitor.cpp \
cxediskmonitorprivate.cpp \
cxesnapshotcontrol.cpp \
cxesnapshotcontrolprivate.cpp \
- cxegeotaggingtrail.cpp \
- cxegeotaggingtrailprivate.cpp \
+ cxegeotaggingtrail_symbian_p.cpp \
sensor/xqsensor.cpp \
sensor/xqaccsensor.cpp \
sensor/xqdeviceorientation.cpp \
sensor/xqdeviceorientation_p.cpp \
sensor/xqsensor_p.cpp \
sensor/xqaccsensor_p.cpp
-
-
-
-
+
+} else {
+SOURCES += cxeautofocuscontroldesktop.cpp \
+ cxecameradevicecontroldesktop.cpp \
+ cxeviewfindercontroldesktop.cpp \
+ cxezoomcontroldesktop.cpp \
+ cxefilenamegeneratordesktop.cpp \
+ cxefilesavethreaddesktop.cpp \
+ cxeimagedataqueuedesktop.cpp \
+ cxeimagedataitemdesktop.cpp \
+ cxevideocapturecontroldesktop.cpp \
+ cxestillimagedesktop.cpp \
+ cxestillcapturecontroldesktop.cpp \
+ cxequalitypresetsdesktop.cpp \
+ cxesensoreventhandlerdesktop.cpp \
+ cxesettingsstoredesktop.cpp \
+ cxecameradevicedesktop.cpp \
+ cxeviewfinderwidgetdesktop.cpp \
+ cxegeotaggingtrail_desktop_p.cpp \
+ cxeenginedesktop.cpp
+}
--- a/camerauis/cameraxui/cxengine/inc/api/cxeengine.h Thu Jul 15 01:55:05 2010 +0300
+++ b/camerauis/cameraxui/cxengine/inc/api/cxeengine.h Fri Jul 23 11:35:41 2010 +0300
@@ -1,5 +1,5 @@
/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies).
* All rights reserved.
* This component and the accompanying materials are made available
* under the terms of "Eclipse Public License v1.0"
@@ -19,6 +19,7 @@
#include <QObject>
#include "cxenamespace.h"
+#include "cxengine_global.h"
class CxeCameraDeviceControl;
class CxeViewfinderControl;
@@ -46,7 +47,7 @@
* Create a new engine instance. This is the first call the client needs to
* do when using CxeEngine.
*/
- IMPORT_C static CxeEngine* createEngine();
+ CAMERAX_ENGINE_EXPORT static CxeEngine* createEngine();
virtual ~CxeEngine();
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/camerauis/cameraxui/cxengine/inc/api/cxeexception.h Fri Jul 23 11:35:41 2010 +0300
@@ -0,0 +1,59 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#ifndef CXEEXCEPTION_H
+#define CXEEXCEPTION_H
+
+#include <exception>
+
+/*!
+* Exception class for engine internal errors.
+* Contains one integer which can be used to carry error code,
+* in normal cases which is of type CxeError::Id.
+*/
+class CxeException : public std::exception
+{
+public:
+ /*!
+ * Constructor.
+ */
+ explicit CxeException(int error) : mError(error) {};
+
+ /*!
+ * Destructor.
+ */
+ virtual ~CxeException() throw() {};
+
+ /*!
+ * Get the error code causing this exception.
+ * @return The error code.
+ */
+ int error() const { return mError; };
+
+ /*!
+ * Helper method to throw exception if given status code is an error.
+ * Everything but zero is considered error.
+ * @param status The status code to check.
+ */
+ static void throwIfError(int status) { if (status) { throw new CxeException(status); } }
+
+private:
+ //! Error code for this exception.
+ int mError;
+};
+
+#endif // CXEEXCEPTION_H
--- a/camerauis/cameraxui/cxengine/inc/api/cxefeaturemanager.h Thu Jul 15 01:55:05 2010 +0300
+++ b/camerauis/cameraxui/cxengine/inc/api/cxefeaturemanager.h Fri Jul 23 11:35:41 2010 +0300
@@ -1,5 +1,5 @@
/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies).
* All rights reserved.
* This component and the accompanying materials are made available
* under the terms of "Eclipse Public License v1.0"
@@ -21,9 +21,6 @@
#include <QMetaType>
#include "cxeerror.h"
-// forward declarations
-class CxeSettingsModel;
-
/*!
* Handling and accessing configured run-time values for specific features
--- a/camerauis/cameraxui/cxengine/inc/api/cxeimagedataitem.h Thu Jul 15 01:55:05 2010 +0300
+++ b/camerauis/cameraxui/cxengine/inc/api/cxeimagedataitem.h Fri Jul 23 11:35:41 2010 +0300
@@ -1,5 +1,5 @@
/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies).
* All rights reserved.
* This component and the accompanying materials are made available
* under the terms of "Eclipse Public License v1.0"
@@ -23,9 +23,6 @@
#include "cxeerror.h"
-class CxeImageDataItem;
-class QImage;
-
/**
* CxeImageDataItem represents a single object that is in a queue to be saved to
* the file system.
@@ -67,8 +64,8 @@
virtual QString path() const = 0;
signals:
- void imageSaved(CxeError::Id error, const QString& filename, int id);
- void stateChanged( State newState, CxeError::Id error );
+ void imageSaved(CxeError::Id error, const QString &filename, int id);
+ void stateChanged(State newState, CxeError::Id error);
protected:
CxeImageDataItem() {}
--- a/camerauis/cameraxui/cxengine/inc/api/cxenamespace.h Thu Jul 15 01:55:05 2010 +0300
+++ b/camerauis/cameraxui/cxengine/inc/api/cxenamespace.h Fri Jul 23 11:35:41 2010 +0300
@@ -120,7 +120,7 @@
};
/*!
- * Index to CxeRuntimeKeys::FREE_MEMORY_LEVELS comma separated values
+ * Index to CxeVariationKeys::FREE_MEMORY_LEVELS comma separated values
*/
enum FreeMemoryIndex
{
@@ -193,9 +193,13 @@
static const char* FNAME_IMAGE_COUNTER = "image_counter";
static const char* FNAME_VIDEO_COUNTER = "video_counter";
- // scene mode keys
- static const char* IMAGE_SCENE = "still_scene_modes";
- static const char* VIDEO_SCENE = "video_scene_modes";
+ // scene modes. these ids are used to access scene data in settings (CxeScene)
+ static const char* IMAGE_SCENE_DATA = "still_scene_mode_data";
+ static const char* VIDEO_SCENE_DATA = "video_scene_mode_data";
+
+ // these setting ids are used to access scene id
+ static const char* IMAGE_SCENE = "still_scene_mode";
+ static const char* VIDEO_SCENE = "video_scene_mode";
// setting keys for post capture timeout
static const char* STILL_SHOWCAPTURED = "still_showcaptured";
@@ -206,12 +210,9 @@
}
-namespace CxeRuntimeKeys
+namespace CxeVariationKeys
{
- // Runtime keys
- static const char* PRIMARY_CAMERA_CAPTURE_KEYS = "primary_camera_capture_keys";
- static const char* PRIMARY_CAMERA_AUTOFOCUS_KEYS = "primary_camera_autofocus_keys";
- static const char* SECONDARY_CAMERA_CAPTURE_KEYS = "secondary_camera_capture_keys";
+ // Runtime variation keys
static const char* FREE_MEMORY_LEVELS = "free_memory_levels";
static const char* STILL_MAX_ZOOM_LIMITS = "still_max_zoom_limits";
static const char* VIDEO_MAX_ZOOM_LIMITS = "video_max_zoom_limits";
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/camerauis/cameraxui/cxengine/inc/api/cxengine_global.h Fri Jul 23 11:35:41 2010 +0300
@@ -0,0 +1,33 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#ifndef CXENGINE_GLOBAL_H
+#define CXENGINE_GLOBAL_H
+
+#include <QtCore/qglobal.h>
+
+#if defined(CAMERAX_ENGINE_LIBRARY)
+# define CAMERAX_ENGINE_EXPORT Q_DECL_EXPORT
+#else
+# if defined(CAMERAX_ENGINE_NO_LIBRARY)
+# define CAMERAX_ENGINE_EXPORT
+# else
+# define CAMERAX_ENGINE_EXPORT Q_DECL_IMPORT
+# endif
+#endif
+
+#endif // CXENGINE_GLOBAL_H
--- a/camerauis/cameraxui/cxengine/inc/api/cxesettings.h Thu Jul 15 01:55:05 2010 +0300
+++ b/camerauis/cameraxui/cxengine/inc/api/cxesettings.h Fri Jul 23 11:35:41 2010 +0300
@@ -1,5 +1,5 @@
/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies).
* All rights reserved.
* This component and the accompanying materials are made available
* under the terms of "Eclipse Public License v1.0"
@@ -27,114 +27,164 @@
#include <QString>
#include <QVariant>
+#include "cxeerror.h"
#include "cxenamespace.h"
-#include "cxeerror.h"
-
+#include "cxeexception.h"
-// forward declaration
-class CxeSettingsModel;
-
-
-
-/*
+/*!
* Class to access all kind of Camera Settings
+*
+* There are templated get() and set() methods for accessing and modifying settings.
+* Supported types are int, qreal, QString, QVariantMap and enums.
+*
+* It is possible to monitor changes in settings, either by connecting to settingValueChanged() signal
+* or registering a slot as listener to a specific setting using listenForSetting(). With the latter
+* method you will only be notified of the change in the requested setting, as opposed to the settingValueChanged()
+* which will be emitted for any setting change.
*/
class CxeSettings : public QObject
{
Q_OBJECT
- public:
-
- /*
- * returns the current integer setting value for the given key
- */
- virtual CxeError::Id get(const QString &key, int &value) const = 0;
+public:
+
+
+ /*!
+ * Returns value of external setting item which is not owned by camera
+ */
+ virtual void get(long int uid,
+ unsigned long int key,
+ Cxe::SettingKeyType type,
+ QVariant &value) const = 0;
- /*
- * returns the current real setting value for the given key
- */
- virtual CxeError::Id get(const QString &key, qreal &value) const = 0;
+ /*!
+ * Get a value of a certain setting. Template method that can be used
+ * with any enumeration (well actually, anything that can be cast to from int),
+ * int, QString and QVariantMap. Will throw CxeException in case of error.
+ *
+ * An example:
+ * \code
+ * try {
+ * Cxe::Whitebalance wb = settings.get<Cxe::Whitebalance>(CxeSettingIds::WHITE_BALANCE);
+ * catch (CxeException &e) {
+ * CX_DEBUG(("Error getting white balance"));
+ * }
+ * \endcode
+ * @param settingId Setting key
+ * @return Setting value
+ */
+ template<typename T>
+ inline T get(const QString &key) const {
+ QVariant v;
+ getValue(key, v);
+ return (T)v.value<int>();
+ }
+
+ /*!
+ * Same as above but with default value in case of error. No exceptions are thrown.
+ *
+ *An example:
+ * \code
+ *
+ * Cxe::Whitebalance wb = settings.get<Cxe::Whitebalance>(CxeSettingIds::WHITE_BALANCE, Cxe::WhitebalanceAutomatic);
+ *
+ * \endcode
+ * @param key Setting key
+ * @param defaultValue Default value returned in case of error
+ * @return Value of the setting
+ */
+ template<typename T>
+ inline T get(const QString &key, const T &defaultValue) const {
+ try {
+ return get<T>(key);
+ } catch (CxeException &e) {
+ return defaultValue;
+ }
+ }
+
+
- /*
- * returns the current string setting value for the given key
- */
- virtual CxeError::Id get(const QString &key, QString &stringValue) const = 0;
-
- /*
- * Returns value of external setting item which is not owned by camera
- */
- virtual void get(long int uid,
- unsigned long int key,
- Cxe::SettingKeyType type,
- QVariant &value) const = 0;
-
- /**
- * Get a value of a certain setting. A convenience method with a template
- * parameter to be used with enumerations.
- *
- * An example:
- * \code
- * Cxe::Whitebalance wb = Cxe::WhitebalanceAutomatic;
- * if (settings.get<Cxe::Whitebalance>(CxeSettingIds::WHITE_BALANCE, wb)) {
- * CX_DEBUG(("Error getting white balance - using default"));
- * }
- * \endcode
- * @param settingId Setting key
- * @param value Reference to a variable where to put the setting value
- * @return Error code
- */
- template<typename T>
- inline CxeError::Id get(const QString &key, T &value) const {
- int intValue = value; // This will not compile if T cannot be converted to an int
- CxeError::Id err = get(key, intValue);
- value = static_cast<T>(intValue); // Convert to enum
- return err;
- }
-
- /*
- * Set new values for the given key
- */
- virtual CxeError::Id set(const QString &key, int newValue) = 0;
+ /*!
+ * Set a value of a certain setting. Template method that can be used
+ * with any enumeration (well actually, anything that can be cast to from int),
+ * int, QString and QVariantMap.
+ *
+ * An example:
+ * \code
+ * try {
+ * Cxe::Whitebalance wb = Cxe::WhiteBalanceAutomatic;
+ * settings.get<Cxe::Whitebalance>(CxeSettingIds::WHITE_BALANCE, wb);
+ * catch (CxeException &e) {
+ * CX_DEBUG(("Error setting white balance"));
+ * }
+ * \endcode
+ * @param settingId Setting key
+ * @param value Setting value
+ */
+ template<typename T>
+ inline void set(const QString &key, const T &value) {
+ QVariant v;
+ v.setValue((int)value);
+ setValue(key, v);
+ }
+
+ /*!
+ * Resets settings to default values.
+ */
+ virtual void reset() = 0;
+
+ /*!
+ * Get value of variation setting.
+ */
+ virtual CxeError::Id getVariationValue(const QString &key, QVariant &value) = 0;
- /*
- * Set new values for the given key
- */
- virtual CxeError::Id set(const QString &key, qreal newValue) = 0;
+ /*!
+ * Add listener for changes in one setting. When the value of the setting changes, the given
+ * slot is invoked on given object.
+ *
+ * @param settingKey Setting to listen to
+ * @param target Object that the slot will be invoked for
+ * @param slot Slot that will be invoked. The slot can have either of these two signatures:
+ * slotName(const QVariant&) only new value of setting is passed as parameter
+ * slotName(const QString&, const QVariant&) both setting key and new value are passed as parameter
+ * @return boolean to indicate success
+ */
+ virtual bool listenForSetting(const QString &settingKey, QObject *target, const char *slot) = 0;
- /*
- * Set new values for the given key
- */
- virtual CxeError::Id set(const QString &key, const QString &newValue) = 0;
+protected:
+ /*!
+ * returns the setting as QVariant
+ */
+ virtual void getValue(const QString &key, QVariant &value) const = 0;
- /*
- * Resets only virtual settings( persistent settings )
- */
- virtual void reset() = 0;
-
- signals:
- /*
- * to notify engine and ui components for a change in a setting value
- */
- void settingValueChanged(const QString &key, QVariant newValue);
+ /*!
+ * Set new value for the given key
+ */
+ virtual void setValue(const QString &key, const QVariant &newValue) = 0;
+
+signals:
+
+ /*!
+ * to notify engine and ui components for a change in a setting value
+ */
+ void settingValueChanged(const QString &key, QVariant newValue);
- /*
- * to notify engine and ui components for a change in a setting value
- */
- void settingValueChanged(long int uid, unsigned long int key, QVariant value);
+ /*!
+ * to notify engine and ui components for a change in a setting value
+ */
+ void settingValueChanged(long int uid, unsigned long int key, QVariant value);
- /*
- * to update engine and ui components of new image scene
- */
- void sceneChanged(CxeScene &scene);
+protected:
+ CxeSettings() {}
- protected:
- CxeSettings() {}
-
- private:
- Q_DISABLE_COPY( CxeSettings )
+private:
+ Q_DISABLE_COPY( CxeSettings )
};
+// include set/get function specializations
+#include "cxesettings.inl"
+
#endif /*CXESETTINGS_H_*/
// end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/camerauis/cameraxui/cxengine/inc/api/cxesettings.inl Fri Jul 23 11:35:41 2010 +0300
@@ -0,0 +1,136 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+// specializations for getters
+// throwing versions
+template<>
+inline int CxeSettings::get<int>(const QString &key) const {
+ QVariant v;
+ getValue(key, v);
+ return v.value<int>();
+}
+
+template<>
+inline bool CxeSettings::get<bool>(const QString &key) const {
+ QVariant v;
+ getValue(key, v);
+ return v.value<bool>();
+}
+
+template<>
+inline qreal CxeSettings::get<qreal>(const QString &key) const {
+ QVariant v;
+ getValue(key, v);
+ return v.value<qreal>();
+}
+
+template<>
+inline QString CxeSettings::get<QString>(const QString &key) const {
+ QVariant v;
+ getValue(key, v);
+ return v.value<QString>();
+}
+
+template<>
+inline QVariantMap CxeSettings::get<QVariantMap>(const QString &key) const {
+ QVariant v;
+ getValue(key, v);
+ return v.value<QVariantMap>();
+}
+
+// non-throwing versions
+template<>
+inline int CxeSettings::get<int>(const QString &key, const int &defaultValue) const {
+ try {
+ return get<int>(key);
+ } catch (CxeException &e) {
+ return defaultValue;
+ }
+}
+
+template<>
+inline bool CxeSettings::get<bool>(const QString &key, const bool &defaultValue) const {
+ try {
+ return get<bool>(key);
+ } catch (CxeException &e) {
+ return defaultValue;
+ }
+}
+
+template<>
+inline qreal CxeSettings::get<qreal>(const QString &key, const qreal &defaultValue) const {
+ try {
+ return get<qreal>(key);
+ } catch (CxeException &e) {
+ return defaultValue;
+ }
+}
+
+template<>
+inline QString CxeSettings::get<QString>(const QString &key, const QString &defaultValue) const {
+ try {
+ return get<QString>(key);
+ } catch (CxeException &e) {
+ return defaultValue;
+ }
+}
+
+template<>
+inline QVariantMap CxeSettings::get<QVariantMap>(const QString &key, const QVariantMap &defaultValue) const {
+ try {
+ return get<QVariantMap>(key);
+ } catch (CxeException &e) {
+ return defaultValue;
+ }
+}
+
+// specializations for setters
+template<>
+inline void CxeSettings::set<int>(const QString &key, const int &value) {
+ QVariant v;
+ v.setValue(value);
+ setValue(key, v);
+}
+
+template<>
+inline void CxeSettings::set<bool>(const QString &key, const bool &value) {
+ QVariant v;
+ v.setValue(value);
+ setValue(key, v);
+}
+
+template<>
+inline void CxeSettings::set<qreal>(const QString &key, const qreal &value) {
+ QVariant v;
+ v.setValue(value);
+ setValue(key, v);
+}
+
+template<>
+inline void CxeSettings::set<QString>(const QString &key, const QString &value) {
+ QVariant v;
+ v.setValue(value);
+ setValue(key, v);
+}
+
+template<>
+inline void CxeSettings::set<QVariantMap>(const QString &key, const QVariantMap &value) {
+ QVariant v;
+ v.setValue(value);
+ setValue(key, v);
+}
--- a/camerauis/cameraxui/cxengine/inc/api/cxutils.h Thu Jul 15 01:55:05 2010 +0300
+++ b/camerauis/cameraxui/cxengine/inc/api/cxutils.h Fri Jul 23 11:35:41 2010 +0300
@@ -64,7 +64,13 @@
#define CX_DEBUG_IN_FUNCTION()
#define CX_DEBUG_EXIT_FUNCTION()
#define CX_DEBUG_ASSERT(x)
+
+#ifdef Q_OS_SYMBIAN
#define CX_ASSERT_ALWAYS(x) ASSERT(x)
+#else // !Q_OS_SYMBIAN
+ #define CX_ASSERT_ALWAYS(x) Q_ASSERT(x)
+ #define OstTrace0(x,y,z)
+#endif // Q_OS_SYMBIAN
#endif // _DEBUG
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/camerauis/cameraxui/cxengine/inc/cxeautofocuscontroldesktop.h Fri Jul 23 11:35:41 2010 +0300
@@ -0,0 +1,60 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#ifndef CXEAUTOFOCUSCONTROLDESKTOP_H
+#define CXEAUTOFOCUSCONTROLDESKTOP_H
+
+#include <QVariant>
+#include "cxenamespace.h"
+#include "cxeautofocuscontrol.h"
+
+/**
+ * CxeAutoFocusControl is responsible for handling Autofocus events from the camera adaptation.
+ * It also routes the Autofocus successful and failed events to the clients interested in ´knowing the
+ * status of Autofocus.
+ */
+class CxeAutoFocusControlDesktop: public CxeAutoFocusControl
+{
+ Q_OBJECT
+public:
+
+ CxeAutoFocusControlDesktop();
+ virtual ~CxeAutoFocusControlDesktop();
+
+ CxeError::Id start(bool soundEnabled = true);
+ void cancel();
+ void setMode(CxeAutoFocusControl::Mode newMode);
+ CxeAutoFocusControl::Mode mode() const;
+ virtual bool isFixedFocusMode(Mode mode) const;
+
+
+ CxeAutoFocusControl::State state() const;
+ bool supported() const;
+ bool isSoundEnabled() const;
+
+protected:
+ void initializeStates();
+ // intializes all the resources we need for AF functionality
+ void initializeResources();
+
+protected:
+ CxeAutoFocusControl::Mode mAfMode;
+ CxeAutoFocusControl::State mState;
+ bool mCancelled;
+};
+
+#endif // CXEAUTOFOCUSCONTROLDESKTOP_H
--- a/camerauis/cameraxui/cxengine/inc/cxeautofocuscontrolsymbian.h Thu Jul 15 01:55:05 2010 +0300
+++ b/camerauis/cameraxui/cxengine/inc/cxeautofocuscontrolsymbian.h Fri Jul 23 11:35:41 2010 +0300
@@ -82,7 +82,7 @@
// Handle ECam events
void handleCameraEvent( int eventUid, int error );
- void handleSceneChanged(CxeScene &scene);
+ void handleSceneChanged(const QVariant &scene);
void handleSettingValueChanged(const QString &settingId, QVariant newValue);
private:
--- a/camerauis/cameraxui/cxengine/inc/cxecameradevice.h Thu Jul 15 01:55:05 2010 +0300
+++ b/camerauis/cameraxui/cxengine/inc/cxecameradevice.h Fri Jul 23 11:35:41 2010 +0300
@@ -1,5 +1,5 @@
/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies).
* All rights reserved.
* This component and the accompanying materials are made available
* under the terms of "Eclipse Public License v1.0"
@@ -28,6 +28,7 @@
class MCameraOrientation;
class MCameraFaceTracking;
+class MCameraUseCaseHint;
// Class Definitions
class CxeCameraDevice : public QObject
@@ -44,10 +45,12 @@
MCameraOrientation *cameraOrientation();
CCamera::CCameraSnapshot *cameraSnapshot();
MCameraFaceTracking *faceTracking();
+ MCameraUseCaseHint *useCaseHintApi();
virtual void setCamera( CCamera *aCamera );
virtual void deleteCamera();
virtual void releaseCamera();
+ virtual void reserveCamera();
virtual CxeError::Id newCamera(Cxe::CameraIndex cameraIndex, MCameraObserver2 *observer);
protected:
@@ -56,7 +59,7 @@
void prepareForCameraDelete();
void cameraAllocated(CxeError::Id error);
void prepareForRelease();
-
+ void aboutToReserve();
private:
CxeError::Id initResources();
@@ -69,6 +72,7 @@
CCamera::CCameraSnapshot *mCameraSnapshot;
MCameraOrientation *mCameraOrientation; // not owned
MCameraFaceTracking *mFaceTracking; // not owned
+ MCameraUseCaseHint *mUseCaseHintApi; // not owned
friend class CxeCameraDeviceControlSymbian;
};
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/camerauis/cameraxui/cxengine/inc/cxecameradevicecontroldesktop.h Fri Jul 23 11:35:41 2010 +0300
@@ -0,0 +1,55 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+#ifndef CXECAMERADEVICECONTROLDESKTOP_H
+#define CXECAMERADEVICECONTROLDESKTOP_H
+
+#include <QObject>
+#include <QMetaType>
+#include "cxecameradevicecontrol.h"
+#include "cxenamespace.h"
+#include "cxeerror.h"
+
+class CxeCameraDeviceControlDesktop : public CxeCameraDeviceControl
+{
+ Q_OBJECT
+
+public:
+
+ CxeCameraDeviceControlDesktop();
+ ~CxeCameraDeviceControlDesktop();
+
+public: // from CxeCameraDeviceControl
+ virtual Cxe::CameraMode mode() const;
+ virtual void setMode(Cxe::CameraMode mode);
+ virtual void init();
+ virtual void reserve();
+ virtual void release();
+ virtual Cxe::CameraIndex cameraIndex() const;
+ virtual CxeError::Id switchCamera(Cxe::CameraIndex index);
+ virtual CxeCameraDeviceControl::State state() const;
+
+private:
+ void setState(CxeCameraDeviceControl::State stateId, CxeError::Id error = CxeError::None);
+
+private:
+ Cxe::CameraIndex mIndex;
+ Cxe::CameraMode mMode;
+ State mState;
+
+};
+
+#endif // CXECAMERADEVICECONTROLDESKTOP_H
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/camerauis/cameraxui/cxengine/inc/cxecameradevicedesktop.h Fri Jul 23 11:35:41 2010 +0300
@@ -0,0 +1,52 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#ifndef CXECAMERADEVICEDESKTOP_H
+#define CXECAMERADEVICEDESKTOP_H
+
+#include <QGraphicsWidget>
+#include <QList>
+
+class QTimer;
+class QPixmap;
+
+class CxeCameraDeviceDesktop : public QObject
+{
+ Q_OBJECT
+public:
+ CxeCameraDeviceDesktop();
+ virtual ~CxeCameraDeviceDesktop();
+ void start();
+ void stop();
+ const QPixmap ¤tSnaphot();
+
+signals:
+ void imageChanged(const QPixmap &newImage);
+
+protected slots:
+ void handleTimeout();
+
+private:
+ void loadPictures();
+ void setupTimer();
+
+ QTimer *mSwitchPictureTimer;
+ QList<QPixmap> mPictureList;
+ QList<QPixmap>::size_type mPictureIndex;
+};
+
+#endif // CXECAMERADEVICEDESKTOP_H
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/camerauis/cameraxui/cxengine/inc/cxeenginedesktop.h Fri Jul 23 11:35:41 2010 +0300
@@ -0,0 +1,93 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+#ifndef CXEENGINEDESKTOP_H
+#define CXEENGINEDESKTOP_H
+
+#include <QObject>
+#include "cxeengine.h"
+
+class CxeCameraDeviceControl;
+class CxeViewfinderControl;
+class CxeSnapshotControl;
+class CxeStillCaptureControl;
+class CxeVideoCaptureControl;
+class CxeAutoFocusControl;
+class CxeZoomControl;
+class CxeImageDataQueue;
+class CxeFeatureManager;
+class CxeSettings;
+class CxeFilenameGenerator;
+class CxeFileSaveThread;
+class CxeSensorEventHandler;
+class CxeQualityPresets;
+class CxeCameraDeviceDesktop;
+class CxeDiskMonitor;
+class CxeMemoryMonitor;
+class CxeGeoTaggingTrail;
+
+class CxeEngineDesktop : public CxeEngine
+{
+ Q_OBJECT
+public:
+ CxeEngineDesktop();
+ virtual ~CxeEngineDesktop();
+
+ void construct();
+
+ void createControls();
+
+ void connectSignals();
+public: // from CxeEngine
+ virtual CxeCameraDeviceControl &cameraDeviceControl();
+ virtual CxeViewfinderControl &viewfinderControl();
+ virtual CxeSnapshotControl &snapshotControl();
+ virtual CxeStillCaptureControl &stillCaptureControl();
+ virtual CxeVideoCaptureControl &videoCaptureControl();
+ virtual CxeAutoFocusControl &autoFocusControl();
+ virtual CxeZoomControl &zoomControl();
+ virtual CxeSettings &settings();
+ virtual CxeFeatureManager &featureManager();
+ virtual CxeMemoryMonitor &memoryMonitor();
+ virtual CxeGeoTaggingTrail &geoTaggingTrail();
+ virtual Cxe::CameraMode mode() const;
+ void setMode(Cxe::CameraMode mode);
+ virtual void initMode(Cxe::CameraMode cameraMode);
+ virtual bool isEngineReady();
+
+protected:
+ CxeCameraDeviceControl *mCameraDeviceControl;
+ CxeViewfinderControl *mViewfinderControl;
+ CxeSnapshotControl *mSnapshotControl;
+ CxeStillCaptureControl *mStillCaptureControl;
+ CxeVideoCaptureControl *mVideoCaptureControl;
+ CxeAutoFocusControl *mAutoFocusControl;
+ CxeZoomControl *mZoomControl;
+ CxeImageDataQueue *mImageDataQueue;
+ CxeSettings *mSettings;
+ CxeFeatureManager *mFeatureManager;
+ CxeFilenameGenerator *mFilenameGenerator;
+ CxeSensorEventHandler *mSensorEventHandler;
+ CxeQualityPresets *mQualityPresets;
+ CxeFileSaveThread *mFileSaveThread;
+ CxeCameraDeviceDesktop *mCameraDevice;
+ CxeDiskMonitor *mDiskMonitor;
+ CxeMemoryMonitor *mMemoryMonitor;
+ CxeGeoTaggingTrail *mGeoTaggingTrail;
+
+};
+
+#endif // CXEENGINEDESKTOP_H
--- a/camerauis/cameraxui/cxengine/inc/cxeenginesymbian.h Thu Jul 15 01:55:05 2010 +0300
+++ b/camerauis/cameraxui/cxengine/inc/cxeenginesymbian.h Fri Jul 23 11:35:41 2010 +0300
@@ -1,5 +1,5 @@
/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies).
* All rights reserved.
* This component and the accompanying materials are made available
* under the terms of "Eclipse Public License v1.0"
@@ -33,7 +33,6 @@
class CxeAutoFocusControl;
class CxeSettings;
class CxeFeatureManager;
-class CxeSettingsModel;
class CxeSensorEventHandler;
class CxeFilenameGenerator;
class CxeQualityPresets;
@@ -77,6 +76,7 @@
private slots:
void doInit();
+ void initGeotagging();
private:
void connectSignals();
@@ -85,7 +85,6 @@
bool startViewfinderNeeded();
void reserve();
void saveMode();
- void startGeotaggingTrail();
protected:
CxeCameraDeviceControl *mCameraDeviceControl;
@@ -99,7 +98,6 @@
CxeZoomControl *mZoomControl;
CxeSettings *mSettings;
CxeFeatureManager *mFeatureManager;
- CxeSettingsModel *mSettingsModel;
CxeFilenameGenerator *mFilenameGenerator;
CxeSensorEventHandler* mSensorEventHandler;
CxeQualityPresets *mQualityPresets;
--- a/camerauis/cameraxui/cxengine/inc/cxeexception.h Thu Jul 15 01:55:05 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,59 +0,0 @@
-/*
-* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
-*
-*/
-
-#ifndef CXEEXCEPTION_H
-#define CXEEXCEPTION_H
-
-#include <exception>
-
-/*!
-* Exception class for engine internal errors.
-* Contains one integer which can be used to carry error code,
-* in normal cases which is of type CxeError::Id.
-*/
-class CxeException : public std::exception
-{
-public:
- /*!
- * Constructor.
- */
- explicit CxeException(int error) : mError(error) {};
-
- /*!
- * Destructor.
- */
- virtual ~CxeException() throw() {};
-
- /*!
- * Get the error code causing this exception.
- * @return The error code.
- */
- int error() const { return mError; };
-
- /*!
- * Helper method to throw exception if given status code is an error.
- * Everything but zero is considered error.
- * @param status The status code to check.
- */
- static void throwIfError(int status) { if (status) { throw new CxeException(status); } }
-
-private:
- //! Error code for this exception.
- int mError;
-};
-
-#endif // CXEEXCEPTION_H
--- a/camerauis/cameraxui/cxengine/inc/cxefeaturemanagerimp.h Thu Jul 15 01:55:05 2010 +0300
+++ b/camerauis/cameraxui/cxengine/inc/cxefeaturemanagerimp.h Fri Jul 23 11:35:41 2010 +0300
@@ -1,5 +1,5 @@
/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies).
* All rights reserved.
* This component and the accompanying materials are made available
* under the terms of "Eclipse Public License v1.0"
@@ -28,7 +28,7 @@
#include "cxeerror.h"
// forward declarations
-class CxeSettingsModel;
+class CxeSettings;
@@ -41,24 +41,14 @@
public:
- CxeFeatureManagerImp(CxeSettingsModel& settingsModel);
+ CxeFeatureManagerImp(CxeSettings &settings);
virtual ~CxeFeatureManagerImp();
- /*
- * returns if a feature is supported or not
- * true -> supported
- * false -> not supported
- */
- CxeError::Id isFeatureSupported(const QString& key, bool& value) const;
-
-
- /*
- * We retrieve all the configured values for the given key
- */
- CxeError::Id configuredValues(const QString& key,QList<int>& values);
+ CxeError::Id isFeatureSupported(const QString &key, bool &value) const;
+ CxeError::Id configuredValues(const QString &key, QList<int> &values);
-private: // not owned
- CxeSettingsModel& mSettingsModel;
+private:
+ CxeSettings &mSettings;
};
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/camerauis/cameraxui/cxengine/inc/cxefilenamegeneratordesktop.h Fri Jul 23 11:35:41 2010 +0300
@@ -0,0 +1,55 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#ifndef CXEFILENAMEGENERATORDESKTOP_H
+#define CXEFILENAMEGENERATORDESKTOP_H
+
+#include "cxefilenamegenerator.h"
+
+class CxeFilenameGeneratorDesktop : public CxeFilenameGenerator
+{
+public:
+ CxeFilenameGeneratorDesktop();
+ virtual ~CxeFilenameGeneratorDesktop();
+
+public: // from CxeFilenameGenerator
+ virtual CxeError::Id init(Cxe::CameraMode mode);
+ virtual void startNewImageFilenameSequence();
+ virtual CxeError::Id nextImageFilenameInSequence(QString &filename, const QString &fileExt);
+ virtual CxeError::Id generateFilename(QString &filename, const QString &fileExt);
+ virtual void raiseCounterValue();
+
+private:
+ void getNextVideoFilename(QString &filename);
+ void getNextImageFilename(QString &filename);
+
+ QString assembleFilename(const QString &baseName, int sequenceNumber, const QString &extension);
+
+ Cxe::CameraMode mMode;
+
+ QString mImageBaseFolder;
+ QString mVideoBaseFolder;
+
+ QString mImageExtension;
+ QString mVideoExtension;
+
+ int mImageSequenceNumber;
+ int mVideoSequenceNumber;
+
+};
+
+#endif // CXEFILENAMEGENERATORDESKTOP_H
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/camerauis/cameraxui/cxengine/inc/cxefilesavethreaddesktop.h Fri Jul 23 11:35:41 2010 +0300
@@ -0,0 +1,66 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Still image saving thread
+*
+*/
+
+#ifndef CXEFILESAVETHREADDESKTOP_H
+#define CXEFILESAVETHREADDESKTOP_H
+
+#include <QObject>
+#include <QThread>
+#include <QMutex>
+#include <QWaitCondition>
+#include "cxefilesavethread.h"
+
+class CxeImageDataItem;
+
+
+class CxeFileSaveThreadDesktop : public CxeFileSaveThread
+{
+ Q_OBJECT
+public:
+
+ CxeFileSaveThreadDesktop(QObject *parent = 0);
+ ~CxeFileSaveThreadDesktop();
+
+ void save(CxeImageDataItem *data);
+
+public slots:
+ void handleVideoSaved(CxeError::Id status, const QString &filename);
+ void handleSnapshotReady(CxeError::Id status, const QImage &snapshot, const QString &filename);
+ void handleSnapshotReady(CxeError::Id status, const QImage &snapshot, int id);
+
+private:
+ /**
+ * This method includes saving in own thread.
+ * Functions called from this method are running in "saving thread"
+ */
+ void run();
+ void read();
+
+private: // data shared between the threads
+
+ bool mExitThread;
+ QList<CxeImageDataItem*> mDataList; //! @todo Consider QQueue
+
+ QMutex mMutex;
+ QWaitCondition mDataToSave;
+
+private: // thread private data
+ int mCount;
+ bool mExit;
+};
+
+#endif // CXEFILESAVETHREADDESKTOP_H
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/camerauis/cameraxui/cxengine/inc/cxegeotaggingtrail_desktop_p.h Fri Jul 23 11:35:41 2010 +0300
@@ -0,0 +1,65 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#ifndef CXEGEOTAGGINGTRAIL_DESKTOP_P_H
+#define CXEGEOTAGGINGTRAIL_DESKTOP_P_H
+
+#include <QTimer>
+#include <QObject>
+#include <QVariant>
+#include <QString>
+
+#include "cxeerror.h"
+#include "cxestatemachine.h"
+#include "cxegeotaggingtrail.h"
+
+// Forward declarations
+class CxeSettings;
+
+class CxeGeoTaggingTrailPrivate : public QObject,
+ public CxeStateMachine
+{
+ Q_OBJECT
+
+private:
+ CxeGeoTaggingTrailPrivate(CxeStillCaptureControl &stillControl,
+ CxeVideoCaptureControl &videoControl,
+ CxeSettings &settings);
+ ~CxeGeoTaggingTrailPrivate();
+
+signals:
+ void stateChanged(CxeGeoTaggingTrail::State newState, CxeError::Id error);
+
+protected: // from CxeStateMachine
+ void handleStateChanged(int newStateId, CxeError::Id error);
+
+private:
+ void start();
+ void initializeStates();
+ CxeGeoTaggingTrail::State state() const;
+
+private slots:
+ void handleSettingValueChanged(const QString&, QVariant);
+ void stop(bool closeSession = false);
+
+private:
+ CxeSettings &mSettings;
+
+ friend class CxeGeoTaggingTrail;
+};
+
+#endif // CXEGEOTAGGINGTRAIL_DESKTOP_P_H
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/camerauis/cameraxui/cxengine/inc/cxegeotaggingtrail_symbian_p.h Fri Jul 23 11:35:41 2010 +0300
@@ -0,0 +1,78 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#ifndef CXEGEOTAGGINGTRAIL_SYMBIAN_P_H
+#define CXEGEOTAGGINGTRAIL_SYMBIAN_P_H
+
+#include <QTimer>
+#include <QObject>
+#include <QVariant>
+#include <QString>
+
+#include "cxeerror.h"
+#include "rlocationtrail.h"
+#include "cxestatemachine.h"
+#include "cxegeotaggingtrail.h"
+
+// Forward declarations
+class CxeSettings;
+class RLocationTrail;
+class CxeStillCaptureControl;
+class CxeVideoCaptureControl;
+
+class CxeGeoTaggingTrailPrivate : public QObject,
+ public CxeStateMachine
+{
+ Q_OBJECT
+
+private:
+
+ CxeGeoTaggingTrailPrivate(CxeStillCaptureControl &stillControl,
+ CxeVideoCaptureControl &videoControl,
+ CxeSettings &settings);
+ ~CxeGeoTaggingTrailPrivate();
+
+signals:
+ void stateChanged(CxeGeoTaggingTrail::State newState, CxeError::Id error);
+
+protected: // from CxeStateMachine
+ void handleStateChanged(int newStateId, CxeError::Id error);
+
+private:
+ void start();
+ void initializeStates();
+ bool canStopTrail() const;
+ CxeGeoTaggingTrail::State state() const;
+
+private slots:
+ void handleSettingValueChanged(const QString&, QVariant);
+ void handleGeoTaggingPropertyEvent(long int uid, unsigned long int key, QVariant value);
+ void timeout();
+ void stop(bool closeSession = false);
+
+private:
+ CxeStillCaptureControl &mStillCaptureControl;
+ CxeVideoCaptureControl &mVideoCaptureControl;
+ CxeSettings &mSettings;
+ QTimer mStopLocationTrailTimer;
+ bool mPendingStopTrailSession;
+ RLocationTrail mLocationTrail;
+
+ friend class CxeGeoTaggingTrail;
+};
+
+#endif // CXEGEOTAGGINGTRAIL_SYMBIAN_P_H
--- a/camerauis/cameraxui/cxengine/inc/cxegeotaggingtrailprivate.h Thu Jul 15 01:55:05 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,86 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
-*
-*/
-
-#ifndef CXEGEOTAGGINGTRAILPRIVATE_H
-#define CXEGEOTAGGINGTRAILPRIVATE_H
-
-#include <QTimer>
-#include <QObject>
-#include <QVariant>
-#include <QString>
-
-#include "cxeerror.h"
-#include "rlocationtrail.h"
-#include "cxestatemachine.h"
-#include "cxegeotaggingtrail.h"
-
-
-
-
-// Forward declarations
-class CxeSettings;
-class RLocationTrail;
-class CxeStillCaptureControl;
-class CxeVideoCaptureControl;
-
-
-
-
-class CxeGeoTaggingTrailPrivate : public QObject,
- public CxeStateMachine
-{
- Q_OBJECT
-
-private:
-
- CxeGeoTaggingTrailPrivate(CxeStillCaptureControl &stillControl,
- CxeVideoCaptureControl &videoControl,
- CxeSettings &settings);
- ~CxeGeoTaggingTrailPrivate();
-
-signals:
- void stateChanged(CxeGeoTaggingTrail::State newState, CxeError::Id error);
-
-protected: // from CxeStateMachine
- void handleStateChanged(int newStateId, CxeError::Id error);
-
-private slots:
- void handleSettingValueChanged(const QString&,QVariant);
- void handleGeoTaggingPropertyEvent(long int uid, unsigned long int key, QVariant value);
- void timeout();
- void stop(bool closeSession = false);
-
-private:
- void start();
- void initializeStates();
- bool canStopTrail() const;
- CxeGeoTaggingTrail::State state() const;
-
-private:
- CxeStillCaptureControl &mStillCaptureControl;
- CxeVideoCaptureControl &mVideoCaptureControl;
- CxeSettings &mSettings;
- QTimer mStopLocationTrailTimer;
- bool mPendingStopTrailSession;
-#if defined(Q_OS_SYMBIAN)
- RLocationTrail mLocationTrail;
-#endif
-
- friend class CxeGeoTaggingTrail;
-};
-
-#endif // CXEGEOTAGGINGTRAILPRIVATE_H
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/camerauis/cameraxui/cxengine/inc/cxeimagedataitemdesktop.h Fri Jul 23 11:35:41 2010 +0300
@@ -0,0 +1,50 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+#ifndef CXEIMAGEDATAITEMDESKTOP_H
+#define CXEIMAGEDATAITEMDESKTOP_H
+
+#include <QPixmap>
+#include "cxeimagedataitem.h"
+
+
+/**
+ * CxeImageDataItem represents a single object that is in a queue to be saved to
+ * the file system.
+ */
+class CxeImageDataItemDesktop : public CxeImageDataItem
+{
+ Q_OBJECT
+
+public:
+ CxeImageDataItemDesktop(int index, QByteArray data, QString filename, int id);
+ CxeImageDataItemDesktop(int index, QPixmap pixmapData, QString filename, int id);
+public: // from CxeImageDataItem
+ virtual CxeError::Id save();
+ virtual CxeImageDataItem::State state() const;
+ virtual int id() const;
+ virtual QString path() const;
+
+protected:
+ int mIndex;
+ int mId;
+ QByteArray mData;
+ QString mFilename;
+ QPixmap mPixmapData;
+ CxeImageDataItem::State mState;
+};
+
+#endif // CXEIMAGEDATAITEMDESKTOP_H
--- a/camerauis/cameraxui/cxengine/inc/cxeimagedataitemsymbian.h Thu Jul 15 01:55:05 2010 +0300
+++ b/camerauis/cameraxui/cxengine/inc/cxeimagedataitemsymbian.h Fri Jul 23 11:35:41 2010 +0300
@@ -1,5 +1,5 @@
/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies).
* All rights reserved.
* This component and the accompanying materials are made available
* under the terms of "Eclipse Public License v1.0"
@@ -23,8 +23,6 @@
#include "cxestatemachine.h"
-class RFs;
-
class CxeImageDataItemSymbian : public CxeImageDataItem,
public CxeStateMachine
{
@@ -42,27 +40,24 @@
CxeError::Id save();
int id() const;
bool isLocationEnabled() const;
-
+
public: // new methods
QString path() const;
protected: // from CxeStateMachine
- void handleStateChanged( int newStateId, CxeError::Id error );
-
-
-protected:
+ void handleStateChanged(int newStateId, CxeError::Id error);
void initializeStates();
-private: // private member functions
+protected:
+ virtual bool checkDiskSpace(RFs *aFs, TInt aBytesToWrite, TInt aDrive);
- void saveCleanup(); // delete data and report
- int checkDiskSpace(RFs* aFs, TInt aBytesToWrite, TInt aDrive);
-
+private: // private member functions
+ void trySave();
+ void closeHandles();
private: // private data members
int mIndex;
- int mError;
int mId;
// used for image saving
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/camerauis/cameraxui/cxengine/inc/cxeimagedataqueuedesktop.h Fri Jul 23 11:35:41 2010 +0300
@@ -0,0 +1,55 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+#ifndef CXEIMAGEDATAQUEUEDESKTOP_H
+#define CXEIMAGEDATAQUEUEDESKTOP_H
+
+// Include Files
+
+#include <QList>
+
+#include "cxeimagedataqueue.h"
+
+// Constants
+
+
+// Class Definitions
+
+class QImage;
+class CxeImageDataItem;
+
+class CxeImageDataQueueDesktop : public CxeImageDataQueue
+{
+ Q_OBJECT
+
+public:
+ CxeImageDataQueueDesktop();
+ virtual ~CxeImageDataQueueDesktop();
+
+
+public: // from CxeImageDataQueue
+ int size() const;
+ void clear();
+ CxeImageDataItem &operator[](int index);
+
+public: // public member functions, not in client API
+ CxeImageDataItem *startSave(QByteArray data, QString path, int id);
+
+private: // private data members
+ QList<CxeImageDataItem *> mList;
+};
+
+#endif // __CXEIMAGEDATAQUEUEDESKTOP_H
--- a/camerauis/cameraxui/cxengine/inc/cxequalitypresets.h Thu Jul 15 01:55:05 2010 +0300
+++ b/camerauis/cameraxui/cxengine/inc/cxequalitypresets.h Fri Jul 23 11:35:41 2010 +0300
@@ -17,7 +17,7 @@
#ifndef CXEQUALITYPRESETS_H
#define CXEQUALITYPRESETS_H
-#include <imagingconfigmanager.h>
+
#include "cxequalitydetails.h"
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/camerauis/cameraxui/cxengine/inc/cxequalitypresetsdesktop.h Fri Jul 23 11:35:41 2010 +0300
@@ -0,0 +1,35 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#ifndef CXEQUALITYPRESETSDESKTOP_H
+#define CXEQUALITYPRESETSDESKTOP_H
+
+// Include Files
+#include "cxequalitypresets.h"
+
+class CxeQualityPresetsDesktop : public CxeQualityPresets
+{
+public:
+ CxeQualityPresetsDesktop();
+ virtual ~CxeQualityPresetsDesktop();
+ QList<CxeImageDetails> imageQualityPresets(Cxe::CameraIndex cameraId);
+ QList<CxeVideoDetails> videoQualityPresets(Cxe::CameraIndex cameraId);
+ int recordingTimeAvailable(const CxeVideoDetails &details, qint64 space);
+
+};
+
+#endif // CXEQUALITYPRESETSDESKTOP_H
--- a/camerauis/cameraxui/cxengine/inc/cxequalitypresetssymbian.h Thu Jul 15 01:55:05 2010 +0300
+++ b/camerauis/cameraxui/cxengine/inc/cxequalitypresetssymbian.h Fri Jul 23 11:35:41 2010 +0300
@@ -23,6 +23,8 @@
// forward declarations
class CImagingConfigManager;
+class TImageQualitySet;
+class TVideoQualitySet;
class CxeSettings;
/**!
@@ -43,11 +45,11 @@
qreal avgVideoBitRateScaler();
Cxe::AspectRatio calculateAspectRatio(int width, int height) const;
QString toString(const TUint8* aData);
- CxeVideoDetails createVideoPreset(TVideoQualitySet set);
- CxeImageDetails createImagePreset(TImageQualitySet set);
+ CxeVideoDetails createVideoPreset(const TVideoQualitySet &set);
+ CxeImageDetails createImagePreset(const TImageQualitySet &set);
QString calculateMegaPixelCount(int imageWidth, int imageHeight);
- void debugPrints(CxeVideoDetails preset);
- void debugPrints(CxeImageDetails newPreset);
+ void debugPrints(const CxeVideoDetails &preset);
+ void debugPrints(const CxeImageDetails &newPreset);
private:
CImagingConfigManager *mIcm;
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/camerauis/cameraxui/cxengine/inc/cxescenemodestore.h Fri Jul 23 11:35:41 2010 +0300
@@ -0,0 +1,59 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+#ifndef CXESCENEMODESTORE_H
+#define CXESCENEMODESTORE_H
+
+#include <QObject>
+
+#include "cxenamespace.h"
+#include "cxeerror.h"
+
+class CxeSceneModeStore
+{
+
+public:
+
+ CxeSceneModeStore();
+ ~CxeSceneModeStore();
+
+ CxeError::Id sceneSettingValue(Cxe::CameraMode cameraMode, const QString &key, QVariant &value) const;
+ CxeError::Id setSceneSettingValue(Cxe::CameraMode cameraMode, const QString &key, const QVariant &newValue);
+
+ QString currentSceneId(Cxe::CameraMode cameraMode) const;
+ CxeScene& currentScene(Cxe::CameraMode cameraMode);
+ const CxeScene& currentScene(Cxe::CameraMode cameraMode) const;
+
+ void setCurrentScene(Cxe::CameraMode cameraMode, const QString &sceneId);
+ CxeScene getScene(Cxe::CameraMode cameraMode, const QString &sceneId) const;
+private:
+
+ void loadImageScenes();
+ void loadVideoScenes();
+
+
+private:
+
+ QHash<QString, CxeScene> mImageSceneModes;
+ QHash<QString, CxeScene> mVideoSceneModes;
+
+ CxeScene mCurrentImageScene;
+ CxeScene mCurrentVideoScene;
+};
+
+
+
+#endif /* CXESCENEMODESTORE_H */
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/camerauis/cameraxui/cxengine/inc/cxesensoreventhandlerdesktop.h Fri Jul 23 11:35:41 2010 +0300
@@ -0,0 +1,57 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+#ifndef CXESENSOREVENTHANDLERDESKTOP_H_
+#define CXESENSOREVENTHANDLERDESKTOP_H_
+
+#include <QObject>
+#include <QMetaType>
+
+#include "cxesensoreventhandler.h"
+
+class CxeSensorEventHandlerDesktop : public CxeSensorEventHandler
+{
+ Q_OBJECT
+
+public:
+
+ // ! Sensor types handled and supported in cxengine.
+ enum SensorType
+ {
+ //! Listening to orientation sensor events
+ OrientationSensor
+ };
+
+ CxeSensorEventHandlerDesktop();
+ virtual ~CxeSensorEventHandlerDesktop();
+
+ /**
+ * Data read from sensor. The "type" of data embedded in QVariant is specific to sensor type.
+ */
+ virtual QVariant sensorData(CxeSensorEventHandler::SensorType type);
+
+public slots:
+ virtual void init();
+ virtual void deinit();
+
+signals:
+ /*
+ * A signal indicating that there is new sensor event data available.
+ */
+ void sensorEvent(CxeSensorEventHandler::SensorType type, QVariant data);
+
+};
+#endif /* CXESENSOREVENTHANDLERDESKTOP_H_ */
--- a/camerauis/cameraxui/cxengine/inc/cxesettingscenrepstore.h Thu Jul 15 01:55:05 2010 +0300
+++ b/camerauis/cameraxui/cxengine/inc/cxesettingscenrepstore.h Fri Jul 23 11:35:41 2010 +0300
@@ -25,72 +25,15 @@
#include "cxeerror.h"
#include "cxenamespace.h"
#include "xqsettingsmanager.h"
+#include "cxesettingsstore.h"
// forward declarations
class XQSettingsManager;
class XQSettingsKey;
-
/*!
-* \class CxeSettingsStore
-* \brief Settings store intrerface.
-*/
-class CxeSettingsStore
-{
-public:
-
- /*!
- * This needs to be here to be able to delete an object
- * of inherited class through mixin pointer.
- * If this is not defined, deleting through the mixin pointer
- * results in User-42 panic!
- */
- virtual ~CxeSettingsStore() {};
-
- /*!
- * resets the cenrep store
- */
- virtual void reset() = 0;
-
- /*!
- * Reads a value from cenrep
- * @param "key" - setting key
- * @param "value" - setting value read from cenrep
- */
- virtual CxeError::Id get(const QString& key, QVariant &value) = 0;
+* CxeSettingsCenRepStore class implements CxeSettingsStore.
- /*!
- * Reads a value from cenrep and starts monitoring changes
- * @param "uid" - UID of the component that own setting key
- * @param "key" - setting key id
- * @param "type" - type of setting key
- * @param "value" - setting value read from cenrep
- */
- virtual void startMonitoring(long int uid, unsigned long int key, Cxe::SettingKeyType type, QVariant &value) = 0;
-
- /*!
- * Sets a new value to cenrep
- * @param "key" - setting key
- * @param "newValue" - new value set to the key in cenrep
- */
- virtual CxeError::Id set(const QString& key,const QVariant newValue) = 0;
-
- /*!
- * Reads/loads all run-time settings values from cenrep
- * @param QList<QString> contains list of all runtime key ids which we use to load values from cenrep.
- * returns: QHash container, "contains" values associated with each key that are read from cenrep
- * NOTE: loading runtime settings should be done only ONCE at start-up. Its an overhead to read runtime keys
- * unnecessarily multiple times as the values of the runtime keys are not changed.
- * Runtime keys are only used to configure camerax application.
- */
- virtual QHash<QString, QVariantList> loadRuntimeSettings(QList<QString>& settingKeys) = 0;
-};
-
-
-
-/*!
-* \class CxeSettingsCenRepStore
-* \brief Class implements CxeSettingsStore.
* This class uses CenRep key mechanism for storing and retrieving settings information.
*/
class CxeSettingsCenRepStore : public QObject,
@@ -107,10 +50,10 @@
public: // from base class
void reset();
- CxeError::Id get(const QString& key, QVariant &value);
+ CxeError::Id get(const QString &key, QVariant &value);
void startMonitoring(long int uid, unsigned long int key, Cxe::SettingKeyType type, QVariant &value);
- CxeError::Id set(const QString& key,const QVariant newValue);
- QHash<QString, QVariantList> loadRuntimeSettings(QList<QString>& settingKeys);
+ CxeError::Id set(const QString &key, const QVariant newValue);
+ QHash<QString, QVariantList> loadVariationSettings(QList<QString> &settingKeys);
signals:
--- a/camerauis/cameraxui/cxengine/inc/cxesettingscontrolsymbian.h Thu Jul 15 01:55:05 2010 +0300
+++ b/camerauis/cameraxui/cxengine/inc/cxesettingscontrolsymbian.h Fri Jul 23 11:35:41 2010 +0300
@@ -1,5 +1,5 @@
/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies).
* All rights reserved.
* This component and the accompanying materials are made available
* under the terms of "Eclipse Public License v1.0"
@@ -39,7 +39,7 @@
public slots:
void handleSettingValueChanged(const QString& settingId, QVariant newValue);
- void handleSceneChanged(CxeScene& scene);
+ void handleSceneChanged(const QVariant &scene);
private:
--- a/camerauis/cameraxui/cxengine/inc/cxesettingsimp.h Thu Jul 15 01:55:05 2010 +0300
+++ b/camerauis/cameraxui/cxengine/inc/cxesettingsimp.h Fri Jul 23 11:35:41 2010 +0300
@@ -1,5 +1,5 @@
/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies).
* All rights reserved.
* This component and the accompanying materials are made available
* under the terms of "Eclipse Public License v1.0"
@@ -17,13 +17,17 @@
#ifndef CXESETTINGSIMP_H
#define CXESETTINGSIMP_H
+#include <QMetaMethod>
#include "cxesettings.h"
#include "cxeerror.h"
+#include "cxescenemodestore.h"
+
+// forward declaration
+class CxeSettingsStore;
-// forward declaration
-class CxeSettingsModel;
-
+typedef QPair<QObject*, QMetaMethod> CxeSettingListener;
+typedef QList<CxeSettingListener> CxeSettingListenerList;
/*
* Class to access all kind of Settings
@@ -34,28 +38,45 @@
public:
- CxeSettingsImp(CxeSettingsModel &settingsModel);
+ CxeSettingsImp(CxeSettingsStore *settingStore);
virtual ~CxeSettingsImp();
- CxeError::Id get(const QString &key, int &value) const;
- CxeError::Id get(const QString &key, QString &stringValue) const;
- CxeError::Id get(const QString &key, qreal &value) const;
void get(long int uid, unsigned long int key, Cxe::SettingKeyType type, QVariant &value) const;
- CxeError::Id set(const QString &key, int newValue);
- CxeError::Id set(const QString &key,const QString &newValue);
- CxeError::Id set(const QString &key, qreal newValue);
void reset();
+ CxeError::Id getVariationValue(const QString &key, QVariant &value);
+ bool listenForSetting(const QString &settingKey, QObject *target, const char *slot);
public slots:
void loadSettings(Cxe::CameraMode mode);
+protected:
+ void getValue(const QString &key, QVariant &value) const;
+ void setValue(const QString &key, const QVariant &newValue);
+
private: // helper methods
- CxeError::Id getSceneMode(const QString &key, QString &stringValue) const;
- CxeError::Id setSceneMode(const QString &key, const QString &stringValue);
+
+ void restoreImageSettings();
+ void restoreVideoSettings();
+
+ void setImageScene(const QString &newScene);
+ void setVideoScene(const QString &newScene);
+
+ void loadVariationSettings();
+
+ void notifyListeners(const QString &settingKey, const QVariant &newValue);
+
+private slots:
+ void handleListenerDestroyed(QObject *object);
private:
- CxeSettingsModel &mSettingsModel; // not owned
+
+ CxeSettingsStore *mSettingStore;
+ QHash<QString, QVariantList> mVariationSettings;
+ CxeSceneModeStore mSceneModeStore;
+ Cxe::CameraMode mCameraMode;
+
+ QMap<QString, CxeSettingListenerList> mSettingListeners;
};
#endif // CXESETTINGSIMP_H
--- a/camerauis/cameraxui/cxengine/inc/cxesettingsmappersymbian.h Thu Jul 15 01:55:05 2010 +0300
+++ b/camerauis/cameraxui/cxengine/inc/cxesettingsmappersymbian.h Fri Jul 23 11:35:41 2010 +0300
@@ -1,5 +1,5 @@
/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies).
* All rights reserved.
* This component and the accompanying materials are made available
* under the terms of "Eclipse Public License v1.0"
@@ -14,35 +14,39 @@
* Description:
*
*/
-/*
- * cxesettings.h
- *
- * Created on: Dec 30, 2008
- *
- */
-#ifndef CXESETTINGSMAPPERSYMBIAN_H_
-#define CXESETTINGSMAPPERSYMBIAN_H_
+#ifndef CXESETTINGSMAPPERSYMBIAN_H
+#define CXESETTINGSMAPPERSYMBIAN_H
#include <ecam.h>
#include <ecamadvsettings.h>
#include <ECamOrientationCustomInterface2.h>
+#include <ecamusecasehintcustomapi.h>
#include "cxeautofocuscontrol.h"
#include "cxenamespace.h"
-/*
-* Class to access all kind of Settings
+#include "cxequalitydetails.h"
+
+/*!
+ Map CameraX specific enums to ECam equivalents
*/
class CxeSettingsMapperSymbian
{
-
- public: // mappings functions that maps UI enum value to CCamera specific enum
- static CCamera::TWhiteBalance Map2CameraWb(int aWbId );
- static CCamera::TFlash Map2CameraFlash(int aFlashId );
- static CCamera::TExposure Map2CameraExposureMode(int aExpModeId );
- static CCamera::CCameraImageProcessing::TEffect Map2CameraEffect(int aColourFilterId );
- static CCamera::CCameraAdvancedSettings::TFocusRange Map2CameraAutofocus(CxeAutoFocusControl::Mode afMode);
- static MCameraOrientation::TOrientation Map2CameraOrientation(Cxe::DeviceOrientation orientation);
+public:
+ static CCamera::TWhiteBalance Map2CameraWb(Cxe::Whitebalance whiteBalance);
+ static CCamera::TFlash Map2CameraFlash(Cxe::FlashMode flashMode);
+ static CCamera::TExposure Map2CameraExposureMode(
+ Cxe::ExposureMode exposureMode);
+ static CCamera::CCameraImageProcessing::TEffect Map2CameraEffect(
+ Cxe::Colortone colorTone);
+ static CCamera::CCameraAdvancedSettings::TFocusRange Map2CameraAutofocus(
+ CxeAutoFocusControl::Mode afMode);
+ static MCameraOrientation::TOrientation Map2CameraOrientation(
+ Cxe::DeviceOrientation orientation);
+ static void Map2UseCaseHintVideoParameters(
+ const CxeVideoDetails &videoDetails,
+ MCameraUseCaseHint::TVideoCodec &codec,
+ MCameraUseCaseHint::TVideoProfile &profile);
};
-#endif /*CXESETTINGSMAPPERSYMBIAN_H_*/
+#endif /*CXESETTINGSMAPPERSYMBIAN_H*/
// end of file
--- a/camerauis/cameraxui/cxengine/inc/cxesettingsmodel.h Thu Jul 15 01:55:05 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,105 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
-*
-*/
-#ifndef CXESETTINGSMODEL_H_
-#define CXESETTINGSMODEL_H_
-
-// Include Files
-#include <QVariant>
-#include "cxeerror.h"
-#include "cxenamespace.h"
-
-/*
-* Settings model class handles all settings data i.e. loading, saving, getting settings data based on the settings key.
-*/
-class CxeSettingsModel
-{
-
-public:
-
- virtual ~CxeSettingsModel() {};
-
- /*
- * resets and reload settings that qualify reseting
- * return CxeEngine specific error code
- */
- virtual void reset() = 0;
-
- /*
- * Get setting value associated with the key.
- * @Param key - Setting key Id ( refer to CxeSettingIds in cxenums.h )
- * @Param value - contains the value associated with the key.
- * @returns CxeError::None if successful or any CxeError specific error code.
- */
- virtual CxeError::Id getSettingValue(const QString &key, QVariant &value) = 0;
-
- /*
- * Get setting value associated with the key.
- * @param uid - UID of component that owns the setting key
- * @Param key - key id of the setting
- * @param type - the type of key
- * @Param value - contains the value associated with the key.
- */
- virtual void getSettingValue(long int uid, unsigned long int key, Cxe::SettingKeyType type, QVariant &value) = 0;
-
- /*
- * Get the configured run-time value associated with the key.
- * @Param key - Setting key Id ( refer to CxeSettingIds in cxenums.h )
- * @Param value - contains the value associated with the key.
- * @returns CxeError::None if successful or any CxeError specific error code.
- */
- virtual CxeError::Id getRuntimeValue(const QString &key, QVariant &value) = 0;
-
- /*
- * Set a value to the key.
- * @Param key - Setting key Id ( refer to CxeSettingIds in cxenums.h )
- * @Param value - contains the value associated with the key.
- * @returns CxeError::None if successful or any CxeError specific error code.
- */
- virtual CxeError::Id set(const QString &key,const QVariant newValue) = 0;
-
-
- /*
- * Returns the current image scene mode.
- */
- virtual CxeScene& currentImageScene() = 0;
-
- /*
- * Returns the current video scene mode.
- */
- virtual CxeScene& currentVideoScene() = 0;
-
- /*
- * Updating settings model whenever mode is changed from image to video and vice-versa.
- */
- virtual void cameraModeChanged(Cxe::CameraMode newMode) = 0;
-
- /*
- * Set a new image scene mode
- * @returns CxeError::None if successful or any CxeError specific error code.
- */
- virtual CxeError::Id setImageScene(const QString &newScene) = 0;
-
- /*
- * Set a new video scene mode
- * @returns CxeError::None if successful or any CxeError specific error code.
- */
- virtual CxeError::Id setVideoScene(const QString &newScene) = 0;
-
-};
-
-#endif // CXESETTINGSMODEL_H_
-
--- a/camerauis/cameraxui/cxengine/inc/cxesettingsmodelimp.h Thu Jul 15 01:55:05 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,95 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
-*
-*/
-
-#ifndef CXESETTINGSMODELIMP_H
-#define CXESETTINGSMODELIMP_H
-
-// Include Files
-#include <QHash>
-#include <QVariant>
-#include <QMetaType>
-#include "cxesettingsmodel.h"
-#include "cxenamespace.h"
-#include "cxeerror.h"
-
-// forward declarations
-class QVariant;
-class CxeSettingsStore;
-
-/*
-* Settings model class handles all settings data i.e. loading, saving, getting settings data based on the settings key.
-*/
-class CxeSettingsModelImp : public CxeSettingsModel
-{
-
-public:
-
- CxeSettingsModelImp(CxeSettingsStore *settingsStore);
- ~CxeSettingsModelImp();
-
-public:
-
- void reset();
- CxeError::Id getSettingValue(const QString &key, QVariant &value);
- void getSettingValue(long int uid, unsigned long int key, Cxe::SettingKeyType type, QVariant &value);
- CxeError::Id getRuntimeValue(const QString &key, QVariant &value);
- CxeError::Id set(const QString &key, const QVariant newValue);
- CxeScene& currentImageScene();
- CxeScene& currentVideoScene();
- void cameraModeChanged(Cxe::CameraMode newMode);
- CxeError::Id setImageScene(const QString& newScene);
- CxeError::Id setVideoScene(const QString& newScene);
-
-private:
-
- void init();
- void loadRuntimeSettings();
-
- void loadImageScenes();
- void loadVideoScenes();
-
- CxeError::Id loadSceneData(const QString &newScene, CxeScene ¤tSceneSettings);
- CxeError::Id sceneSettingValue(const QString &key, QVariant &value);
- CxeError::Id setSceneSettingValue(const QString &key, QVariant newValue);
-
- void supportedKeys(QList<QString> &runtimeKeys);
-
- CxeError::Id videoScene(const QString &sceneId, CxeScene &sceneSettings);
- CxeError::Id imageScene(const QString &sceneId, CxeScene &sceneSettings);
-
- void restoreImageSettings();
- void restoreVideoSettings();
-
-
-private:
-
- CxeSettingsStore *mSettingStore;
- QHash<QString, QVariantList> mRuntimeSettings;
-
- QHash<QString, CxeScene> mImageSceneModes;
- QHash<QString, CxeScene> mVideoSceneModes;
-
- CxeScene mCurrentImgScene;
- CxeScene mCurrentVidScene;
-
- Cxe::CameraMode mCameraMode;
-};
-
-Q_DECLARE_METATYPE(QVariantList)
-Q_DECLARE_METATYPE(CxeScene)
-
-#endif /* CXESETTINGSMODELIMP_H */
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/camerauis/cameraxui/cxengine/inc/cxesettingsstore.h Fri Jul 23 11:35:41 2010 +0300
@@ -0,0 +1,80 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+#ifndef CXESETTINGSSTORE_H_
+#define CXESETTINGSSTORE_H_
+
+// Include Files
+#include <QHash>
+#include <QVariant>
+#include <QMetaType>
+#include "cxeerror.h"
+#include "cxenamespace.h"
+
+/*!
+* Settings store intrerface.
+*/
+class CxeSettingsStore
+{
+public:
+
+ /*!
+ * Destructor. Needs to be virtual.
+ */
+ virtual ~CxeSettingsStore() {};
+
+ /*!
+ * resets the cenrep store
+ */
+ virtual void reset() = 0;
+
+ /*!
+ * Reads a value from cenrep
+ * \param "key" - setting key
+ * \param "value" - setting value read from cenrep
+ */
+ virtual CxeError::Id get(const QString &key, QVariant &value) = 0;
+
+ /*!
+ * Reads a value from the settings store and starts monitoring it.
+ * \param "uid" - UID of the component that own setting key
+ * \param "key" - setting key id
+ * \param "type" - type of setting key
+ * \param "value" - setting value read from cenrep
+ */
+ virtual void startMonitoring(long int uid, unsigned long int key, Cxe::SettingKeyType type, QVariant &value) = 0;
+
+ /*!
+ * Sets a new value to cenrep
+ * \param "key" - setting key
+ * \param "newValue" - new value set to the key in cenrep
+ */
+ virtual CxeError::Id set(const QString &key,const QVariant newValue) = 0;
+
+ /*!
+ * Reads/loads all run-time variation settings values from cenrep
+ * @param QList<QString> contains list of all runtime variation key ids which we use to load values from cenrep.
+ * returns: QHash container, "contains" values associated with each key that are read from cenrep
+ * NOTE: loading runtime variation settings should be done only ONCE at start-up. Its an overhead to read variation keys
+ * unnecessarily multiple times as the values of the runtime keys are not changed.
+ * Variation keys are only used to configure camerax application.
+ */
+ virtual QHash<QString, QVariantList> loadVariationSettings(QList<QString> &settingKeys) = 0;
+};
+
+
+#endif // CXESETTINGSSTORE_H_
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/camerauis/cameraxui/cxengine/inc/cxesettingsstoredesktop.h Fri Jul 23 11:35:41 2010 +0300
@@ -0,0 +1,58 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#ifndef CXESETTINGSSTOREDESKTOP_H_
+#define CXESETTINGSSTOREDESKTOP_H_
+
+// Include Files
+#include <QHash>
+#include <QVariant>
+#include <QMetaType>
+#include "cxesettingsstore.h"
+#include "cxeerror.h"
+
+/*!
+* CxeSettingsStoreDesktop class implements CxeSettingsStore.
+*/
+class CxeSettingsStoreDesktop : public QObject,
+ public CxeSettingsStore
+{
+ Q_OBJECT
+
+public:
+
+ CxeSettingsStoreDesktop();
+ ~CxeSettingsStoreDesktop();
+
+public: // from base class
+ void reset();
+ CxeError::Id get(const QString &key, QVariant &value);
+ void startMonitoring(long int uid, unsigned long int key, Cxe::SettingKeyType type, QVariant &value);
+ CxeError::Id set(const QString &key,const QVariant newValue);
+
+ QHash<QString, QVariantList> loadVariationSettings(QList<QString> &settingKeys);
+
+private:
+ void initSettings();
+
+private:
+ QHash<QString, QVariant> mSettings;
+
+};
+
+#endif // CXESETTINGSSTOREDESKTOP_H_
+
--- a/camerauis/cameraxui/cxengine/inc/cxestatemachine.h Thu Jul 15 01:55:05 2010 +0300
+++ b/camerauis/cameraxui/cxengine/inc/cxestatemachine.h Fri Jul 23 11:35:41 2010 +0300
@@ -1,5 +1,5 @@
/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies).
* All rights reserved.
* This component and the accompanying materials are made available
* under the terms of "Eclipse Public License v1.0"
@@ -14,6 +14,7 @@
* Description:
*
*/
+
#ifndef CXESTATEMACHINE_H
#define CXESTATEMACHINE_H
@@ -40,7 +41,7 @@
* @sa addState setInitialState
* @param stateMachineName Name for this state machine (used for debug prints)
*/
- CxeStateMachine(const char* stateMachineName);
+ CxeStateMachine(const char *stateMachineName);
virtual ~CxeStateMachine();
protected:
@@ -62,7 +63,7 @@
* @param stateId State ID of the new state
* @param error Optional error code to be associated with the transition
*/
- bool setState(int stateId, int error = 0);
+ bool setState(int stateId, CxeError::Id error = CxeError::None);
/**
* Set the initial state of the state machine. Can be called only once.
@@ -87,5 +88,3 @@
};
#endif // CXESTATEMACHINE_H
-
-
--- a/camerauis/cameraxui/cxengine/inc/cxestatemachinebase.h Thu Jul 15 01:55:05 2010 +0300
+++ b/camerauis/cameraxui/cxengine/inc/cxestatemachinebase.h Fri Jul 23 11:35:41 2010 +0300
@@ -1,5 +1,5 @@
/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies).
* All rights reserved.
* This component and the accompanying materials are made available
* under the terms of "Eclipse Public License v1.0"
@@ -14,6 +14,7 @@
* Description:
*
*/
+
#ifndef CXESTATEMACHINEBASE_H
#define CXESTATEMACHINEBASE_H
@@ -52,7 +53,7 @@
* @sa addState setInitialState
* @param stateMachineName Name for this state machine (used for debug prints)
*/
- CxeStateMachineBase(const char* stateMachineName);
+ CxeStateMachineBase(const char *stateMachineName);
virtual ~CxeStateMachineBase();
protected:
@@ -76,7 +77,7 @@
* @return False if state change fails. True if changing is allowed, or the current state is same
* as the new state.
*/
- virtual bool setState(int stateId, int error = 0);
+ virtual bool setState(int stateId, CxeError::Id error = CxeError::None);
/**
* Set the initial state of the state machine. Can be called only once.
@@ -116,7 +117,7 @@
private:
//! Hash table of all states. stateId as key
- QHash<int, CxeState*> mStates;
+ QHash<int, CxeState *> mStates;
//! All states ORed together
int mStateBitsUsed;
@@ -130,5 +131,3 @@
};
#endif // CXESTATEMACHINEBASE_H
-
-
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/camerauis/cameraxui/cxengine/inc/cxestillcapturecontroldesktop.h Fri Jul 23 11:35:41 2010 +0300
@@ -0,0 +1,130 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+#ifndef CXESTILLCAPTURECONTROLDESKTOP_H
+#define CXESTILLCAPTURECONTROLDESKTOP_H
+
+#include <QList>
+#include <QVariant>
+
+#include "cxestillcapturecontrol.h"
+#include "cxeimagedataqueuedesktop.h"
+#include "cxenamespace.h"
+#include "cxeerror.h"
+#include "cxeautofocuscontrol.h"
+
+class CxeFilenameGenerator;
+class CxeFileSaveThread;
+class CxeStillImageDesktop;
+class CxeViewfinderControl;
+class CxeCameraDeviceControl;
+class CxeCameraDeviceDesktop;
+
+
+
+/**
+ * Class CxeStillCaptureControlSymbian.
+ * Inherits/implements CxeStillCaptureControl.
+ */
+class CxeStillCaptureControlDesktop : public CxeStillCaptureControl
+{
+ Q_OBJECT
+
+public: // constructors
+
+ CxeStillCaptureControlDesktop(CxeCameraDeviceDesktop &cameraDevice,
+ CxeViewfinderControl &viewfinderControl,
+ CxeCameraDeviceControl &cameraDeviceControl,
+ CxeFilenameGenerator &nameGenerator,
+ CxeAutoFocusControl &autoFocusControl,
+ CxeFileSaveThread &saveThread);
+
+ virtual ~CxeStillCaptureControlDesktop();
+
+public: // from CxeStillCaptureControl
+
+ void capture();
+ State state() const;
+ int imageCount() const;
+ void reset();
+ void cancelAll();
+ void setMode(CaptureMode mode);
+ CaptureMode mode() const;
+ CxeStillImage &operator[](int index);
+ CxeImageDataQueue &imageDataQueue();
+ QList<CxeImageDetails> supportedImageQualities();
+ int imagesLeft();
+
+signals:
+ void imagePrepareComplete(CxeError::Id error);
+ void prepareZoomForStill(int ecamStillResolutionIndex);
+
+public slots:
+ void init();
+ void deinit();
+
+protected slots:
+ // notifications when camera reference is changed
+ void prepareForCameraDelete();
+ void handleCameraAllocated(CxeError::Id error);
+
+ // notification for when camera is released
+ void prepareForRelease();
+
+ // settings call back
+ void handleSettingValueChanged(const QString &settingId, QVariant newValue);
+ void handleSceneChanged(CxeScene &scene);
+
+ // Autofocus events
+ void handleAutofocusStateChanged(CxeAutoFocusControl::State newState, CxeError::Id error);
+
+private: // helper functions
+ void updateFlashSetting(QVariant newValue);
+ void updateISOSetting(QVariant newValue);
+ void updateEVCompensationSetting(QVariant newValue);
+ CxeError::Id prepareFilename(CxeStillImageDesktop *stillImage);
+ void setOrientation(QVariant sensorData);
+ CxeStillImageDesktop *getImageForIndex(int index);
+ int prepareStillSnapshot();
+ CxeError::Id getImageQualityDetails(CxeImageDetails &imageInfo);
+ void handleSnapshotEvent(CxeError::Id error);
+ void initializeStates();
+ void prepare();
+
+private: // private data
+
+ State mState;
+ CxeImageDataQueueDesktop *mImageDataQueue; // own
+ CxeCameraDeviceDesktop &mCameraDevice;
+ CxeViewfinderControl &mViewfinderControl;
+ CxeCameraDeviceControl &mCameraDeviceControl;
+ CxeFilenameGenerator &mFilenameGenerator; //! @todo could be shared with video capture control?
+ CxeAutoFocusControl &mAutoFocusControl;
+ CaptureMode mMode;
+ CxeAutoFocusControl::State mAfState;
+ QList<CxeStillImageDesktop*> mImages;
+ CxeFileSaveThread &mSaveThread;
+
+ int mNextSnapshotIndex;
+ int mNextImageDataIndex;
+ //still resolutions supported by ICM
+ QList<CxeImageDetails> mSupportedImageQualities;
+ //still resolutions supported by ecam
+ //current image quality details
+ CxeImageDetails mCurrentImageDetails;
+};
+
+#endif // CXESTILLCAPTURECONTROLDESKTOP_H
--- a/camerauis/cameraxui/cxengine/inc/cxestillcapturecontrolsymbian.h Thu Jul 15 01:55:05 2010 +0300
+++ b/camerauis/cameraxui/cxengine/inc/cxestillcapturecontrolsymbian.h Fri Jul 23 11:35:41 2010 +0300
@@ -1,5 +1,5 @@
/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies).
* All rights reserved.
* This component and the accompanying materials are made available
* under the terms of "Eclipse Public License v1.0"
@@ -127,14 +127,18 @@
// sensor events
void handleSensorEvent(CxeSensorEventHandler::SensorType type,QVariant data);
+ // Use ECam Use Case Hint Custom API to inform ECam of our intended use case
+ // before calling Reserve()
+ void hintUseCase();
+
private: // helper functions
CxeError::Id prepareFilename(CxeStillImageSymbian *stillImage);
void setOrientation(QVariant sensorData);
CxeStillImageSymbian* getImageForIndex(int index);
CCamera::TFormat supportedStillFormat(Cxe::CameraIndex cameraIndex);
- int prepareStillSnapshot();
- CxeError::Id getImageQualityDetails(CxeImageDetails &imageInfo);
+ void prepareSnapshot();
+ void updateStillCaptureParameters();
void handleSnapshotEvent(CxeError::Id error);
void initializeStates();
void prepare();
@@ -168,6 +172,8 @@
QList<TSize> mECamSupportedImageResolutions;
//current image quality details in use
CxeImageDetails mCurrentImageDetails;
+ CCamera::TFormat mCaptureFormat;
+ int mSizeIndex; //!< ECam still capture size index
};
#endif // CXESTILLCAPTURECONTROLSYMBIAN_H
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/camerauis/cameraxui/cxengine/inc/cxestillimagedesktop.h Fri Jul 23 11:35:41 2010 +0300
@@ -0,0 +1,55 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+#ifndef CXESTILLIMAGEDESKTOP_H
+#define CXESTILLIMAGEDESKTOP_H
+
+// Include Files
+#include <QString>
+#include <QPixmap>
+#include "cxestillimage.h"
+
+class CxeImageDataItem;
+
+class CxeStillImageDesktop : public CxeStillImage
+{
+public:
+ CxeStillImageDesktop();
+ virtual ~CxeStillImageDesktop();
+
+public: // from CxeStillImage
+ CxeImageDataItem *dataItem(); // NULL if already saved
+ QString filename() const;
+ QPixmap snapshot() const;
+ bool saved() const;
+ int id() const;
+
+public:
+ void setSnapshot(QPixmap pixmap);
+ void setFilename(const QString &filename);
+ void setSaved(bool saved);
+ void setDataItem(CxeImageDataItem *dataItem);
+
+private:
+ QPixmap mSnapshot;
+ CxeImageDataItem *mDataItem; // not own
+ QString mFilename;
+ bool mSaved;
+ const int mId;
+ static int mNextId;
+};
+
+#endif // CXESTILLIMAGEDESKTOP_H
--- a/camerauis/cameraxui/cxengine/inc/cxestillimagesymbian.h Thu Jul 15 01:55:05 2010 +0300
+++ b/camerauis/cameraxui/cxengine/inc/cxestillimagesymbian.h Fri Jul 23 11:35:41 2010 +0300
@@ -1,5 +1,5 @@
/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies).
* All rights reserved.
* This component and the accompanying materials are made available
* under the terms of "Eclipse Public License v1.0"
@@ -18,30 +18,37 @@
#define CXESTILLIMAGESYMBIAN_H
// Include Files
-#include <QString>
-#include <QPixmap>
+#include <QObject>
+#include "cxeerror.h"
#include "cxestillimage.h"
+class QString;
+class QPixmap;
class CxeImageDataItem;
-class CxeStillImageSymbian : public CxeStillImage
+class CxeStillImageSymbian : public QObject,
+ public CxeStillImage
{
+ Q_OBJECT
public:
CxeStillImageSymbian();
virtual ~CxeStillImageSymbian();
public: // from CxeStillImage
- CxeImageDataItem* dataItem(); // NULL if already saved
+ CxeImageDataItem *dataItem(); // NULL if already saved
QString filename() const;
QPixmap snapshot() const;
bool saved() const;
int id() const;
public:
- void setSnapshot( QPixmap pixmap );
- void setFilename( const QString& filename );
- void setSaved( bool saved );
- void setDataItem( CxeImageDataItem* dataItem );
+ void setSnapshot(QPixmap pixmap);
+ void setFilename(const QString &filename);
+ void setSaved(bool saved);
+ void setDataItem(CxeImageDataItem *dataItem);
+
+private slots:
+ void imageDataSaved(CxeError::Id status);
private:
QPixmap mSnapshot;
--- a/camerauis/cameraxui/cxengine/inc/cxesysutil.h Thu Jul 15 01:55:05 2010 +0300
+++ b/camerauis/cameraxui/cxengine/inc/cxesysutil.h Fri Jul 23 11:35:41 2010 +0300
@@ -1,5 +1,5 @@
/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies).
* All rights reserved.
* This component and the accompanying materials are made available
* under the terms of "Eclipse Public License v1.0"
@@ -32,7 +32,7 @@
public:
- static TBool DiskSpaceBelowCriticalLevel(
+ static bool DiskSpaceBelowCriticalLevel(
RFs* aFs,
TInt aBytesToWrite,
TInt aDrive );
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/camerauis/cameraxui/cxengine/inc/cxevideocapturecontroldesktop.h Fri Jul 23 11:35:41 2010 +0300
@@ -0,0 +1,137 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#ifndef CXEVIDEOCAPTURECONTROLDESKTOP_H_
+#define CXEVIDEOCAPTURECONTROLDESKTOP_H_
+
+#include <QTime>
+#include <QPixmap>
+#include <QTimer>
+
+#include "cxesettings.h"
+#include "cxevideocapturecontrol.h"
+#include "cxestatemachine.h"
+#include "cxenamespace.h"
+
+
+// Custom command for setting a new filename without closing & reopening the controller
+enum TCamCControllerCustomCommands
+ {
+ ECamCControllerCCNewFilename = 0,
+ ECamCControllerCCVideoStopAsync
+ };
+
+
+// forward declarations
+class CxeCameraDeviceDesktop;
+class CxeQualityPresets;
+class CxeFilenameGenerator;
+class CxeViewfinderControl;
+class CxeCameraDeviceControl;
+
+
+class CxeVideoCaptureControlDesktop : public CxeVideoCaptureControl
+{
+ Q_OBJECT
+
+public: // constructors
+
+ CxeVideoCaptureControlDesktop( CxeCameraDeviceDesktop &cameraDevice,
+ CxeViewfinderControl &viewfinderControl,
+ CxeCameraDeviceControl &cameraDeviceControl,
+ CxeFilenameGenerator &nameGenerator,
+ CxeQualityPresets &qualityPresets);
+
+ virtual ~CxeVideoCaptureControlDesktop();
+
+public: // functions from CxeVideoCaptureControl
+ CxeVideoCaptureControl::State state() const;
+ void record();
+ void pause();
+ void stop();
+ void remainingTime(int &time);
+ bool elapsedTime(int &time);
+ void reset();
+ QString filename() const;
+ QPixmap snapshot() const;
+ QList<CxeVideoDetails> supportedVideoQualities();
+
+public: // public member functions, not in client API
+ void handleSnapshotEvent(CxeError::Id error);
+
+signals:
+ void videoPrepareComplete(CxeError::Id error);
+ void prepareZoomForVideo();
+
+public slots:
+ //! Notification for when camera device is ready and we're entering video mode
+ void init();
+ //! Notification for when we're exiting video mode
+ void deinit();
+ //! Notification that videocapture sound has been played
+ void handleSoundPlayed();
+
+protected slots:
+ // notifications when ECam reference is changed
+ void prepareForCameraDelete();
+ void handleCameraAllocated(CxeError::Id error);
+ void prepareForRelease();
+ // ECam events
+ void handleCameraEvent(int eventUid, int error);
+ // settings call back
+ void handleSettingValueChanged(const QString &settingId, QVariant newValue);
+ void handleSceneChanged(CxeScene &scene);
+
+private: // helper methods
+ void releaseResources();
+ void initializeStates();
+ int prepareVideoSnapshot();
+ void initVideoRecorder();
+ void open();
+ void prepare();
+ void createVideoRecorder();
+ void setupElapseTimer();
+ void setState(CxeVideoCaptureControl::State stateId, CxeError::Id error = CxeError::None);
+
+private slots:
+ void handleElapseTimeout();
+
+private: // private data
+
+ CxeCameraDeviceDesktop &mCameraDevice;
+ CxeCameraDeviceControl &mCameraDeviceControl;
+ CxeViewfinderControl &mViewfinderControl;
+ CxeFilenameGenerator &mFilenameGenerator;
+ CxeQualityPresets &mQualityPresets;
+ //! Snapshot image.
+ QPixmap mSnapshot;
+ //! New file name generated for the video prepare.
+ QString mNewFileName;
+ //! Current video file name
+ QString mCurrentFilename;
+ CxeVideoCaptureControl::State mState;
+ //current video quality details in use
+ CxeVideoDetails mCurrentVideoDetails;
+
+ //timer for simulating elapsing time
+ QTimer mRecordElapseTimer;
+
+ //elapsed recording time in seconds
+ int mElapsedTime;
+};
+
+#endif /* CXEVIDEOCAPTURECONTROLDESKTOP_H_ */
--- a/camerauis/cameraxui/cxengine/inc/cxevideocapturecontrolsymbian.h Thu Jul 15 01:55:05 2010 +0300
+++ b/camerauis/cameraxui/cxengine/inc/cxevideocapturecontrolsymbian.h Fri Jul 23 11:35:41 2010 +0300
@@ -1,5 +1,5 @@
/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies).
* All rights reserved.
* This component and the accompanying materials are made available
* under the terms of "Eclipse Public License v1.0"
@@ -106,21 +106,23 @@
void handleCameraAllocated(CxeError::Id error);
void prepareForRelease();
// settings call back
- void handleSettingValueChanged(const QString& settingId,QVariant newValue);
+ void handleSettingValueChanged(const QString &settingId, QVariant newValue);
// scene mode change
- void handleSceneChanged(CxeScene& scene);
+ void handleSceneChanged(const QVariant &scene);
// Disk space change
void handleDiskSpaceChanged();
+ void hintUseCase();
private: // helper methods
void releaseResources();
void initializeStates();
- void getVideoQualityDetails(CxeVideoDetails &videoInfo);
+ void updateVideoCaptureParameters();
void initVideoRecorder();
void open();
void prepare();
+ void prepareSnapshot();
virtual void createVideoRecorder();
- int calculateRemainingTime(const CxeVideoDetails& videoDetails);
+ int calculateRemainingTime(const CxeVideoDetails &videoDetails);
void updateRemainingRecordingTimeCounter();
void generateFilename();
void handlePrepareFailed();
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/camerauis/cameraxui/cxengine/inc/cxeviewfindercontroldesktop.h Fri Jul 23 11:35:41 2010 +0300
@@ -0,0 +1,52 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+#ifndef CXEVIEWFINDERCONTROLDESKTOP_H_
+#define CXEVIEWFINDERCONTROLDESKTOP_H_
+
+#include "cxeviewfindercontrol.h"
+
+class CxeCameraDeviceDesktop;
+class CxeViewfinderWidgetDesktop;
+
+class CxeViewfinderControlDesktop : public CxeViewfinderControl
+{
+ Q_OBJECT
+public:
+
+ CxeViewfinderControlDesktop(CxeCameraDeviceDesktop &cameraDevice);
+ virtual ~CxeViewfinderControlDesktop();
+
+ virtual void setWindow(WId windowId);
+
+ virtual CxeError::Id start();
+
+ virtual void stop();
+
+ virtual CxeViewfinderControl::State state() const;
+
+ virtual QSize deviceDisplayResolution() const;
+
+private:
+ State mState;
+ WId mWindowId;
+ QSize mResolution;
+ CxeCameraDeviceDesktop &mCameraDevice;
+ CxeViewfinderWidgetDesktop *mViewfinderWidget;
+
+};
+
+#endif /*CXEVIEWFINDERCONTROLDESKTOP_H_*/
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/camerauis/cameraxui/cxengine/inc/cxeviewfinderwidgetdesktop.h Fri Jul 23 11:35:41 2010 +0300
@@ -0,0 +1,41 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#ifndef CXEVIEWFINDERWIDGETDESKTOP_H
+#define CXEVIEWFINDERWIDGETDESKTOP_H
+
+#include <QGraphicsWidget>
+
+class QPixmap;
+
+class CxeViewfinderWidgetDesktop : public QGraphicsWidget
+{
+ Q_OBJECT
+public:
+ CxeViewfinderWidgetDesktop();
+ virtual ~CxeViewfinderWidgetDesktop();
+
+ virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget);
+
+public slots:
+ void handleImageChange(const QPixmap &newImage);
+
+private:
+ QPixmap mCurrentPixmap;
+};
+
+#endif // CXEVIEWFINDERWIDGETDESKTOP_H
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/camerauis/cameraxui/cxengine/inc/cxezoomcontroldesktop.h Fri Jul 23 11:35:41 2010 +0300
@@ -0,0 +1,81 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#ifndef CXEZOOMCONTROLDESKTOP_H
+#define CXEZOOMCONTROLDESKTOP_H
+
+#include "cxezoomcontrol.h"
+#include "cxestatemachine.h"
+#include "cxecameradevicecontrol.h"
+
+class CxeCameraDeviceControl;
+class CxeSettings;
+class CxeFeatureManager;
+
+class CxeZoomControlDesktop : public CxeZoomControl
+{
+ Q_OBJECT
+
+public: // constructors
+
+ CxeZoomControlDesktop(CxeCameraDeviceControl &cameraDeviceControl);
+
+ virtual ~CxeZoomControlDesktop();
+
+public:
+ // from CxeZoomControl
+ CxeZoomControl::State state() const;
+ int min() const;
+ int max() const;
+ void zoomTo(int value);
+
+protected slots:
+
+ // Slot to react to still capture signal:
+ // prepares the zoom control for still.
+ void prepareZoomForStill(int ecamStillResolutionIndex);
+
+ // Slot to react to video capture signal:
+ // prepares the zoom control for video.
+ void prepareZoomForVideo();
+
+ // Slot to prepare for camera delete signal.
+ void reset();
+
+private:
+ // private member functions
+ void init();
+ void finalizeZoomPreparation(int error);
+
+private:
+ // private data
+
+ CxeCameraDeviceControl &mCameraDeviceControl;
+
+ // Zoom levels
+ int mCurrentZoomLevel;
+ int mMinZoomLevel;
+ int mMaxZoomLevel;
+
+ // values ready from feature manager.
+ QList<int> mStillMaxZoomLimits;
+ QList<int> mVideoMaxZoomLimits;
+
+ CxeZoomControl::State mState;
+};
+
+#endif // CXEZOOMCONTROLDESKTOP_H
--- a/camerauis/cameraxui/cxengine/inc/cxezoomcontrolsymbian.h Thu Jul 15 01:55:05 2010 +0300
+++ b/camerauis/cameraxui/cxengine/inc/cxezoomcontrolsymbian.h Fri Jul 23 11:35:41 2010 +0300
@@ -1,5 +1,5 @@
/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies).
* All rights reserved.
* This component and the accompanying materials are made available
* under the terms of "Eclipse Public License v1.0"
@@ -63,9 +63,6 @@
// Slot to prepare for camera delete signal.
void reset();
- // slot for setting value change
- void handleSettingValueChanged(const QString& settingId,QVariant newValue);
-
private:
// private member functions
void init();
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/camerauis/cameraxui/cxengine/src/cxeautofocuscontroldesktop.cpp Fri Jul 23 11:35:41 2010 +0300
@@ -0,0 +1,173 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#include <QMetaType>
+#include <QImage>
+
+//#include "cxesettings.h"
+#include "cxeautofocuscontroldesktop.h"
+#include "cxutils.h"
+#include "cxestate.h"
+
+/*
+* CxeAutoFocusControlSymbian::CxeAutoFocusControlSymbian
+*/
+CxeAutoFocusControlDesktop::CxeAutoFocusControlDesktop()
+ : mCancelled(false),
+ mState(Unknown)
+{
+ CX_DEBUG_ENTER_FUNCTION();
+
+ qRegisterMetaType<CxeAutoFocusControl::State>();
+
+ initializeStates();
+ initializeResources();
+
+ CX_DEBUG_EXIT_FUNCTION();
+}
+
+/*
+* CxeAutoFocusControlDesktop::~CxeAutoFocusControlDesktop
+*/
+CxeAutoFocusControlDesktop::~CxeAutoFocusControlDesktop()
+{
+ CX_DEBUG_ENTER_FUNCTION();
+ CX_DEBUG_EXIT_FUNCTION();
+}
+
+/*
+* Start Autofocus
+*/
+CxeError::Id CxeAutoFocusControlDesktop::start(bool soundEnabled)
+{
+ Q_UNUSED(soundEnabled);
+
+ CX_DEBUG( ("CxeAutoFocusControlDesktop::start() <> state: %d", state() ) );
+
+ CxeError::Id err = CxeError::None;
+
+ if (state() != CxeAutoFocusControl::InProgress && state() != CxeAutoFocusControl::Canceling) {
+ CX_DEBUG(("CxeAutoFocusControlDesktop::start() calling SetAutoFocusType"));
+ mCancelled = false;
+ mState = Ready;
+ emit stateChanged(mState, CxeError::None);
+ } else { // AF was started earlier, can't start until it completes
+ err = CxeError::InUse;
+ }
+
+ CX_DEBUG( ("CxeAutoFocusControlDesktop::start() <= err : %d", err ) );
+
+ return err;
+}
+
+/*
+* Cancel Autofocus
+*/
+void CxeAutoFocusControlDesktop::cancel()
+{
+ CX_DEBUG( ("CxeAutoFocusControlSymbian::cancel <> state: %d", state() ) );
+
+ if (!mCancelled) {
+ if (state() == CxeAutoFocusControl::InProgress) {
+ // Need to stop current AF first. Wait for AF event to proceed.
+ mState = Canceling;
+ emit stateChanged(mState, CxeError::None);
+ } else if (state() != CxeAutoFocusControl::Canceling) {
+ // Cancel means move to hyperfocal.
+ mState = Canceling;
+ emit stateChanged(mState, CxeError::None);
+ }
+ }
+ CX_DEBUG_EXIT_FUNCTION();
+}
+
+/*
+* Set Autofocus mode
+*/
+void CxeAutoFocusControlDesktop::setMode(CxeAutoFocusControl::Mode newMode)
+{
+ CX_DEBUG_ENTER_FUNCTION();
+
+ mAfMode = newMode;
+ mCancelled = false;
+
+ CX_DEBUG_EXIT_FUNCTION();
+}
+
+/*
+* returns Autofocus mode
+*/
+CxeAutoFocusControl::Mode CxeAutoFocusControlDesktop::mode() const
+{
+ return mAfMode;
+}
+
+/**
+* Is the given mode a fixed focus mode?
+*/
+bool CxeAutoFocusControlDesktop::isFixedFocusMode(CxeAutoFocusControl::Mode mode) const
+{
+ return (mode == CxeAutoFocusControl::Hyperfocal
+ || mode == CxeAutoFocusControl::Infinity);
+}
+
+/*
+* To check if Autofocus is supported
+*/
+bool CxeAutoFocusControlDesktop::supported() const
+{
+ CX_DEBUG_ENTER_FUNCTION();
+
+ bool supported = true;
+ CX_DEBUG_EXIT_FUNCTION();
+ return supported;
+}
+
+/*
+* CxeAutoFocusControlDesktop::state
+*/
+CxeAutoFocusControl::State CxeAutoFocusControlDesktop::state() const
+{
+ return mState;
+}
+
+/*
+* CxeAutoFocusControlDesktop::initializeStates
+*/
+void CxeAutoFocusControlDesktop::initializeStates()
+{
+}
+
+/*
+* CxeAutoFocusControlDesktop::initializeResources
+*/
+void CxeAutoFocusControlDesktop::initializeResources()
+{
+ CX_DEBUG_ENTER_FUNCTION();
+ CX_DEBUG_EXIT_FUNCTION();
+}
+
+/*!
+ * Public method for checking if auto focus sound is enabled
+ * \return true if enabled
+ */
+bool CxeAutoFocusControlDesktop::isSoundEnabled() const
+{
+ return false; // should actually return mSoundEnabled
+}
+
+// end of file
--- a/camerauis/cameraxui/cxengine/src/cxeautofocuscontrolsymbian.cpp Thu Jul 15 01:55:05 2010 +0300
+++ b/camerauis/cameraxui/cxengine/src/cxeautofocuscontrolsymbian.cpp Fri Jul 23 11:35:41 2010 +0300
@@ -401,10 +401,11 @@
/*
* Image Scene mode changed, get the new autofocus value
*/
-void CxeAutoFocusControlSymbian::handleSceneChanged(CxeScene& scene)
+void CxeAutoFocusControlSymbian::handleSceneChanged(const QVariant& sceneData)
{
CX_DEBUG_ENTER_FUNCTION();
+ CxeScene scene = sceneData.value<CxeScene>();
// whenever scene mode is changed we set the state to unknown
setState(CxeAutoFocusControl::Unknown);
@@ -442,14 +443,14 @@
if (KErrNone == error) {
setState(CxeAutoFocusControl::Ready);
} else {
- setState(CxeAutoFocusControl::Failed, error);
+ setState(CxeAutoFocusControl::Failed, CxeErrorHandlingSymbian::map(error));
}
} else if (eventUid == KUidECamEventCameraSettingFocusRangeUidValue) {
// check for error, we don't need this event for anything else
if (error != KErrNone) {
CX_DEBUG(("CxeAutofocusControlSymbian::handleAfEvent <> "
"KUidECamEventCameraSettingFocusRangeUidValue: autofocus failed %d", error));
- setState(CxeAutoFocusControl::Failed, error);
+ setState(CxeAutoFocusControl::Failed, CxeErrorHandlingSymbian::map(error));
}
}
break;
--- a/camerauis/cameraxui/cxengine/src/cxecameradevice.cpp Thu Jul 15 01:55:05 2010 +0300
+++ b/camerauis/cameraxui/cxengine/src/cxecameradevice.cpp Fri Jul 23 11:35:41 2010 +0300
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+ * Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies).
* All rights reserved.
* This component and the accompanying materials are made available
* under the terms of "Eclipse Public License v1.0"
@@ -16,6 +16,7 @@
*/
#include <ECamOrientationCustomInterface2.h>
#include <ecamfacetrackingcustomapi.h>
+#include <ecamusecasehintcustomapi.h>
#include "cxecameradevice.h"
#include "cxeerrormappingsymbian.h"
@@ -72,6 +73,18 @@
CX_DEBUG_EXIT_FUNCTION();
}
+void CxeCameraDevice::reserveCamera()
+{
+ CX_DEBUG_ENTER_FUNCTION();
+
+ if (mCamera) {
+ emit aboutToReserve();
+ mCamera->Reserve();
+ }
+
+ CX_DEBUG_EXIT_FUNCTION();
+}
+
void CxeCameraDevice::setCamera( CCamera *camera )
{
CX_DEBUG_ENTER_FUNCTION();
@@ -124,6 +137,11 @@
return mFaceTracking;
}
+MCameraUseCaseHint *CxeCameraDevice::useCaseHintApi()
+{
+ return mUseCaseHintApi;
+}
+
CxeError::Id CxeCameraDevice::initResources()
{
CX_DEBUG_ENTER_FUNCTION();
@@ -131,6 +149,8 @@
TInt status = KErrNone;
if (mCamera) {
+ OstTrace0(camerax_performance, CXECAMERADEVICE_EXTENSIONS_1, "msg: e_CX_GET_CCAMERA_EXTENSIONS 1");
+
CX_DEBUG(("Get CCamera extensions.."));
mCameraOrientation = static_cast<MCameraOrientation*>(
@@ -141,6 +161,10 @@
mCamera->CustomInterface(KCameraFaceTrackingUid));
CX_DEBUG(("MCameraFaceTracking interface 0x%08x", mFaceTracking));
+ mUseCaseHintApi = static_cast<MCameraUseCaseHint*>(
+ mCamera->CustomInterface(KCameraUseCaseHintUid));
+ CX_DEBUG(("MCameraUseCaseHint interface 0x%08x", mUseCaseHintApi));
+
TRAPD(errorAdvSet, mAdvancedSettings =
CCamera::CCameraAdvancedSettings::NewL(*mCamera));
CX_DEBUG(("CCameraAdvancedSettings status: %d", errorAdvSet));
@@ -159,6 +183,8 @@
status = errorAdvSet != KErrNone
? errorAdvSet : errorSnap;
CX_DEBUG(("Total status: %d", status));
+
+ OstTrace0(camerax_performance, CXECAMERADEVICE_EXTENSIONS_2, "msg: e_CX_GET_CCAMERA_EXTENSIONS 0");
}
CX_DEBUG_EXIT_FUNCTION();
@@ -172,6 +198,7 @@
// not owned.
mCameraOrientation = NULL;
mFaceTracking = NULL;
+ mUseCaseHintApi = NULL;
delete mCameraSnapshot;
mCameraSnapshot = NULL;
@@ -191,7 +218,7 @@
CxeError::Id CxeCameraDevice::newCamera( Cxe::CameraIndex cameraIndex, MCameraObserver2 *observer )
{
CX_DEBUG_ENTER_FUNCTION();
- OstTrace0(camerax_performance, CXECAMERADEVICE_NEWCAMERA_IN, "msg: e_CX_CAMERADEVICE_CREATE_CCAMERA 1");
+ OstTrace0(camerax_performance, CXECAMERADEVICE_NEWCAMERA_IN, "msg: e_CX_CREATE_CCAMERA 1");
CX_DEBUG(("Cxe: using camera index %d", cameraIndex));
@@ -207,11 +234,12 @@
CX_DEBUG(("CxeCameraDevice::newCamera <> new CCamera"));
#endif
+ OstTrace0(camerax_performance, CXECAMERADEVICE_NEWCAMERA_OUT, "msg: e_CX_CREATE_CCAMERA 0");
+
if (!err) {
setCamera(camera);
}
- OstTrace0(camerax_performance, CXECAMERADEVICE_NEWCAMERA_OUT, "msg: e_CX_CAMERADEVICE_CREATE_CCAMERA 0");
CX_DEBUG_EXIT_FUNCTION();
return CxeErrorHandlingSymbian::map(err);
}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/camerauis/cameraxui/cxengine/src/cxecameradevicecontroldesktop.cpp Fri Jul 23 11:35:41 2010 +0300
@@ -0,0 +1,115 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+#include "cxecameradevicecontroldesktop.h"
+#include "cxeviewfindercontroldesktop.h"
+#include "cxutils.h"
+
+CxeCameraDeviceControlDesktop::CxeCameraDeviceControlDesktop() : mIndex(Cxe::PrimaryCameraIndex), mMode(Cxe::ImageMode), mState(Idle)
+{
+ CX_DEBUG_IN_FUNCTION()
+}
+
+CxeCameraDeviceControlDesktop::~CxeCameraDeviceControlDesktop()
+{
+ CX_DEBUG_IN_FUNCTION()
+}
+
+/**
+ * Get current camera mode.
+ */
+Cxe::CameraMode CxeCameraDeviceControlDesktop::mode() const
+{
+ return mMode;
+}
+/**
+ * Set current camera mode.
+ */
+void CxeCameraDeviceControlDesktop::setMode(Cxe::CameraMode mode)
+{
+ CX_DEBUG_ENTER_FUNCTION();
+ mMode = mode;
+ CX_DEBUG_EXIT_FUNCTION();
+}
+
+void CxeCameraDeviceControlDesktop::init()
+{
+ CX_DEBUG_ENTER_FUNCTION();
+ setState(CxeCameraDeviceControl::Ready);
+ CX_DEBUG_EXIT_FUNCTION();
+}
+
+/**
+ * Reserve camera device for exclusive use.
+ */
+void CxeCameraDeviceControlDesktop::reserve()
+{
+ CX_DEBUG_IN_FUNCTION()
+}
+
+/**
+ * Cancel all operations and release camera for other applications to use.
+ * Camera module is also powered off.
+ */
+void CxeCameraDeviceControlDesktop::release()
+{
+ CX_DEBUG_ENTER_FUNCTION();
+ setState(CxeCameraDeviceControl::Idle);
+ CX_DEBUG_EXIT_FUNCTION();
+}
+
+/**
+ * Get current camera index (primary or secondary).
+ *
+ * @return Current camera index
+ */
+Cxe::CameraIndex CxeCameraDeviceControlDesktop::cameraIndex() const
+{
+ return mIndex;
+}
+
+/**
+ * Switch between primary and secondary camera.
+ *
+ * @param index New camera index
+ */
+CxeError::Id CxeCameraDeviceControlDesktop::switchCamera(Cxe::CameraIndex index)
+{
+ CX_DEBUG_ENTER_FUNCTION();
+ mIndex = index;
+ setState(CxeCameraDeviceControl::Ready);
+ return CxeError::None;
+ CX_DEBUG_EXIT_FUNCTION();
+}
+
+/**
+ * Get current device control state.
+ *
+ * @return Current state
+ */
+CxeCameraDeviceControl::State CxeCameraDeviceControlDesktop::state() const
+{
+ return mState;
+}
+
+void CxeCameraDeviceControlDesktop::setState(CxeCameraDeviceControl::State stateId, CxeError::Id error)
+{
+ CX_DEBUG_ENTER_FUNCTION();
+ mState = stateId;
+ emit stateChanged(mState, error);
+ CX_DEBUG_EXIT_FUNCTION();
+}
+// end of file
--- a/camerauis/cameraxui/cxengine/src/cxecameradevicecontrolsymbian.cpp Thu Jul 15 01:55:05 2010 +0300
+++ b/camerauis/cameraxui/cxengine/src/cxecameradevicecontrolsymbian.cpp Fri Jul 23 11:35:41 2010 +0300
@@ -1,5 +1,5 @@
/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies).
* All rights reserved.
* This component and the accompanying materials are made available
* under the terms of "Eclipse Public License v1.0"
@@ -17,7 +17,6 @@
#include "cxecameradevicecontrolsymbian.h"
#include "cxesettingsimp.h"
#include "cxefeaturemanagerimp.h"
-#include "cxesettingsmodel.h"
#include "cxutils.h"
#include "cxenamespace.h"
#include "cxeerrormappingsymbian.h"
@@ -82,7 +81,7 @@
if (state() == Idle) {
setState(Initializing);
- mCameraDevice->camera()->Reserve();
+ mCameraDevice->reserveCamera();
OstTrace0(camerax_performance, CXECAMERADEVICECONTROLSYMBIAN_RESERVE, "msg: e_CX_RESERVE 1");
} else if (state() == PendingRelease) {
// if we get a reserve request and if there is a pending release
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/camerauis/cameraxui/cxengine/src/cxecameradevicedesktop.cpp Fri Jul 23 11:35:41 2010 +0300
@@ -0,0 +1,126 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#include "cxecameradevicedesktop.h"
+
+#include <QTimer>
+#include <QDir>
+#include "cxutils.h"
+
+
+/*!
+* Constructor
+*/
+CxeCameraDeviceDesktop::CxeCameraDeviceDesktop() :
+ mSwitchPictureTimer(0),
+ mPictureIndex(0)
+{
+ CX_DEBUG_ENTER_FUNCTION();
+ loadPictures();
+ setupTimer();
+ CX_DEBUG_EXIT_FUNCTION();
+}
+
+/*!
+* Destructor
+*/
+CxeCameraDeviceDesktop::~CxeCameraDeviceDesktop()
+{
+ CX_DEBUG_ENTER_FUNCTION();
+ mSwitchPictureTimer->stop();
+ delete mSwitchPictureTimer;
+ CX_DEBUG_EXIT_FUNCTION();
+}
+
+/*!
+* Start the camera device
+*/
+void CxeCameraDeviceDesktop::start()
+{
+ CX_DEBUG_ENTER_FUNCTION();
+ if (!mSwitchPictureTimer->isActive()) {
+ mSwitchPictureTimer->start();
+ CX_DEBUG_EXIT_FUNCTION();
+ }
+}
+
+/*!
+* Stop the camera device
+*/
+void CxeCameraDeviceDesktop::stop()
+{
+ CX_DEBUG_ENTER_FUNCTION();
+ mSwitchPictureTimer->stop();
+ CX_DEBUG_EXIT_FUNCTION();
+}
+
+/*!
+* Get current picture
+* @ Return current picture
+*/
+const QPixmap &CxeCameraDeviceDesktop::currentSnaphot()
+{
+ return mPictureList.at(mPictureIndex);
+}
+
+/*!
+* Handle timeout
+*/
+void CxeCameraDeviceDesktop::handleTimeout()
+{
+ CX_DEBUG_ENTER_FUNCTION();
+ mPictureIndex++;
+
+ if (mPictureIndex >= mPictureList.count()) {
+ mPictureIndex = 0;
+ }
+
+ emit imageChanged(mPictureList.at(mPictureIndex));
+ CX_DEBUG_EXIT_FUNCTION();
+}
+
+/*!
+* Load pictures
+*/
+void CxeCameraDeviceDesktop::loadPictures()
+{
+ CX_DEBUG_ENTER_FUNCTION();
+ QDir currentDir(".","*.jpg");
+
+ if (!currentDir.count()) {
+ mPictureList.append(QPixmap(360, 640));
+ return;
+ }
+
+ foreach (QString entry, currentDir.entryList()){
+ mPictureList.append(QPixmap(entry).scaledToHeight(360));
+ }
+ CX_DEBUG_EXIT_FUNCTION();
+}
+
+/*!
+* Create timer
+*/
+void CxeCameraDeviceDesktop::setupTimer()
+{
+ CX_DEBUG_ENTER_FUNCTION();
+ mSwitchPictureTimer = new QTimer(this);
+ mSwitchPictureTimer->setInterval(500);
+ mSwitchPictureTimer->setSingleShot(false);
+ connect(mSwitchPictureTimer, SIGNAL(timeout()), this, SLOT(handleTimeout()));
+ CX_DEBUG_EXIT_FUNCTION();
+}
--- a/camerauis/cameraxui/cxengine/src/cxeengine.cpp Thu Jul 15 01:55:05 2010 +0300
+++ b/camerauis/cameraxui/cxengine/src/cxeengine.cpp Fri Jul 23 11:35:41 2010 +0300
@@ -1,5 +1,5 @@
/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies).
* All rights reserved.
* This component and the accompanying materials are made available
* under the terms of "Eclipse Public License v1.0"
@@ -17,15 +17,23 @@
#include "cxutils.h"
#include "cxeengine.h"
+#ifdef Q_OS_SYMBIAN
#include "cxeenginesymbian.h"
-
+#else
+#include "cxeenginedesktop.h"
+#endif
// This should be the only exported method
-EXPORT_C CxeEngine* CxeEngine::createEngine()
+CAMERAX_ENGINE_EXPORT CxeEngine* CxeEngine::createEngine()
{
CX_DEBUG_ENTER_FUNCTION();
+#ifdef Q_OS_SYMBIAN
CxeEngineSymbian *res = new CxeEngineSymbian();
+#else // Q_OS_SYMBIAN
+ CxeEngineDesktop *res = new CxeEngineDesktop();
+#endif // Q_OS_SYMBIAN
+
res->construct();
CX_DEBUG_EXIT_FUNCTION();
return res;
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/camerauis/cameraxui/cxengine/src/cxeenginedesktop.cpp Fri Jul 23 11:35:41 2010 +0300
@@ -0,0 +1,356 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+#include "cxeenginedesktop.h"
+#include "cxecameradevicecontroldesktop.h"
+#include "cxestillcapturecontroldesktop.h"
+#include "cxevideocapturecontroldesktop.h"
+#include "cxeviewfindercontroldesktop.h"
+#include "cxefilenamegeneratordesktop.h"
+#include "cxeautofocuscontroldesktop.h"
+#include "cxezoomcontroldesktop.h"
+#include "cxequalitypresetsdesktop.h"
+#include "cxutils.h"
+#include "cxesettingsimp.h"
+#include "cxefeaturemanagerimp.h"
+#include "cxesettingsstoredesktop.h"
+#include "cxesensoreventhandlerdesktop.h"
+#include "cxefilesavethreaddesktop.h"
+#include "cxecameradevicedesktop.h"
+#include "cxememorymonitor.h"
+#include "cxegeotaggingtrail.h"
+
+
+// Member Functions
+
+CxeEngineDesktop::CxeEngineDesktop()
+ : mCameraDeviceControl(NULL),
+ mViewfinderControl(NULL),
+ mSnapshotControl(NULL),
+ mStillCaptureControl(NULL),
+ mVideoCaptureControl(NULL),
+ mAutoFocusControl(NULL),
+ mZoomControl(NULL),
+ mImageDataQueue(NULL),
+ mSettings(NULL),
+ mFeatureManager(NULL),
+ mFilenameGenerator(NULL),
+ mSensorEventHandler(NULL),
+ mQualityPresets(NULL),
+ mFileSaveThread(NULL),
+ mCameraDevice(NULL),
+ mDiskMonitor(NULL),
+ mMemoryMonitor(NULL),
+ mGeoTaggingTrail(NULL)
+{
+ CX_DEBUG_IN_FUNCTION();
+}
+
+
+/*!
+ Create all control classes and connect relevant signals
+*/
+void CxeEngineDesktop::construct()
+{
+ CX_DEBUG_ENTER_FUNCTION();
+
+ createControls();
+ connectSignals();
+
+ CX_DEBUG_EXIT_FUNCTION();
+}
+
+
+/*!
+ Create all control classes
+*/
+void CxeEngineDesktop::createControls()
+{
+ CX_DEBUG_ENTER_FUNCTION();
+
+ if (!mVideoCaptureControl) {
+ CxeCameraDeviceControlDesktop *deviceControl =
+ new CxeCameraDeviceControlDesktop();
+
+ mCameraDeviceControl = deviceControl;
+
+ mQualityPresets = new CxeQualityPresetsDesktop();
+ CX_DEBUG_ASSERT(mQualityPresets);
+
+ CxeSettingsStoreDesktop *settingsStore = new CxeSettingsStoreDesktop();
+
+ //ownership of settings store transferred to the settings.
+ mSettings = new CxeSettingsImp(settingsStore);
+
+ // Loading current camera mode value from settings store and updating
+ // devicecontrol
+ Cxe::CameraMode cameraMode = mSettings->get<Cxe::CameraMode>(CxeSettingIds::CAMERA_MODE, Cxe::ImageMode);
+ // set current camera mode to devicecontrol.
+ mCameraDeviceControl->setMode(cameraMode);
+
+ static_cast<CxeSettingsImp*>(mSettings)->loadSettings(mode());
+
+ mFeatureManager = new CxeFeatureManagerImp(*mSettings);
+
+ mMemoryMonitor = new CxeMemoryMonitor(*mFeatureManager);
+
+ // sensor event handler initialization
+ mSensorEventHandler = new CxeSensorEventHandlerDesktop();
+
+ mFilenameGenerator = new CxeFilenameGeneratorDesktop();
+
+ mFileSaveThread = new CxeFileSaveThreadDesktop(this);
+
+ mCameraDevice = new CxeCameraDeviceDesktop();
+
+ mViewfinderControl = new CxeViewfinderControlDesktop(*mCameraDevice);
+
+ mAutoFocusControl = new CxeAutoFocusControlDesktop();
+
+ mStillCaptureControl = new CxeStillCaptureControlDesktop(
+ *mCameraDevice, *mViewfinderControl,
+ *mCameraDeviceControl, *mFilenameGenerator,
+ *mAutoFocusControl, *mFileSaveThread);
+
+ mZoomControl = new CxeZoomControlDesktop(*mCameraDeviceControl);
+
+ mVideoCaptureControl = new CxeVideoCaptureControlDesktop(
+ *mCameraDevice,*mViewfinderControl,
+ *mCameraDeviceControl, *mFilenameGenerator,
+ *mQualityPresets);
+
+ mGeoTaggingTrail = new CxeGeoTaggingTrail(*mStillCaptureControl,
+ *mVideoCaptureControl, *mSettings);
+ }
+
+ CX_DEBUG_EXIT_FUNCTION();
+}
+
+/*!
+ Connect internal signals for control classes
+*/
+
+void CxeEngineDesktop::connectSignals()
+{
+ CX_DEBUG_ENTER_FUNCTION();
+
+ // connecting scene setting change callbacks to ViewfinderControl
+ connect(mSettings,
+ SIGNAL(settingValueChanged(const QString&,QVariant)),
+ mViewfinderControl,
+ SLOT(handleSettingValueChanged(const QString&,QVariant)));
+
+ connect(mSettings,
+ SIGNAL(sceneChanged(CxeScene&)),
+ mViewfinderControl,
+ SLOT(handleSceneChanged(CxeScene&)));
+
+ // enabling scene setting change callbacks to Autofocus control
+ connect(mSettings,
+ SIGNAL(sceneChanged(CxeScene&)),
+ mAutoFocusControl,
+ SLOT(handleSceneChanged(CxeScene&)));
+
+ // connecting Autofocus state change callbacks to stillcapturecontrol
+ connect(mAutoFocusControl,
+ SIGNAL(stateChanged(CxeAutoFocusControl::State, CxeError::Id)),
+ mStillCaptureControl,
+ SLOT(handleAutofocusStateChanged(CxeAutoFocusControl::State,CxeError::Id)));
+
+ // Connect signals for ECam events
+ connect(mCameraDeviceControl,
+ SIGNAL(cameraEvent(int,int)),
+ mVideoCaptureControl,
+ SLOT(handleCameraEvent(int,int)));
+
+ connect(mCameraDeviceControl,
+ SIGNAL(cameraEvent(int,int)),
+ mAutoFocusControl,
+ SLOT(handleCameraEvent(int,int)));
+
+ // Connect signal for device ready events
+ connect(mCameraDeviceControl,
+ SIGNAL(deviceReady()),
+ this,
+ SLOT(doInit()));
+
+ // Connect image and video init complete signals to
+ // CameraDeviceControl initModeComplete
+ connect(mStillCaptureControl,
+ SIGNAL(imagePrepareComplete(CxeError::Id)),
+ mCameraDeviceControl,
+ SIGNAL(initModeComplete(CxeError::Id)));
+
+ connect(mVideoCaptureControl,
+ SIGNAL(videoPrepareComplete(CxeError::Id)),
+ mCameraDeviceControl,
+ SIGNAL(initModeComplete(CxeError::Id)));
+
+ // Zoom is prepared once the image/video emits prepare zoom signals
+ connect(mStillCaptureControl,
+ SIGNAL(prepareZoomForStill(int)),
+ mZoomControl,
+ SLOT(prepareZoomForStill(int)));
+
+ connect(mVideoCaptureControl,
+ SIGNAL(prepareZoomForVideo()),
+ mZoomControl,
+ SLOT(prepareZoomForVideo()));
+
+ // connect camera device control prepare for release signal to stop location trail slot
+ connect(mCameraDevice,
+ SIGNAL(prepareForRelease()),
+ mGeoTaggingTrail,
+ SLOT(stop()), Qt::UniqueConnection);
+
+ // init camera device control. We init the camera device control
+ // when all necessary engine classes are constructed.
+ mCameraDeviceControl->init();
+
+ CX_DEBUG_EXIT_FUNCTION();
+}
+
+CxeEngineDesktop::~CxeEngineDesktop()
+{
+ CX_DEBUG_ENTER_FUNCTION();
+
+ delete mGeoTaggingTrail;
+ delete mAutoFocusControl;
+ delete mZoomControl;
+ delete mStillCaptureControl;
+ delete mVideoCaptureControl;
+ delete mViewfinderControl;
+ delete mFilenameGenerator;
+ delete mMemoryMonitor;
+ delete mFeatureManager;
+ delete mSettings;
+ delete mCameraDeviceControl;
+ delete mQualityPresets;
+ delete mCameraDevice;
+ CX_DEBUG_EXIT_FUNCTION();
+}
+
+CxeCameraDeviceControl &CxeEngineDesktop::cameraDeviceControl()
+{
+ return *mCameraDeviceControl;
+}
+
+CxeViewfinderControl &CxeEngineDesktop::viewfinderControl()
+{
+ return *mViewfinderControl;
+}
+
+CxeSnapshotControl &CxeEngineDesktop::snapshotControl()
+{
+ return *mSnapshotControl;
+}
+
+CxeStillCaptureControl &CxeEngineDesktop::stillCaptureControl()
+{
+ return *mStillCaptureControl;
+}
+
+CxeVideoCaptureControl &CxeEngineDesktop::videoCaptureControl()
+{
+ return *mVideoCaptureControl;
+}
+
+CxeAutoFocusControl &CxeEngineDesktop::autoFocusControl()
+{
+ return *mAutoFocusControl;
+}
+
+CxeZoomControl &CxeEngineDesktop::zoomControl()
+{
+ return *mZoomControl;
+}
+
+// Get the settings handle
+CxeSettings &CxeEngineDesktop::settings()
+{
+ return *mSettings;
+}
+
+CxeFeatureManager& CxeEngineDesktop::featureManager()
+{
+ return *mFeatureManager;
+}
+
+/*
+* Returns true, if the engine is ready or else false.
+*/
+bool CxeEngineDesktop::isEngineReady()
+{
+ bool ready = true;
+ return ready;
+}
+
+/*!
+* Get memory monitor utility handle.
+*/
+CxeMemoryMonitor &CxeEngineDesktop::memoryMonitor()
+{
+ return *mMemoryMonitor;
+}
+
+/*!
+ * Get geotaggingtrail handle
+ */
+CxeGeoTaggingTrail &CxeEngineDesktop::geoTaggingTrail()
+{
+ return *mGeoTaggingTrail;
+}
+
+Cxe::CameraMode CxeEngineDesktop::mode() const
+{
+ return mCameraDeviceControl->mode();
+}
+
+/*!
+ * Set camera mode.
+ */
+void CxeEngineDesktop::setMode(Cxe::CameraMode mode)
+{
+ CX_DEBUG_ENTER_FUNCTION();
+ mCameraDeviceControl->setMode(mode);
+ CX_DEBUG_EXIT_FUNCTION();
+}
+
+void CxeEngineDesktop::initMode(Cxe::CameraMode cameraMode)
+{
+ CX_DEBUG_ENTER_FUNCTION();
+
+ mCameraDeviceControl->setMode(cameraMode);
+
+ // load settings whenever we change mode or start camera or switch camera
+ CxeSettingsImp *settingsImp = qobject_cast<CxeSettingsImp*>(mSettings);
+ if (settingsImp) {
+ settingsImp->loadSettings(mode());
+ }
+
+ if (cameraMode == Cxe::ImageMode) {
+ mVideoCaptureControl->deinit();
+ mStillCaptureControl->init();
+ } else {
+ mStillCaptureControl->deinit();
+ mVideoCaptureControl->init();
+ }
+ mFilenameGenerator->init(cameraMode);
+
+ CX_DEBUG_EXIT_FUNCTION();
+}
+
+// End of file
--- a/camerauis/cameraxui/cxengine/src/cxeenginesymbian.cpp Thu Jul 15 01:55:05 2010 +0300
+++ b/camerauis/cameraxui/cxengine/src/cxeenginesymbian.cpp Fri Jul 23 11:35:41 2010 +0300
@@ -31,7 +31,6 @@
#include "cxutils.h"
#include "cxesettingsimp.h"
#include "cxefeaturemanagerimp.h"
-#include "cxesettingsmodelimp.h"
#include "cxesettingscenrepstore.h"
#include "cxesoundplayersymbian.h"
#include "cxesensoreventhandlersymbian.h"
@@ -40,6 +39,7 @@
#include "cxememorymonitor.h"
#include "cxediskmonitor.h"
#include "cxegeotaggingtrail.h"
+#include "cxeexception.h"
#include "OstTraceDefinitions.h"
#ifdef OST_TRACE_COMPILER_IN_USE
@@ -61,7 +61,6 @@
mZoomControl(NULL),
mSettings(NULL),
mFeatureManager(NULL),
- mSettingsModel(NULL),
mFilenameGenerator(NULL),
mSensorEventHandler(NULL),
mQualityPresets(NULL),
@@ -97,7 +96,7 @@
CX_DEBUG_ENTER_FUNCTION();
// Check we do this only once.
- if (!mSettingsModel) {
+ if (!mSettings) {
OstTrace0(camerax_performance, CXEENGINESYMBIAN_CREATECONTROLS_IN, "msg: e_CX_ENGINE_CREATE_CONTROLS 1");
CxeCameraDeviceControlSymbian *deviceControl = new CxeCameraDeviceControlSymbian();
@@ -115,21 +114,20 @@
} else {
settingsStore = new CxeSettingsCenRepStore();
}
- //ownership of settings store transferred to the settings model.
- mSettingsModel = new CxeSettingsModelImp(settingsStore);
- // assert if settings model fails to intialize
- CX_DEBUG_ASSERT(mSettingsModel);
- mSettings = new CxeSettingsImp(*mSettingsModel);
+ //ownership of settings store transferred to the settings
+ mSettings = new CxeSettingsImp(settingsStore);
// Loading current camera mode value from settings store and updating
// devicecontrol
Cxe::CameraMode cameraMode = Cxe::ImageMode;
- int value;
- CxeError::Id err = mSettings->get(CxeSettingIds::CAMERA_MODE, value);
- if (!err) {
- cameraMode = static_cast<Cxe::CameraMode>(value);
+
+ try {
+ cameraMode = mSettings->get<Cxe::CameraMode>(CxeSettingIds::CAMERA_MODE);
+ } catch (CxeException &e) {
+ CX_DEBUG(("Failed to read camera mode from settings, using image mode. Error code: %d", e.error()));
}
+
// set current camera mode to devicecontrol.
mCameraDeviceControl->setMode(cameraMode);
@@ -141,7 +139,7 @@
connect(settingsStore, SIGNAL(settingValueChanged(long int, unsigned long int, QVariant)),
mSettings, SIGNAL(settingValueChanged(long int, unsigned long int, QVariant)));
- mFeatureManager = new CxeFeatureManagerImp(*mSettingsModel);
+ mFeatureManager = new CxeFeatureManagerImp(*mSettings);
// Memory monitor needed as early as possible to request free memory.
// Note: Throws error if enough memory cannot be freed!
@@ -201,10 +199,8 @@
OstTrace0(camerax_performance, CXEENGINESYMBIAN_CONNECTSIGNALS_IN, "msg: e_CX_ENGINE_CONNECT_SIGNALS 1");
// enabling scene setting change callbacks to Autofocus control
- connect(mSettings,
- SIGNAL(sceneChanged(CxeScene&)),
- mAutoFocusControl,
- SLOT(handleSceneChanged(CxeScene&)));
+ mSettings->listenForSetting(CxeSettingIds::IMAGE_SCENE_DATA, mAutoFocusControl, SLOT(handleSceneChanged(const QVariant&)));
+ mSettings->listenForSetting(CxeSettingIds::VIDEO_SCENE_DATA, mAutoFocusControl, SLOT(handleSceneChanged(const QVariant&)));
// connecting Autofocus state change callbacks to stillcapturecontrol
connect(mAutoFocusControl,
@@ -272,7 +268,6 @@
mFileSaveThread,
SLOT(handleSnapshotReady(CxeError::Id, const QImage&, const QString&)));
-
// stop location trail when releasing camera.
connect(mCameraDevice,
SIGNAL(prepareForRelease()),
@@ -280,6 +275,29 @@
SLOT(stop()),
Qt::UniqueConnection);
+ // Use MCameraUseCaseHint API before calling Reserve()
+ connect(mCameraDevice,
+ SIGNAL(aboutToReserve()),
+ mStillCaptureControl,
+ SLOT(hintUseCase()),
+ Qt::UniqueConnection);
+ connect(mCameraDevice,
+ SIGNAL(aboutToReserve()),
+ mVideoCaptureControl,
+ SLOT(hintUseCase()),
+ Qt::UniqueConnection);
+
+ // Start / stop geotagging based on mode.
+ // Do this later to reduce startup time.
+ connect(mStillCaptureControl,
+ SIGNAL(imagePrepareComplete(CxeError::Id)),
+ this,
+ SLOT(initGeotagging()));
+ connect(mVideoCaptureControl,
+ SIGNAL(videoPrepareComplete(CxeError::Id)),
+ this,
+ SLOT(initGeotagging()));
+
OstTrace0(camerax_performance, CXEENGINESYMBIAN_CONNECTSIGNALS_OUT, "msg: e_CX_ENGINE_CONNECT_SIGNALS 0");
CX_DEBUG_EXIT_FUNCTION();
@@ -305,7 +323,6 @@
delete mMemoryMonitor;
delete mFeatureManager;
delete mSettings;
- delete mSettingsModel;
delete mCameraDeviceControl;
delete mQualityPresets;
delete mFileSaveThread;
@@ -425,16 +442,10 @@
}
if (mode() == Cxe::ImageMode) {
- // start geotagging trail in image mode.
- startGeotaggingTrail();
mVideoCaptureControl->deinit();
mStillCaptureControl->init();
} else if (mode() == Cxe::VideoMode) {
mStillCaptureControl->deinit();
- if (mGeoTaggingTrail) {
- // in video mode, Geotagging is not supported for now.
- mGeoTaggingTrail->stop();
- }
mVideoCaptureControl->init();
}
@@ -585,6 +596,7 @@
void CxeEngineSymbian::reserve()
{
CX_DEBUG_ENTER_FUNCTION();
+ // Start reserving camera HW.
mCameraDeviceControl->reserve();
emit reserveStarted();
CX_DEBUG_EXIT_FUNCTION();
@@ -599,8 +611,11 @@
CX_DEBUG_ENTER_FUNCTION();
if (mCameraDeviceControl && mSettings) {
- int value = mCameraDeviceControl->mode();
- mSettings->set(CxeSettingIds::CAMERA_MODE, value);
+ try {
+ mSettings->set(CxeSettingIds::CAMERA_MODE, mCameraDeviceControl->mode());
+ } catch (CxeException &e) {
+ CX_DEBUG(("Failed to save camera mode, error=%d", e.error()));
+ }
}
CX_DEBUG_EXIT_FUNCTION();
@@ -608,21 +623,28 @@
/*!
-* Start geotagging trail.
+* Initialize geotagging.
+* Check if we are allowed to start the geotagging and if it's supported in current mode.
*/
-void CxeEngineSymbian::startGeotaggingTrail()
+void CxeEngineSymbian::initGeotagging()
{
CX_DEBUG_ENTER_FUNCTION();
OstTrace0(camerax_performance, CXEENGINE_START_GEO_IN, "msg: e_CX_ENGINE_START_GEOTAGGING 1");
if (mGeoTaggingTrail && mSettings) {
- // location trail is limited to image mode only for now.
- int value = Cxe::GeoTaggingDisclaimerDisabled;
- mSettings->get(CxeSettingIds::GEOTAGGING_DISCLAIMER, value);
+ if (mode() == Cxe::ImageMode) {
+ // Location trail is limited to image mode only for now.
+ Cxe::GeoTaggingDisclaimer value =
+ mSettings->get<Cxe::GeoTaggingDisclaimer>(
+ CxeSettingIds::GEOTAGGING_DISCLAIMER, Cxe::GeoTaggingDisclaimerDisabled);
- // we start location trail only when Geotagging First-time-use note is accepted by user.
- if (value == Cxe::GeoTaggingDisclaimerDisabled) {
- mGeoTaggingTrail->start();
+ // we start location trail only when Geotagging First-time-use note is accepted by user.
+ if (value == Cxe::GeoTaggingDisclaimerDisabled) {
+ mGeoTaggingTrail->start();
+ }
+ } else {
+ // Geotagging is not (yet) supported in video mode.
+ mGeoTaggingTrail->stop();
}
}
--- a/camerauis/cameraxui/cxengine/src/cxefeaturemanagerimp.cpp Thu Jul 15 01:55:05 2010 +0300
+++ b/camerauis/cameraxui/cxengine/src/cxefeaturemanagerimp.cpp Fri Jul 23 11:35:41 2010 +0300
@@ -1,5 +1,5 @@
/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies).
* All rights reserved.
* This component and the accompanying materials are made available
* under the terms of "Eclipse Public License v1.0"
@@ -23,21 +23,24 @@
#include <QList>
#include <QMetaType>
-#include "cxesettingsmodel.h"
+#include "cxesettings.h"
#include "cxefeaturemanagerimp.h"
#include "cxutils.h"
#include "cxeerror.h"
-/*
-* CxeFeatureManagerImp::isFeatureSupported
+/*!
+* Returns if a feature is supported or not
+* @param key Feature key
+* @param supported Returned boolean to indicate whether feature is supported or not
+* @return Error code
*/
CxeError::Id CxeFeatureManagerImp::isFeatureSupported(const QString& key, bool& supported) const
{
CX_DEBUG_ENTER_FUNCTION();
QVariant value;
- CxeError::Id err = mSettingsModel.getRuntimeValue(key, value);
+ CxeError::Id err = mSettings.getVariationValue(key, value);
if (err == CxeError::None) {
QList<QVariant> values = qVariantValue<QList<QVariant> >(value);
supported = values[0].toInt();
@@ -52,8 +55,11 @@
-/*
-* CxeFeatureManagerImp::configuredValues
+/*!
+* Retrieves all the configured values for the given key
+* @param key Feature key
+* @param values Returned values
+* @return Error code
*/
CxeError::Id CxeFeatureManagerImp::configuredValues(const QString& key,QList<int>& values)
{
@@ -62,7 +68,7 @@
values.clear();
QVariant variant;
- CxeError::Id err = mSettingsModel.getRuntimeValue(key, variant);
+ CxeError::Id err = mSettings.getVariationValue(key, variant);
if(CxeError::None == err) {
QVariantList list;
@@ -94,8 +100,8 @@
/*
*CxeFeatureManagerImp::CxeFeatureManagerImp
*/
-CxeFeatureManagerImp::CxeFeatureManagerImp(CxeSettingsModel& settingsModel)
-: mSettingsModel(settingsModel)
+CxeFeatureManagerImp::CxeFeatureManagerImp(CxeSettings &settings)
+: mSettings(settings)
{
CX_DEBUG_ENTER_FUNCTION();
CX_DEBUG_EXIT_FUNCTION();
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/camerauis/cameraxui/cxengine/src/cxefilenamegeneratordesktop.cpp Fri Jul 23 11:35:41 2010 +0300
@@ -0,0 +1,138 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#include "cxefilenamegeneratordesktop.h"
+
+#include <QDate>
+#include <qdebug.h>
+
+#ifdef Q_OS_WIN32
+const char* IMAGE_BASE_FOLDER = "C:\\Users\\My Pictures\\CameraX";
+const char* VIDEO_BASE_FOLDER = "C:\\Users\\My Videos\\CameraX";
+const char* IMAGE_EXTENSION = "jpg";
+const char* VIDEO_EXTENSION = "mp4";
+const char* FOLDER_SEPARATOR = "\\";
+const char* FILE_SUFFIX = ".";
+#else
+const char* IMAGE_BASE_FOLDER = "";
+const char* VIDEO_BASE_FOLDER = "";
+const char* IMAGE_EXTENSION = "";
+const char* VIDEO_EXTENSION = "";
+const char* FOLDER_SEPARATOR = "/";
+const char* FILE_SUFFIX = ".";
+#endif
+
+CxeFilenameGeneratorDesktop::CxeFilenameGeneratorDesktop() : mMode(Cxe::ImageMode),
+ mImageBaseFolder(IMAGE_BASE_FOLDER),
+ mVideoBaseFolder(VIDEO_BASE_FOLDER),
+ mImageExtension(IMAGE_EXTENSION),
+ mVideoExtension(VIDEO_EXTENSION),
+ mImageSequenceNumber(0),
+ mVideoSequenceNumber(0)
+{
+
+}
+
+CxeFilenameGeneratorDesktop::~CxeFilenameGeneratorDesktop()
+{
+
+}
+
+/**
+ * Initialize the file name generator for the given mode.
+ * @param mode: current camera mode (image/video)
+ * @return error id, Id::None if no error
+ */
+CxeError::Id CxeFilenameGeneratorDesktop::init(Cxe::CameraMode mode)
+{
+ mMode = mode;
+ return CxeError::None;
+}
+
+/**
+ * This must be called for every burst capture.
+ */
+void CxeFilenameGeneratorDesktop::startNewImageFilenameSequence()
+{
+ mImageSequenceNumber = 0;
+}
+
+/**
+ * Generates the next file name in the sequence.
+ * @param filename: A QString reference to hold the filename
+ * @return error id, Id::None if no error
+ */
+CxeError::Id CxeFilenameGeneratorDesktop::nextImageFilenameInSequence(QString &filename, const QString &fileExt)
+{
+ mImageExtension = fileExt;
+ getNextImageFilename(filename);
+ raiseCounterValue();
+ return CxeError::None;
+}
+
+/**
+ * Generates image/video file name depending on the current active mode.
+ * @param filename: A QString reference to hold the filename
+ * @return error id, CxeError::None if no error.
+ */
+CxeError::Id CxeFilenameGeneratorDesktop::generateFilename(QString &filename, const QString &fileExt)
+{
+ mImageExtension = fileExt;
+ if (Cxe::ImageMode == mMode) {
+ nextImageFilenameInSequence(filename, fileExt);
+ } else {
+ getNextVideoFilename(filename);
+ }
+
+ return CxeError::None;
+}
+
+void CxeFilenameGeneratorDesktop::getNextImageFilename(QString& filename)
+{
+ filename = assembleFilename(mImageBaseFolder, mImageSequenceNumber, mImageExtension);
+ return;
+}
+
+void CxeFilenameGeneratorDesktop::getNextVideoFilename(QString &filename)
+{
+ filename = assembleFilename(mVideoBaseFolder, mVideoSequenceNumber, mVideoExtension);
+ return;
+}
+
+QString CxeFilenameGeneratorDesktop::assembleFilename(const QString& baseFolder, int sequenceNumber, const QString &extension)
+{
+ QString fileName;
+ QDate current = QDate::currentDate();
+
+ fileName = QString("%1%2").arg(current.toString("yyyyMM")).arg(sequenceNumber,3,16,QLatin1Char('0'));
+
+ QString assembledName = baseFolder + FOLDER_SEPARATOR + fileName + FILE_SUFFIX + extension;
+
+ return assembledName;
+}
+
+/**
+ * Raises file number counter value by one
+ */
+void CxeFilenameGeneratorDesktop::raiseCounterValue()
+{
+ if (Cxe::ImageMode == mMode) {
+ mImageSequenceNumber++;
+ } else {
+ mVideoSequenceNumber++;
+ }
+}
--- a/camerauis/cameraxui/cxengine/src/cxefilenamegeneratorsymbian.cpp Thu Jul 15 01:55:05 2010 +0300
+++ b/camerauis/cameraxui/cxengine/src/cxefilenamegeneratorsymbian.cpp Fri Jul 23 11:35:41 2010 +0300
@@ -1,5 +1,5 @@
/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies).
* All rights reserved.
* This component and the accompanying materials are made available
* under the terms of "Eclipse Public License v1.0"
@@ -94,9 +94,9 @@
mVideoCounter = 0;
// Retrieve last used counter values from settings
- mSettings.get(CxeSettingIds::FNAME_MONTH_FOLDER, mCurrentMonth);
- mSettings.get(CxeSettingIds::FNAME_IMAGE_COUNTER, mImageCounter);
- mSettings.get(CxeSettingIds::FNAME_VIDEO_COUNTER, mVideoCounter);
+ mCurrentMonth = mSettings.get<QString>(CxeSettingIds::FNAME_MONTH_FOLDER, "");
+ mImageCounter = mSettings.get<int>(CxeSettingIds::FNAME_IMAGE_COUNTER, 0);
+ mVideoCounter = mSettings.get<int>(CxeSettingIds::FNAME_VIDEO_COUNTER, 0);
OstTrace0(camerax_performance, CXEFILENAMEGENERATOR_2, "msg: e_CX_FILENAMEGENERATOR_NEW 0");
CX_DEBUG_EXIT_FUNCTION();
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/camerauis/cameraxui/cxengine/src/cxefilesavethreaddesktop.cpp Fri Jul 23 11:35:41 2010 +0300
@@ -0,0 +1,144 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+#include "cxefilesavethreaddesktop.h"
+#include "cxeimagedataitem.h" // item
+#include "cxutils.h" // debug
+
+/*!
+ \class CxeFileSaveThreadDesktop
+ \brief Still image saving thread
+*/
+
+
+// ======== MEMBER FUNCTIONS ========
+
+CxeFileSaveThreadDesktop::CxeFileSaveThreadDesktop(QObject *parent)
+ : CxeFileSaveThread(parent), mExitThread(false), mExit(false)
+{
+ start(IdlePriority);
+}
+
+CxeFileSaveThreadDesktop::~CxeFileSaveThreadDesktop()
+{
+ CX_DEBUG_ENTER_FUNCTION();
+ mMutex.lock();
+ mExitThread = true;
+ mDataToSave.wakeOne();
+ mMutex.unlock();
+
+ wait(); // until the thread has finished execution.
+ qDeleteAll(mDataList); // Ensure destruction
+ mDataList.clear();
+ CX_DEBUG_EXIT_FUNCTION();
+}
+
+void CxeFileSaveThreadDesktop::save(CxeImageDataItem *data)
+{
+ CX_DEBUG_ENTER_FUNCTION();
+
+ // Ensure safe data adding.
+ // Saving thread will wait if needed, in read method, until mutex is unlocked
+ mMutex.lock();
+ mDataList.append(data);
+ // Wake up saving thread if it's sleeping
+ mDataToSave.wakeOne();
+ mMutex.unlock();
+
+ CX_DEBUG_EXIT_FUNCTION();
+}
+
+void CxeFileSaveThreadDesktop::handleVideoSaved(CxeError::Id status, const QString &filename)
+{
+ Q_UNUSED(status);
+ Q_UNUSED(filename);
+}
+
+void CxeFileSaveThreadDesktop::handleSnapshotReady(CxeError::Id status, const QImage &snapshot, const QString &filename)
+{
+ Q_UNUSED(status);
+ Q_UNUSED(snapshot);
+ Q_UNUSED(filename);
+}
+
+void CxeFileSaveThreadDesktop::handleSnapshotReady(CxeError::Id status, const QImage &snapshot, int id)
+{
+ Q_UNUSED(status);
+ Q_UNUSED(snapshot);
+ Q_UNUSED(id);
+}
+
+void CxeFileSaveThreadDesktop::read()
+{
+ mMutex.lock();
+ mCount = mDataList.count();
+ mExit = mExitThread;
+ mMutex.unlock();
+}
+
+void CxeFileSaveThreadDesktop::run()
+{
+ CX_DEBUG_ENTER_FUNCTION();
+
+ CxeImageDataItem *item = NULL;
+ int i = 0;
+ // Check if there is data to save.
+ // There should not be any, because the thread is just contructed
+ read();
+
+ while (!mExit || i < mCount) { // Complete save before exit
+ CX_DEBUG(("CxeFileSaveThreadDesktop: index %d", i));
+ // Wait data
+ if (!mExit && i >= mCount) {
+ // If there isn't any data to save, put the thread sleeping
+ CX_DEBUG(("CxeFileSaveThreadDesktop: set thread sleeping"));
+ mMutex.lock();
+ //! @todo: read datalist count here before clearing, because there is some machine cycles after previous read
+ // Clear the datalist, since all items are saved
+ mDataList.clear();
+ i = 0;
+ mDataToSave.wait(&mMutex); // waiting "wakeOne"
+ mMutex.unlock();
+ CX_DEBUG(("CxeFileSaveThreadDesktop: woken up"));
+ }
+
+ // There should be data now, because the thread is woken up
+ read();
+
+ if (i < mCount) {
+ item = mDataList[i];
+ } else {
+ CX_DEBUG(("CxeFileSaveThreadDesktop: ERROR - woke up without data"));
+ continue;
+ }
+
+ // Check that item is not saved already
+ if (item && item->state() == CxeImageDataItem::SavePending) {
+ item->save();// Error ignored since it is emitted from CxeImageDataItemSymbian
+ // Delete item, since we own it
+ delete item;
+ item = NULL;
+ }
+
+ // Saving takes some seconds, there might be new data available.
+ read();
+ ++i;
+ }
+
+ CX_DEBUG_EXIT_FUNCTION();
+}
--- a/camerauis/cameraxui/cxengine/src/cxegeotaggingtrail.cpp Thu Jul 15 01:55:05 2010 +0300
+++ b/camerauis/cameraxui/cxengine/src/cxegeotaggingtrail.cpp Fri Jul 23 11:35:41 2010 +0300
@@ -1,5 +1,5 @@
/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies).
* All rights reserved.
* This component and the accompanying materials are made available
* under the terms of "Eclipse Public License v1.0"
@@ -17,7 +17,11 @@
#include "cxutils.h"
#include "cxegeotaggingtrail.h"
-#include "cxegeotaggingtrailprivate.h"
+#ifdef Q_OS_SYMBIAN
+#include "cxegeotaggingtrail_symbian_p.h"
+#else
+#include "cxegeotaggingtrail_desktop_p.h"
+#endif // ifdef Q_OS_SYMBIAN
/*!
* Constructor
@@ -33,7 +37,6 @@
Qt::UniqueConnection);
}
-
/*!
* Destructor
*/
@@ -60,8 +63,6 @@
d->stop();
}
-
-
/*!
* Returns current state of Geo-tagging trail.
*/
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/camerauis/cameraxui/cxengine/src/cxegeotaggingtrail_desktop_p.cpp Fri Jul 23 11:35:41 2010 +0300
@@ -0,0 +1,160 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#include "cxutils.h"
+#include "cxestate.h"
+#include "cxesettings.h"
+#include "cxenamespace.h"
+#include "cxestillcapturecontrol.h"
+#include "cxevideocapturecontrol.h"
+#include "cxegeotaggingtrail_desktop_p.h"
+
+
+namespace
+{
+ // in milliseconds
+ const int STOP_TRAIL_INTERVAL = 10*1000;
+}
+
+
+/*!
+* Constructor
+*/
+CxeGeoTaggingTrailPrivate::CxeGeoTaggingTrailPrivate(CxeStillCaptureControl &stillControl,
+ CxeVideoCaptureControl &videoControl,
+ CxeSettings &settings)
+ : CxeStateMachine("CxeGeoTaggingTrailPrivate"),
+ mSettings(settings)
+{
+ CX_DEBUG_ENTER_FUNCTION();
+ Q_UNUSED(stillControl);
+ Q_UNUSED(videoControl);
+
+ qRegisterMetaType<CxeGeoTaggingTrail::State>();
+ initializeStates();
+
+ connect(&mSettings, SIGNAL(settingValueChanged(const QString&,QVariant)),
+ this, SLOT(handleSettingValueChanged(const QString&,QVariant)));
+
+ CX_DEBUG_EXIT_FUNCTION();
+}
+
+/*!
+* Destructor
+*/
+CxeGeoTaggingTrailPrivate::~CxeGeoTaggingTrailPrivate()
+{
+ CX_DEBUG_ENTER_FUNCTION();
+
+ // stop trail and close location utility session
+ stop(true);
+
+ CX_DEBUG_EXIT_FUNCTION();
+}
+
+/*!
+* Start location trail.
+*/
+void CxeGeoTaggingTrailPrivate::start()
+{
+ CX_DEBUG_ENTER_FUNCTION();
+
+ setState(CxeGeoTaggingTrail::Connected);
+ setState(CxeGeoTaggingTrail::TrailStarted);
+
+ CX_DEBUG_EXIT_FUNCTION();
+}
+
+/*!
+* Stop location trail.
+* @ param closeSession, indicates if we are willing to close the location utility session.
+*/
+void CxeGeoTaggingTrailPrivate::stop(bool closeSession)
+{
+ CX_DEBUG_ENTER_FUNCTION();
+
+ setState(CxeGeoTaggingTrail::NotConnected);
+
+ CX_DEBUG_EXIT_FUNCTION();
+}
+
+/*!
+* Handle new setting value.
+* Check if the geotagging setting has changed.
+*/
+void CxeGeoTaggingTrailPrivate::handleSettingValueChanged(const QString& settingId, QVariant newValue)
+{
+ CX_DEBUG_ENTER_FUNCTION();
+
+ if (settingId == CxeSettingIds::GEOTAGGING) {
+ if (newValue.toInt() == Cxe::GeoTaggingOn) {
+ // setting is turned ON, start location trail
+ start();
+ } else {
+ // setting is turned OFF, stopping location trail
+ stop();
+ }
+ } else if (settingId == CxeSettingIds::GEOTAGGING_DISCLAIMER) {
+ if (newValue.toInt() == Cxe::GeoTaggingDisclaimerDisabled) {
+ // geotagging disclaimer is diabled, we can start location trail.
+ start();
+ }
+ }
+
+ CX_DEBUG_EXIT_FUNCTION();
+}
+
+/*!
+Returns current state of Location trail
+*/
+CxeGeoTaggingTrail::State CxeGeoTaggingTrailPrivate::state() const
+{
+ return static_cast<CxeGeoTaggingTrail::State> (stateId());
+}
+
+/*!
+* slot called when state is changed.
+*/
+void CxeGeoTaggingTrailPrivate::handleStateChanged(int newStateId, CxeError::Id error)
+{
+ emit stateChanged(static_cast<CxeGeoTaggingTrail::State> (newStateId), error);
+
+}
+
+/*!
+* Initialize states for geotaggingtrail
+*/
+void CxeGeoTaggingTrailPrivate::initializeStates()
+{
+ // addState( id, name, allowed next states )
+ addState(new CxeState(CxeGeoTaggingTrail::NotConnected, "NotConnected", CxeGeoTaggingTrail::Connected));
+
+ addState(new CxeState(CxeGeoTaggingTrail::Connected, "Connected", CxeGeoTaggingTrail::TrailStarted |
+ CxeGeoTaggingTrail::NotConnected));
+
+ addState(new CxeState(CxeGeoTaggingTrail::TrailStarted, "TrailStarted", CxeGeoTaggingTrail::DataAvailable |
+ CxeGeoTaggingTrail::Connected |
+ CxeGeoTaggingTrail::NotConnected));
+
+ addState(new CxeState(CxeGeoTaggingTrail::DataAvailable, "DataAvailable", CxeGeoTaggingTrail::Connected |
+ CxeGeoTaggingTrail::NotConnected));
+
+
+ setInitialState(CxeGeoTaggingTrail::NotConnected);
+}
+
+// end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/camerauis/cameraxui/cxengine/src/cxegeotaggingtrail_symbian_p.cpp Fri Jul 23 11:35:41 2010 +0300
@@ -0,0 +1,288 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#include "cxutils.h"
+#include "cxestate.h"
+#include "cxesettings.h"
+#include "cxenamespace.h"
+#include "cxestillcapturecontrol.h"
+#include "cxevideocapturecontrol.h"
+#include "cxegeotaggingtrail_symbian_p.h"
+
+#include <locationtrailpskeys.h>
+
+namespace
+{
+ // in milliseconds
+ const int STOP_TRAIL_INTERVAL = 10*1000;
+}
+
+/*!
+* Constructor
+*/
+CxeGeoTaggingTrailPrivate::CxeGeoTaggingTrailPrivate(CxeStillCaptureControl &stillControl,
+ CxeVideoCaptureControl &videoControl,
+ CxeSettings &settings)
+ : CxeStateMachine("CxeGeoTaggingTrailPrivate"),
+ mStillCaptureControl(stillControl),
+ mVideoCaptureControl(videoControl),
+ mSettings(settings),
+ mStopLocationTrailTimer(),
+ mPendingStopTrailSession(false)
+{
+ CX_DEBUG_ENTER_FUNCTION();
+
+ qRegisterMetaType<CxeGeoTaggingTrail::State>();
+ initializeStates();
+
+ QVariant locationTrailState;
+ // Get initial location trail state.
+ mSettings.get(KPSUidLocationTrail.iUid, KLocationTrailState,
+ Cxe::PublishAndSubscribe, locationTrailState);
+
+ connect(&mSettings, SIGNAL(settingValueChanged(long int, unsigned long int, QVariant)),
+ this, SLOT(handleGeoTaggingPropertyEvent(long int, unsigned long int, QVariant)));
+
+
+ connect(&mSettings, SIGNAL(settingValueChanged(const QString&,QVariant)),
+ this, SLOT(handleSettingValueChanged(const QString&,QVariant)));
+
+ connect(&mStopLocationTrailTimer, SIGNAL(timeout()),
+ this, SLOT(timeout()), Qt::UniqueConnection);
+
+ CX_DEBUG_EXIT_FUNCTION();
+}
+
+/*!
+* Destructor
+*/
+CxeGeoTaggingTrailPrivate::~CxeGeoTaggingTrailPrivate()
+{
+ CX_DEBUG_ENTER_FUNCTION();
+
+ // stop trail and close location utility session
+ stop(true);
+
+ CX_DEBUG_EXIT_FUNCTION();
+}
+
+
+/*!
+* Start location trail.
+*/
+void CxeGeoTaggingTrailPrivate::start()
+{
+ CX_DEBUG_ENTER_FUNCTION();
+
+ int err = KErrNone;
+ int settingValue = Cxe::GeoTaggingOff;
+ settingValue = mSettings.get(CxeSettingIds::GEOTAGGING, settingValue);
+
+ if (settingValue == Cxe::GeoTaggingOn) {
+ // geotagging setting is ON, trying to start location trail
+ if (state() == CxeGeoTaggingTrail::NotConnected) {
+ err = mLocationTrail.Connect();
+ if (!err) {
+ CX_DEBUG(("CxeGeoTaggingTrail <> location trail connected"));
+ setState(CxeGeoTaggingTrail::Connected);
+ }
+ }
+
+ if (state() == CxeGeoTaggingTrail::Connected && !err) {
+ err = mLocationTrail.StartLocationTrail(RLocationTrail::ECaptureAll);
+ if (!err) {
+ CX_DEBUG(("CxeGeoTaggingTrail <> starting location trail"));
+ mStopLocationTrailTimer.stop(); // stop location timer.
+ setState(CxeGeoTaggingTrail::TrailStarted);
+ }
+ }
+
+ if (err) {
+ CX_DEBUG(("CxeGeoTaggingTrailPrivate::start <> FAILED: error = %d ", err));
+ stop(true);
+ }
+ } else {
+ // geotagging setting off, do nothing.
+ CX_DEBUG(("CxeGeoTaggingTrail <> start -- Geotagging setting OFF, do nothing.."));
+ }
+
+ CX_DEBUG_EXIT_FUNCTION();
+}
+
+/*!
+* Stop location trail.
+* @ param closeSession, indicates if we are willing to close the location utility session.
+*/
+void CxeGeoTaggingTrailPrivate::stop(bool closeSession)
+{
+ CX_DEBUG_ENTER_FUNCTION();
+
+ bool ok2StopTrail = canStopTrail();
+
+ if (ok2StopTrail) {
+
+ if (state() == CxeGeoTaggingTrail::TrailStarted ||
+ state() == CxeGeoTaggingTrail::DataAvailable) {
+ CX_DEBUG(("CxeGeoTaggingTrailPrivate::StopLocationTrail"));
+ // stop location trail timer.
+ mStopLocationTrailTimer.stop();
+ mLocationTrail.StopLocationTrail();
+ setState(CxeGeoTaggingTrail::Connected);
+ }
+
+ if (closeSession && state() == CxeGeoTaggingTrail::Connected) {
+ CX_DEBUG(("CxeGeoTaggingTrailPrivate <> disconnect location trail utility"));
+ mLocationTrail.Close();
+ setState(CxeGeoTaggingTrail::NotConnected);
+ }
+ } else {
+ // not ready to stop the location trail, TrailStarted the timer.
+ if (!mPendingStopTrailSession) {
+ mPendingStopTrailSession = closeSession;
+ }
+ mStopLocationTrailTimer.start(STOP_TRAIL_INTERVAL);
+ }
+
+ CX_DEBUG_EXIT_FUNCTION();
+}
+
+/*!
+* Checking possible stillcapturecontrol/videocapturecontrol states for stopping
+* location trail.
+*/
+bool CxeGeoTaggingTrailPrivate::canStopTrail() const
+{
+ // checking still capture control states
+ bool ok = mStillCaptureControl.state() != CxeStillCaptureControl::Capturing;
+
+ // Still side OK, checking video capture control states
+ if (ok) {
+ ok = (mVideoCaptureControl.state() != CxeVideoCaptureControl::Recording &&
+ mVideoCaptureControl.state() != CxeVideoCaptureControl::Paused &&
+ mVideoCaptureControl.state() != CxeVideoCaptureControl::Stopping);
+ }
+
+ return ok;
+}
+
+/*!
+* Slot that is called when timer timeout signal is triggered. We track this to do pending
+* stopping of location trail.
+*/
+void CxeGeoTaggingTrailPrivate::timeout()
+{
+ CX_DEBUG_ENTER_FUNCTION();
+
+ // stop the pending location trail utility
+ stop(mPendingStopTrailSession);
+
+ CX_DEBUG_EXIT_FUNCTION();
+}
+
+/*!
+* Handle new setting value.
+* Check if the geotagging setting has changed.
+*/
+void CxeGeoTaggingTrailPrivate::handleSettingValueChanged(const QString& settingId, QVariant newValue)
+{
+ CX_DEBUG_ENTER_FUNCTION();
+
+ if (settingId == CxeSettingIds::GEOTAGGING) {
+ if (newValue.toInt() == Cxe::GeoTaggingOn) {
+ // setting is turned ON, start location trail
+ start();
+ } else {
+ // setting is turned OFF, stopping location trail
+ stop();
+ }
+ } else if (settingId == CxeSettingIds::GEOTAGGING_DISCLAIMER) {
+ if (newValue.toInt() == Cxe::GeoTaggingDisclaimerDisabled) {
+ // geotagging disclaimer is diabled, we can start location trail.
+ start();
+ }
+ }
+
+ CX_DEBUG_EXIT_FUNCTION();
+}
+
+/*!
+* Handle new setting value.
+* Check if the geotagging setting has changed.
+*/
+void CxeGeoTaggingTrailPrivate::handleGeoTaggingPropertyEvent(long int uid,
+ unsigned long int key,
+ QVariant value)
+{
+ CX_DEBUG_ENTER_FUNCTION();
+
+ if (uid == KPSUidLocationTrail.iUid && key == KLocationTrailState) {
+ CX_DEBUG(("Location trail: new state = %d ", value.toInt()));
+
+ RLocationTrail::TTrailState newState =
+ static_cast<RLocationTrail::TTrailState>(value.toInt());
+
+ if (newState == RLocationTrail::ETrailStarted) {
+ CX_DEBUG(("CxeGeoTaggingTrail <> location trail started, data available."));
+ setState(CxeGeoTaggingTrail::DataAvailable);
+ } else {
+ // ignoring all other state changes.
+ }
+ }
+
+ CX_DEBUG_EXIT_FUNCTION();
+}
+
+/*!
+Returns current state of Location trail
+*/
+CxeGeoTaggingTrail::State CxeGeoTaggingTrailPrivate::state() const
+{
+ return static_cast<CxeGeoTaggingTrail::State> (stateId());
+}
+
+/*!
+* slot called when state is changed.
+*/
+void CxeGeoTaggingTrailPrivate::handleStateChanged(int newStateId, CxeError::Id error)
+{
+ emit stateChanged(static_cast<CxeGeoTaggingTrail::State> (newStateId), error);
+
+}
+
+/*!
+* Initialize states for geotaggingtrail
+*/
+void CxeGeoTaggingTrailPrivate::initializeStates()
+{
+ // addState( id, name, allowed next states )
+ addState(new CxeState(CxeGeoTaggingTrail::NotConnected, "NotConnected", CxeGeoTaggingTrail::Connected));
+
+ addState(new CxeState(CxeGeoTaggingTrail::Connected, "Connected", CxeGeoTaggingTrail::TrailStarted |
+ CxeGeoTaggingTrail::NotConnected));
+
+ addState(new CxeState(CxeGeoTaggingTrail::TrailStarted, "TrailStarted", CxeGeoTaggingTrail::DataAvailable |
+ CxeGeoTaggingTrail::Connected |
+ CxeGeoTaggingTrail::NotConnected));
+
+ addState(new CxeState(CxeGeoTaggingTrail::DataAvailable, "DataAvailable", CxeGeoTaggingTrail::Connected |
+ CxeGeoTaggingTrail::NotConnected));
+
+
+ setInitialState(CxeGeoTaggingTrail::NotConnected);
+}
+
+// end of file
--- a/camerauis/cameraxui/cxengine/src/cxegeotaggingtrailprivate.cpp Thu Jul 15 01:55:05 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,332 +0,0 @@
-/*
-* Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
-*
-*/
-
-#include <QObject> // For Q_OS_SYMBIAN define
-#if defined(Q_OS_SYMBIAN)
-#include <locationtrailpskeys.h>
-#endif
-
-#include "cxutils.h"
-#include "cxestate.h"
-#include "cxesettings.h"
-#include "cxenamespace.h"
-#include "cxestillcapturecontrol.h"
-#include "cxevideocapturecontrol.h"
-#include "cxegeotaggingtrailprivate.h"
-
-#include "OstTraceDefinitions.h"
-#ifdef OST_TRACE_COMPILER_IN_USE
-#include "cxegeotaggingtrailprivateTraces.h"
-#endif
-
-
-namespace
-{
- // in milliseconds
- const int STOP_TRAIL_INTERVAL = 10*1000;
-}
-
-
-/*!
-* Constructor
-*/
-CxeGeoTaggingTrailPrivate::CxeGeoTaggingTrailPrivate(CxeStillCaptureControl &stillControl,
- CxeVideoCaptureControl &videoControl,
- CxeSettings &settings)
- : CxeStateMachine("CxeGeoTaggingTrailPrivate"),
- mStillCaptureControl(stillControl),
- mVideoCaptureControl(videoControl),
- mSettings(settings),
- mStopLocationTrailTimer(),
- mPendingStopTrailSession(false)
-{
- CX_DEBUG_ENTER_FUNCTION();
-
- qRegisterMetaType<CxeGeoTaggingTrail::State>();
- initializeStates();
-
-#if defined(Q_OS_SYMBIAN)
-
- QVariant locationTrailState;
- // Get initial location trail state.
- mSettings.get(KPSUidLocationTrail.iUid, KLocationTrailState,
- Cxe::PublishAndSubscribe, locationTrailState);
-
- connect(&mSettings, SIGNAL(settingValueChanged(long int, unsigned long int, QVariant)),
- this, SLOT(handleGeoTaggingPropertyEvent(long int, unsigned long int, QVariant)));
-
-#endif
-
- connect(&mSettings, SIGNAL(settingValueChanged(const QString&,QVariant)),
- this, SLOT(handleSettingValueChanged(const QString&,QVariant)));
-
- connect(&mStopLocationTrailTimer, SIGNAL(timeout()),
- this, SLOT(timeout()), Qt::UniqueConnection);
-
- CX_DEBUG_EXIT_FUNCTION();
-}
-
-/*!
-* Destructor
-*/
-CxeGeoTaggingTrailPrivate::~CxeGeoTaggingTrailPrivate()
-{
- CX_DEBUG_ENTER_FUNCTION();
-
- // stop trail and close location utility session
- stop(true);
-
- CX_DEBUG_EXIT_FUNCTION();
-}
-
-
-/*!
-* Start location trail.
-*/
-void CxeGeoTaggingTrailPrivate::start()
-{
- CX_DEBUG_ENTER_FUNCTION();
- OstTrace0(camerax_performance, CXEGEOTAGGINGTRAIL_START_1, "msg: e_CX_START_GEOTAGGING 1");
-
-#if defined(Q_OS_SYMBIAN)
-
- int err = KErrNone;
- int settingValue = Cxe::GeoTaggingOff;
- mSettings.get(CxeSettingIds::GEOTAGGING, settingValue);
-
- if (settingValue == Cxe::GeoTaggingOn) {
- // geotagging setting is ON, trying to start location trail
- if (state() == CxeGeoTaggingTrail::NotConnected) {
- err = mLocationTrail.Connect();
- if (!err) {
- CX_DEBUG(("CxeGeoTaggingTrail <> location trail connected"));
- setState(CxeGeoTaggingTrail::Connected);
- }
- }
-
- if (state() == CxeGeoTaggingTrail::Connected && !err) {
- err = mLocationTrail.StartLocationTrail(RLocationTrail::ECaptureAll);
- if (!err) {
- CX_DEBUG(("CxeGeoTaggingTrail <> starting location trail"));
- mStopLocationTrailTimer.stop(); // stop location timer.
- setState(CxeGeoTaggingTrail::TrailStarted);
- }
- }
-
- if (err) {
- CX_DEBUG(("CxeGeoTaggingTrailPrivate::start <> FAILED: error = %d ", err));
- stop(true);
- }
- } else {
- // geotagging setting off, do nothing.
- CX_DEBUG(("CxeGeoTaggingTrail <> start -- Geotagging setting OFF, do nothing.."));
- }
-
-#endif
- OstTrace0(camerax_performance, CXEGEOTAGGINGTRAIL_START_2, "msg: e_CX_START_GEOTAGGING 0");
-
- CX_DEBUG_EXIT_FUNCTION();
-}
-
-
-
-
-/*!
-* Stop location trail.
-* @ param closeSession, indicates if we are willing to close the location utility session.
-*/
-void CxeGeoTaggingTrailPrivate::stop(bool closeSession)
-{
- CX_DEBUG_ENTER_FUNCTION();
- OstTrace0(camerax_performance, CXEGEOTAGGINGTRAIL_STOP_1, "msg: e_CX_STOP_GEOTAGGING 1");
-
-#if defined(Q_OS_SYMBIAN)
-
- bool ok2StopTrail = canStopTrail();
-
- if (ok2StopTrail) {
-
- if (state() == CxeGeoTaggingTrail::TrailStarted ||
- state() == CxeGeoTaggingTrail::DataAvailable) {
- CX_DEBUG(("CxeGeoTaggingTrailPrivate::StopLocationTrail"));
- // stop location trail timer.
- mStopLocationTrailTimer.stop();
- mLocationTrail.StopLocationTrail();
- setState(CxeGeoTaggingTrail::Connected);
- }
-
- if (closeSession && state() == CxeGeoTaggingTrail::Connected) {
- CX_DEBUG(("CxeGeoTaggingTrailPrivate <> disconnect location trail utility"));
- mLocationTrail.Close();
- setState(CxeGeoTaggingTrail::NotConnected);
- }
- } else {
- // not ready to stop the location trail, TrailStarted the timer.
- if (!mPendingStopTrailSession) {
- mPendingStopTrailSession = closeSession;
- }
- mStopLocationTrailTimer.start(STOP_TRAIL_INTERVAL);
- }
-
-#endif
-
- OstTrace0(camerax_performance, CXEGEOTAGGINGTRAIL_STOP_2, "msg: e_CX_STOP_GEOTAGGING 0");
-}
-
-
-
-/*!
-* Checking possible stillcapturecontrol/videocapturecontrol states for stopping
-* location trail.
-*/
-bool CxeGeoTaggingTrailPrivate::canStopTrail() const
-{
- // checking still capture control states
- bool ok = mStillCaptureControl.state() != CxeStillCaptureControl::Capturing;
-
- // Still side OK, checking video capture control states
- if (ok) {
- ok = (mVideoCaptureControl.state() != CxeVideoCaptureControl::Recording &&
- mVideoCaptureControl.state() != CxeVideoCaptureControl::Paused &&
- mVideoCaptureControl.state() != CxeVideoCaptureControl::Stopping);
- }
-
- return ok;
-}
-
-
-
-/*!
-* Slot that is called when timer timeout signal is triggered. We track this to do pending
-* stopping of location trail.
-*/
-void CxeGeoTaggingTrailPrivate::timeout()
-{
- CX_DEBUG_ENTER_FUNCTION();
-
- // stop the pending location trail utility
- stop(mPendingStopTrailSession);
-
- CX_DEBUG_EXIT_FUNCTION();
-}
-
-
-
-
-/*!
-* Handle new setting value.
-* Check if the geotagging setting has changed.
-*/
-void CxeGeoTaggingTrailPrivate::handleSettingValueChanged(const QString& settingId, QVariant newValue)
-{
- CX_DEBUG_ENTER_FUNCTION();
-
- if (settingId == CxeSettingIds::GEOTAGGING) {
- if (newValue.toInt() == Cxe::GeoTaggingOn) {
- // setting is turned ON, start location trail
- start();
- } else {
- // setting is turned OFF, stopping location trail
- stop();
- }
- } else if (settingId == CxeSettingIds::GEOTAGGING_DISCLAIMER) {
- if (newValue.toInt() == Cxe::GeoTaggingDisclaimerDisabled) {
- // geotagging disclaimer is diabled, we can start location trail.
- start();
- }
- }
-
- CX_DEBUG_EXIT_FUNCTION();
-}
-
-
-/*!
-* Handle new setting value.
-* Check if the geotagging setting has changed.
-*/
-void CxeGeoTaggingTrailPrivate::handleGeoTaggingPropertyEvent(long int uid,
- unsigned long int key,
- QVariant value)
-{
- CX_DEBUG_ENTER_FUNCTION();
-
-#if defined(Q_OS_SYMBIAN)
-
- if (uid == KPSUidLocationTrail.iUid && key == KLocationTrailState) {
- CX_DEBUG(("Location trail: new state = %d ", value.toInt()));
-
- RLocationTrail::TTrailState newState =
- static_cast<RLocationTrail::TTrailState>(value.toInt());
-
- if (newState == RLocationTrail::ETrailStarted) {
- CX_DEBUG(("CxeGeoTaggingTrail <> location trail started, data available."));
- setState(CxeGeoTaggingTrail::DataAvailable);
- } else {
- // ignoring all other state changes.
- }
- }
-
-#endif
-
- CX_DEBUG_EXIT_FUNCTION();
-}
-
-
-
-/*!
-Returns current state of Location trail
-*/
-CxeGeoTaggingTrail::State CxeGeoTaggingTrailPrivate::state() const
-{
- return static_cast<CxeGeoTaggingTrail::State> (stateId());
-}
-
-
-
-/*!
-* slot called when state is changed.
-*/
-void CxeGeoTaggingTrailPrivate::handleStateChanged(int newStateId, CxeError::Id error)
-{
- emit stateChanged(static_cast<CxeGeoTaggingTrail::State> (newStateId), error);
-
-}
-
-
-/*!
-* Initialize states for geotaggingtrail
-*/
-void CxeGeoTaggingTrailPrivate::initializeStates()
-{
- // addState( id, name, allowed next states )
- addState(new CxeState(CxeGeoTaggingTrail::NotConnected, "NotConnected", CxeGeoTaggingTrail::Connected));
-
- addState(new CxeState(CxeGeoTaggingTrail::Connected, "Connected", CxeGeoTaggingTrail::TrailStarted |
- CxeGeoTaggingTrail::NotConnected));
-
- addState(new CxeState(CxeGeoTaggingTrail::TrailStarted, "TrailStarted", CxeGeoTaggingTrail::DataAvailable |
- CxeGeoTaggingTrail::Connected |
- CxeGeoTaggingTrail::NotConnected));
-
- addState(new CxeState(CxeGeoTaggingTrail::DataAvailable, "DataAvailable", CxeGeoTaggingTrail::Connected |
- CxeGeoTaggingTrail::NotConnected));
-
-
- setInitialState(CxeGeoTaggingTrail::NotConnected);
-}
-
-// end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/camerauis/cameraxui/cxengine/src/cxeimagedataitemdesktop.cpp Fri Jul 23 11:35:41 2010 +0300
@@ -0,0 +1,84 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#include "cxeimagedataitemdesktop.h"
+
+CxeImageDataItemDesktop::CxeImageDataItemDesktop(int index, QByteArray data, QString filename, int id) :
+ mIndex(index),
+ mData(data),
+ mFilename(filename),
+ mPixmapData(QPixmap()),
+ mState(CxeImageDataItem::SavePending),
+ mId(id)
+
+{
+
+}
+
+CxeImageDataItemDesktop::CxeImageDataItemDesktop(int index, QPixmap pixmapData, QString filename, int id) :
+ mIndex(index),
+ mData(QByteArray()),
+ mFilename(filename),
+ mPixmapData(pixmapData),
+ mState(CxeImageDataItem::SavePending),
+ mId(id)
+{
+
+}
+
+
+/**
+ * Helper method to save file to Fs
+ * @return CameraX error code
+ */
+CxeError::Id CxeImageDataItemDesktop::save()
+{
+ CxeError::Id errorId = CxeError::None;
+
+ mPixmapData.save(mFilename);
+
+ mState = CxeImageDataItem::Saved;
+ emit stateChanged(mState, errorId);
+
+ return errorId;
+}
+
+/**
+ * Get the current state for this item.
+ *
+ * @return State
+ */
+CxeImageDataItem::State CxeImageDataItemDesktop::state() const
+{
+ return mState;
+}
+
+/**
+ * Get the id of this item.
+ */
+int CxeImageDataItemDesktop::id() const
+{
+ return mId;
+}
+
+/**
+ * Get the id of this item.
+ */
+QString CxeImageDataItemDesktop::path() const
+{
+ return mFilename;
+}
--- a/camerauis/cameraxui/cxengine/src/cxeimagedataitemsymbian.cpp Thu Jul 15 01:55:05 2010 +0300
+++ b/camerauis/cameraxui/cxengine/src/cxeimagedataitemsymbian.cpp Fri Jul 23 11:35:41 2010 +0300
@@ -15,7 +15,6 @@
*
*/
-#include <bautils.h> // for deleting files
#include "cxeimagedataitemsymbian.h"
#include "cxeerrormappingsymbian.h"
#include "cxesysutil.h"
@@ -27,14 +26,15 @@
#include "cxeimagedataitemsymbianTraces.h"
#endif
-
+/*!
+* Constructor.
+*/
CxeImageDataItemSymbian::CxeImageDataItemSymbian(QByteArray data,
QString filename,
int id,
bool addLocation,
CxeImageDataItem::State state)
: CxeStateMachine("CxeImageDataItemSymbian"),
- mError(KErrNone),
mId(id),
mData(data),
mAddLocationInfo(addLocation),
@@ -47,202 +47,109 @@
// Init mState
initializeStates();
setInitialState(state);
- // Init delayer variables
- //mDelayedDelete = false;
- //mDelayedRename = false;
- //mDelayedFileName = NULL;
-
- CX_DEBUG_EXIT_FUNCTION();
-}
-
-CxeImageDataItemSymbian::~CxeImageDataItemSymbian()
-{
- CX_DEBUG_ENTER_FUNCTION();
-
- // Close file
- mFile.Close();
-
- // Close file system
- mFs.Close();
CX_DEBUG_EXIT_FUNCTION();
}
-/*
-void CxeImageDataItemSymbian::deleteImage()
- {
+/*!
+* Destructor.
+*/
+CxeImageDataItemSymbian::~CxeImageDataItemSymbian()
+{
+ CX_DEBUG_ENTER_FUNCTION();
+ closeHandles();
+ CX_DEBUG_EXIT_FUNCTION();
+}
+
+/*!
+* Save the data now.
+* @return Status code.
+*/
+CxeError::Id CxeImageDataItemSymbian::save()
+{
CX_DEBUG_ENTER_FUNCTION();
- int err = KErrNone;
-
- //! @todo: make this function return a KErrNotReady if below
- if ( mState != CxeImageDataItem::Idle )
- {
- CX_DEBUG(("Error: This data item has no data..."));
- CX_DEBUG_ASSERT(0); // panics
- return;
- }
-
- // do delete or delayed delete
- if (( mState == CxeImageDataItem::Waiting ) || ( mState == CxeImageDataItem::Saving ))
- {
- // we are currently saving, so we have to delete later
- CX_DEBUG(("delayed delete"));
- mDelayedDelete = true;
- }
- else
- {
- // delete now
- CX_DEBUG(("deleting now..."));
- err = KErrNotFound;
-
-
- //! @todo: this is horrible for performance... there is no need to create multiple server sessions
- RFs fs;
- TInt connectError = fs.Connect();
- BaflUtils ba;
- if( !connectError && ba.FileExists( fs, *mPath ) )
- {
- err = KErrNone;
- ba.DeleteFile( fs, *mPath );
- }
- fs.Close();
- }
-
- CX_DEBUG(("err: %d", err));
-
- CX_DEBUG_EXIT_FUNCTION();
- //return err; //! @todo
+ CxeError::Id status(CxeError::None);
+ try {
+ setState(CxeImageDataItem::Saving);
+ trySave();
+ setState(CxeImageDataItem::Saved);
+ } catch (const std::exception &e) {
+ closeHandles();
+ status = CxeErrorHandlingSymbian::map(qt_symbian_exception2Error(e));
+ setState(CxeImageDataItem::SaveFailed);
}
-void CxeImageDataItemSymbian::renameImage( const TDesC& newPath )
- {
- CX_DEBUG_ENTER_FUNCTION();
-
- int err = KErrNone;
-
- //! @todo: make this function return a KErrNotReady if below
- if ( mState != CxeImageDataItem::Idle )
- {
- CX_DEBUG(("Error: This data item has no data..."));
- CX_DEBUG_ASSERT(0); // panics
- return;
- }
-
- // do rename or delayed rename
- if (( mState == CxeImageDataItem::Waiting ) || ( mState == CxeImageDataItem::Saving ))
- {
- // we are currently saving, so we have to rename later
- CX_DEBUG(("delayed rename"));
- mDelayedRename = true;
-
- TRAP( err,
- mDelayedFileName = HBufC::NewL( newPath.Length() );
- mDelayedFileName->Des().Append( newPath );
- );
- }
- else
- {
- // rename now
- CX_DEBUG(("delayed rename"));
- err = KErrNotFound;
- RFs fs;
- TInt connectError = fs.Connect();
- BaflUtils ba;
- if( !connectError && ba.FileExists( fs, *mPath ) )
- {
- err = KErrNone;
- ba.RenameFile( fs, *mPath, newPath );
- }
- fs.Close();
- }
-
- CX_DEBUG(("err: %d", err));
+ emit imageSaved(status, mPath, mId);
CX_DEBUG_EXIT_FUNCTION();
- //return err; //! @todo
- }
+ return status;
+}
+
+/*!
+* Helper method for trying to save the data.
+* If any error is encountered during the saving process, exception is thrown.
*/
-
-CxeError::Id CxeImageDataItemSymbian::save()
+void CxeImageDataItemSymbian::trySave()
{
CX_DEBUG_ENTER_FUNCTION();
OstTrace0(camerax_performance, CXEIMAGEDATAITEMSYMBIAN_SAVE_IN, "msg: e_CX_IMAGEDATAITEM_SAVE 1");
- mError = KErrNone;
-
- CX_DEBUG(( "Starting to save %s", mPath.toAscii().constData() ));
+ CX_DEBUG(("CxeImageDataItemSymbian - Starting to save [%s]", qPrintable(mPath)));
+ // Check we have the path set.
if (mPath.isEmpty()) {
- CX_DEBUG(("Filename not set !"));
- mError = KErrArgument;
+ CX_DEBUG(("CxeImageDataItemSymbian - Filename not set!"));
+ qt_symbian_throwIfError(KErrArgument);
}
TPtrC16 filename;
-
- if (!mError) {
- filename.Set(reinterpret_cast<const TUint16*>(mPath.utf16()));
- // Init
- mError = mFs.Connect();
- CX_DEBUG(("mFsSession.Connect mError=%d", mError));
- }
+ filename.Set(reinterpret_cast<const TUint16*>(mPath.utf16()));
+ // Init
+ CX_DEBUG(("CxeImageDataItemSymbian - connect to RFs.."));
+ qt_symbian_throwIfError(mFs.Connect());
// Get drive number
TInt drive = 0;
- if (!mError) {
- mError = RFs::CharToDrive(filename[0], drive);
- CX_DEBUG(("CharToDrive mError=%d", mError));
- }
+ CX_DEBUG(("CxeImageDataItemSymbian - Get drive number.."));
+ qt_symbian_throwIfError(RFs::CharToDrive(filename[0], drive));
- // Check disk space
- if (!mError) {
- TBool fullDisk = EFalse;
- fullDisk = checkDiskSpace(&mFs, mData.size(), drive);
- if (fullDisk) {
- CX_DEBUG(("SysUtil::FullDisk"));
- mError = KErrDiskFull;
- }
+ // Check disk has space
+ bool fullDisk = checkDiskSpace(&mFs, mData.size(), drive);
+ if (fullDisk) {
+ CX_DEBUG(("CxeImageDataItemSymbian - Disk is full!"));
+ qt_symbian_throwIfError(KErrDiskFull);
}
// Attempt to create the file
- if (!mError) {
- // Note: In sake of MDS not starting harvesting here,
- // do not use RFile::Replace. If harvesting is started now,
- // our later call to harvest may be ignored and
- // file may be missing from "Captured" album.
- mError = mFile.Create(mFs, filename, EFileWrite);
- CX_DEBUG(("file.Create mError=%d", mError));
- }
+ // Note: In sake of MDS not starting harvesting here,
+ // do not use RFile::Replace. If harvesting is started now,
+ // our later call to harvest may be ignored and
+ // file may be missing from "Captured" album.
+ CX_DEBUG(("CxeImageDataItemSymbian - Create the file.."));
+ qt_symbian_throwIfError(mFile.Create(mFs, filename, EFileWrite));
- // Write the file
- if (!mError) {
- // Update state
- setState(CxeImageDataItem::Saving);
+ // Write data to the file.
+ CX_DEBUG(("CxeImageDataItemSymbian - Starting to write the file.."));
+ TPtrC8 data(reinterpret_cast<const TUint8*> (mData.constData()), mData.size());
+ qt_symbian_throwIfError(mFile.Write(data)); // synchronous
- CX_DEBUG(("about to write to file"));
- TPtrC8 data(reinterpret_cast<const TUint8*> (mData.constData()), mData.size());
- mError = mFile.Write(data); // synchronous
- saveCleanup();
- CX_DEBUG(("file write completed"));
- }
+ // Flush all the data to file now.
+ // This may take a while depending on buffer sizes and file server load.
+ OstTrace0(camerax_performance, CXEIMAGEDATAITEMSYMBIAN_FLUSH_1, "msg: e_CX_SAVE_FLUSH_FILE 1");
+ qt_symbian_throwIfError(mFile.Flush());
+ OstTrace0(camerax_performance, CXEIMAGEDATAITEMSYMBIAN_FLUSH_2, "msg: e_CX_SAVE_FLUSH_FILE 0");
- mFile.Close(); //~400us
- mFs.Close(); //~450us
- OstTrace0(camerax_performance, CXEIMAGEDATAITEMSYMBIAN_SAVED, "msg: e_CX_SHOT_TO_SAVE 0");
+ // Close the file and server handles.
+ closeHandles();
+ CX_DEBUG(("CxeImageDataItemSymbian - Saving to file completed.."));
- if (mError == KErrNone) {
- setState(CxeImageDataItem::Saved);
- } else {
- setState(CxeImageDataItem::SaveFailed);
- }
- emit imageSaved(CxeErrorHandlingSymbian::map(mError), mPath, mId);
-
+ OstTrace0(camerax_performance, CXEIMAGEDATAITEMSYMBIAN_SAVED, "msg: e_CX_SHOT_TO_SAVE 0");
OstTrace0(camerax_performance, CXEIMAGEDATAITEMSYMBIAN_SAVE_OUT, "msg: e_CX_IMAGEDATAITEM_SAVE 0");
CX_DEBUG_EXIT_FUNCTION();
- return CxeErrorHandlingSymbian::map(mError);
}
-/**
+/*!
* Get the id number of this data item.
*/
int CxeImageDataItemSymbian::id() const
@@ -250,7 +157,7 @@
return mId;
}
-/**
+/*!
* Get the path of this data item.
*/
QString CxeImageDataItemSymbian::path() const
@@ -258,84 +165,54 @@
return mPath;
}
-
-int CxeImageDataItemSymbian::checkDiskSpace(RFs* aFs,
+/*!
+* Check that there's enough space in the drive.
+* @param aFs File server session
+* @param aBytesToWrite Amount of bytes to be written.
+* @param aDrive Drive number.
+* @return True, if given amount of bytes can be written to the drive, false otherwise.
+*/
+bool CxeImageDataItemSymbian::checkDiskSpace(RFs* aFs,
TInt aBytesToWrite,
TInt aDrive)
{
CX_DEBUG_ENTER_FUNCTION();
- int value = CxeSysUtil::DiskSpaceBelowCriticalLevel(
+ bool value = CxeSysUtil::DiskSpaceBelowCriticalLevel(
aFs,
aBytesToWrite,
aDrive );
return value;
}
-void CxeImageDataItemSymbian::saveCleanup()
-{
- CX_DEBUG_ENTER_FUNCTION();
-
- CX_DEBUG_ASSERT( state() == CxeImageDataItem::Saving );
-
- // Flush file.
- if (!mError) {
- CX_DEBUG(("flushing..."));
- mError = mFile.Flush();
- CX_DEBUG(("flushed"));
- }
-
-
- /*
- // Delayed rename, if needed
- if (( !mError ) && ( mDelayedRename ))
- {
- CX_DEBUG(("doing delayed rename..."));
- mError = KErrNotFound;
- BaflUtils ba;
- if( ba.FileExists( mFs, *mPath ) )
- {
- mError = KErrNone;
- TPtrC newPath = *mDelayedFileName;
- ba.RenameFile( mFs, *mPath, newPath );
- }
- mDelayedRename = false;
- CX_DEBUG(("rename done, mError: %d", mError));
- }
-
- // Delayed delete, if needed
- if (( !mError ) && ( mDelayedDelete ))
- {
- CX_DEBUG(("doing delayed delete..."));
- mError = KErrNotFound;
- BaflUtils ba;
- if( ba.FileExists( mFs, *mPath ) )
- {
- mError = KErrNone;
- ba.DeleteFile( mFs, *mPath );
- }
- mDelayedDelete = false;
- CX_DEBUG(("delete done, mError: %d", mError));
- }*/
-
- CX_DEBUG_EXIT_FUNCTION();
-}
-
+/*!
+* State of this item.
+* @return The state.
+*/
CxeImageDataItem::State CxeImageDataItemSymbian::state() const
{
return static_cast<CxeImageDataItem::State> (stateId());
}
+/*!
+* Handle state change.
+*/
void CxeImageDataItemSymbian::handleStateChanged(int newStateId, CxeError::Id error)
{
emit stateChanged(static_cast<State> (newStateId), error);
}
-
+/*!
+* Is location tagging enabled for this item.
+* @return True if location tagging is enabled, false otherwise.
+*/
bool CxeImageDataItemSymbian::isLocationEnabled() const
{
return mAddLocationInfo;
}
+/*!
+* Init the state machine.
+*/
void CxeImageDataItemSymbian::initializeStates()
{
// addState( id, name, allowed next states )
@@ -344,3 +221,14 @@
addState(new CxeState(Saved, "Saved", 0));
addState(new CxeState(SaveFailed, "SaveFailed", 0));
}
+
+/*!
+* Close the file server and file handles.
+*/
+void CxeImageDataItemSymbian::closeHandles()
+{
+ mFile.Close();
+ mFs.Close();
+}
+
+// end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/camerauis/cameraxui/cxengine/src/cxeimagedataqueuedesktop.cpp Fri Jul 23 11:35:41 2010 +0300
@@ -0,0 +1,71 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+#include <QImage>
+#include <QList>
+
+#include "cxeimagedataqueuedesktop.h"
+#include "cxeimagedataitemdesktop.h"
+#include "cxutils.h"
+
+
+CxeImageDataQueueDesktop::CxeImageDataQueueDesktop()
+{
+ CX_DEBUG_IN_FUNCTION();
+}
+
+CxeImageDataQueueDesktop::~CxeImageDataQueueDesktop()
+{
+ CX_DEBUG_ENTER_FUNCTION();
+
+ // This will delete all remaining items!
+ clear();
+
+ CX_DEBUG_EXIT_FUNCTION();
+}
+
+int CxeImageDataQueueDesktop::size() const
+{
+ return mList.size();
+}
+
+void CxeImageDataQueueDesktop::clear()
+{
+ CX_DEBUG_ENTER_FUNCTION();
+
+ // This will delete all remaining items!
+ mList.clear();
+
+ CX_DEBUG_EXIT_FUNCTION();
+}
+
+CxeImageDataItem &CxeImageDataQueueDesktop::operator[](int index)
+{
+ CX_DEBUG_ASSERT( index >= 0 && index < mList.count() );
+ return *mList[index];
+}
+
+CxeImageDataItem *CxeImageDataQueueDesktop::startSave(QByteArray data, QString path, int id)
+{
+ CX_DEBUG_ENTER_FUNCTION();
+
+ int index = mList.size();
+ CxeImageDataItem *dataItem = new CxeImageDataItemDesktop(index, data, path, id);
+ mList.append(dataItem);
+
+ CX_DEBUG_EXIT_FUNCTION();
+ return dataItem;
+}
--- a/camerauis/cameraxui/cxengine/src/cxememorymonitorprivate.cpp Thu Jul 15 01:55:05 2010 +0300
+++ b/camerauis/cameraxui/cxengine/src/cxememorymonitorprivate.cpp Fri Jul 23 11:35:41 2010 +0300
@@ -1,5 +1,5 @@
/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies).
* All rights reserved.
* This component and the accompanying materials are made available
* under the terms of "Eclipse Public License v1.0"
@@ -15,12 +15,15 @@
*
*/
+#include "cxememorymonitorprivate.h"
+
+#ifdef Q_OS_SYMBIAN
#include <hal.h>
+#endif // Q_OS_SYMBIAN
#include "cxutils.h"
#include "cxenamespace.h"
#include "cxefeaturemanager.h"
-#include "cxememorymonitorprivate.h"
namespace
{
@@ -36,7 +39,7 @@
{
CX_DEBUG_ENTER_FUNCTION();
- mFeatures.configuredValues(CxeRuntimeKeys::FREE_MEMORY_LEVELS, mLevels);
+ mFeatures.configuredValues(CxeVariationKeys::FREE_MEMORY_LEVELS, mLevels);
CX_DEBUG(("CxeMemoryMonitorPrivate - trigger level: %d bytes", mLevels.value(Cxe::FreeMemoryTrigger)));
CX_DEBUG(("CxeMemoryMonitorPrivate - target level: %d bytes", mLevels.value(Cxe::FreeMemoryTarget)));
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/camerauis/cameraxui/cxengine/src/cxequalitypresetsdesktop.cpp Fri Jul 23 11:35:41 2010 +0300
@@ -0,0 +1,97 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#include "cxutils.h"
+#include "cxequalitydetails.h"
+#include "cxequalitypresetsdesktop.h"
+
+/*!
+* Intializes ImagingConfigManager
+*/
+CxeQualityPresetsDesktop::CxeQualityPresetsDesktop()
+{
+ CX_DEBUG_ENTER_FUNCTION();
+ CX_DEBUG_EXIT_FUNCTION();
+
+}
+
+/*!
+* CxeQualityPresetsDesktop::~CxeQualityPresetsDesktop()
+*/
+CxeQualityPresetsDesktop::~CxeQualityPresetsDesktop()
+{
+ CX_DEBUG_ENTER_FUNCTION();
+
+ CX_DEBUG_EXIT_FUNCTION();
+}
+
+/*!
+This function returns sorted list of image qualities from highest to lowest resolution.
+i.e. first element in the list represent highest supported image resolution and so on.
+@param cameraId The CameraIndex which defines which camera we are using primary/secondary.
+Returns sorted list of image qualities in descending order.
+*/
+QList<CxeImageDetails> CxeQualityPresetsDesktop::imageQualityPresets(Cxe::CameraIndex cameraId)
+{
+ CX_DEBUG_ENTER_FUNCTION();
+ CX_DEBUG_EXIT_FUNCTION();
+
+ return QList<CxeImageDetails>();
+}
+
+
+
+/*!
+This function returns sorted list of video qualities from highest to lowest resolution.
+i.e. first element in the list represent highest supported video resolution and so on.
+@param cameraId The CameraIndex which defines which camera we are using primary/secondary.
+Returns sorted list if image qualities in descending order.
+*/
+QList<CxeVideoDetails> CxeQualityPresetsDesktop::videoQualityPresets(Cxe::CameraIndex cameraId)
+{
+ CX_DEBUG_ENTER_FUNCTION();
+ CX_DEBUG_EXIT_FUNCTION();
+
+ return QList<CxeVideoDetails>();
+}
+
+int CxeQualityPresetsDesktop::recordingTimeAvailable(const CxeVideoDetails &details, qint64 space)
+{
+ Q_UNUSED(details);
+ Q_UNUSED(space);
+
+ return 0;
+}
+
+/*!
+Operator to sort values in ascending order.
+@param s1 type of data to be sorted.
+*/
+bool CxeImageDetails::operator<(const CxeImageDetails &s1) const
+{
+ return mHeight < s1.mHeight;
+}
+
+
+/*!
+Operator to sort values in ascending order.
+@param s1 type of data to be sorted.
+*/
+bool CxeVideoDetails::operator<(const CxeVideoDetails &s1) const
+{
+ return mHeight < s1.mHeight;
+}
--- a/camerauis/cameraxui/cxengine/src/cxequalitypresetssymbian.cpp Thu Jul 15 01:55:05 2010 +0300
+++ b/camerauis/cameraxui/cxengine/src/cxequalitypresetssymbian.cpp Fri Jul 23 11:35:41 2010 +0300
@@ -1,5 +1,5 @@
/*
-* Copyright (c) 2009, Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies).
* All rights reserved.
* This component and the accompanying materials are made available
* under the terms of "Eclipse Public License v1.0"
@@ -20,6 +20,7 @@
#include <algorithm>
#include <e32std.h> // For Symbian types used in mmsenginedomaincrkeys.h
#include <MmsEngineDomainCRKeys.h>
+#include <imagingconfigmanager.h>
#include "cxutils.h"
#include "cxenamespace.h"
@@ -222,7 +223,7 @@
@ param set contains the ICM configuration data
@ returns CxeImageQuality struct
*/
-CxeImageDetails CxeQualityPresetsSymbian::createImagePreset(TImageQualitySet set)
+CxeImageDetails CxeQualityPresetsSymbian::createImagePreset(const TImageQualitySet &set)
{
CxeImageDetails newPreset;
// set setting values from quality set
@@ -244,7 +245,7 @@
/*!
* Creates a new video preset based on TVideoQualitySet values from ICM.
*/
-CxeVideoDetails CxeQualityPresetsSymbian::createVideoPreset(TVideoQualitySet set)
+CxeVideoDetails CxeQualityPresetsSymbian::createVideoPreset(const TVideoQualitySet &set)
{
CX_DEBUG_ENTER_FUNCTION();
CxeVideoDetails newPreset;
@@ -384,11 +385,10 @@
scaler = VIDEO_AVG_BITRATE_SCALER;
}
- int muteSetting = 0; // audio enabled
- mSettings.get(CxeSettingIds::VIDEO_MUTE_SETTING, muteSetting);
+ bool muteSetting = mSettings.get<bool>(CxeSettingIds::VIDEO_MUTE_SETTING, false); // false = audio enabled
int avgVideoBitRate = (details.mVideoBitRate * scaler);
- int avgAudioBitRate = (muteSetting == 1) ? 0 : details.mAudioBitRate;
+ int avgAudioBitRate = muteSetting ? 0 : details.mAudioBitRate;
quint32 averageBitRate = (quint32)((avgVideoBitRate + avgAudioBitRate) * VIDEO_METADATA_COEFF);
quint32 averageByteRate = averageBitRate / 8;
@@ -437,7 +437,7 @@
* Helper method to enable debug prints.
@ param Video quality preset values are printed out for debugging
*/
-void CxeQualityPresetsSymbian::debugPrints(CxeVideoDetails preset)
+void CxeQualityPresetsSymbian::debugPrints(const CxeVideoDetails &preset)
{
CX_DEBUG(("Video quality details"));
CX_DEBUG(("Video resolution (%d,%d)", preset.mWidth, preset.mHeight));
@@ -462,7 +462,7 @@
* Helper method to enable debug prints.
@ param Image quality preset values are printed out for debugging
*/
-void CxeQualityPresetsSymbian::debugPrints(CxeImageDetails newPreset)
+void CxeQualityPresetsSymbian::debugPrints(const CxeImageDetails &newPreset)
{
CX_DEBUG(("Image quality details"));
CX_DEBUG(("Image resolution (%d,%d)", newPreset.mWidth, newPreset.mHeight));
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/camerauis/cameraxui/cxengine/src/cxescenemodestore.cpp Fri Jul 23 11:35:41 2010 +0300
@@ -0,0 +1,397 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#include "cxescenemodestore.h"
+#include "cxutils.h"
+#include "cxenamespace.h"
+#include "cxeautofocuscontrol.h"
+#include "cxeexception.h"
+
+using namespace Cxe;
+
+/*!
+ * Constructor.
+ */
+CxeSceneModeStore::CxeSceneModeStore()
+{
+ CX_DEBUG_ENTER_FUNCTION();
+ loadImageScenes();
+ loadVideoScenes();
+
+ mCurrentImageScene = mImageSceneModes[Cxe::IMAGE_SCENE_AUTO];
+ mCurrentVideoScene = mVideoSceneModes[Cxe::VIDEO_SCENE_AUTO];
+
+ CX_DEBUG_EXIT_FUNCTION();
+}
+
+/*!
+ * Destructor.
+ */
+CxeSceneModeStore::~CxeSceneModeStore()
+{
+ CX_DEBUG_IN_FUNCTION();
+}
+
+/*!
+* Returns scene setting value from current scene.
+* @param cameraMode Camera mode used to determine which scene mode to use
+* @param key Settings key
+* @param[out] value Value associated with the key
+* @return Error id. CxeError::None if no errors.
+*/
+CxeError::Id CxeSceneModeStore::sceneSettingValue(Cxe::CameraMode cameraMode, const QString &key, QVariant &value) const
+{
+ CX_DEBUG_ENTER_FUNCTION();
+
+ CxeScene scene;
+ CxeError::Id err = CxeError::None;
+
+ if(cameraMode == Cxe::ImageMode) {
+ CX_DEBUG(( "CxeSceneModeStore::sceneSettingValue - Image mode Setting"));
+ scene = mCurrentImageScene;
+ } else {
+ CX_DEBUG(( "CxeSceneModeStore::sceneSettingValue - Video mode Setting"));
+ scene = mCurrentVideoScene;
+ }
+
+ if (scene.contains(key)) {
+ value = scene[key];
+ } else {
+ err = CxeError::NotFound;
+ }
+
+
+ CX_DEBUG_EXIT_FUNCTION();
+
+ return err;
+}
+
+/*!
+* Sets new value to settings specific to the scene to the current scene.
+* @param cameraMode Camera mode used to determine which scene mode to use
+* @param key - setting id.
+* @param newValue - new setting value
+* @return Error id. CxeError::None if no errors.
+*/
+CxeError::Id CxeSceneModeStore::setSceneSettingValue(Cxe::CameraMode cameraMode, const QString &key, const QVariant &newValue)
+{
+ CX_DEBUG_ENTER_FUNCTION();
+
+ CxeError::Id err = CxeError::None;
+ CxeScene *scene(0);
+
+ if (cameraMode == Cxe::ImageMode) {
+ CX_DEBUG(( "CxeSettingsImp::setSceneSettingValue - Image mode Setting"));
+ scene = &mCurrentImageScene;
+ } else {
+ CX_DEBUG(( "CxeSettingsImp::setSceneSettingValue - Video mode Setting"));
+ scene = &mCurrentVideoScene;
+ }
+
+ if (scene && scene->contains(key)) {
+ CX_DEBUG(( "CxeSettingsImp::setSceneSettingValue KEY found, writing value"));
+ scene->insert(key, newValue);
+ } else {
+ err = CxeError::NotFound;
+ }
+
+ CX_DEBUG_EXIT_FUNCTION();
+
+ return err;
+}
+
+/*!
+ * Returns id of current scene.
+ * @param cameraMode Camera mode used to determine which scene mode to use
+ * @return id of current scene mode
+ */
+QString CxeSceneModeStore::currentSceneId(Cxe::CameraMode cameraMode) const
+{
+ if (cameraMode == Cxe::ImageMode) {
+ return mCurrentImageScene[CxeSettingIds::SCENE_ID].toString();
+ } else {
+ return mCurrentVideoScene[CxeSettingIds::SCENE_ID].toString();
+ }
+}
+/*!
+ * Returns current scene mode.
+ * @param cameraMode Camera mode used to determine which scene mode to use
+ * @return Current scene mode
+ */
+CxeScene& CxeSceneModeStore::currentScene(Cxe::CameraMode cameraMode)
+{
+ CX_DEBUG_ENTER_FUNCTION();
+ if (cameraMode == Cxe::ImageMode) {
+ CX_DEBUG_EXIT_FUNCTION();
+ return mCurrentImageScene;
+ } else {
+ CX_DEBUG_EXIT_FUNCTION();
+ return mCurrentVideoScene;
+ }
+}
+
+/*!
+ * Returns current scene mode. Overloaded const version.
+ */
+const CxeScene& CxeSceneModeStore::currentScene(Cxe::CameraMode cameraMode) const
+{
+ CX_DEBUG_ENTER_FUNCTION();
+ if (cameraMode == Cxe::ImageMode) {
+ CX_DEBUG_EXIT_FUNCTION();
+ return mCurrentImageScene;
+ } else {
+ CX_DEBUG_EXIT_FUNCTION();
+ return mCurrentVideoScene;
+ }
+}
+/*!
+ * Set current scene mode.
+ * @param cameraMode Camera mode used to determine which scene mode to use
+ * @sceneId id of the scene mode to set
+ */
+void CxeSceneModeStore::setCurrentScene(Cxe::CameraMode cameraMode, const QString &sceneId)
+{
+ CX_DEBUG_ENTER_FUNCTION();
+ CX_DEBUG(("Setting scene mode: %s", sceneId.toAscii().data()));
+ // @todo check that scene is valid
+ if (cameraMode == Cxe::ImageMode) {
+ if (!mImageSceneModes.contains(sceneId)) {
+ throw CxeException(CxeError::NotFound);
+ }
+ mCurrentImageScene = mImageSceneModes[sceneId];
+ } else {
+ if (!mVideoSceneModes.contains(sceneId)) {
+ throw CxeException(CxeError::NotFound);
+ }
+ mCurrentVideoScene = mVideoSceneModes[sceneId];
+ }
+ CX_DEBUG_EXIT_FUNCTION();
+}
+
+/*!
+ * Returns scene mode based on id.
+ * @param cameraMode Camera mode used to determine which scene mode to use
+ * @param sceneId id of the scene mode
+ * @return scene mode
+ */
+CxeScene CxeSceneModeStore::getScene(Cxe::CameraMode cameraMode, const QString &sceneId) const
+{
+ CX_DEBUG_ENTER_FUNCTION();
+ CX_DEBUG(("Getting scene mode: %s", sceneId.toAscii().data()));
+ if (cameraMode == Cxe::ImageMode) {
+ if (!mImageSceneModes.contains(sceneId)) {
+ throw CxeException(CxeError::NotFound);
+ }
+ CX_DEBUG_EXIT_FUNCTION();
+ return mImageSceneModes[sceneId];
+ } else {
+ if (!mVideoSceneModes.contains(sceneId)) {
+ throw CxeException(CxeError::NotFound);
+ }
+ CX_DEBUG_EXIT_FUNCTION();
+ return mVideoSceneModes[sceneId];
+ }
+}
+
+/*!
+* Loads all Image Scene Modes
+*/
+void CxeSceneModeStore::loadImageScenes()
+{
+ CX_DEBUG_ENTER_FUNCTION();
+
+ mImageSceneModes.clear();
+
+ CxeScene imgSceneAuto;
+
+ imgSceneAuto.insert(CxeSettingIds::SCENE_ID, Cxe::IMAGE_SCENE_AUTO);
+ imgSceneAuto.insert(CxeSettingIds::FOCAL_RANGE, CxeAutoFocusControl::Auto);
+ imgSceneAuto.insert(CxeSettingIds::WHITE_BALANCE, WhitebalanceAutomatic);
+ imgSceneAuto.insert(CxeSettingIds::EXPOSURE_MODE, ExposureAuto);
+ imgSceneAuto.insert(CxeSettingIds::COLOR_TONE, ColortoneNormal);
+ imgSceneAuto.insert(CxeSettingIds::CONTRAST, 0);
+ imgSceneAuto.insert(CxeSettingIds::SHARPNESS, SharpnessNormal);
+ imgSceneAuto.insert(CxeSettingIds::LIGHT_SENSITIVITY, LightSensitivityAutomatic);
+ imgSceneAuto.insert(CxeSettingIds::EV_COMPENSATION_VALUE, 0);
+ imgSceneAuto.insert(CxeSettingIds::BRIGHTNESS, 0);
+ imgSceneAuto.insert(CxeSettingIds::FLASH_MODE, FlashAuto);
+ imgSceneAuto.insert(CxeSettingIds::FACE_TRACKING, 1);
+
+ mImageSceneModes.insert(Cxe::IMAGE_SCENE_AUTO, imgSceneAuto);
+
+
+ CxeScene imgSceneSports;
+
+ imgSceneSports.insert(CxeSettingIds::SCENE_ID, Cxe::IMAGE_SCENE_SPORTS);
+ imgSceneSports.insert(CxeSettingIds::FOCAL_RANGE, CxeAutoFocusControl::Hyperfocal);
+ imgSceneSports.insert(CxeSettingIds::WHITE_BALANCE, WhitebalanceAutomatic);
+ imgSceneSports.insert(CxeSettingIds::EXPOSURE_MODE, ExposureSport);
+ imgSceneSports.insert(CxeSettingIds::COLOR_TONE, ColortoneNormal);
+ imgSceneSports.insert(CxeSettingIds::CONTRAST, 0);
+ imgSceneSports.insert(CxeSettingIds::SHARPNESS, SharpnessNormal);
+ imgSceneSports.insert(CxeSettingIds::LIGHT_SENSITIVITY, LightSensitivityAutomatic);
+ imgSceneSports.insert(CxeSettingIds::EV_COMPENSATION_VALUE, 0);
+ imgSceneSports.insert(CxeSettingIds::BRIGHTNESS, 0);
+ imgSceneSports.insert(CxeSettingIds::FLASH_MODE, FlashOff);
+ imgSceneSports.insert(CxeSettingIds::FACE_TRACKING, 0);
+
+ mImageSceneModes.insert(Cxe::IMAGE_SCENE_SPORTS, imgSceneSports);
+
+
+ CxeScene imgSceneCloseUp;
+
+ imgSceneCloseUp.insert(CxeSettingIds::SCENE_ID, Cxe::IMAGE_SCENE_MACRO);
+ imgSceneCloseUp.insert(CxeSettingIds::FOCAL_RANGE, CxeAutoFocusControl::Macro);
+ imgSceneCloseUp.insert(CxeSettingIds::WHITE_BALANCE, WhitebalanceAutomatic);
+ imgSceneCloseUp.insert(CxeSettingIds::EXPOSURE_MODE, ExposureAuto);
+ imgSceneCloseUp.insert(CxeSettingIds::COLOR_TONE, ColortoneNormal);
+ imgSceneCloseUp.insert(CxeSettingIds::CONTRAST, 0);
+ imgSceneCloseUp.insert(CxeSettingIds::SHARPNESS, SharpnessNormal);
+ imgSceneCloseUp.insert(CxeSettingIds::LIGHT_SENSITIVITY, LightSensitivityAutomatic);
+ imgSceneCloseUp.insert(CxeSettingIds::EV_COMPENSATION_VALUE, 0);
+ imgSceneCloseUp.insert(CxeSettingIds::BRIGHTNESS, 0);
+ imgSceneCloseUp.insert(CxeSettingIds::FLASH_MODE, FlashAuto);
+ imgSceneCloseUp.insert(CxeSettingIds::FACE_TRACKING, 0);
+
+ mImageSceneModes.insert(Cxe::IMAGE_SCENE_MACRO, imgSceneCloseUp);
+
+ CxeScene imgPortraitscene;
+
+ imgPortraitscene.insert(CxeSettingIds::SCENE_ID, Cxe::IMAGE_SCENE_PORTRAIT);
+ imgPortraitscene.insert(CxeSettingIds::FOCAL_RANGE, CxeAutoFocusControl::Portrait);
+ imgPortraitscene.insert(CxeSettingIds::WHITE_BALANCE, WhitebalanceAutomatic);
+ imgPortraitscene.insert(CxeSettingIds::EXPOSURE_MODE, ExposureBacklight);
+ imgPortraitscene.insert(CxeSettingIds::COLOR_TONE, ColortoneNormal);
+ imgPortraitscene.insert(CxeSettingIds::CONTRAST, 0);
+ imgPortraitscene.insert(CxeSettingIds::SHARPNESS, SharpnessSoft);
+ imgPortraitscene.insert(CxeSettingIds::LIGHT_SENSITIVITY, LightSensitivityAutomatic);
+ imgPortraitscene.insert(CxeSettingIds::EV_COMPENSATION_VALUE, 0);
+ imgPortraitscene.insert(CxeSettingIds::BRIGHTNESS, 0);
+ imgPortraitscene.insert(CxeSettingIds::FLASH_MODE, FlashAntiRedEye);
+ imgPortraitscene.insert(CxeSettingIds::FACE_TRACKING, 1);
+
+ mImageSceneModes.insert(Cxe::IMAGE_SCENE_PORTRAIT, imgPortraitscene);
+
+ CxeScene imglandscapescene;
+
+ imglandscapescene.insert(CxeSettingIds::SCENE_ID, Cxe::IMAGE_SCENE_SCENERY);
+ imglandscapescene.insert(CxeSettingIds::FOCAL_RANGE, CxeAutoFocusControl::Infinity);
+ imglandscapescene.insert(CxeSettingIds::WHITE_BALANCE, WhitebalanceSunny);
+ imglandscapescene.insert(CxeSettingIds::EXPOSURE_MODE, ExposureAuto);
+ imglandscapescene.insert(CxeSettingIds::COLOR_TONE, ColortoneNormal);
+ imglandscapescene.insert(CxeSettingIds::CONTRAST, 0);
+ imglandscapescene.insert(CxeSettingIds::SHARPNESS, SharpnessHard);
+ imglandscapescene.insert(CxeSettingIds::LIGHT_SENSITIVITY, LightSensitivityAutomatic);
+ imglandscapescene.insert(CxeSettingIds::EV_COMPENSATION_VALUE, 0);
+ imglandscapescene.insert(CxeSettingIds::BRIGHTNESS, 0);
+ imglandscapescene.insert(CxeSettingIds::FLASH_MODE, FlashOff);
+ imglandscapescene.insert(CxeSettingIds::FACE_TRACKING, 0);
+
+ mImageSceneModes.insert(Cxe::IMAGE_SCENE_SCENERY, imglandscapescene);
+
+
+ CxeScene imgNightscene;
+
+ imgNightscene.insert(CxeSettingIds::SCENE_ID, Cxe::IMAGE_SCENE_NIGHT);
+ imgNightscene.insert(CxeSettingIds::FOCAL_RANGE, CxeAutoFocusControl::Auto);
+ imgNightscene.insert(CxeSettingIds::WHITE_BALANCE, WhitebalanceAutomatic);
+ imgNightscene.insert(CxeSettingIds::EXPOSURE_MODE, ExposureNight);
+ imgNightscene.insert(CxeSettingIds::COLOR_TONE, ColortoneNormal);
+ imgNightscene.insert(CxeSettingIds::CONTRAST, 0);
+ imgNightscene.insert(CxeSettingIds::SHARPNESS, SharpnessNormal);
+ imgNightscene.insert(CxeSettingIds::LIGHT_SENSITIVITY, LightSensitivityAutomatic);
+ imgNightscene.insert(CxeSettingIds::EV_COMPENSATION_VALUE, 0);
+ imgNightscene.insert(CxeSettingIds::BRIGHTNESS, 0);
+ imgNightscene.insert(CxeSettingIds::FLASH_MODE, FlashOff);
+ imgNightscene.insert(CxeSettingIds::FACE_TRACKING, 1);
+
+ mImageSceneModes.insert(Cxe::IMAGE_SCENE_NIGHT, imgNightscene);
+
+ CxeScene imgNightpotraitscene;
+
+ imgNightpotraitscene.insert(CxeSettingIds::SCENE_ID, Cxe::IMAGE_SCENE_NIGHTPORTRAIT);
+ imgNightpotraitscene.insert(CxeSettingIds::FOCAL_RANGE, CxeAutoFocusControl::Portrait);
+ imgNightpotraitscene.insert(CxeSettingIds::WHITE_BALANCE, WhitebalanceAutomatic);
+ imgNightpotraitscene.insert(CxeSettingIds::EXPOSURE_MODE, ExposureNight);
+ imgNightpotraitscene.insert(CxeSettingIds::COLOR_TONE, ColortoneNormal);
+ imgNightpotraitscene.insert(CxeSettingIds::CONTRAST, 0);
+ imgNightpotraitscene.insert(CxeSettingIds::SHARPNESS, SharpnessNormal);
+ imgNightpotraitscene.insert(CxeSettingIds::LIGHT_SENSITIVITY, LightSensitivityAutomatic);
+ imgNightpotraitscene.insert(CxeSettingIds::EV_COMPENSATION_VALUE, 0);
+ imgNightpotraitscene.insert(CxeSettingIds::BRIGHTNESS, 0);
+ imgNightpotraitscene.insert(CxeSettingIds::FLASH_MODE, FlashAntiRedEye);
+ imgNightpotraitscene.insert(CxeSettingIds::FACE_TRACKING, 1);
+
+ mImageSceneModes.insert(Cxe::IMAGE_SCENE_NIGHTPORTRAIT, imgNightpotraitscene);
+
+ CX_DEBUG_EXIT_FUNCTION();
+}
+
+
+/*!
+* Loads all video scene modes
+*/
+void CxeSceneModeStore::loadVideoScenes()
+{
+ CX_DEBUG_ENTER_FUNCTION();
+
+ mVideoSceneModes.clear();
+
+ CxeScene vidSceneAuto;
+
+ vidSceneAuto.insert(CxeSettingIds::SCENE_ID, Cxe::VIDEO_SCENE_AUTO);
+ vidSceneAuto.insert(CxeSettingIds::FOCAL_RANGE, CxeAutoFocusControl::Hyperfocal);
+ vidSceneAuto.insert(CxeSettingIds::WHITE_BALANCE, WhitebalanceAutomatic);
+ vidSceneAuto.insert(CxeSettingIds::EXPOSURE_MODE, ExposureAuto);
+ vidSceneAuto.insert(CxeSettingIds::COLOR_TONE, ColortoneNormal);
+ vidSceneAuto.insert(CxeSettingIds::CONTRAST, 0);
+ vidSceneAuto.insert(CxeSettingIds::FRAME_RATE, 0);
+ vidSceneAuto.insert(CxeSettingIds::EV_COMPENSATION_VALUE, 0);
+
+ mVideoSceneModes.insert(Cxe::VIDEO_SCENE_AUTO,vidSceneAuto);
+
+
+ CxeScene vidSceneNight;
+
+ vidSceneNight.insert(CxeSettingIds::SCENE_ID, Cxe::VIDEO_SCENE_NIGHT);
+ vidSceneNight.insert(CxeSettingIds::FOCAL_RANGE, CxeAutoFocusControl::Hyperfocal);
+ vidSceneNight.insert(CxeSettingIds::WHITE_BALANCE, WhitebalanceAutomatic);
+ vidSceneNight.insert(CxeSettingIds::EXPOSURE_MODE, ExposureNight);
+ vidSceneNight.insert(CxeSettingIds::COLOR_TONE, ColortoneNormal);
+ vidSceneNight.insert(CxeSettingIds::CONTRAST, 0);
+ vidSceneNight.insert(CxeSettingIds::FRAME_RATE, 0);
+ vidSceneNight.insert(CxeSettingIds::EV_COMPENSATION_VALUE, 0);
+
+ mVideoSceneModes.insert(Cxe::VIDEO_SCENE_NIGHT, vidSceneNight);
+
+
+ CxeScene vidSceneLowLight;
+
+ vidSceneLowLight.insert(CxeSettingIds::SCENE_ID, Cxe::VIDEO_SCENE_LOWLIGHT);
+ vidSceneLowLight.insert(CxeSettingIds::FOCAL_RANGE, CxeAutoFocusControl::Hyperfocal);
+ vidSceneLowLight.insert(CxeSettingIds::WHITE_BALANCE, WhitebalanceAutomatic);
+ vidSceneLowLight.insert(CxeSettingIds::EXPOSURE_MODE, ExposureAuto);
+ vidSceneLowLight.insert(CxeSettingIds::COLOR_TONE, ColortoneNormal);
+ vidSceneLowLight.insert(CxeSettingIds::CONTRAST, 0);
+ vidSceneLowLight.insert(CxeSettingIds::FRAME_RATE, 15); //fps
+ vidSceneLowLight.insert(CxeSettingIds::EV_COMPENSATION_VALUE, 0);
+
+ mVideoSceneModes.insert(Cxe::VIDEO_SCENE_LOWLIGHT, vidSceneLowLight);
+
+
+ CX_DEBUG_EXIT_FUNCTION();
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/camerauis/cameraxui/cxengine/src/cxesensoreventhandlerdesktop.cpp Fri Jul 23 11:35:41 2010 +0300
@@ -0,0 +1,66 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+#include "cxesensoreventhandlerdesktop.h"
+#include "cxutils.h"
+
+
+CxeSensorEventHandlerDesktop::CxeSensorEventHandlerDesktop()
+: CxeSensorEventHandler()
+{
+ CX_DEBUG_ENTER_FUNCTION();
+ CX_DEBUG_EXIT_FUNCTION();
+}
+
+CxeSensorEventHandlerDesktop::~CxeSensorEventHandlerDesktop()
+{
+ CX_DEBUG_ENTER_FUNCTION();
+ CX_DEBUG_EXIT_FUNCTION();
+}
+
+/**
+* Data read from sensor. The "type" of data embedded in QVariant is specific to sensor type.
+*/
+QVariant CxeSensorEventHandlerDesktop::sensorData(CxeSensorEventHandler::SensorType type)
+{
+ QVariant sensorData;
+ CX_DEBUG_ENTER_FUNCTION();
+ CX_DEBUG_EXIT_FUNCTION();
+ return sensorData;
+}
+
+/*
+* initializes and enables all supported sensor events
+*/
+void CxeSensorEventHandlerDesktop::init()
+{
+ CX_DEBUG_ENTER_FUNCTION();
+ CX_DEBUG_EXIT_FUNCTION();
+}
+
+
+/*
+* closes all supported sensors.
+*/
+void CxeSensorEventHandlerDesktop::deinit()
+{
+ CX_DEBUG_ENTER_FUNCTION();
+ CX_DEBUG_EXIT_FUNCTION();
+}
+
+// end of file
--- a/camerauis/cameraxui/cxengine/src/cxesettingscenrepstore.cpp Thu Jul 15 01:55:05 2010 +0300
+++ b/camerauis/cameraxui/cxengine/src/cxesettingscenrepstore.cpp Fri Jul 23 11:35:41 2010 +0300
@@ -116,12 +116,12 @@
/*!
-* Reads/loads all run-time settings values from cenrep
-* @param QList<QString> contains list of all runtime key ids which we use to load values from cenrep.
+* Reads/loads all run-time variation settings values from cenrep
+* @param QList<QString> contains list of all variation key ids which we use to load values from cenrep.
* returns: QHash container, "contains" values associated with each key that are read from cenrep
-* NOTE: loading runtime settings should be done only ONCE at start-up.
+* NOTE: loading variation settings should be done only ONCE at start-up.
*/
-QHash<QString, QVariantList> CxeSettingsCenRepStore::loadRuntimeSettings(QList<QString>& runtimeKeys)
+QHash<QString, QVariantList> CxeSettingsCenRepStore::loadVariationSettings(QList<QString>& variationKeys)
{
CX_DEBUG_ENTER_FUNCTION();
OstTrace0(camerax_performance, CXESETTINGSCENREPSTORE_LOADRUNTIME_1, "msg: e_CX_SETTINGSSTORE_LOAD_RUNTIME 1");
@@ -131,8 +131,8 @@
QVariantList list;
QVariant data;
- // parsing through the list of run-time keys and reading values from cenrep.
- foreach (QString key, runtimeKeys) {
+ // parsing through the list of run-time variation keys and reading values from cenrep.
+ foreach (QString key, variationKeys) {
// read the data from cenrep
err = get(key, data);
@@ -370,33 +370,18 @@
GeoTaggingDisclaimerCr,
XQSettingsManager::TypeInt);
- // mapping run-time keys
- addKeyMapping(CxeRuntimeKeys::PRIMARY_CAMERA_CAPTURE_KEYS,
- PrimaryCameraCaptureKeysCr,
- XQSettingsManager::TypeString,
- true);
-
- addKeyMapping(CxeRuntimeKeys::PRIMARY_CAMERA_AUTOFOCUS_KEYS,
- PrimaryCameraAutofocusKeysCr,
- XQSettingsManager::TypeString,
- true);
-
- addKeyMapping(CxeRuntimeKeys::SECONDARY_CAMERA_CAPTURE_KEYS,
- SecondaryCameraCaptureKeysCr,
- XQSettingsManager::TypeString,
- true);
-
- addKeyMapping(CxeRuntimeKeys::FREE_MEMORY_LEVELS,
+ // mapping run-time variation keys
+ addKeyMapping(CxeVariationKeys::FREE_MEMORY_LEVELS,
FreeMemoryLevelsCr,
XQSettingsManager::TypeString,
true);
- addKeyMapping(CxeRuntimeKeys::STILL_MAX_ZOOM_LIMITS,
+ addKeyMapping(CxeVariationKeys::STILL_MAX_ZOOM_LIMITS,
StillMaxZoomLimitsCr,
XQSettingsManager::TypeString,
true);
- addKeyMapping(CxeRuntimeKeys::VIDEO_MAX_ZOOM_LIMITS,
+ addKeyMapping(CxeVariationKeys::VIDEO_MAX_ZOOM_LIMITS,
VideoMaxZoomLimitsCr,
XQSettingsManager::TypeString,
true);
--- a/camerauis/cameraxui/cxengine/src/cxesettingscontrolsymbian.cpp Thu Jul 15 01:55:05 2010 +0300
+++ b/camerauis/cameraxui/cxengine/src/cxesettingscontrolsymbian.cpp Fri Jul 23 11:35:41 2010 +0300
@@ -1,5 +1,5 @@
/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies).
* All rights reserved.
* This component and the accompanying materials are made available
* under the terms of "Eclipse Public License v1.0"
@@ -40,7 +40,8 @@
/*!
* Constructor
*/
-CxeSettingsControlSymbian::CxeSettingsControlSymbian(CxeCameraDevice &cameraDevice, CxeSettings &settings)
+CxeSettingsControlSymbian::CxeSettingsControlSymbian(
+ CxeCameraDevice &cameraDevice, CxeSettings &settings)
: mCameraDevice(cameraDevice),
mSettings(settings)
{
@@ -50,10 +51,9 @@
this,
SLOT(handleSettingValueChanged(const QString&,QVariant)));
- connect(&mSettings,
- SIGNAL(sceneChanged(CxeScene&)),
- this,
- SLOT(handleSceneChanged(CxeScene&)));
+ mSettings.listenForSetting(CxeSettingIds::IMAGE_SCENE_DATA, this, SLOT(handleSceneChanged(const QVariant&)));
+ mSettings.listenForSetting(CxeSettingIds::VIDEO_SCENE_DATA, this, SLOT(handleSceneChanged(const QVariant&)));
+
}
/*!
@@ -69,7 +69,8 @@
* \param settingId The id of the updated setting
* \param newValue A new value for the updated setting
*/
-void CxeSettingsControlSymbian::handleSettingValueChanged(const QString& settingId, QVariant newValue)
+void CxeSettingsControlSymbian::handleSettingValueChanged(
+ const QString &settingId, QVariant newValue)
{
CX_DEBUG_ENTER_FUNCTION();
if (settingId == CxeSettingIds::COLOR_TONE) {
@@ -106,9 +107,11 @@
* Scene settings are checked and new values are set to camera.
* \param scene New scene containing scene specific settings.
*/
-void CxeSettingsControlSymbian::handleSceneChanged(CxeScene& scene)
+void CxeSettingsControlSymbian::handleSceneChanged(const QVariant &sceneData)
{
CX_DEBUG_ENTER_FUNCTION();
+
+ CxeScene scene = sceneData.value<CxeScene>();
OstTrace0(camerax_performance, CXESETTINGSCONTROL_SCENE_1, "msg: e_CX_SCENE_SETTINGS_TO_CAMERA 1");
CX_DEBUG(("CxeSettingsControlSymbian <> new scene [%s]",
@@ -136,13 +139,12 @@
CX_ASSERT_ALWAYS(mCameraDevice.imageProcessor());
CCamera::CCameraImageProcessing::TEffect effect =
- CxeSettingsMapperSymbian::Map2CameraEffect(newValue.toInt());
+ CxeSettingsMapperSymbian::Map2CameraEffect(
+ static_cast<Cxe::Colortone>(newValue.toInt()));
- if (effect != mCameraDevice.imageProcessor()->TransformationValue(KUidECamEventImageProcessingEffect)) {
- mCameraDevice.imageProcessor()->SetTransformationValue(KUidECamEventImageProcessingEffect, effect);
- } else {
- CX_DEBUG(("CxeSettingsControlSymbian: value up-to-date"));
- }
+ mCameraDevice.imageProcessor()->SetTransformationValue(
+ KUidECamEventImageProcessingEffect, effect);
+
#else
Q_UNUSED(newValue)
#endif
@@ -159,13 +161,10 @@
CX_DEBUG_ENTER_FUNCTION();
CX_DEBUG_ASSERT(mCameraDevice.camera());
- CCamera::TWhiteBalance wb = CxeSettingsMapperSymbian::Map2CameraWb(newValue.toInt());
+ CCamera::TWhiteBalance wb = CxeSettingsMapperSymbian::Map2CameraWb(
+ static_cast<Cxe::Whitebalance>(newValue.toInt()));
- if (wb != mCameraDevice.camera()->WhiteBalance()) {
- TRAP_IGNORE( mCameraDevice.camera()->SetWhiteBalanceL(wb) );
- } else {
- CX_DEBUG(("CxeSettingsControlSymbian: value up-to-date"));
- }
+ TRAP_IGNORE(mCameraDevice.camera()->SetWhiteBalanceL(wb));
CX_DEBUG_EXIT_FUNCTION();
}
@@ -181,17 +180,15 @@
int iso = newValue.toInt();
- if (iso != mCameraDevice.advancedSettings()->IsoRate()) {
- CCamera::CCameraAdvancedSettings::TISORateType type;
- if(iso == 0) {
- // Automatic ISO rate
- type = CCamera::CCameraAdvancedSettings::EISOAutoUnPrioritised;
- } else {
- // Manual ISO rate
- type = CCamera::CCameraAdvancedSettings::EISOManual;
- }
- TRAP_IGNORE(mCameraDevice.advancedSettings()->SetISORateL(type, iso));
+ CCamera::CCameraAdvancedSettings::TISORateType type;
+ if (iso == 0) {
+ // Automatic ISO rate
+ type = CCamera::CCameraAdvancedSettings::EISOAutoUnPrioritised;
+ } else {
+ // Manual ISO rate
+ type = CCamera::CCameraAdvancedSettings::EISOManual;
}
+ TRAP_IGNORE(mCameraDevice.advancedSettings()->SetISORateL(type, iso));
CX_DEBUG_EXIT_FUNCTION();
}
@@ -210,16 +207,13 @@
CX_ASSERT_ALWAYS(mCameraDevice.imageProcessor());
// Scale UI values of -2..2 to ECAM range -100..100.
- int currentSharpness = mCameraDevice.imageProcessor()->TransformationValue(KUidECamEventImageProcessingAdjustSharpness);
- int newSharpness = newValue.toReal()*50;
+ int newSharpness = newValue.toReal() * 50;
- CX_DEBUG(("Current sharpness [uid:0x%08x] value is [%d]", KUidECamEventImageProcessingAdjustSharpness, currentSharpness));
- CX_DEBUG(("Setting sharpness [uid:0x%08x] to value [%d]", KUidECamEventImageProcessingAdjustSharpness, newSharpness));
- if (newSharpness != currentSharpness) {
- mCameraDevice.imageProcessor()->SetTransformationValue(KUidECamEventImageProcessingAdjustSharpness, newSharpness);
- } else {
- CX_DEBUG(("CxeSettingsControlSymbian: value up-to-date"));
- }
+ CX_DEBUG(("Setting sharpness [uid:0x%08x] to value [%d]",
+ KUidECamEventImageProcessingAdjustSharpness, newSharpness));
+ mCameraDevice.imageProcessor()->SetTransformationValue(
+ KUidECamEventImageProcessingAdjustSharpness, newSharpness);
+
#else
Q_UNUSED(newValue)
#endif
@@ -237,16 +231,13 @@
CX_ASSERT_ALWAYS(mCameraDevice.imageProcessor());
// Scale UI values of -2..2 to ECAM range -100..100.
- int currentContrast = mCameraDevice.imageProcessor()->TransformationValue(KUidECamEventImageProcessingAdjustContrast);
- int newContrast = newValue.toReal()*50;
+ int newContrast = newValue.toReal() * 50;
- CX_DEBUG(("Current contrast [uid:0x%08x] value is [%d]", KUidECamEventImageProcessingAdjustContrast, currentContrast));
- CX_DEBUG(("Setting contrast [uid:0x%08x] to value [%d]", KUidECamEventImageProcessingAdjustContrast, newContrast));
- if (newContrast != currentContrast) {
- mCameraDevice.imageProcessor()->SetTransformationValue(KUidECamEventImageProcessingAdjustContrast, newContrast);
- } else {
- CX_DEBUG(("CxeSettingsControlSymbian: value up-to-date"));
- }
+ CX_DEBUG(("Setting contrast [uid:0x%08x] to value [%d]",
+ KUidECamEventImageProcessingAdjustContrast, newContrast));
+
+ mCameraDevice.imageProcessor()->SetTransformationValue(
+ KUidECamEventImageProcessingAdjustContrast, newContrast);
CX_DEBUG_EXIT_FUNCTION();
}
@@ -261,16 +252,13 @@
CX_ASSERT_ALWAYS(mCameraDevice.imageProcessor());
// Scale UI values of -10..10 to ECAM range -100..100.
- int currentBrightness = mCameraDevice.imageProcessor()->TransformationValue(KUidECamEventImageProcessingAdjustBrightness);
- int newBrightness = newValue.toInt()*10;
+ int newBrightness = newValue.toInt() * 10;
- CX_DEBUG(("Current brightness [uid:0x%08x] value is [%d]", KUidECamEventImageProcessingAdjustBrightness, currentBrightness));
- CX_DEBUG(("Setting brightness [uid:0x%08x] to value [%d]", KUidECamEventImageProcessingAdjustBrightness, newBrightness));
- if (newBrightness != currentBrightness) {
- mCameraDevice.imageProcessor()->SetTransformationValue(KUidECamEventImageProcessingAdjustBrightness, newBrightness);
- } else {
- CX_DEBUG(("CxeSettingsControlSymbian: value up-to-date"));
- }
+ CX_DEBUG(("Setting brightness [uid:0x%08x] to value [%d]",
+ KUidECamEventImageProcessingAdjustBrightness, newBrightness));
+
+ mCameraDevice.imageProcessor()->SetTransformationValue(
+ KUidECamEventImageProcessingAdjustBrightness, newBrightness);
CX_DEBUG_EXIT_FUNCTION();
}
@@ -284,13 +272,11 @@
CX_DEBUG_ENTER_FUNCTION();
CX_DEBUG_ASSERT(mCameraDevice.advancedSettings());
- CCamera::TExposure exposure = CxeSettingsMapperSymbian::Map2CameraExposureMode(newValue.toInt());
+ CCamera::TExposure exposure =
+ CxeSettingsMapperSymbian::Map2CameraExposureMode(
+ static_cast<Cxe::ExposureMode>(newValue.toInt()));
- if(exposure != mCameraDevice.advancedSettings()->ExposureMode()) {
- mCameraDevice.advancedSettings()->SetExposureMode(exposure);
- } else {
- CX_DEBUG(("CxeSettingsControlSymbian: value up-to-date"));
- }
+ mCameraDevice.advancedSettings()->SetExposureMode(exposure);
CX_DEBUG_EXIT_FUNCTION();
}
@@ -307,13 +293,9 @@
// Exposure compensation is a float value, e.g. "-1.5".
// ECAM interface takes integer values, so KECamFineResolutionFactor from
// ecamconstants.h needs to be used as scaler.
- int ev = newValue.toReal()*KECamFineResolutionFactor;
+ int ev = newValue.toReal() * KECamFineResolutionFactor;
- if (ev != mCameraDevice.advancedSettings()->ExposureCompensationStep()) {
- mCameraDevice.advancedSettings()->SetExposureCompensationStep(ev);
- } else {
- CX_DEBUG(("CxeSettingsControlSymbian: value up-to-date"));
- }
+ mCameraDevice.advancedSettings()->SetExposureCompensationStep(ev);
CX_DEBUG_EXIT_FUNCTION();
}
@@ -327,13 +309,10 @@
CX_DEBUG_ENTER_FUNCTION();
CX_ASSERT_ALWAYS(mCameraDevice.camera());
- CCamera::TFlash flash = CxeSettingsMapperSymbian::Map2CameraFlash(newValue.toInt());
+ CCamera::TFlash flash = CxeSettingsMapperSymbian::Map2CameraFlash(
+ static_cast<Cxe::FlashMode>(newValue.toInt()));
- if (flash != mCameraDevice.camera()->Flash()) {
- TRAP_IGNORE(mCameraDevice.camera()->SetFlashL(flash));
- } else {
- CX_DEBUG(("CxeSettingsControlSymbian: value up-to-date"));
- }
+ TRAP_IGNORE(mCameraDevice.camera()->SetFlashL(flash));
CX_DEBUG_EXIT_FUNCTION();
}
@@ -346,7 +325,7 @@
{
CX_DEBUG_ENTER_FUNCTION();
MCameraFaceTracking *faceTracking = mCameraDevice.faceTracking();
- if(faceTracking) {
+ if (faceTracking) {
TRAP_IGNORE(faceTracking->SetFaceTrackingL(newValue.toInt()));
}
CX_DEBUG_EXIT_FUNCTION();
--- a/camerauis/cameraxui/cxengine/src/cxesettingsimp.cpp Thu Jul 15 01:55:05 2010 +0300
+++ b/camerauis/cameraxui/cxengine/src/cxesettingsimp.cpp Fri Jul 23 11:35:41 2010 +0300
@@ -22,130 +22,55 @@
#include <QVariant>
#include <QList>
#include <QMetaType>
-#include <ecam.h>
-#include <ecamadvsettingsuids.hrh>
-#include <ecamadvsettings.h>
#include <QObject>
-#include "cxesettingsmodel.h"
#include "cxesettingsimp.h"
-#include "cxesettings.h"
#include "cxutils.h"
#include "cxenamespace.h"
#include "cxeerror.h"
+#include "cxesettingsstore.h"
+#include "cxeexception.h"
+#ifdef Q_OS_SYMBIAN
#include "OstTraceDefinitions.h"
#ifdef OST_TRACE_COMPILER_IN_USE
#include "cxesettingsimpTraces.h"
#endif
+#endif // Q_OS_SYMBIAN
+// signatures for setting listener slots
+const char *SETTING_LISTENER_SIGNATURE1 = "settingChanged(const QString &, const QVariant &)";
+const char *SETTING_LISTENER_SIGNATURE2 = "settingChanged(const QVariant &)";
-/*!
- Load image/video specific settings during mode change or startup
+/*
+* CxeSettingsImp::CxeSettingsImp
*/
-void CxeSettingsImp::loadSettings(Cxe::CameraMode mode)
+CxeSettingsImp::CxeSettingsImp(CxeSettingsStore *settingStore)
+: mSettingStore(settingStore),
+ mVariationSettings(),
+ mSceneModeStore(),
+ mCameraMode(Cxe::ImageMode)
{
CX_DEBUG_ENTER_FUNCTION();
- OstTrace0(camerax_performance, CXESETTINGSIMP_LOADSETTINGS_IN, "msg: e_CX_SETTINGS_LOADSETTINGS 1");
-
-
- // inform the settings model for the change in mode.
- mSettingsModel.cameraModeChanged(mode);
+ loadVariationSettings();
- if (mode == Cxe::ImageMode) {
- emit sceneChanged(mSettingsModel.currentImageScene());
- } else {
- emit sceneChanged(mSettingsModel.currentVideoScene());
- }
-
- OstTrace0(camerax_performance, CXESETTINGSIMP_LOADSETTINGS_OUT, "msg: e_CX_SETTINGS_LOADSETTINGS 0");
CX_DEBUG_EXIT_FUNCTION();
}
-
-
-/*!
- Return the current integer setting value for the given key
+/*
+* CxeSettingsImp::close
*/
-CxeError::Id CxeSettingsImp::get(const QString &key, int &value) const
-{
- CX_DEBUG_ENTER_FUNCTION();
-
- QVariant v;
- CxeError::Id err = mSettingsModel.getSettingValue(key, v);
-
- bool isInt;
- value = v.toInt(&isInt); // 0 denotes base, check the API
-
- if (isInt) {
- CX_DEBUG(("CxeSettingsImp::get - key: %s value: %d",
- key.toAscii().data(), value ));
- } else {
- err = CxeError::NotSupported;
- }
-
- CX_DEBUG_EXIT_FUNCTION();
-
- return err;
-}
-
-
-
-
-/*!
- Return the current real setting value for the given key
-*/
-CxeError::Id CxeSettingsImp::get(const QString &key, qreal &value) const
+CxeSettingsImp::~CxeSettingsImp()
{
CX_DEBUG_ENTER_FUNCTION();
-
- QVariant v;
- CxeError::Id err = mSettingsModel.getSettingValue(key, v);
-
- bool isReal;
- value = v.toReal(&isReal);
-
- if (isReal) {
- CX_DEBUG(("CxeSettingsImp::get - key: %s value: %f",
- key.toAscii().data(), value ));
- } else {
- err = CxeError::NotSupported;
- }
-
- CX_DEBUG_EXIT_FUNCTION();
-
- return err;
-}
-
+ delete mSettingStore;
-/*!
- Return the current string setting value for the given key
-*/
-CxeError::Id CxeSettingsImp::get(
- const QString &key, QString &stringValue) const
-{
- CX_DEBUG_ENTER_FUNCTION();
-
- QVariant value;
- CxeError::Id err = getSceneMode(key, stringValue);
-
- if (err == CxeError::NotFound) {
- // read from settings store
- err = mSettingsModel.getSettingValue(key, value);
- stringValue = value.toString();
- }
-
- CX_DEBUG(("CxeSettingsImp::get - key: %s value: %s",
- key.toAscii().data(), stringValue.toAscii().data()));
+ mVariationSettings.clear();
CX_DEBUG_EXIT_FUNCTION();
-
- return err;
}
-
-
/*
* Reads a value from cenrep
* @param key - setting key
@@ -160,41 +85,47 @@
QVariant &value) const
{
CX_DEBUG_ENTER_FUNCTION();
+ CX_DEBUG_ASSERT(mSettingStore);
- mSettingsModel.getSettingValue(uid, key, type, value);
+ mSettingStore->startMonitoring(uid, key, type, value);
CX_DEBUG_EXIT_FUNCTION();
}
+/*!
+ Reset static settings (persistent settings)
+*/
+void CxeSettingsImp::reset()
+{
+ CX_DEBUG_ENTER_FUNCTION();
+
+ CX_DEBUG_ASSERT(mSettingStore);
+ mSettingStore->reset();
+
+ CX_DEBUG_EXIT_FUNCTION();
+}
/*!
- Get the current scene mode setting value for the given key
+* Get the configured run-time value associated with the key.
+* @Param key - Setting key Id ( refer to CxeSettingIds in cxenums.h )
+* @Param value - contains the value associated with the key.
+* @returns CxeError::None if successful or any CxeError specific error code.
*/
-CxeError::Id CxeSettingsImp::getSceneMode(
- const QString &key, QString &stringValue) const
+CxeError::Id CxeSettingsImp::getVariationValue(const QString &key, QVariant &value)
{
CX_DEBUG_ENTER_FUNCTION();
CxeError::Id err = CxeError::None;
- CxeScene scene;
- if(CxeSettingIds::IMAGE_SCENE == key) {
- scene = mSettingsModel.currentImageScene();
- } else if(CxeSettingIds::VIDEO_SCENE == key) {
- scene = mSettingsModel.currentVideoScene();
+ // read run-time configuration value
+ if ( mVariationSettings.contains(key) ) {
+ value = qVariantFromValue<QVariantList > (mVariationSettings.value(key));
} else {
err = CxeError::NotFound;
}
- if (err == CxeError::None) {
- stringValue = scene["sceneId"].toString();
- }
-
- CX_DEBUG(("CxeSettingsImp::get - key: %s value: %s",
- key.toAscii().data(), stringValue.toAscii().data()));
-
CX_DEBUG_EXIT_FUNCTION();
return err;
@@ -202,139 +133,401 @@
/*!
- Set new int value for the given key
-*/
-CxeError::Id CxeSettingsImp::set(const QString &key, int newValue)
+ * Add listener for changes in one setting. When the value of the setting changes, the given
+ * slot is invoked on given object.
+ *
+ * @param settingKey Setting to listen to
+ * @param target Object that the slot will be invoked for
+ * @param slot Slot that will be invoked. The slot can have either of these two signatures:
+ * slotName(const QVariant&) only new value of setting is passed as parameter
+ * slotName(const QString&, const QVariant&) both setting key and new value are passed as parameter
+ *
+ * @return boolean to indicate success
+ *
+ */
+bool CxeSettingsImp::listenForSetting(const QString &settingKey, QObject *target, const char *slot)
{
+
CX_DEBUG_ENTER_FUNCTION();
+ CX_DEBUG_ASSERT(target && slot);
+
+ // SLOT() macro adds '1' to the beginning of string so we use slot+1 to get the name of the slot
+ CX_DEBUG(("Adding listener %s::%s for key %s", target->metaObject()->className(), slot+1, settingKey.toAscii().data()));
+ QByteArray normalizedSlotName = QMetaObject::normalizedSignature(slot+1);
+
+ int slotIndex = target->metaObject()->indexOfSlot(normalizedSlotName);
- CX_DEBUG(("CxeSettingsImp::set - key: %s value: %d",
- key.toAscii().data(), newValue));
+ bool ok = false;
+ if (slotIndex > -1) {
+ CX_DEBUG(("Slot found, checking signature"));
+ // verify that slot is correct type
+ if (QMetaObject::checkConnectArgs(QMetaObject::normalizedSignature(SETTING_LISTENER_SIGNATURE1), normalizedSlotName) ||
+ QMetaObject::checkConnectArgs(QMetaObject::normalizedSignature(SETTING_LISTENER_SIGNATURE2), normalizedSlotName)) {
+
+ CX_DEBUG(("Slot signature ok, adding listener"));
+
+ // check if list for given key already exists
+ if (!mSettingListeners.contains(settingKey)) {
+ mSettingListeners.insert(settingKey, CxeSettingListenerList());
+ }
- CxeError::Id error = mSettingsModel.set(key, newValue);
- if (error == CxeError::None) {
- emit settingValueChanged(key, newValue);
+ // get QMetaMethod object
+ QMetaMethod method = target->metaObject()->method(slotIndex);
+ // add listener to the list
+ CxeSettingListenerList& list = mSettingListeners[settingKey];
+ list.append(CxeSettingListener(target, method));
+
+ // connect to destroyed() signal so we can remove listener if it's deleted
+ connect(target, SIGNAL(destroyed(QObject*)), this, SLOT(handleListenerDestroyed(QObject*)));
+
+ ok = true;
+ } else {
+ CX_DEBUG(("Slot signature doesn't match, can't add listener"));
+ }
+
+ } else {
+ CX_DEBUG(("Slot not found, can't add listener"));
}
CX_DEBUG_EXIT_FUNCTION();
-
- return error;
+ return ok;
}
+/*!
+ Load image/video specific settings during mode change or startup
+*/
+void CxeSettingsImp::loadSettings(Cxe::CameraMode mode)
+{
+ CX_DEBUG_ENTER_FUNCTION();
+ OstTrace0(camerax_performance, CXESETTINGSIMP_LOADSETTINGS_IN, "msg: e_CX_SETTINGS_LOADSETTINGS 1");
+ mCameraMode = mode;
+
+ // inform the settings model for the change in mode.
+ if (mode == Cxe::ImageMode) {
+ restoreImageSettings();
+ notifyListeners(CxeSettingIds::IMAGE_SCENE_DATA, mSceneModeStore.currentScene(Cxe::ImageMode));
+ notifyListeners(CxeSettingIds::IMAGE_SCENE, mSceneModeStore.currentSceneId(Cxe::ImageMode));
+ emit settingValueChanged(CxeSettingIds::IMAGE_SCENE, mSceneModeStore.currentSceneId(Cxe::ImageMode));
+ } else {
+ restoreVideoSettings();
+ notifyListeners(CxeSettingIds::VIDEO_SCENE_DATA, mSceneModeStore.currentScene(Cxe::VideoMode));
+ notifyListeners(CxeSettingIds::VIDEO_SCENE, mSceneModeStore.currentSceneId(Cxe::VideoMode));
+ emit settingValueChanged(CxeSettingIds::VIDEO_SCENE, mSceneModeStore.currentSceneId(Cxe::VideoMode));
+ }
+
+ OstTrace0(camerax_performance, CXESETTINGSIMP_LOADSETTINGS_OUT, "msg: e_CX_SETTINGS_LOADSETTINGS 0");
+ CX_DEBUG_EXIT_FUNCTION();
+}
/*!
- Set new int value for the given key
+* Get setting value associated with the key.
+* @Param key - Setting key Id ( refer to CxeSettingIds in cxenums.h )
+* @Param value - contains the value associated with the key.
+* @returns CxeError::None if successful or any CxeError specific error code.
*/
-CxeError::Id CxeSettingsImp::set(const QString &key, qreal newValue)
+void CxeSettingsImp::getValue(const QString &key, QVariant &value) const
{
CX_DEBUG_ENTER_FUNCTION();
+ CX_DEBUG_ASSERT(mSettingStore);
- CX_DEBUG(("CxeSettingsImp::set - key: %s value: %f",
- key.toAscii().data(), newValue));
+
+ CxeError::Id err = CxeError::None;
- CxeError::Id error = mSettingsModel.set(key, newValue);
+ // check if getting scene mode
+ if(key == CxeSettingIds::IMAGE_SCENE_DATA) {
+ value = mSceneModeStore.currentScene(Cxe::ImageMode);
+ } else if(key == CxeSettingIds::VIDEO_SCENE_DATA) {
+ value = mSceneModeStore.currentScene(Cxe::VideoMode);
+ } else {
+ // Try first to find the item from cenrep store.
+ err = mSettingStore->get(key, value);
- if (error == CxeError::None) {
- emit settingValueChanged(key, newValue);
+ // If setting is not in cenrep store, try fetching it from scene settings.
+ if (!err) {
+ CX_DEBUG(("Got value %s from settings store", value.toString().toAscii().data()));
+ } else {
+ // setting not found in setting store, try finding if its scene specific setting.
+ CX_DEBUG(( "fetching value from scene settings" ));
+ err = mSceneModeStore.sceneSettingValue(mCameraMode, key, value);
+ }
+ if (err) {
+ throw CxeException(err);
+ }
}
CX_DEBUG_EXIT_FUNCTION();
- return error;
}
-
/*!
- Set new string value for the given key
+* Set a value to the key.
+* @Param key - Setting key Id ( refer to CxeSettingIds in cxenums.h )
+* @Param value - contains the value associated with the key.
+* @returns CxeError::None if successful or any CxeError specific error code.
*/
-CxeError::Id CxeSettingsImp::set(const QString &key, const QString &newValue)
+void CxeSettingsImp::setValue(const QString &key, const QVariant &newValue)
{
CX_DEBUG_ENTER_FUNCTION();
-
- CX_DEBUG(("CxeSettingsImp::set - key: %s value: %s",
- key.toAscii().data(), newValue.toAscii().data()));
+ CX_DEBUG_ASSERT(mSettingStore);
- CxeError::Id error = setSceneMode(key, newValue);
+ CxeError::Id err;
+ // check if setting scene mode
+ if(key == CxeSettingIds::IMAGE_SCENE) {
+ setImageScene(newValue.toString());
+ } else if(key == CxeSettingIds::VIDEO_SCENE) {
+ setVideoScene(newValue.toString());
+ } else if(key == CxeSettingIds::IMAGE_SCENE_DATA || key == CxeSettingIds::VIDEO_SCENE_DATA) {
+ // setting whole scene by value is not supported
+ throw CxeException(CxeError::NotSupported);
+ } else {
+ // Try storing new value to cenrep
+ err = mSettingStore->set(key, newValue);
- if (error == CxeError::NotFound) {
- // not scene mode setting, try setting value to settings store
- mSettingsModel.set(key, newValue);
+ if (err) {
+ CX_DEBUG(( "Key not found in cenrepstore, writing value to scene settings" ));
+ err = mSceneModeStore.setSceneSettingValue(mCameraMode, key, newValue);
+ }
+
+ if (err) {
+ throw CxeException(err);
+ }
+
+ // send notifications
emit settingValueChanged(key, newValue);
+ notifyListeners(key, newValue);
}
CX_DEBUG_EXIT_FUNCTION();
- return error;
}
-
-
/*!
- Set the current scene mode setting value for the given key
+* Restores image settings, during mode change or during startup.
*/
-CxeError::Id CxeSettingsImp::setSceneMode(
- const QString &key,const QString &newValue)
+void CxeSettingsImp::restoreImageSettings()
{
CX_DEBUG_ENTER_FUNCTION();
- CX_DEBUG(("CxeSettingsImp::set - key: %s value: %s",
- key.toAscii().data(), newValue.toAscii().data()));
+ QString currentSceneInUse = mSceneModeStore.currentSceneId(Cxe::ImageMode);
- CxeError::Id error = CxeError::None;
- CxeScene scene;
+ // get the image scene value from cenrep and load the scene settings
+ QString key(CxeSettingIds::IMAGE_SCENE);
+ QString cenrepSceneValue = CxeSettings::get<QString>(key);
- if(CxeSettingIds::IMAGE_SCENE == key) {
- error = mSettingsModel.setImageScene(newValue);
- scene = mSettingsModel.currentImageScene();
- } else if(CxeSettingIds::VIDEO_SCENE == key) {
- error = mSettingsModel.setVideoScene(newValue);
- scene = mSettingsModel.currentVideoScene();
- } else {
- error = CxeError::NotFound;
+ bool ok2LoadSceneSettings = (cenrepSceneValue != currentSceneInUse);
+
+ if (ok2LoadSceneSettings) {
+ // loading scene settings
+ mSceneModeStore.setCurrentScene(Cxe::ImageMode, cenrepSceneValue);
}
- if (error == CxeError::None) {
- // scene mode set, inform clients about scene mode change
- emit sceneChanged(scene);
- }
+ // Updating Flash setting from cenrep
+ key = CxeSettingIds::FLASH_MODE;
+ int flashMode = CxeSettings::get<int>(key);
- CX_DEBUG_EXIT_FUNCTION();
+ // update local datastructure with flash setting value from cenrep.
+ CX_DEBUG(( "flash setting value %d", flashMode));
+ mSceneModeStore.setSceneSettingValue(Cxe::ImageMode, key, flashMode);
- return error;
-}
+ // Updating Face Tracking setting from cenrep
+ key = CxeSettingIds::FACE_TRACKING;
+ int faceTracking = CxeSettings::get<int>(key);
-/*!
- Reset static settings (persistent settings)
-*/
-void CxeSettingsImp::reset()
-{
- CX_DEBUG_ENTER_FUNCTION();
+ // update local datastructure with flash setting value from cenrep.
+ CX_DEBUG(( "Face Tracking setting value %d", faceTracking));
+ mSceneModeStore.setSceneSettingValue(Cxe::ImageMode, key, faceTracking);
- mSettingsModel.reset();
CX_DEBUG_EXIT_FUNCTION();
}
+/*!
+* Restores video settings, during mode change or during startup.
+*/
+void CxeSettingsImp::restoreVideoSettings()
+{
+ CX_DEBUG_ENTER_FUNCTION();
-/*
-* CxeSettingsImp::CxeSettingsImp
+ QString currentSceneInUse = mSceneModeStore.currentSceneId(Cxe::VideoMode);
+
+ // get the video scene value from cenrep and load the scene settings
+ QString cenrepSceneValue = CxeSettings::get<QString>(CxeSettingIds::VIDEO_SCENE);
+
+ bool ok2LoadSceneSettings = (cenrepSceneValue != currentSceneInUse);
+
+ if (ok2LoadSceneSettings) {
+ // loading video scene settings
+ mSceneModeStore.setCurrentScene(Cxe::VideoMode, cenrepSceneValue);
+ }
+
+ CX_DEBUG_EXIT_FUNCTION();
+}
+
+/*!
+* Set new Image scene mode.
+* @returns CxeError::None if successful or any CxeError specific error code.
+*/
+void CxeSettingsImp::setImageScene(const QString &newScene)
+{
+ CX_DEBUG_ENTER_FUNCTION();
+
+ // load scene specific settings
+ mSceneModeStore.setCurrentScene(Cxe::ImageMode, newScene);
+
+ // saving current image scene to cenrep
+ CxeError::Id err = mSettingStore->set(CxeSettingIds::IMAGE_SCENE, newScene);
+ CxeException::throwIfError(err);
+
+ // saving flash value from scene to cenrep
+ // call CxeSettingStore::set directly because we don't want to send notifications
+ // about these changes
+ QString key(CxeSettingIds::FLASH_MODE);
+ err = mSettingStore->set(key, mSceneModeStore.currentScene(Cxe::ImageMode)[key].toInt());
+
+ CxeException::throwIfError(err);
+ // saving face tracking value from scene to cenrep
+ key = CxeSettingIds::FACE_TRACKING;
+ err = mSettingStore->set(key, mSceneModeStore.currentScene(Cxe::ImageMode)[key].toInt());
+ CxeException::throwIfError(err);
+
+ // send notifications
+ emit settingValueChanged(CxeSettingIds::IMAGE_SCENE, mSceneModeStore.currentSceneId(Cxe::ImageMode));
+ notifyListeners(CxeSettingIds::IMAGE_SCENE, mSceneModeStore.currentSceneId(Cxe::ImageMode));
+ notifyListeners(CxeSettingIds::IMAGE_SCENE_DATA, mSceneModeStore.currentScene(Cxe::ImageMode));
+
+ CX_DEBUG_EXIT_FUNCTION();
+
+}
+
+/*!
+* Set new video scene mode.
+* @returns CxeError::None if successful or any CxeError specific error code.
*/
-CxeSettingsImp::CxeSettingsImp(CxeSettingsModel &settingsModel)
-: mSettingsModel(settingsModel)
+void CxeSettingsImp::setVideoScene(const QString &newScene)
+{
+ CX_DEBUG_ENTER_FUNCTION();
+
+ mSceneModeStore.setCurrentScene(Cxe::VideoMode, newScene);
+
+ // video scene set successfully, store the scene value to cenrep
+ CxeError::Id err = mSettingStore->set(CxeSettingIds::VIDEO_SCENE, newScene);
+ CxeException::throwIfError(err);
+
+ emit settingValueChanged(CxeSettingIds::VIDEO_SCENE, mSceneModeStore.currentSceneId(Cxe::VideoMode));
+ notifyListeners(CxeSettingIds::VIDEO_SCENE, mSceneModeStore.currentSceneId(Cxe::VideoMode));
+ notifyListeners(CxeSettingIds::VIDEO_SCENE_DATA, mSceneModeStore.currentScene(Cxe::VideoMode));
+
+ CX_DEBUG_EXIT_FUNCTION();
+
+}
+
+/*!
+* Loads all run-time variation settings
+*/
+void CxeSettingsImp::loadVariationSettings()
+{
+ CX_DEBUG_ENTER_FUNCTION();
+ CX_DEBUG_ASSERT( mSettingStore );
+
+ QList<QString> variationKeys;
+ // all supported runtime variation keys are fetched from here.
+ variationKeys.append(CxeVariationKeys::FREE_MEMORY_LEVELS);
+ variationKeys.append(CxeVariationKeys::STILL_MAX_ZOOM_LIMITS);
+ variationKeys.append(CxeVariationKeys::VIDEO_MAX_ZOOM_LIMITS);
+
+ // load all run-time setting values from cenrep.
+ mVariationSettings = mSettingStore->loadVariationSettings(variationKeys);
+
+ CX_DEBUG_EXIT_FUNCTION();
+}
+
+/*!
+ * Notify setting listeners that setting has changed
+ * @param settingKey Setting that has changed
+ * @param newValue New value of the setting
+ */
+void CxeSettingsImp::notifyListeners(const QString &settingKey, const QVariant &newValue)
{
- CX_DEBUG_IN_FUNCTION();
-}
+ CX_DEBUG_ENTER_FUNCTION();
+
+ CX_DEBUG(("CxeSettingsImp::notifyListeners settingKey=%s", settingKey.toAscii().data()));
+
+ if (mSettingListeners.contains(settingKey)) {
+ CX_DEBUG(("Listeners found"));
+ // get list of listener
+ CxeSettingListenerList& list = mSettingListeners[settingKey];
+
+ // iterate through the list and call all listeners
+ CxeSettingListenerList::const_iterator i = list.constBegin();
+ for(; i != list.constEnd(); ++i) {
+
+ QObject *object = (*i).first;
+ QMetaMethod slot = (*i).second;
+
+ CX_DEBUG_ASSERT(object);
+
+ // invoke the slot
+ CX_DEBUG(("Calling slot %s::%s", object->metaObject()->className(), slot.signature()));
+
+ bool ok = false;
+ if (slot.parameterTypes().size() == 2) {
+ // slot has two parameters, send settingKey as well
+ ok = slot.invoke(object,
+ Qt::AutoConnection,
+ Q_ARG(QString, settingKey),
+ Q_ARG(QVariant, newValue));
+ } else {
+ // don't send settingKey as parameter
+ ok = slot.invoke(object,
+ Qt::AutoConnection,
+ Q_ARG(QVariant, newValue));
+ }
+
+ if (!ok) {
+ CX_DEBUG(("QMetaMethod::invoke() failed, listener not notified"))
+ }
+
+ }
+
+ } else {
+ CX_DEBUG(("NO listeners found"));
+ }
-/*
-* CxeSettingsImp::close
-*/
-CxeSettingsImp::~CxeSettingsImp()
+ CX_DEBUG_EXIT_FUNCTION();
+}
+
+/*!
+ * Handle deletion of registered listener.
+ */
+void CxeSettingsImp::handleListenerDestroyed(QObject *object)
{
- CX_DEBUG_IN_FUNCTION();
+ CX_DEBUG_ENTER_FUNCTION();
+
+ QList<QString> keyList = mSettingListeners.keys();
+
+ for (int i = 0; i < keyList.size(); i++) {
+
+ QString key = keyList[i];
+ CxeSettingListenerList& list = mSettingListeners[key];
+
+ for (int j = 0; j < list.size(); j++) {
+ CxeSettingListener &listener = list[j];
+ if (listener.first == object) {
+ list.removeAt(j--);
+ }
+ }
+
+ // removed last listener for this key
+ if (list.size() == 0) {
+ mSettingListeners.remove(key);
+ }
+ }
+
+ CX_DEBUG_EXIT_FUNCTION();
}
// end of file
--- a/camerauis/cameraxui/cxengine/src/cxesettingsmappersymbian.cpp Thu Jul 15 01:55:05 2010 +0300
+++ b/camerauis/cameraxui/cxengine/src/cxesettingsmappersymbian.cpp Fri Jul 23 11:35:41 2010 +0300
@@ -1,5 +1,5 @@
/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies).
* All rights reserved.
* This component and the accompanying materials are made available
* under the terms of "Eclipse Public License v1.0"
@@ -14,10 +14,8 @@
* Description:
*
*/
-/*
-* Symbian specific settings handling
-*/
+#include <QRegExp>
#include <ecamadvsettingsuids.hrh>
#include "cxeautofocuscontrol.h"
@@ -27,149 +25,279 @@
using namespace Cxe;
-/*
-* Map White balance UI value to its corresponding CCamera value
+
+
+/*!
+ Map Cxe::Whitebalance value to its corresponding CCamera value.
*/
+CCamera::TWhiteBalance CxeSettingsMapperSymbian::Map2CameraWb(
+ Cxe::Whitebalance whiteBalance )
+{
+ CCamera::TWhiteBalance wb(CCamera::EWBAuto);
-CCamera::TWhiteBalance
-CxeSettingsMapperSymbian::Map2CameraWb(int wbId )
+ switch (whiteBalance) {
+ case WhitebalanceSunny:
+ wb = CCamera::EWBDaylight;
+ break;
+ case WhitebalanceCloudy:
+ wb = CCamera::EWBCloudy;
+ break;
+ case WhitebalanceIncandescent:
+ wb = CCamera::EWBTungsten;
+ break;
+ case WhitebalanceFluorescent:
+ wb = CCamera::EWBFluorescent;
+ break;
+ case WhitebalanceAutomatic:
+ default:
+ wb = CCamera::EWBAuto;
+ break;
+ }
+ return wb;
+}
+
+
+/*!
+ Map Cxe::FlashMode to its corresponding CCamera value.
+*/
+CCamera::TFlash CxeSettingsMapperSymbian::Map2CameraFlash(
+ Cxe::FlashMode flashMode)
+{
+ CCamera::TFlash flash(CCamera::EFlashAuto);
+
+ switch (flashMode) {
+ case FlashAntiRedEye:
+ flash = CCamera::EFlashRedEyeReduce;
+ break;
+ case FlashOn:
+ flash = CCamera::EFlashForced;
+ break;
+ case FlashOff:
+ flash = CCamera::EFlashNone;
+ break;
+ case FlashAuto:
+ default:
+ flash = CCamera::EFlashAuto;
+ break;
+ }
+ return flash;
+}
+
+
+/*!
+ Map Cxe::ExposureMode to its corresponding CCamera value.
+*/
+CCamera::TExposure CxeSettingsMapperSymbian::Map2CameraExposureMode(
+ Cxe::ExposureMode exposureMode)
{
- CCamera::TWhiteBalance wb( CCamera::EWBAuto );
- switch(wbId) {
- case WhitebalanceAutomatic: wb = CCamera::EWBAuto; break;
- case WhitebalanceSunny: wb = CCamera::EWBDaylight; break;
- case WhitebalanceCloudy: wb = CCamera::EWBCloudy; break;
- case WhitebalanceIncandescent: wb = CCamera::EWBTungsten; break;
- case WhitebalanceFluorescent: wb = CCamera::EWBFluorescent; break;
- default:
- break;
- }
- return wb;
+ CCamera::TExposure expo(CCamera::EExposureAuto);
+
+ switch (exposureMode) {
+ case ExposureNight:
+ expo = CCamera::EExposureNight;
+ break;
+ case ExposureBacklight:
+ expo = CCamera::EExposureBacklight;
+ break;
+ case ExposureSport:
+ expo = CCamera::EExposureSport;
+ break;
+ case ExposureAuto:
+ default:
+ expo = CCamera::EExposureAuto;
+ break;
+ }
+
+ return expo;
+}
+
+
+/*!
+ Map Cxe::ExposureMode to its corresponding CCamera value.
+*/
+CCamera::CCameraImageProcessing::TEffect
+ CxeSettingsMapperSymbian::Map2CameraEffect(Cxe::Colortone colorTone)
+{
+ CCamera::CCameraImageProcessing::TEffect effect(
+ CCamera::CCameraImageProcessing::EEffectNone);
+
+ switch(colorTone) {
+ case ColortoneBlackAndWhite:
+ effect = CCamera::CCameraImageProcessing::EEffectMonochrome;
+ break;
+ case ColortoneSepia:
+ effect = CCamera::CCameraImageProcessing::EEffectSepia;
+ break;
+ case ColortoneNegative:
+ effect = CCamera::CCameraImageProcessing::EEffectNegative;
+ break;
+ case ColortoneVivid:
+ effect = CCamera::CCameraImageProcessing::EEffectVivid;
+ break;
+ case ColortoneNormal:
+ default:
+ effect = CCamera::CCameraImageProcessing::EEffectNone;
+ break;
+ }
+ return effect;
+}
+
+/*!
+ Map CxeAutoFocusControl::Mode to its corresponding CCamera value.
+*/
+CCamera::CCameraAdvancedSettings::TFocusRange
+CxeSettingsMapperSymbian::Map2CameraAutofocus(CxeAutoFocusControl::Mode afMode)
+{
+ CCamera::CCameraAdvancedSettings::TFocusRange value;
+
+ switch (afMode) {
+ case CxeAutoFocusControl::Macro:
+ value = CCamera::CCameraAdvancedSettings::EFocusRangeMacro;
+ break;
+ case CxeAutoFocusControl::Portrait:
+ value = CCamera::CCameraAdvancedSettings::EFocusRangeAuto;
+ break;
+ case CxeAutoFocusControl::Infinity:
+ value = CCamera::CCameraAdvancedSettings::EFocusRangeInfinite;
+ break;
+ case CxeAutoFocusControl::Hyperfocal:
+ value = CCamera::CCameraAdvancedSettings::EFocusRangeHyperfocal;
+ break;
+ case CxeAutoFocusControl::Auto: // Fall through
+ default:
+ value = CCamera::CCameraAdvancedSettings::EFocusRangeAuto;
+ break;
+ }
+ return value;
}
-// Map2CameraFlash
-
-CCamera::TFlash
-CxeSettingsMapperSymbian::Map2CameraFlash(int flashId)
+/*!
+ Map Cxe::DeviceOrientation to MCameraOrientation.
+*/
+MCameraOrientation::TOrientation
+ CxeSettingsMapperSymbian::Map2CameraOrientation(Cxe::DeviceOrientation
+ uiOrientation)
{
- CCamera::TFlash flash( CCamera::EFlashAuto );
- switch (flashId) {
- case FlashAuto: flash = CCamera::EFlashAuto; break;
- case FlashAntiRedEye: flash = CCamera::EFlashRedEyeReduce; break;
- case FlashOn: flash = CCamera::EFlashForced; break;
- case FlashOff: flash = CCamera::EFlashNone; break;
- default:
- break;
- }
- return flash;
+ MCameraOrientation::TOrientation cameraOrientation;
+
+ switch (uiOrientation) {
+ case Orientation90:
+ cameraOrientation = MCameraOrientation::EOrientation90;
+ break;
+ case Orientation180:
+ cameraOrientation = MCameraOrientation::EOrientation180;
+ break;
+ case Orientation270:
+ cameraOrientation = MCameraOrientation::EOrientation270;
+ break;
+ case Orientation0: // default
+ default:
+ cameraOrientation = MCameraOrientation::EOrientation0;
+ break;
+ }
+ return cameraOrientation;
}
-
-// ---------------------------------------------------------------------------
-// Map2CameraExposureMode
-// ---------------------------------------------------------------------------
-//
-CCamera::TExposure
-CxeSettingsMapperSymbian::Map2CameraExposureMode(int expModeId )
- {
- CCamera::TExposure expo( CCamera::EExposureAuto );
-
- switch ( expModeId )
+/*!
+ Helper data structure to define how MIME types are mapped to
+ MCameraUseCaseHint enumerations.
+*/
+class CxeCodecMapping
+{
+public:
+ CxeCodecMapping(const char *regexp, MCameraUseCaseHint::TVideoCodec codec,
+ MCameraUseCaseHint::TVideoProfile profile) :
+ mRegExp(regexp),
+ mCodec(codec),
+ mProfile(profile)
{
- case ExposureAuto: expo = CCamera::EExposureAuto; break;
- case ExposureNight: expo = CCamera::EExposureNight; break;
- case ExposureBacklight: expo = CCamera::EExposureBacklight; break;
- case ExposureSport: expo = CCamera::EExposureSport; break;
- default:
- break;
+ // No implementation needed
}
- return expo;
- }
-
-
-
+public:
+ QString mRegExp;
+ MCameraUseCaseHint::TVideoCodec mCodec;
+ MCameraUseCaseHint::TVideoProfile mProfile;
+};
-// ---------------------------------------------------------------------------
-// Map2CameraEffect
-// ---------------------------------------------------------------------------
-//
-CCamera::CCameraImageProcessing::TEffect
-CxeSettingsMapperSymbian::Map2CameraEffect(int colourFilterId)
- {
- CCamera::CCameraImageProcessing::TEffect effect(
- CCamera::CCameraImageProcessing::EEffectNone );
+/*!
+ Map video codec MIME type from ICM to enumerations used by the
+ MCameraUseCaseHint custom interface
- switch( colourFilterId )
- {
- case ColortoneNormal: effect = CCamera::CCameraImageProcessing::EEffectNone; break;
- case ColortoneBlackAndWhite: effect = CCamera::CCameraImageProcessing::EEffectMonochrome; break;
- case ColortoneSepia: effect = CCamera::CCameraImageProcessing::EEffectSepia; break;
- case ColortoneNegative: effect = CCamera::CCameraImageProcessing::EEffectNegative; break;
- case ColortoneVivid: effect = CCamera::CCameraImageProcessing::EEffectVivid; break;
- default:
- break;
- }
- return effect;
- }
-
-
-
-// ---------------------------------------------------------------------------
-// CxeSettingsMapperSymbian::Map2CameraAutofocus
-// ---------------------------------------------------------------------------
-//
-CCamera::CCameraAdvancedSettings::TFocusRange
-CxeSettingsMapperSymbian::Map2CameraAutofocus(CxeAutoFocusControl::Mode afMode )
+ \param[in] videoDetails CxeVideoDetails defining the current video quality.
+ \param[out] codec Reference where to store the video codec info.
+ MCameraUseCaseHint::ECodecUnknown if not known.
+ \param[out] profile Reference where to store the video profile info.
+ MCameraUseCaseHint::EProfileUnknown if not known.
+*/
+void CxeSettingsMapperSymbian::Map2UseCaseHintVideoParameters(
+ const CxeVideoDetails &videoDetails,
+ MCameraUseCaseHint::TVideoCodec &codec,
+ MCameraUseCaseHint::TVideoProfile &profile)
{
- CCamera::CCameraAdvancedSettings::TFocusRange value;
- switch( afMode ) {
- case CxeAutoFocusControl::Macro:
- value = CCamera::CCameraAdvancedSettings::EFocusRangeMacro;
- break;
- case CxeAutoFocusControl::Portrait:
- value = CCamera::CCameraAdvancedSettings::EFocusRangeAuto;
- break;
- case CxeAutoFocusControl::Infinity:
- value = CCamera::CCameraAdvancedSettings::EFocusRangeInfinite;
- break;
- case CxeAutoFocusControl::Hyperfocal:
- value = CCamera::CCameraAdvancedSettings::EFocusRangeHyperfocal;
- break;
- case CxeAutoFocusControl::Auto: // Fall through
- default:
- value = CCamera::CCameraAdvancedSettings::EFocusRangeAuto;
- break;
- }
- return value;
-}
+ typedef QPair<MCameraUseCaseHint::TVideoCodec,
+ MCameraUseCaseHint::TVideoProfile> CxeCodecAndProfile;
+
+ codec = MCameraUseCaseHint::ECodecUnknown;
+ profile = MCameraUseCaseHint::EProfileUnknown;
+
+ // Create a mapping table for mapping from the MIME type string
+ // to MCameraUseCaseHint codec and profile enums using QRegExp. Specific
+ // rules should be before more generic ones because the map is iterated in
+ // order.
+ QList<CxeCodecMapping> mappingTable;
+ mappingTable << CxeCodecMapping("^video/H263-2000",
+ MCameraUseCaseHint::ECodecH263,
+ MCameraUseCaseHint::EProfileH263P0L10)
+
+ << CxeCodecMapping("^video/H264.*profile-level-id=42801E",
+ MCameraUseCaseHint::ECodecH264,
+ MCameraUseCaseHint::EProfileH264BpL3)
+
+ << CxeCodecMapping("^video/H264.*profile-level-id=42801F",
+ MCameraUseCaseHint::ECodecH264,
+ MCameraUseCaseHint::EProfileH264BpL3_1)
+
+ << CxeCodecMapping("^video/H264", // Other H.264 profile
+ MCameraUseCaseHint::ECodecH264,
+ MCameraUseCaseHint::EProfileUnknown)
+ << CxeCodecMapping("^video/mp4v-es.*profile-level-id=2",
+ MCameraUseCaseHint::ECodecMpeg4,
+ MCameraUseCaseHint::EProfileMPEG4SpL2)
-// CxeSettingsMapperSymbian::Map2CameraOrientation
+ << CxeCodecMapping("^video/mp4v-es.*profile-level-id=3",
+ MCameraUseCaseHint::ECodecMpeg4,
+ MCameraUseCaseHint::EProfileMPEG4SpL3)
+
+ << CxeCodecMapping("^video/mp4v-es.*profile-level-id=4",
+ MCameraUseCaseHint::ECodecMpeg4,
+ MCameraUseCaseHint::EProfileMPEG4SpL4a)
+
+ << CxeCodecMapping("^video/mp4v-es", // Other MPEG-4 profile
+ MCameraUseCaseHint::ECodecMpeg4,
+ MCameraUseCaseHint::EProfileUnknown);
-MCameraOrientation::TOrientation
-CxeSettingsMapperSymbian::Map2CameraOrientation(DeviceOrientation uiOrientation)
-{
- MCameraOrientation::TOrientation cameraOrientation;
- switch(uiOrientation) {
- case Orientation90:
- cameraOrientation = MCameraOrientation::EOrientation90;
- break;
- case Orientation180:
- cameraOrientation = MCameraOrientation::EOrientation180;
- break;
- case Orientation270:
- cameraOrientation = MCameraOrientation::EOrientation270;
- break;
- case Orientation0: // default
- default:
- cameraOrientation = MCameraOrientation::EOrientation0;
- break;
+ bool found = false;
+ for (int i = 0; i < mappingTable.count() && !found; i++) {
+ QRegExp regExp(mappingTable[i].mRegExp, Qt::CaseInsensitive);
+ if (regExp.indexIn(videoDetails.mVideoCodecMimeType) >= 0) {
+ found = true;
+ codec = mappingTable[i].mCodec;
+ profile = mappingTable[i].mProfile;
+
+ CX_DEBUG(("Matched codec %d, profile 0x%x for '%s'", codec, profile,
+ videoDetails.mVideoCodecMimeType.toAscii().constData()));
+ }
}
- return cameraOrientation;
+
+ if (!found) {
+ CX_DEBUG(("No codec/profile found for '%s'",
+ videoDetails.mVideoCodecMimeType.toAscii().constData()));
+ }
}
// end of file
--- a/camerauis/cameraxui/cxengine/src/cxesettingsmodelimp.cpp Thu Jul 15 01:55:05 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,753 +0,0 @@
-/*
-* Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
-*
-*/
-/*
-* Symbian specific settings handling
-*/
-
-#include <QVariant>
-#include <QFile>
-#include <QList>
-#include <QMultiMap>
-#include <QMetaType>
-
-#include "cxesettingsmodelimp.h"
-#include "cxesettingscenrepstore.h"
-#include "cxesettings.h"
-#include "cxutils.h"
-#include "cxenamespace.h"
-#include "cxeerror.h"
-#include "cxeautofocuscontrol.h"
-
-
-using namespace Cxe;
-
-
-/*!
-* CxeSettingsModel::CxeSettingsModel
-*/
-CxeSettingsModelImp::CxeSettingsModelImp(CxeSettingsStore *settingsStore)
-{
- CX_DEBUG_ENTER_FUNCTION();
- CX_ASSERT_ALWAYS(settingsStore);
- // we take ownership of the settings store.
- mSettingStore = settingsStore;
- init();
-
- CX_DEBUG_EXIT_FUNCTION();
-}
-
-
-/*!
-* CxeSettingsModelImp::init
-*/
-void CxeSettingsModelImp::init()
-{
- CX_DEBUG_ENTER_FUNCTION();
-
- mCurrentImgScene.clear();
- mCurrentVidScene.clear();
-
- loadRuntimeSettings();
- loadImageScenes();
- loadVideoScenes();
-
- CX_DEBUG_EXIT_FUNCTION();
-}
-
-
-
-/*!
-* CxeSettingsModelImp::~CxeSettingsModelImp()
-*/
-CxeSettingsModelImp::~CxeSettingsModelImp()
-{
- CX_DEBUG_ENTER_FUNCTION();
-
- delete mSettingStore;
-
- mCurrentImgScene.clear();
- mCurrentVidScene.clear();
-
- mImageSceneModes.clear();
- mVideoSceneModes.clear();
-
- mRuntimeSettings.clear();
-
- CX_DEBUG_EXIT_FUNCTION();
-}
-
-
-
-/*!
-* Loads all run-time settings
-*/
-void CxeSettingsModelImp::loadRuntimeSettings()
-{
- CX_DEBUG_ENTER_FUNCTION();
- CX_DEBUG_ASSERT( mSettingStore );
-
- QList<QString> runtimeKeys;
- // all supported runtime keys are fetched from here.
- supportedKeys(runtimeKeys);
- // load all run-time setting values from cenrep.
- mRuntimeSettings = mSettingStore->loadRuntimeSettings(runtimeKeys);
-
- CX_DEBUG_EXIT_FUNCTION();
-}
-
-
-/*!
-* Get setting value associated with the key.
-* @Param key - Setting key Id ( refer to CxeSettingIds in cxenums.h )
-* @Param value - contains the value associated with the key.
-* @returns CxeError::None if successful or any CxeError specific error code.
-*/
-CxeError::Id CxeSettingsModelImp::getSettingValue(const QString &key, QVariant &value)
-{
- CX_DEBUG_ENTER_FUNCTION();
- CX_DEBUG_ASSERT(mSettingStore);
-
- // Try first to find the item from cenrep store.
-
- CxeError::Id err = mSettingStore->get(key, value);
-
- // If setting is not in cenrep store, try fetching it from scene settings.
- if (err) {
- // setting not found in setting store, try finding if its scene specific setting.
- CX_DEBUG(( "fetching value from scene settings" ));
- err = sceneSettingValue(key, value);
- }
-
- CX_DEBUG_EXIT_FUNCTION();
-
- return err;
-}
-
-
-
-
-/*!
-* Get setting value associated with the key.
-* @param uid - UID of component that owns the setting key
-* @Param key - key id of the setting
-* @param type - the type of key
-* @Param value - contains the value associated with the key.
-*/
-void CxeSettingsModelImp::getSettingValue(long int uid,
- unsigned long int key,
- Cxe::SettingKeyType type,
- QVariant &value)
-{
- CX_DEBUG_ENTER_FUNCTION();
- CX_DEBUG_ASSERT(mSettingStore);
-
- mSettingStore->startMonitoring(uid, key, type, value);
-
- CX_DEBUG_EXIT_FUNCTION();
-}
-
-
-
-
-/*!
-* Set a value to the key.
-* @Param key - Setting key Id ( refer to CxeSettingIds in cxenums.h )
-* @Param value - contains the value associated with the key.
-* @returns CxeError::None if successful or any CxeError specific error code.
-*/
-CxeError::Id CxeSettingsModelImp::set(const QString &key, const QVariant newValue)
-{
- CX_DEBUG_ENTER_FUNCTION();
- CX_DEBUG_ASSERT(mSettingStore);
-
- // Try storing new value to cenrep
- CxeError::Id err = mSettingStore->set(key, newValue);
-
- if (err) {
- CX_DEBUG(( "Key not found in cenrepstore, writing value to scene settings" ));
- err = setSceneSettingValue(key, newValue);
- }
-
- CX_DEBUG_EXIT_FUNCTION();
-
- return err;
-}
-
-
-/*!
-* Reset all settings
-*/
-void CxeSettingsModelImp::reset()
-{
- CX_DEBUG_ENTER_FUNCTION();
- CX_DEBUG_ASSERT(mSettingStore);
- mSettingStore->reset();
- CX_DEBUG_EXIT_FUNCTION();
-}
-
-
-/*!
-* Get the configured run-time value associated with the key.
-* @Param key - Setting key Id ( refer to CxeSettingIds in cxenums.h )
-* @Param value - contains the value associated with the key.
-* @returns CxeError::None if successful or any CxeError specific error code.
-*/
-CxeError::Id CxeSettingsModelImp::getRuntimeValue(const QString &key, QVariant &value)
-{
- CX_DEBUG_ENTER_FUNCTION();
-
- CxeError::Id err = CxeError::None;
-
- // read run-time configuration value
- if ( mRuntimeSettings.contains(key) ) {
- value = qVariantFromValue<QVariantList > (mRuntimeSettings.value(key));
- } else {
- err = CxeError::NotFound;
- }
-
- CX_DEBUG_EXIT_FUNCTION();
-
- return err;
-}
-
-
-/*!
-* Set new Image scene mode.
-* @returns CxeError::None if successful or any CxeError specific error code.
-*/
-CxeError::Id CxeSettingsModelImp::setImageScene(const QString &newScene)
-{
- CX_DEBUG_ENTER_FUNCTION();
-
- // load scene specific settings
- CxeError::Id err = loadSceneData(newScene, mCurrentImgScene);
-
- if (!err) {
- // saving current image scene to cenrep
- err = set(CxeSettingIds::IMAGE_SCENE, newScene);
-
- // saving flash value from scene to cenrep
- QString key(CxeSettingIds::FLASH_MODE);
- err = set(key, mCurrentImgScene[key].toInt());
-
- // saving face tracking value from scene to cenrep
- key = CxeSettingIds::FACE_TRACKING;
- err = set(key, mCurrentImgScene[key].toInt());
- }
-
- CX_DEBUG_EXIT_FUNCTION();
-
- return err;
-}
-
-
-/*!
-* Set new video scene mode.
-* @returns CxeError::None if successful or any CxeError specific error code.
-*/
-CxeError::Id CxeSettingsModelImp::setVideoScene(const QString &newScene)
-{
- CX_DEBUG_ENTER_FUNCTION();
-
- CxeError::Id err = loadSceneData(newScene, mCurrentVidScene);
-
- if (!err) {
- // video scene loaded successfully, store the scene value to cenrep
- err = set(CxeSettingIds::VIDEO_SCENE, newScene);
- }
-
- CX_DEBUG_EXIT_FUNCTION();
-
- return err;
-}
-
-
-
-/*!
-* Loads Image scene settings for the given Scene ID
-*/
-CxeError::Id CxeSettingsModelImp::imageScene(const QString &sceneId, CxeScene &sceneSettings)
-{
- CX_DEBUG_ENTER_FUNCTION();
-
- CxeError::Id err = CxeError::None;
-
- if(mImageSceneModes.contains(sceneId)) {
- sceneSettings = mImageSceneModes[sceneId];
- } else {
- err = CxeError::NotFound;
- }
-
- CX_DEBUG_EXIT_FUNCTION();
-
- return err;
-}
-
-
-/*!
-* Loads Video scene settings for the given Scene ID
-* \param sceneId
-* \param sceneSettings
-*/
-CxeError::Id CxeSettingsModelImp::videoScene(const QString &sceneId, CxeScene &sceneSettings)
-{
- CX_DEBUG_ENTER_FUNCTION();
-
- CxeError::Id err = CxeError::None;
-
- if(mVideoSceneModes.contains(sceneId)) {
- sceneSettings = mVideoSceneModes[sceneId];
- } else {
- err = CxeError::NotFound;
- }
-
- CX_DEBUG_EXIT_FUNCTION();
-
- return err;
-}
-
-
-/*!
-* Creates a copy of the selected scene that we use for accessing specific scene settings.
-* \param newScene
-* \param currentSceneSettings
-*/
-CxeError::Id CxeSettingsModelImp::loadSceneData(const QString &newScene, CxeScene ¤tSceneSettings)
-{
- CX_DEBUG_ENTER_FUNCTION();
-
- CxeScene sceneDefaultSettings;
- CxeError::Id err = imageScene(newScene, sceneDefaultSettings);
-
- if (err == CxeError::NotFound) {
- // not still scene, try in video scene.
- err = videoScene(newScene, sceneDefaultSettings);
- }
-
- if (!err) {
- // We have a new scene available, so we can clear the old values.
- currentSceneSettings.clear();
-
- // creating a deep copy of the scene mode selected.
- CxeScene::const_iterator scene = sceneDefaultSettings.constBegin();
- while (scene != sceneDefaultSettings.constEnd()) {
- currentSceneSettings.insert(scene.key(), scene.value());
- ++scene;
- }
- }
-
- CX_DEBUG_EXIT_FUNCTION();
-
- return err;
-}
-
-
-/*!
-* Returns scene setting value
-* \param key Settings key
-* \param[out] value Value associated with the key
-* \return Error id. CxeError::None if no errors.
-*/
-CxeError::Id CxeSettingsModelImp::sceneSettingValue(const QString &key, QVariant &value)
-{
- CX_DEBUG_ENTER_FUNCTION();
-
- CxeScene scene;
- CxeError::Id err = CxeError::None;
-
- if(mCameraMode == Cxe::ImageMode) {
- CX_DEBUG(( "CxeSettingsModelImp::sceneSettingValue - Image mode Setting"));
- scene = mCurrentImgScene;
- } else {
- CX_DEBUG(( "CxeSettingsModelImp::sceneSettingValue - Video mode Setting"));
- scene = mCurrentVidScene;
- }
-
- if (scene.contains(key)) {
- value = scene[key];
- } else {
- err = CxeError::NotFound;
- }
-
-
- CX_DEBUG_EXIT_FUNCTION();
-
- return err;
-}
-
-
-/*!
-* Sets new value to settings specific to the scene.
-* @param key - setting id.
-* @param newValue - new setting value
-* @param error Error code. CxeError::None if operation has been successful.
-* @return Error id. CxeError::None if no errors.
-*/
-CxeError::Id CxeSettingsModelImp::setSceneSettingValue(const QString &key, QVariant newValue)
-{
- CX_DEBUG_ENTER_FUNCTION();
-
- CxeError::Id err = CxeError::None;
- CxeScene *scene(0);
-
- if (mCameraMode == Cxe::ImageMode) {
- CX_DEBUG(( "CxeSettingsModelImp::setSceneSettingValue - Image mode Setting"));
- scene = &mCurrentImgScene;
- } else {
- CX_DEBUG(( "CxeSettingsModelImp::setSceneSettingValue - Video mode Setting"));
- scene = &mCurrentVidScene;
- }
-
- if (scene && scene->contains(key)) {
- CX_DEBUG(( "CxeSettingsModelImp::setSceneSettingValue KEY found, writing value"));
- scene->insert(key, newValue);
- } else {
- err = CxeError::NotFound;
- }
-
- CX_DEBUG_EXIT_FUNCTION();
-
- return err;
-}
-
-
-/*!
-* Appending the run-time keys to an array
-* \param[in,out] runtimeKeys QList where the supported runtimekeys will be added to
-*/
-void CxeSettingsModelImp::supportedKeys(QList<QString>& runtimeKeys)
-{
- CX_DEBUG_ENTER_FUNCTION();
-
- runtimeKeys.append(CxeRuntimeKeys::PRIMARY_CAMERA_CAPTURE_KEYS);
- runtimeKeys.append(CxeRuntimeKeys::PRIMARY_CAMERA_AUTOFOCUS_KEYS);
- runtimeKeys.append(CxeRuntimeKeys::SECONDARY_CAMERA_CAPTURE_KEYS);
- runtimeKeys.append(CxeRuntimeKeys::FREE_MEMORY_LEVELS);
- runtimeKeys.append(CxeRuntimeKeys::STILL_MAX_ZOOM_LIMITS);
- runtimeKeys.append(CxeRuntimeKeys::VIDEO_MAX_ZOOM_LIMITS);
-
- CX_DEBUG_EXIT_FUNCTION();
-}
-
-
-/*!
-* Loads all video scene modes
-*/
-void CxeSettingsModelImp::loadVideoScenes()
-{
- CX_DEBUG_ENTER_FUNCTION();
-
- mVideoSceneModes.clear();
-
- CxeScene vidSceneAuto;
-
- vidSceneAuto.insert(CxeSettingIds::SCENE_ID, Cxe::VIDEO_SCENE_AUTO);
- vidSceneAuto.insert(CxeSettingIds::FOCAL_RANGE, CxeAutoFocusControl::Hyperfocal);
- vidSceneAuto.insert(CxeSettingIds::WHITE_BALANCE, WhitebalanceAutomatic);
- vidSceneAuto.insert(CxeSettingIds::EXPOSURE_MODE, ExposureAuto);
- vidSceneAuto.insert(CxeSettingIds::COLOR_TONE, ColortoneNormal);
- vidSceneAuto.insert(CxeSettingIds::CONTRAST, 0);
- vidSceneAuto.insert(CxeSettingIds::FRAME_RATE, 0);
- vidSceneAuto.insert(CxeSettingIds::EV_COMPENSATION_VALUE, 0);
-
- mVideoSceneModes.insert(Cxe::VIDEO_SCENE_AUTO,vidSceneAuto);
-
-
- CxeScene vidSceneNight;
-
- vidSceneNight.insert(CxeSettingIds::SCENE_ID, Cxe::VIDEO_SCENE_NIGHT);
- vidSceneNight.insert(CxeSettingIds::FOCAL_RANGE, CxeAutoFocusControl::Hyperfocal);
- vidSceneNight.insert(CxeSettingIds::WHITE_BALANCE, WhitebalanceAutomatic);
- vidSceneNight.insert(CxeSettingIds::EXPOSURE_MODE, ExposureNight);
- vidSceneNight.insert(CxeSettingIds::COLOR_TONE, ColortoneNormal);
- vidSceneNight.insert(CxeSettingIds::CONTRAST, 0);
- vidSceneNight.insert(CxeSettingIds::FRAME_RATE, 0);
- vidSceneNight.insert(CxeSettingIds::EV_COMPENSATION_VALUE, 0);
-
- mVideoSceneModes.insert(Cxe::VIDEO_SCENE_NIGHT, vidSceneNight);
-
-
- CxeScene vidSceneLowLight;
-
- vidSceneLowLight.insert(CxeSettingIds::SCENE_ID, Cxe::VIDEO_SCENE_LOWLIGHT);
- vidSceneLowLight.insert(CxeSettingIds::FOCAL_RANGE, CxeAutoFocusControl::Hyperfocal);
- vidSceneLowLight.insert(CxeSettingIds::WHITE_BALANCE, WhitebalanceAutomatic);
- vidSceneLowLight.insert(CxeSettingIds::EXPOSURE_MODE, ExposureAuto);
- vidSceneLowLight.insert(CxeSettingIds::COLOR_TONE, ColortoneNormal);
- vidSceneLowLight.insert(CxeSettingIds::CONTRAST, 0);
- vidSceneLowLight.insert(CxeSettingIds::FRAME_RATE, 15); //fps
- vidSceneLowLight.insert(CxeSettingIds::EV_COMPENSATION_VALUE, 0);
-
- mVideoSceneModes.insert(Cxe::VIDEO_SCENE_LOWLIGHT, vidSceneLowLight);
-
-
- CX_DEBUG_EXIT_FUNCTION();
-}
-
-
-/*!
-* Loads all Image Scene Modes
-*/
-void CxeSettingsModelImp::loadImageScenes()
-{
- CX_DEBUG_ENTER_FUNCTION();
-
- mImageSceneModes.clear();
-
- CxeScene imgSceneAuto;
-
- imgSceneAuto.insert(CxeSettingIds::SCENE_ID, Cxe::IMAGE_SCENE_AUTO);
- imgSceneAuto.insert(CxeSettingIds::FOCAL_RANGE, CxeAutoFocusControl::Auto);
- imgSceneAuto.insert(CxeSettingIds::WHITE_BALANCE, WhitebalanceAutomatic);
- imgSceneAuto.insert(CxeSettingIds::EXPOSURE_MODE, ExposureAuto);
- imgSceneAuto.insert(CxeSettingIds::COLOR_TONE, ColortoneNormal);
- imgSceneAuto.insert(CxeSettingIds::CONTRAST, 0);
- imgSceneAuto.insert(CxeSettingIds::SHARPNESS, SharpnessNormal);
- imgSceneAuto.insert(CxeSettingIds::LIGHT_SENSITIVITY, LightSensitivityAutomatic);
- imgSceneAuto.insert(CxeSettingIds::EV_COMPENSATION_VALUE, 0);
- imgSceneAuto.insert(CxeSettingIds::BRIGHTNESS, 0);
- imgSceneAuto.insert(CxeSettingIds::FLASH_MODE, FlashAuto);
- imgSceneAuto.insert(CxeSettingIds::FACE_TRACKING, 1);
-
- mImageSceneModes.insert(Cxe::IMAGE_SCENE_AUTO, imgSceneAuto);
-
-
- CxeScene imgSceneSports;
-
- imgSceneSports.insert(CxeSettingIds::SCENE_ID, Cxe::IMAGE_SCENE_SPORTS);
- imgSceneSports.insert(CxeSettingIds::FOCAL_RANGE, CxeAutoFocusControl::Hyperfocal);
- imgSceneSports.insert(CxeSettingIds::WHITE_BALANCE, WhitebalanceAutomatic);
- imgSceneSports.insert(CxeSettingIds::EXPOSURE_MODE, ExposureSport);
- imgSceneSports.insert(CxeSettingIds::COLOR_TONE, ColortoneNormal);
- imgSceneSports.insert(CxeSettingIds::CONTRAST, 0);
- imgSceneSports.insert(CxeSettingIds::SHARPNESS, SharpnessNormal);
- imgSceneSports.insert(CxeSettingIds::LIGHT_SENSITIVITY, LightSensitivityAutomatic);
- imgSceneSports.insert(CxeSettingIds::EV_COMPENSATION_VALUE, 0);
- imgSceneSports.insert(CxeSettingIds::BRIGHTNESS, 0);
- imgSceneSports.insert(CxeSettingIds::FLASH_MODE, FlashOff);
- imgSceneSports.insert(CxeSettingIds::FACE_TRACKING, 0);
-
- mImageSceneModes.insert(Cxe::IMAGE_SCENE_SPORTS, imgSceneSports);
-
-
- CxeScene imgSceneCloseUp;
-
- imgSceneCloseUp.insert(CxeSettingIds::SCENE_ID, Cxe::IMAGE_SCENE_MACRO);
- imgSceneCloseUp.insert(CxeSettingIds::FOCAL_RANGE, CxeAutoFocusControl::Macro);
- imgSceneCloseUp.insert(CxeSettingIds::WHITE_BALANCE, WhitebalanceAutomatic);
- imgSceneCloseUp.insert(CxeSettingIds::EXPOSURE_MODE, ExposureAuto);
- imgSceneCloseUp.insert(CxeSettingIds::COLOR_TONE, ColortoneNormal);
- imgSceneCloseUp.insert(CxeSettingIds::CONTRAST, 0);
- imgSceneCloseUp.insert(CxeSettingIds::SHARPNESS, SharpnessNormal);
- imgSceneCloseUp.insert(CxeSettingIds::LIGHT_SENSITIVITY, LightSensitivityAutomatic);
- imgSceneCloseUp.insert(CxeSettingIds::EV_COMPENSATION_VALUE, 0);
- imgSceneCloseUp.insert(CxeSettingIds::BRIGHTNESS, 0);
- imgSceneCloseUp.insert(CxeSettingIds::FLASH_MODE, FlashAuto);
- imgSceneCloseUp.insert(CxeSettingIds::FACE_TRACKING, 0);
-
- mImageSceneModes.insert(Cxe::IMAGE_SCENE_MACRO, imgSceneCloseUp);
-
- CxeScene imgPortraitscene;
-
- imgPortraitscene.insert(CxeSettingIds::SCENE_ID, Cxe::IMAGE_SCENE_PORTRAIT);
- imgPortraitscene.insert(CxeSettingIds::FOCAL_RANGE, CxeAutoFocusControl::Portrait);
- imgPortraitscene.insert(CxeSettingIds::WHITE_BALANCE, WhitebalanceAutomatic);
- imgPortraitscene.insert(CxeSettingIds::EXPOSURE_MODE, ExposureBacklight);
- imgPortraitscene.insert(CxeSettingIds::COLOR_TONE, ColortoneNormal);
- imgPortraitscene.insert(CxeSettingIds::CONTRAST, 0);
- imgPortraitscene.insert(CxeSettingIds::SHARPNESS, SharpnessSoft);
- imgPortraitscene.insert(CxeSettingIds::LIGHT_SENSITIVITY, LightSensitivityAutomatic);
- imgPortraitscene.insert(CxeSettingIds::EV_COMPENSATION_VALUE, 0);
- imgPortraitscene.insert(CxeSettingIds::BRIGHTNESS, 0);
- imgPortraitscene.insert(CxeSettingIds::FLASH_MODE, FlashAntiRedEye);
- imgPortraitscene.insert(CxeSettingIds::FACE_TRACKING, 1);
-
- mImageSceneModes.insert(Cxe::IMAGE_SCENE_PORTRAIT, imgPortraitscene);
-
- CxeScene imglandscapescene;
-
- imglandscapescene.insert(CxeSettingIds::SCENE_ID, Cxe::IMAGE_SCENE_SCENERY);
- imglandscapescene.insert(CxeSettingIds::FOCAL_RANGE, CxeAutoFocusControl::Infinity);
- imglandscapescene.insert(CxeSettingIds::WHITE_BALANCE, WhitebalanceSunny);
- imglandscapescene.insert(CxeSettingIds::EXPOSURE_MODE, ExposureAuto);
- imglandscapescene.insert(CxeSettingIds::COLOR_TONE, ColortoneNormal);
- imglandscapescene.insert(CxeSettingIds::CONTRAST, 0);
- imglandscapescene.insert(CxeSettingIds::SHARPNESS, SharpnessHard);
- imglandscapescene.insert(CxeSettingIds::LIGHT_SENSITIVITY, LightSensitivityAutomatic);
- imglandscapescene.insert(CxeSettingIds::EV_COMPENSATION_VALUE, 0);
- imglandscapescene.insert(CxeSettingIds::BRIGHTNESS, 0);
- imglandscapescene.insert(CxeSettingIds::FLASH_MODE, FlashOff);
- imglandscapescene.insert(CxeSettingIds::FACE_TRACKING, 0);
-
- mImageSceneModes.insert(Cxe::IMAGE_SCENE_SCENERY, imglandscapescene);
-
-
- CxeScene imgNightscene;
-
- imgNightscene.insert(CxeSettingIds::SCENE_ID, Cxe::IMAGE_SCENE_NIGHT);
- imgNightscene.insert(CxeSettingIds::FOCAL_RANGE, CxeAutoFocusControl::Auto);
- imgNightscene.insert(CxeSettingIds::WHITE_BALANCE, WhitebalanceAutomatic);
- imgNightscene.insert(CxeSettingIds::EXPOSURE_MODE, ExposureNight);
- imgNightscene.insert(CxeSettingIds::COLOR_TONE, ColortoneNormal);
- imgNightscene.insert(CxeSettingIds::CONTRAST, 0);
- imgNightscene.insert(CxeSettingIds::SHARPNESS, SharpnessNormal);
- imgNightscene.insert(CxeSettingIds::LIGHT_SENSITIVITY, LightSensitivityAutomatic);
- imgNightscene.insert(CxeSettingIds::EV_COMPENSATION_VALUE, 0);
- imgNightscene.insert(CxeSettingIds::BRIGHTNESS, 0);
- imgNightscene.insert(CxeSettingIds::FLASH_MODE, FlashOff);
- imgNightscene.insert(CxeSettingIds::FACE_TRACKING, 1);
-
- mImageSceneModes.insert(Cxe::IMAGE_SCENE_NIGHT, imgNightscene);
-
- CxeScene imgNightpotraitscene;
-
- imgNightpotraitscene.insert(CxeSettingIds::SCENE_ID, Cxe::IMAGE_SCENE_NIGHTPORTRAIT);
- imgNightpotraitscene.insert(CxeSettingIds::FOCAL_RANGE, CxeAutoFocusControl::Portrait);
- imgNightpotraitscene.insert(CxeSettingIds::WHITE_BALANCE, WhitebalanceAutomatic);
- imgNightpotraitscene.insert(CxeSettingIds::EXPOSURE_MODE, ExposureNight);
- imgNightpotraitscene.insert(CxeSettingIds::COLOR_TONE, ColortoneNormal);
- imgNightpotraitscene.insert(CxeSettingIds::CONTRAST, 0);
- imgNightpotraitscene.insert(CxeSettingIds::SHARPNESS, SharpnessNormal);
- imgNightpotraitscene.insert(CxeSettingIds::LIGHT_SENSITIVITY, LightSensitivityAutomatic);
- imgNightpotraitscene.insert(CxeSettingIds::EV_COMPENSATION_VALUE, 0);
- imgNightpotraitscene.insert(CxeSettingIds::BRIGHTNESS, 0);
- imgNightpotraitscene.insert(CxeSettingIds::FLASH_MODE, FlashAntiRedEye);
- imgNightpotraitscene.insert(CxeSettingIds::FACE_TRACKING, 1);
-
- mImageSceneModes.insert(Cxe::IMAGE_SCENE_NIGHTPORTRAIT, imgNightpotraitscene);
-
- CX_DEBUG_EXIT_FUNCTION();
-}
-
-/*!
-* Returns the current image scene mode.
-*/
-CxeScene& CxeSettingsModelImp::currentImageScene()
-{
- CX_DEBUG_ENTER_FUNCTION();
- CX_DEBUG_EXIT_FUNCTION();
-
- return mCurrentImgScene;
-}
-
-
-/*!
-* Returns the current video scene mode.
-*/
-CxeScene& CxeSettingsModelImp::currentVideoScene()
-{
- CX_DEBUG_ENTER_FUNCTION();
- CX_DEBUG_EXIT_FUNCTION();
-
- return mCurrentVidScene;
-}
-
-
-/*!
-* Restores settings whenever we switch between Image/Video modes or
-* during startup.
-*/
-void CxeSettingsModelImp::cameraModeChanged(Cxe::CameraMode newMode)
-{
- CX_DEBUG_ENTER_FUNCTION();
-
- if (newMode == Cxe::ImageMode) {
- restoreImageSettings();
- } else {
- restoreVideoSettings();
- }
-
- mCameraMode = newMode;
-
- CX_DEBUG_EXIT_FUNCTION();
-}
-
-
-
-/*!
-* Restores image settings, during mode change or during startup.
-*/
-void CxeSettingsModelImp::restoreImageSettings()
-{
- CX_DEBUG_ENTER_FUNCTION();
-
- CxeError::Id err = CxeError::None;
- QVariant currentSceneInUse = mCurrentImgScene[CxeSettingIds::SCENE_ID];
-
- // get the image scene value from cenrep and load the scene settings
- QVariant cenrepSceneValue;
- QString key(CxeSettingIds::IMAGE_SCENE);
- err = getSettingValue(key, cenrepSceneValue);
-
- bool ok2LoadSceneSettings = (cenrepSceneValue != currentSceneInUse);
-
- if (!err && ok2LoadSceneSettings) {
- // loading scene settings
- err = loadSceneData(cenrepSceneValue.toString(), mCurrentImgScene);
- }
-
- // Updating Flash setting from cenrep
- QVariant value;
- key = CxeSettingIds::FLASH_MODE;
- err = getSettingValue(key, value);
-
- if (!err && mCurrentImgScene.contains(key)) {
- // update local datastructure with flash setting value from cenrep.
- CX_DEBUG(( "flash setting value %d", value.toInt()));
- mCurrentImgScene[key] = value;
- }
-
- // Updating Face Tracking setting from cenrep
- key = CxeSettingIds::FACE_TRACKING;
- err = getSettingValue(key, value);
-
- if (!err && mCurrentImgScene.contains(key)) {
- // update local datastructure with flash setting value from cenrep.
- CX_DEBUG(( "Face Tracking setting value %d", value.toInt()));
- mCurrentImgScene[key] = value;
- }
-
- CX_DEBUG_EXIT_FUNCTION();
-}
-
-
-
-/*!
-* Restores video settings, during mode change or during startup.
-*/
-void CxeSettingsModelImp::restoreVideoSettings()
-{
- CX_DEBUG_ENTER_FUNCTION();
-
- CxeError::Id err = CxeError::None;
- QVariant currentSceneInUse = mCurrentVidScene[CxeSettingIds::SCENE_ID];
-
- // get the video scene value from cenrep and load the scene settings
- QVariant cenrepSceneValue;
- err = getSettingValue(CxeSettingIds::VIDEO_SCENE, cenrepSceneValue);
-
- bool ok2LoadSceneSettings = (cenrepSceneValue != currentSceneInUse);
-
- if (!err && ok2LoadSceneSettings) {
- // loading video scene settings
- loadSceneData(cenrepSceneValue.toString(), mCurrentVidScene);
- }
-
- CX_DEBUG_EXIT_FUNCTION();
-}
-
-// end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/camerauis/cameraxui/cxengine/src/cxesettingsstoredesktop.cpp Fri Jul 23 11:35:41 2010 +0300
@@ -0,0 +1,210 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Desktop specific settings handling
+*
+*/
+
+#include <QVariant>
+#include <QList>
+#include <QMultiMap>
+#include <QMetaType>
+#include <QString>
+#include <QStringList>
+#include <QVariant>
+
+#include "cxesettingsstoredesktop.h"
+#include "cxenamespace.h"
+#include "cxutils.h"
+#include "cxenamespace.h"
+#include "cxeerror.h"
+
+using namespace Cxe;
+using namespace CxeSettingIds;
+
+
+/*!
+* Constructor
+*/
+CxeSettingsStoreDesktop::CxeSettingsStoreDesktop()
+{
+ CX_DEBUG_ENTER_FUNCTION();
+
+ initSettings();
+
+ CX_DEBUG_EXIT_FUNCTION();
+}
+
+
+
+/*!
+* Destructor
+*/
+CxeSettingsStoreDesktop::~CxeSettingsStoreDesktop()
+{
+ CX_DEBUG_ENTER_FUNCTION();
+ CX_DEBUG_EXIT_FUNCTION();
+}
+
+
+
+/*!
+* Initalizes settings with default values.
+*/
+void CxeSettingsStoreDesktop::initSettings()
+{
+ mSettings[CAMERA_MODE] = QVariant(0);
+ mSettings[FLASH_MODE] = QVariant(0);
+ mSettings[WHITE_BALANCE] = QVariant(0);
+ mSettings[LIGHT_SENSITIVITY] = QVariant(0);
+ mSettings[EXPOSURE_MODE] = QVariant(0);
+ mSettings[SHARPNESS] = QVariant(0);
+ mSettings[COLOR_TONE] = QVariant(0);
+ mSettings[EV_COMPENSATION_VALUE] = QVariant(0);
+ mSettings[CONTRAST] = QVariant(0);
+ mSettings[BRIGHTNESS] = QVariant(0);
+ mSettings[SCENE_ID] = QVariant(IMAGE_SCENE_AUTO);
+ mSettings[IMAGE_QUALITY] = QVariant(0);
+ mSettings[VIDEO_QUALITY] = QVariant(0);
+ mSettings[SELF_TIMER] = QVariant(-1);
+ mSettings[FACE_TRACKING] = QVariant(0);
+ mSettings[GEOTAGGING] = QVariant(0);
+ mSettings[IMAGE_SCENE] = QVariant(IMAGE_SCENE_AUTO);
+ mSettings[VIDEO_SCENE] = QVariant(VIDEO_SCENE_AUTO);
+ mSettings[STILL_SHOWCAPTURED] = QVariant(2000);
+ mSettings[VIDEO_SHOWCAPTURED] = QVariant(2000);
+}
+
+
+
+/*!
+* Reads all run-time settings values from the internal hash
+* \param QList<QString> contains list of all runtime key ids.
+* \return QHash containing value associated to the keys
+* \note loading runtime settings should be done only ONCE at start-up.
+*/
+QHash<QString, QVariantList> CxeSettingsStoreDesktop::loadVariationSettings(QList<QString>& runtimeKeys)
+{
+ CX_DEBUG_ENTER_FUNCTION();
+
+ QHash<QString, QVariantList> settings;
+ CxeError::Id err = CxeError::None;
+ QVariantList list;
+ QVariant data;
+
+ // parsing through the list of run-time keys and reading values from the settings array.
+ foreach (QString key, runtimeKeys) {
+
+ // read the data from cenrep
+ err = get(key, data);
+
+ // clear the list
+ list.clear();
+
+ if (CxeError::None == err) {
+ if (data.type() == QMetaType::QString ) {
+ QString str = data.toString();
+ QVariant strListVariant = qVariantFromValue(str.split(","));
+ //generate qvariantlist from strListVariant
+ list = strListVariant.toList();
+ } else {
+ // if its of any other type, then just append to the list
+ list.append(data);
+ }
+ }
+ // append the values associated with the key to the list.
+ settings.insert(key, list);
+
+ } // end for
+
+ CX_DEBUG_EXIT_FUNCTION();
+
+ return settings;
+}
+
+
+
+/*!
+* Reads a setting from the internal hash
+* \param "key" - setting key
+* \param "value" - setting value read from cenrep
+* \return Error code
+*/
+
+CxeError::Id CxeSettingsStoreDesktop::get(const QString& key, QVariant &value)
+{
+ CX_DEBUG_ENTER_FUNCTION();
+
+ CX_DEBUG(("CxeSettingsStoreDesktop::get - key: %s", key.toAscii().constData()));
+
+ if (mSettings.contains(key) )
+ {
+ value.setValue(mSettings.value(key));
+ }
+
+ CxeError::Id err = CxeError::None;
+
+ CX_DEBUG_EXIT_FUNCTION();
+
+ return err;
+}
+
+/*!
+* Reads a value from the settings store and starts monitoring it.
+* \param "uid" - UID of the component that own setting key
+* \param "key" - setting key id
+* \param "type" - type of setting key
+* \param "value" - setting value read from cenrep
+* \note Not only dummy implementation in desktop.
+*/
+void CxeSettingsStoreDesktop::startMonitoring(long int uid, unsigned long int key, Cxe::SettingKeyType type, QVariant &value)
+{
+ CX_DEBUG_ENTER_FUNCTION();
+ value = QVariant::Invalid;
+ CX_DEBUG_EXIT_FUNCTION();
+}
+
+/*!
+* Sets a new value to the internal hash
+* \param "key" - setting key
+* \param "newValue" - new value set to the key in cenrep
+* \return Error code, in this case, always CxeError::None
+*/
+CxeError::Id CxeSettingsStoreDesktop::set(const QString& key, const QVariant newValue)
+{
+ CX_DEBUG_ENTER_FUNCTION();
+
+ if (mSettings.contains(key) )
+ {
+ mSettings[key] = newValue;
+ }
+ CxeError::Id err = CxeError::None;
+
+ CX_DEBUG_EXIT_FUNCTION();
+
+ return err;
+}
+
+
+
+/*!
+* resets the cenrep store
+*/
+void CxeSettingsStoreDesktop::reset()
+{
+ CX_DEBUG_ENTER_FUNCTION();
+ //!@Todo: How to reset the repository.
+ CX_DEBUG_EXIT_FUNCTION();
+}
+
+// end of file
--- a/camerauis/cameraxui/cxengine/src/cxesoundplayersymbian.cpp Thu Jul 15 01:55:05 2010 +0300
+++ b/camerauis/cameraxui/cxengine/src/cxesoundplayersymbian.cpp Fri Jul 23 11:35:41 2010 +0300
@@ -259,12 +259,8 @@
CX_DEBUG(("Warning tones enabled [%d]", value.toInt()));
// check whether capture sound is forced or not
- int forced = 0;
- mSettings.get(CxeSettingIds::CAPTURE_SOUND_ALWAYS_ON, forced);
- // 0 -> capture sound not forced
- // 1 -> capture sound forced on
- mCaptureSoundForced = (forced == 1);
- CX_DEBUG(("Capture sound forced [%d]", forced));
+ mCaptureSoundForced = mSettings.get<bool>(CxeSettingIds::CAPTURE_SOUND_ALWAYS_ON, false);
+ CX_DEBUG(("Capture sound forced [%d]", mCaptureSoundForced));
// use sound if forced on or warningtones are enabled
mUseSound = mCaptureSoundForced || warningTonesEnabled;
--- a/camerauis/cameraxui/cxengine/src/cxestatemachine.cpp Thu Jul 15 01:55:05 2010 +0300
+++ b/camerauis/cameraxui/cxengine/src/cxestatemachine.cpp Fri Jul 23 11:35:41 2010 +0300
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+ * Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies).
* All rights reserved.
* This component and the accompanying materials are made available
* under the terms of "Eclipse Public License v1.0"
@@ -14,11 +14,12 @@
* Description:
*
*/
+
#include "cxestatemachine.h"
#include "cxestate.h"
#include "cxutils.h"
-CxeStateMachine::CxeStateMachine( const char* stateMachineName ) :
+CxeStateMachine::CxeStateMachine(const char *stateMachineName) :
CxeStateMachineBase(stateMachineName)
{
}
@@ -28,7 +29,7 @@
}
-bool CxeStateMachine::addState( CxeState* state )
+bool CxeStateMachine::addState(CxeState *state)
{
CX_DEBUG_ENTER_FUNCTION();
bool success = CxeStateMachineBase::addState(state);
@@ -37,7 +38,7 @@
return success;
}
-bool CxeStateMachine::setState( int stateId, int error )
+bool CxeStateMachine::setState(int stateId, CxeError::Id error)
{
CX_DEBUG_ENTER_FUNCTION();
bool success = CxeStateMachineBase::setState(stateId, error);
@@ -46,7 +47,7 @@
return success;
}
-bool CxeStateMachine::setInitialState( int stateId )
+bool CxeStateMachine::setInitialState(int stateId)
{
CX_DEBUG_ENTER_FUNCTION();
bool success = CxeStateMachineBase::setInitialState(stateId);
@@ -54,8 +55,3 @@
CX_DEBUG_EXIT_FUNCTION();
return success;
}
-
-
-
-
-
--- a/camerauis/cameraxui/cxengine/src/cxestatemachinebase.cpp Thu Jul 15 01:55:05 2010 +0300
+++ b/camerauis/cameraxui/cxengine/src/cxestatemachinebase.cpp Fri Jul 23 11:35:41 2010 +0300
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+ * Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies).
* All rights reserved.
* This component and the accompanying materials are made available
* under the terms of "Eclipse Public License v1.0"
@@ -14,12 +14,12 @@
* Description:
*
*/
+
#include "cxestatemachinebase.h"
#include "cxutils.h"
-#include "cxeerrormappingsymbian.h"
#include "cxestate.h"
-CxeStateMachineBase::CxeStateMachineBase( const char* stateMachineName ) :
+CxeStateMachineBase::CxeStateMachineBase(const char *stateMachineName) :
mStateBitsUsed(0), mStateId(0), mName(stateMachineName)
{
}
@@ -30,7 +30,7 @@
mStates.clear();
}
-bool CxeStateMachineBase::addState( CxeState* state )
+bool CxeStateMachineBase::addState(CxeState *state)
{
bool success( state // non-null state object
&& state->stateId() // state id is not zero
@@ -46,7 +46,7 @@
return success;
}
-bool CxeStateMachineBase::setState( int stateId, int error )
+bool CxeStateMachineBase::setState(int stateId, CxeError::Id error)
{
bool success = true;
@@ -76,13 +76,13 @@
if (success) {
mStateId = stateId;
- handleStateChanged(mStateId, CxeErrorHandlingSymbian::map(error));
+ handleStateChanged(mStateId, error);
}
return success;
}
-bool CxeStateMachineBase::setInitialState( int stateId )
+bool CxeStateMachineBase::setInitialState(int stateId)
{
bool success = mStates.contains(stateId);
@@ -113,7 +113,7 @@
return mStateId;
}
-bool CxeStateMachineBase::verifyStateChange( int newStateId )
+bool CxeStateMachineBase::verifyStateChange(int newStateId)
{
bool allowStateChange = false;
@@ -126,7 +126,3 @@
return allowStateChange;
}
-
-
-
-
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/camerauis/cameraxui/cxengine/src/cxestillcapturecontroldesktop.cpp Fri Jul 23 11:35:41 2010 +0300
@@ -0,0 +1,594 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#include <QPixmap>
+
+#include "cxestillcapturecontroldesktop.h"
+#include "cxeimagedataitemdesktop.h"
+#include "cxeimagedataqueuedesktop.h"
+#include "cxefilenamegenerator.h"
+#include "cxefilesavethreaddesktop.h"
+#include "cxutils.h"
+#include "cxecameradevicecontrol.h"
+#include "cxestillimagedesktop.h"
+#include "cxeviewfindercontrol.h"
+#include "cxeviewfindercontroldesktop.h"
+#include "cxeautofocuscontrol.h"
+#include "cxestate.h"
+#include "cxecameradevicedesktop.h"
+
+// constants
+const int KMaintainAspectRatio = false;
+
+
+
+/**
+ * Constructor.
+ */
+CxeStillCaptureControlDesktop::CxeStillCaptureControlDesktop(
+ CxeCameraDeviceDesktop &cameraDevice,
+ CxeViewfinderControl &viewfinderControl,
+ CxeCameraDeviceControl &cameraDeviceControl,
+ CxeFilenameGenerator &nameGenerator,
+ CxeAutoFocusControl &autoFocusControl,
+ CxeFileSaveThread &saveThread) :
+ mCameraDevice(cameraDevice),
+ mState(CxeStillCaptureControl::Uninitialized),
+ mViewfinderControl(viewfinderControl),
+ mCameraDeviceControl(cameraDeviceControl),
+ mFilenameGenerator(nameGenerator),
+ mAutoFocusControl(autoFocusControl),
+ mMode(SingleImageCapture),
+ mAfState(CxeAutoFocusControl::Unknown),
+ mSaveThread(saveThread)
+{
+ CX_DEBUG_ENTER_FUNCTION();
+
+ qRegisterMetaType<CxeStillCaptureControl::State>();
+ initializeStates();
+ reset();
+
+ mImageDataQueue = new CxeImageDataQueueDesktop();
+
+ CX_DEBUG_EXIT_FUNCTION();
+}
+
+/**
+ * Destructor.
+ */
+CxeStillCaptureControlDesktop::~CxeStillCaptureControlDesktop()
+{
+ CX_DEBUG_ENTER_FUNCTION();
+
+ deinit();
+ reset();
+ mSupportedImageQualities.clear();
+ delete mImageDataQueue;
+
+ CX_DEBUG_EXIT_FUNCTION();
+}
+
+/**
+ * Return the current state.
+ */
+CxeStillCaptureControl::State CxeStillCaptureControlDesktop::state() const
+{
+ return mState;
+}
+
+/**
+ * Initialize the control states.
+ */
+void CxeStillCaptureControlDesktop::initializeStates()
+{
+
+ // addState( id, name, allowed next states )
+}
+
+/**
+ * Initialize the still image capture control.
+ */
+void CxeStillCaptureControlDesktop::init()
+{
+ CX_DEBUG_ENTER_FUNCTION();
+
+ if (state() == Uninitialized) {
+ CxeImageDetails dummyDetails;
+ dummyDetails.mAspectRatio = Cxe::AspectRatio4to3;
+ dummyDetails.mEstimatedSize = 10000;
+ dummyDetails.mHeight = 360;
+ dummyDetails.mWidth = 640;
+ mSupportedImageQualities.append(dummyDetails);
+ prepare();
+ }
+
+ CX_DEBUG_EXIT_FUNCTION();
+}
+
+/**
+ * Un-initialize the image mode.
+ */
+void CxeStillCaptureControlDesktop::deinit()
+{
+ CX_DEBUG_ENTER_FUNCTION();
+
+ if (state() == Uninitialized) {
+ // nothing to do
+ CX_DEBUG_EXIT_FUNCTION();
+ return;
+ }
+ mState = Uninitialized;
+ CX_DEBUG_EXIT_FUNCTION();
+}
+
+
+/*!
+ * Prepare still capture mode.
+ */
+void CxeStillCaptureControlDesktop::prepare()
+{
+ CX_DEBUG_ENTER_FUNCTION();
+
+ if (state() != Uninitialized) {
+ // wrong state and we return
+ return;
+ }
+
+ int err = 0;
+ CxeError::Id cxErr = getImageQualityDetails(mCurrentImageDetails);
+ int ecamStillResolutionIndex = 0;
+
+ if (cxErr == CxeError::None) {
+ int imageWidth = mCurrentImageDetails.mWidth;
+ int imageHeight = mCurrentImageDetails.mHeight;
+ CX_DEBUG(("CxeStillCaptureControlSymbian::prepare <> resolution = (%d, %d)", imageWidth, imageHeight));
+
+ if (ecamStillResolutionIndex < 0) {
+ CX_DEBUG(("CxeStillCaptureControlSymbian::prepare - WARNING! resolution not supported, falling back to index 0"));
+ ecamStillResolutionIndex = 0;
+ }
+
+ CX_DEBUG(("PrepareImageCaptureL done, err=%d, resolution index = %d", err, ecamStillResolutionIndex));
+
+ if (!err) {
+ // still capture prepare went fine, try preparing snapshot
+ err = prepareStillSnapshot();
+ }
+ } else {
+ err = 0;
+ }
+
+ if (!err) {
+ // If viewfinder is already running, this call does nothing
+ mViewfinderControl.start();
+ // inform zoom control to prepare zoom
+ emit prepareZoomForStill(ecamStillResolutionIndex);
+ } else {
+ CX_DEBUG(("Image Prepare FAILED! symbian error = %d", err));
+ }
+ mState = Ready;
+ emit imagePrepareComplete(CxeError::None);
+ CX_DEBUG_EXIT_FUNCTION();
+}
+
+
+
+/*!
+ Prepare still snapshot
+ Returns symbian error code.
+ */
+int CxeStillCaptureControlDesktop::prepareStillSnapshot()
+{
+ CX_DEBUG_ENTER_FUNCTION();
+
+ handleSnapshotEvent(CxeError::None);
+
+ CX_DEBUG_EXIT_FUNCTION();
+
+ return 0;
+}
+
+
+/*!
+ imageInfo contains image qualities details
+ Returns CxeError error code.
+ */
+CxeError::Id CxeStillCaptureControlDesktop::getImageQualityDetails(CxeImageDetails &imageInfo)
+{
+ CX_DEBUG_ENTER_FUNCTION();
+
+ int imageQuality = 0;
+ CxeError::Id err = CxeError::None;
+ if (mCameraDeviceControl.cameraIndex() == Cxe::PrimaryCameraIndex) {
+ bool validQuality = (imageQuality >= 0 && imageQuality < mSupportedImageQualities.count());
+
+ if (err == CxeError::None && validQuality ) {
+ // get image quality details
+ imageInfo = mSupportedImageQualities.at(imageQuality);
+ } else {
+ err = CxeError::NotFound;
+ CX_DEBUG(("Invalid ImageQuality = %d", imageQuality));
+ }
+ } else {
+ // we are in secondary camera
+ // get secondary camera image quality details
+ imageInfo = mSupportedImageQualities.at(imageQuality);
+ }
+
+ CX_DEBUG_EXIT_FUNCTION();
+ return err;
+}
+
+
+/**
+ * Command to start image capture now.
+ */
+void CxeStillCaptureControlDesktop::capture()
+{
+ CX_DEBUG_ENTER_FUNCTION();
+
+ //! @todo: NOTE: This call may not stay here. It can move depending on the implementation for burst capture.
+ if (mMode == BurstCapture) {
+ // Start a new filename sequence
+ mFilenameGenerator.startNewImageFilenameSequence();
+ }
+ emit imageCaptured(CxeError::None, 0);
+ handleSnapshotEvent(CxeError::None);
+ CX_DEBUG_EXIT_FUNCTION();
+}
+
+
+/**
+ * Snapshot ready notification. Ask the snapshot from snapshot interface.
+ * NB: Typically snapshot arrives before image data but can be in reverse
+ * order as well.
+ */
+void CxeStillCaptureControlDesktop::handleSnapshotEvent(CxeError::Id error)
+{
+ CX_DEBUG_ENTER_FUNCTION();
+
+ if (state() == CxeStillCaptureControl::Uninitialized) {
+ // we ignore this event, when we are not active
+ return;
+ }
+
+ if (error) {
+ emit snapshotReady(error, QImage(), 0);
+ }
+
+ // Get image container for current snapshot index.
+ // Remember to increment counter.
+ CxeStillImageDesktop* stillImage = getImageForIndex(mNextSnapshotIndex++);
+
+ // When the snapshot ready event is handled, prepare new filename.
+ if (stillImage->filename().isEmpty()) {
+ // Error ignored at this point, try again when image data arrives.
+ prepareFilename(stillImage);
+ }
+
+ CxeImageDataItem* dataItem = new CxeImageDataItemDesktop(mNextImageDataIndex++, stillImage->snapshot(), stillImage->filename(), stillImage->id());
+
+ stillImage->setDataItem(dataItem);
+
+ mSaveThread.save(dataItem);
+
+ emit snapshotReady(CxeError::None, QImage(), stillImage->id());
+ emit imageCaptured(CxeError::None, stillImage->id());
+
+ mState = Ready;
+ emit stateChanged(mState, CxeError::None);
+
+ CX_DEBUG_EXIT_FUNCTION();
+}
+
+
+
+/**
+ * Settings changed, needs updated
+ */
+void CxeStillCaptureControlDesktop::handleSettingValueChanged(const QString& settingId,QVariant newValue)
+{
+ CX_DEBUG_ENTER_FUNCTION();
+
+ if (settingId == CxeSettingIds::FLASH_MODE) {
+ updateFlashSetting(newValue);
+ } else if (settingId == CxeSettingIds::LIGHT_SENSITIVITY) {
+ updateISOSetting(newValue);
+ } else if (settingId == CxeSettingIds::EV_COMPENSATION_VALUE) {
+ updateEVCompensationSetting(newValue);
+ } else if (settingId == CxeSettingIds::IMAGE_QUALITY) {
+ // re-prepare for still
+ deinit();
+ init();
+ } else {
+ // do nothing
+ }
+ CX_DEBUG_EXIT_FUNCTION();
+}
+
+/**
+ * Image Scene mode changed, needs updated
+ */
+void CxeStillCaptureControlDesktop::handleSceneChanged(CxeScene& scene)
+{
+ CX_DEBUG_ENTER_FUNCTION();
+
+ if (mCameraDeviceControl.cameraIndex() == Cxe::PrimaryCameraIndex){
+ CX_DEBUG_ASSERT(scene.count() != 0);
+ // we are interested only in the following settings in this class scope
+
+ if(scene.contains(CxeSettingIds::FLASH_MODE)) {
+ CX_DEBUG(("CxeStillCaptureControlSymbian::handleSceneChanged scene->mFlashMode = %d", scene[CxeSettingIds::FLASH_MODE].toInt()));
+ updateFlashSetting(scene[CxeSettingIds::FLASH_MODE]);
+ }
+
+ if(scene.contains(CxeSettingIds::LIGHT_SENSITIVITY)) {
+ updateISOSetting(scene[CxeSettingIds::LIGHT_SENSITIVITY]);
+ }
+
+ if(scene.contains(CxeSettingIds::EV_COMPENSATION_VALUE)) {
+ updateEVCompensationSetting(scene[CxeSettingIds::EV_COMPENSATION_VALUE]);
+ }
+ }
+
+ CX_DEBUG_EXIT_FUNCTION();
+}
+
+/**
+ * UpdateFlashSetting
+ */
+void CxeStillCaptureControlDesktop::updateFlashSetting(QVariant newValue)
+{
+ CX_DEBUG_ENTER_FUNCTION();
+
+ Q_UNUSED(newValue);
+
+ CX_DEBUG_EXIT_FUNCTION();
+}
+
+/**
+ * UpdateISOSetting
+ */
+void CxeStillCaptureControlDesktop::updateISOSetting(QVariant newValue)
+{
+ CX_DEBUG_ENTER_FUNCTION();
+
+ Q_UNUSED(newValue);
+
+ CX_DEBUG_EXIT_FUNCTION();
+}
+
+/**
+ * UpdateEVCompensationSetting
+ */
+void CxeStillCaptureControlDesktop::updateEVCompensationSetting(QVariant newValue)
+{
+ CX_DEBUG_ENTER_FUNCTION();
+
+ Q_UNUSED(newValue);
+
+
+ CX_DEBUG_EXIT_FUNCTION();
+}
+
+
+/**
+ * ECam reference changing, release resources
+ */
+void CxeStillCaptureControlDesktop::prepareForCameraDelete()
+{
+ CX_DEBUG_ENTER_FUNCTION();
+ deinit();
+ CX_DEBUG_EXIT_FUNCTION();
+}
+
+/**
+ * Camera being released. Cancel ongoing capture, if any.
+ */
+void CxeStillCaptureControlDesktop::prepareForRelease()
+{
+ CX_DEBUG_ENTER_FUNCTION();
+ deinit();
+ CX_DEBUG_EXIT_FUNCTION();
+}
+
+/**
+ * New camera available,
+ */
+void CxeStillCaptureControlDesktop::handleCameraAllocated(CxeError::Id error)
+{
+ CX_DEBUG_ENTER_FUNCTION();
+
+ if (error == CxeError::None) {
+ // load all still resoultions supported by ecam
+ // load all still qualities supported by icm
+ mSupportedImageQualities.clear();
+ // get list of supported image qualities based on camera index
+
+ }
+
+ CX_DEBUG_EXIT_FUNCTION();
+}
+
+/**
+ * Return number of images captured (during current capture operation only).
+ */
+int CxeStillCaptureControlDesktop::imageCount() const
+{
+ return mImages.count();
+}
+
+/**
+ * Reset the image array.
+ */
+void CxeStillCaptureControlDesktop::reset()
+{
+ CX_DEBUG_ENTER_FUNCTION();
+
+ qDeleteAll(mImages);
+ mImages.clear();
+
+ mNextSnapshotIndex = 0;
+ mNextImageDataIndex = 0;
+
+ CX_DEBUG_EXIT_FUNCTION();
+}
+
+/**
+ * This should cancel any ongoing image captures.
+ */
+void CxeStillCaptureControlDesktop::cancelAll()
+{
+ mImageDataQueue->clear();
+ reset();
+}
+
+/**
+ * Sets the current capture mode: SingleImageCapture / BurstCapture.
+ */
+void CxeStillCaptureControlDesktop::setMode(CaptureMode mode)
+{
+ mMode = mode;
+}
+
+/**
+ * Returns the current capture mode.
+ */
+CxeStillCaptureControl::CaptureMode CxeStillCaptureControlDesktop::mode() const
+{
+ return mMode;
+}
+
+/**
+ * Operator [] - returns the indexed image from capture array.
+ */
+CxeStillImage &CxeStillCaptureControlDesktop::operator[](int index)
+{
+ return *mImages[ index ];
+}
+
+/**
+ * Getter for image data queue.
+ */
+CxeImageDataQueue &CxeStillCaptureControlDesktop::imageDataQueue()
+{
+ return *mImageDataQueue;
+}
+
+/**
+ * Generates a filename and sets it in the still image object.
+ * Skips the process if filename already copied exists in the object. This
+ * behaviour is required in rare cases where image data arrives before snapshot.
+ */
+CxeError::Id CxeStillCaptureControlDesktop::prepareFilename(CxeStillImageDesktop *stillImage)
+{
+ CxeError::Id err = CxeError::None;
+ if (stillImage->filename().isEmpty()) {
+ QString path;
+
+ QString fileExt = mCurrentImageDetails.mImageFileExtension;
+
+ if (mMode == SingleImageCapture) {
+ err = mFilenameGenerator.generateFilename(path, fileExt);
+ }
+ else {
+ err = mFilenameGenerator.nextImageFilenameInSequence(path, fileExt);
+ }
+
+ if (!err) {
+ CX_DEBUG(( "Next image file path: %s", path.toAscii().constData() ));
+ stillImage->setFilename(path);
+ }
+ else {
+ //! @todo: Error ID can be returned by this function.
+ // Also error can be detected from empty filename string.
+ CX_DEBUG(("ERROR in filename generation. err:%d", err));
+ }
+ }
+ return err;
+}
+
+/*!
+* Helper method to set orientation data from the orientation sensor
+*/
+void CxeStillCaptureControlDesktop::setOrientation(QVariant sensorData)
+{
+ CX_DEBUG_ENTER_FUNCTION();
+
+ Q_UNUSED(sensorData);
+
+ CX_DEBUG_EXIT_FUNCTION();
+}
+
+/**
+ * Get the image container at given index or create a new one if needed.
+ */
+CxeStillImageDesktop* CxeStillCaptureControlDesktop::getImageForIndex(int index)
+{
+ CxeStillImageDesktop* image(NULL);
+
+ if (mImages.count() <= index) {
+ image = new CxeStillImageDesktop();
+ image->setSnapshot(mCameraDevice.currentSnaphot());
+ mImages.append(image);
+ } else {
+ CX_DEBUG_ASSERT( mNextImageDataIndex >= 0 && index < mImages.count() );
+ image = mImages[index];
+ }
+ return image;
+}
+
+
+/*!
+* Slot to handle Autofocus events.
+*/
+void CxeStillCaptureControlDesktop::handleAutofocusStateChanged(
+ CxeAutoFocusControl::State newState,
+ CxeError::Id /*error*/ )
+{
+ CX_DEBUG_ENTER_FUNCTION();
+
+ mAfState = newState;
+ CxeAutoFocusControl::Mode mode = mAutoFocusControl.mode();
+
+ // if focused and in correct mode, play sound
+ if (newState == CxeAutoFocusControl::Ready &&
+ mode != CxeAutoFocusControl::Hyperfocal &&
+ mode != CxeAutoFocusControl::Infinity) {
+ }
+ CX_DEBUG_EXIT_FUNCTION();
+}
+
+
+/*!
+* Returns supported image qualities based on the camera index
+* (primary/secondary).
+*/
+QList<CxeImageDetails> CxeStillCaptureControlDesktop::supportedImageQualities()
+{
+ return QList<CxeImageDetails>();
+}
+
+/*!
+* Returns the number of images left for the current image quality setting
+*/
+int CxeStillCaptureControlDesktop::imagesLeft()
+{
+ return 100; // Stub: Dummy value
+}
+
+// end of file
--- a/camerauis/cameraxui/cxengine/src/cxestillcapturecontrolsymbian.cpp Thu Jul 15 01:55:05 2010 +0300
+++ b/camerauis/cameraxui/cxengine/src/cxestillcapturecontrolsymbian.cpp Fri Jul 23 11:35:41 2010 +0300
@@ -22,6 +22,7 @@
#include <coemain.h>
#include <ECamOrientationCustomInterface2.h>
#include <ecamfacetrackingcustomapi.h>
+#include <ecamusecasehintcustomapi.h>
#include "cxestillcapturecontrolsymbian.h"
#include "cxeimagedataqueuesymbian.h"
@@ -43,6 +44,7 @@
#include "cxesensoreventhandler.h"
#include "cxequalitypresetssymbian.h"
#include "cxediskmonitor.h"
+#include "cxeexception.h"
#include "OstTraceDefinitions.h"
#ifdef OST_TRACE_COMPILER_IN_USE
@@ -248,55 +250,31 @@
OstTrace0(camerax_performance, CXESTILLCAPTURECONTROL_PREPARE_IN, "msg: e_CX_STILLCAPCONT_PREPARE 1");
- int err = KErrNone;
- CxeError::Id cxErr = getImageQualityDetails(mCurrentImageDetails);
- int ecamStillResolutionIndex = 0;
-
- if (cxErr == CxeError::None) {
- int imageWidth = mCurrentImageDetails.mWidth;
- int imageHeight = mCurrentImageDetails.mHeight;
- CX_DEBUG(("CxeStillCaptureControlSymbian::prepare <> resolution = (%d, %d)", imageWidth, imageHeight));
+ CxeError::Id status(CxeError::None);
- TSize imageSize;
- imageSize.SetSize(imageWidth, imageHeight);
-
- if (mECamSupportedImageResolutions.count() > 0) {
- ecamStillResolutionIndex = mECamSupportedImageResolutions.indexOf(imageSize);
- }
-
- if (ecamStillResolutionIndex < 0) {
- CX_DEBUG(("CxeStillCaptureControlSymbian::prepare - WARNING! resolution not supported, falling back to index 0"));
- ecamStillResolutionIndex = 0;
- }
+ try {
+ // Update capture parameters
+ updateStillCaptureParameters();
// Prepare Image capture
- CCamera::TFormat imgFormat = supportedStillFormat(mCameraDeviceControl.cameraIndex());
+ CX_DEBUG(("Calling PrepareImageCaptureL, resolution index = %d", mSizeIndex));
OstTrace0(camerax_performance, CXESTILLCAPTURECONTROL_PREPARE_MID1, "msg: e_CX_PREPARE_IMAGE_CAPTURE 1");
- TRAP(err, mCameraDevice.camera()->PrepareImageCaptureL(imgFormat, ecamStillResolutionIndex));
+ QT_TRAP_THROWING(mCameraDevice.camera()->PrepareImageCaptureL(mCaptureFormat, mSizeIndex));
OstTrace0(camerax_performance, CXESTILLCAPTURECONTROL_PREPARE_MID2, "msg: e_CX_PREPARE_IMAGE_CAPTURE 0");
- CX_DEBUG(("PrepareImageCaptureL done, err=%d, resolution index = %d", err, ecamStillResolutionIndex));
-
- if (!err) {
- // still capture prepare went fine, try preparing snapshot
- err = prepareStillSnapshot();
- }
- } else {
- err = KErrNotFound;
- }
-
- if (!err) {
// Start viewfinder before claiming to be ready,
// as e.g. pending capture might be started by state change,
// and viewfinder start might have problems with just started capturing.
// If viewfinder is already running, this call does nothing.
mViewfinderControl.start();
+ // Prepare snapshot
+ prepareSnapshot();
+
// Start monitoring disk space.
mDiskMonitor.start();
connect(&mDiskMonitor, SIGNAL(diskSpaceChanged()), this, SLOT(handleDiskSpaceChanged()));
-
// Enable AF reticule drawing by adaptation
MCameraFaceTracking *faceTracking = mCameraDevice.faceTracking();
if (faceTracking) {
@@ -308,19 +286,20 @@
setState(Ready);
// inform zoom control to prepare zoom
- emit prepareZoomForStill(ecamStillResolutionIndex);
- } else {
- CX_DEBUG(("Image Prepare FAILED! symbian error = %d", err));
- // release resources
+ emit prepareZoomForStill(mSizeIndex);
+
+ } catch (const std::exception &e) {
+ // Exception encountered, free resources.
+ CX_DEBUG(("Image Prepare FAILED! symbian error = %d", qt_symbian_exception2Error(e)));
+ status = CxeErrorHandlingSymbian::map(qt_symbian_exception2Error(e));
deinit();
}
// Inform interested parties that image mode has been prepared for capture
- emit imagePrepareComplete(CxeErrorHandlingSymbian::map(err));
+ emit imagePrepareComplete(status);
OstTrace0(camerax_performance, CXESTILLCAPTURECONTROL_GOTOSTILL, "msg: e_CX_GO_TO_STILL_MODE 0");
OstTrace0(camerax_performance, CXESTILLCAPTURECONTROL_PREPARE_OUT, "msg: e_CX_STILLCAPCONT_PREPARE 0");
-
CX_DEBUG_EXIT_FUNCTION();
}
@@ -328,61 +307,81 @@
/*!
Prepare still snapshot
- Returns symbian error code.
+ Throws exception on error.
*/
-int CxeStillCaptureControlSymbian::prepareStillSnapshot()
+void CxeStillCaptureControlSymbian::prepareSnapshot()
{
CX_DEBUG_ENTER_FUNCTION();
OstTrace0( camerax_performance, CXESTILLCAPTURECONTROL_PREPARESNAP_1, "msg: e_CX_PREPARE_SNAPSHOT 1" );
- int status(KErrNone);
- try {
- QSize snapshotSize = mSnapshotControl.calculateSnapshotSize(
- mViewfinderControl.deviceDisplayResolution(),
- mCurrentImageDetails.mAspectRatio);
- mSnapshotControl.start(snapshotSize);
- } catch (...) {
- status = KErrGeneral;
- }
+ QSize snapshotSize = mSnapshotControl.calculateSnapshotSize(
+ mViewfinderControl.deviceDisplayResolution(),
+ mCurrentImageDetails.mAspectRatio);
+ mSnapshotControl.start(snapshotSize);
+
OstTrace0( camerax_performance, CXESTILLCAPTURECONTROL_PREPARESNAP_2, "msg: e_CX_PREPARE_SNAPSHOT 0" );
-
CX_DEBUG_EXIT_FUNCTION();
- return status;
}
/*!
- imageInfo contains image qualities details
- Returns CxeError error code.
- */
-CxeError::Id CxeStillCaptureControlSymbian::getImageQualityDetails(CxeImageDetails &imageInfo)
+ Update image capture parameters. mCurrentImageDetails, mCaptureFormat and
+ mSizeIndex are updated based on the current settings.
+*/
+void CxeStillCaptureControlSymbian::updateStillCaptureParameters()
{
CX_DEBUG_ENTER_FUNCTION();
- OstTrace0( camerax_performance, CXESTILLCAPTURECONTROL_GETQUALITYDETAILS_1, "msg: e_CX_GET_QUALITY_DETAILS 1" );
+ OstTrace0( camerax_performance, CXESTILLCAPTURECONTROL_UPDATESTILLCAPTUREPARAMETERS_1, "msg: e_CX_UPDATE_STILL_CAPTURE_PARAMETERS 1" );
int imageQuality = 0;
CxeError::Id err = CxeError::None;
if (mCameraDeviceControl.cameraIndex() == Cxe::PrimaryCameraIndex) {
- err = mSettings.get(CxeSettingIds::IMAGE_QUALITY, imageQuality);
+ try {
+ imageQuality = mSettings.get<int>(CxeSettingIds::IMAGE_QUALITY);
- bool validQuality = (imageQuality >= 0 && imageQuality < mIcmSupportedImageResolutions.count());
+ bool validQuality = (imageQuality >= 0 &&
+ imageQuality < mIcmSupportedImageResolutions.count());
- if (err == CxeError::None && validQuality ) {
- // get image quality details
- imageInfo = mIcmSupportedImageResolutions.at(imageQuality);
- } else {
- err = CxeError::NotFound;
- CX_DEBUG(("Invalid ImageQuality = %d", imageQuality));
+ if (validQuality ) {
+ // get image quality details
+ mCurrentImageDetails = mIcmSupportedImageResolutions.at(imageQuality);
+ } else {
+ err = CxeError::NotFound;
+ CX_DEBUG(("Invalid ImageQuality = %d", imageQuality));
+ }
+ } catch (CxeException &e) {
+ err = (CxeError::Id) e.error();
}
} else {
// we are in secondary camera
// get secondary camera image quality details
- imageInfo = mIcmSupportedImageResolutions.at(imageQuality);
+ mCurrentImageDetails = mIcmSupportedImageResolutions.at(imageQuality);
}
- OstTrace0( camerax_performance, CXESTILLCAPTURECONTROL_GETQUALITYDETAILS_2, "msg: e_CX_GET_QUALITY_DETAILS 0" );
+ mSizeIndex = 0;
+
+ if (err == CxeError::None) {
+ int imageWidth = mCurrentImageDetails.mWidth;
+ int imageHeight = mCurrentImageDetails.mHeight;
+ CX_DEBUG(("CxeStillCaptureControlSymbian::updateStillCaptureParameters <> resolution = (%d, %d)", imageWidth, imageHeight));
+
+ TSize imageSize;
+ imageSize.SetSize(imageWidth, imageHeight);
+
+ if (mECamSupportedImageResolutions.count() > 0) {
+ mSizeIndex = mECamSupportedImageResolutions.indexOf(imageSize);
+ }
+
+ if (mSizeIndex < 0) {
+ CX_DEBUG(("CxeStillCaptureControlSymbian::updateStillCaptureParameters - WARNING! resolution not supported, falling back to index 0"));
+ mSizeIndex = 0;
+ }
+
+ mCaptureFormat = supportedStillFormat(mCameraDeviceControl.cameraIndex());
+ }
+
+ OstTrace0( camerax_performance, CXESTILLCAPTURECONTROL_UPDATESTILLCAPTUREPARAMETERS_2, "msg: e_CX_UPDATE_STILL_CAPTURE_PARAMETERS 0" );
CX_DEBUG_EXIT_FUNCTION();
- return err;
}
/*!
@@ -547,8 +546,8 @@
data = NULL;
// get geotagging setting value and check if we have to add location trail to image data.
- int value = Cxe::GeoTaggingOff;
- mSettings.get(CxeSettingIds::GEOTAGGING, value);
+ Cxe::GeoTagging value = mSettings.get<Cxe::GeoTagging>(CxeSettingIds::GEOTAGGING, Cxe::GeoTaggingOff);
+
// Save the image data
CxeImageDataItemSymbian* dataItem = mImageDataQueue->startSave(byteArray,
@@ -868,6 +867,28 @@
/*!
+ Use ECam Use Case Hint Custom API to inform ECam of our intended use case
+ before calling Reserve().
+*/
+void CxeStillCaptureControlSymbian::hintUseCase()
+{
+ CX_DEBUG_ENTER_FUNCTION();
+
+ // Make sure ECam knows we're doing still image capture so it can prepare
+ // for the correct use case.
+ if (mCameraDeviceControl.mode() == Cxe::ImageMode) {
+ MCameraUseCaseHint *useCaseHintApi = mCameraDevice.useCaseHintApi();
+ if (useCaseHintApi) {
+ updateStillCaptureParameters();
+ TRAP_IGNORE(useCaseHintApi->HintStillCaptureL(mCaptureFormat,
+ mSizeIndex));
+ }
+ }
+
+ CX_DEBUG_EXIT_FUNCTION();
+}
+
+/*!
* Returns supported image qualities based on the camera index
* (primary/secondary).
*/
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/camerauis/cameraxui/cxengine/src/cxestillimagedesktop.cpp Fri Jul 23 11:35:41 2010 +0300
@@ -0,0 +1,78 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#include "cxestillimagedesktop.h"
+#include "cxutils.h"
+
+int CxeStillImageDesktop::mNextId = CxeStillImage::INVALID_ID + 1;
+
+CxeStillImageDesktop::CxeStillImageDesktop()
+ : mSnapshot(),
+ mDataItem(NULL),
+ mSaved(false),
+ mId(++mNextId)
+{
+}
+
+CxeStillImageDesktop::~CxeStillImageDesktop()
+{
+ mDataItem = NULL;
+}
+
+CxeImageDataItem *CxeStillImageDesktop::dataItem()
+{
+ return mDataItem;
+}
+
+QString CxeStillImageDesktop::filename() const
+{
+ return mFilename;
+}
+
+QPixmap CxeStillImageDesktop::snapshot() const
+{
+ return mSnapshot;
+}
+
+bool CxeStillImageDesktop::saved() const
+{
+ return mSaved;
+}
+
+int CxeStillImageDesktop::id() const
+{
+ return mId;
+}
+
+void CxeStillImageDesktop::setSnapshot(QPixmap pixmap)
+ {
+ mSnapshot = pixmap;
+ }
+
+void CxeStillImageDesktop::setFilename(const QString &filename)
+ {
+ mFilename = filename;
+ }
+void CxeStillImageDesktop::setSaved(bool saved)
+ {
+ mSaved = saved;
+ }
+
+void CxeStillImageDesktop::setDataItem(CxeImageDataItem *dataItem)
+ {
+ mDataItem = dataItem;
+ }
--- a/camerauis/cameraxui/cxengine/src/cxestillimagesymbian.cpp Thu Jul 15 01:55:05 2010 +0300
+++ b/camerauis/cameraxui/cxengine/src/cxestillimagesymbian.cpp Fri Jul 23 11:35:41 2010 +0300
@@ -1,5 +1,5 @@
/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies).
* All rights reserved.
* This component and the accompanying materials are made available
* under the terms of "Eclipse Public License v1.0"
@@ -15,11 +15,19 @@
*
*/
+#include <QString>
+#include <QPixmap>
+
+#include "cxeimagedataitem.h"
#include "cxestillimagesymbian.h"
#include "cxutils.h"
+// Static initialization
int CxeStillImageSymbian::mNextId = CxeStillImage::INVALID_ID + 1;
+/*!
+* Constructor.
+*/
CxeStillImageSymbian::CxeStillImageSymbian()
: mSnapshot(),
mDataItem(NULL),
@@ -28,53 +36,115 @@
{
}
+/*!
+* Destructor.
+*/
CxeStillImageSymbian::~CxeStillImageSymbian()
{
// Not owned.
mDataItem = NULL;
}
-CxeImageDataItem* CxeStillImageSymbian::dataItem()
+/*!
+* Get the contained data item.
+* @return Image data item.
+*/
+CxeImageDataItem *CxeStillImageSymbian::dataItem()
{
return mDataItem;
}
+/*!
+* Get the filename of this image.
+* @return The filename.
+*/
QString CxeStillImageSymbian::filename() const
{
return mFilename;
}
+/*!
+* Get snapshot for this image.
+* @return Snapshot for this image if set. Null pixmap otherwise.
+*/
QPixmap CxeStillImageSymbian::snapshot() const
{
return mSnapshot;
}
+/*!
+* Image saved status.
+* @return Is this image saved.
+*/
bool CxeStillImageSymbian::saved() const
{
return mSaved;
}
+/*!
+* Set the unique id of this image.
+* Usable in one application run context.
+*/
int CxeStillImageSymbian::id() const
{
return mId;
}
-void CxeStillImageSymbian::setSnapshot( QPixmap pixmap )
+/*!
+* Set snapshot for this image.
+* @param pixmap The snapshot.
+*/
+void CxeStillImageSymbian::setSnapshot(QPixmap pixmap)
{
mSnapshot = pixmap;
}
-void CxeStillImageSymbian::setFilename( const QString& filename )
+/*!
+* Set the filename of this image.
+* @param filename The filename.
+*/
+void CxeStillImageSymbian::setFilename(const QString &filename)
{
mFilename = filename;
}
-void CxeStillImageSymbian::setSaved( bool saved )
+/*!
+* Set this image as saved.
+* @param saved Is this item saved or not.
+*/
+void CxeStillImageSymbian::setSaved(bool saved)
{
mSaved = saved;
}
-void CxeStillImageSymbian::setDataItem( CxeImageDataItem* dataItem )
+/*!
+* Set the contained image data item.
+* @param dataItem Image data item to store. Ownership not taken.
+*/
+void CxeStillImageSymbian::setDataItem(CxeImageDataItem *dataItem)
{
+ // Disconnect from old data item if it exists.
+ if (mDataItem) {
+ disconnect(mDataItem, 0, this, 0);
+ }
+
+ // Set the new item.
mDataItem = dataItem;
+
+ // Connnect to the new item's saved signal.
+ if (mDataItem) {
+ bool ok = connect(mDataItem, SIGNAL(imageSaved(CxeError::Id, const QString&, int)),
+ this, SLOT(imageDataSaved(CxeError::Id)), Qt::UniqueConnection);
+ CX_ASSERT_ALWAYS(ok);
+ }
}
+
+/*!
+* Slot to handle saving the data item has finished.
+*/
+void CxeStillImageSymbian::imageDataSaved(CxeError::Id status)
+{
+ setSaved(status == CxeError::None);
+}
+
+// end of file
--- a/camerauis/cameraxui/cxengine/src/cxesysutil.cpp Thu Jul 15 01:55:05 2010 +0300
+++ b/camerauis/cameraxui/cxengine/src/cxesysutil.cpp Fri Jul 23 11:35:41 2010 +0300
@@ -1,5 +1,5 @@
/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies).
* All rights reserved.
* This component and the accompanying materials are made available
* under the terms of "Eclipse Public License v1.0"
@@ -77,17 +77,17 @@
* is not enough free memory to create a temporary connection to
* file server.
*/
-TBool CxeSysUtil::DiskSpaceBelowCriticalLevel(
+bool CxeSysUtil::DiskSpaceBelowCriticalLevel(
RFs* aFs,
TInt aBytesToWrite,
TInt aDrive )
{
- TBool fullDisk = EFalse;
+ bool fullDisk = false;
TRAPD( utilErr,
fullDisk = SysUtil::DiskSpaceBelowCriticalLevelL(
aFs, aBytesToWrite, aDrive ) );
if(utilErr) {
- fullDisk = EFalse;
+ fullDisk = false;
}
return fullDisk;
}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/camerauis/cameraxui/cxengine/src/cxevideocapturecontroldesktop.cpp Fri Jul 23 11:35:41 2010 +0300
@@ -0,0 +1,550 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+#include <QTime>
+#include <QPixmap>
+
+#include "cxevideocapturecontroldesktop.h"
+#include "cxeviewfindercontrol.h"
+#include "cxutils.h"
+#include "cxestate.h"
+#include "cxenamespace.h"
+#include "cxefilenamegeneratordesktop.h"
+#include "cxecameradevicedesktop.h"
+#include "cxeexception.h"
+
+namespace
+{
+ // Unit is milliseconds
+ static const int CXENGINE_ELAPSED_TIME_TIMEOUT = 1000; // 1 second
+
+ // Unit is seconds
+ static const int CXENGINE_MAXIMUM_VIDEO_TIME = 90*60; // 90 minutes
+}
+
+
+/*!
+* Constructor
+*/
+CxeVideoCaptureControlDesktop::CxeVideoCaptureControlDesktop(CxeCameraDeviceDesktop &cameraDevice,
+ CxeViewfinderControl &viewfinderControl,
+ CxeCameraDeviceControl &cameraDeviceControl,
+ CxeFilenameGenerator &nameGenerator,
+ CxeQualityPresets &qualityPresets) :
+ mCameraDevice(cameraDevice),
+ mCameraDeviceControl(cameraDeviceControl),
+ mViewfinderControl(viewfinderControl),
+ mFilenameGenerator(nameGenerator),
+ mQualityPresets(qualityPresets),
+ mSnapshot(),
+ mNewFileName(""),
+ mCurrentFilename(""),
+ mState(Idle),
+ mElapsedTime(0)
+{
+ CX_DEBUG_ENTER_FUNCTION();
+
+ qRegisterMetaType<CxeVideoCaptureControl::State> ();
+ initializeStates();
+ setupElapseTimer();
+ CX_DEBUG_EXIT_FUNCTION();
+}
+
+
+/*!
+* Destructor
+*/
+CxeVideoCaptureControlDesktop::~CxeVideoCaptureControlDesktop()
+{
+ CX_DEBUG_ENTER_FUNCTION();
+
+ releaseResources();
+
+ CX_DEBUG_EXIT_FUNCTION();
+}
+
+
+/*!
+* Initializes resources for video recording.
+*/
+void CxeVideoCaptureControlDesktop::init()
+{
+ CX_DEBUG_ENTER_FUNCTION();
+
+ if (state() == Idle) {
+ // start initializing resources for video capture
+ initVideoRecorder();
+ } else if (state() == Initialized) {
+ // video recorder already initalized. Continue to prepare video reocording.
+ open();
+ }
+
+ CX_DEBUG_EXIT_FUNCTION();
+}
+
+
+/*!
+* Releases all resources
+*/
+void CxeVideoCaptureControlDesktop::deinit()
+{
+ CX_DEBUG_ENTER_FUNCTION();
+
+ if (state() == Idle) {
+ // nothing to do
+ CX_DEBUG_EXIT_FUNCTION();
+ return;
+ }
+ // stop video-recording in-case if its ongoing.
+ stop();
+
+ setState(Idle);
+
+ CX_DEBUG_EXIT_FUNCTION();
+}
+
+
+/*!
+* Intializes VideoRecorder for recording.
+*/
+void CxeVideoCaptureControlDesktop::initVideoRecorder()
+{
+ CX_DEBUG_ENTER_FUNCTION();
+
+ if (state() != Idle) {
+ // not valid state to start "open" operation
+ CX_DEBUG_EXIT_FUNCTION();
+ return;
+ }
+
+ // update current video quality details from icm
+ CxeError::Id err = CxeError::None;
+
+ setState(Initialized);
+ open();
+
+ if (err) {
+ // In case of error
+ emit videoPrepareComplete(err);
+ deinit();
+ }
+
+ CX_DEBUG_EXIT_FUNCTION();
+}
+
+/*!
+* Setup the timer for elapsed time
+*/
+void CxeVideoCaptureControlDesktop::setupElapseTimer()
+{
+ mRecordElapseTimer.setSingleShot(false);
+ mRecordElapseTimer.setInterval(CXENGINE_ELAPSED_TIME_TIMEOUT);
+ connect(&mRecordElapseTimer, SIGNAL(timeout()), this, SLOT(handleElapseTimeout()));
+}
+
+
+/*!
+* Opens file for video recording.
+*/
+void CxeVideoCaptureControlDesktop::open()
+{
+ CX_DEBUG_ENTER_FUNCTION();
+
+ if (state() != Initialized) {
+ // not valid state to start "open" operation
+ CX_DEBUG_EXIT_FUNCTION();
+ return;
+ }
+
+ CxeError::Id err = CxeError::None;
+
+ // generate video file name, if necessary
+ if (mNewFileName.isEmpty()) {
+ QString fileExt = ".mp4";
+
+ // Generate new filename and open the file for writing video data
+ err = mFilenameGenerator.generateFilename(mNewFileName, fileExt);
+ if (err == CxeError::None) {
+ mCurrentFilename = mNewFileName;
+ } else {
+ // file name is not valid, re-initialize the value of current string
+ // back to empty string
+ mCurrentFilename = QString("");
+ }
+ }
+
+ if (err) {
+ // error occured.
+ deinit();
+ emit videoPrepareComplete(err);
+ } else {
+ setState(Preparing);
+ prepare();
+ }
+ CX_DEBUG_EXIT_FUNCTION();
+}
+
+
+
+/*!
+* Prepare Video Recorder with necessary settings for video capture.
+*/
+void CxeVideoCaptureControlDesktop::prepare()
+{
+ CX_DEBUG_ENTER_FUNCTION();
+
+ if (state() != Preparing) {
+ // not valid state to continue prepare.
+ CX_DEBUG_EXIT_FUNCTION();
+ return;
+ }
+
+ int err = CxeError::None;
+
+ if (!err) {
+ // prepare snapshot
+ err = prepareVideoSnapshot();
+ }
+
+ if (!err) {
+ // prepare zoom only when there are no errors during prepare.
+ emit prepareZoomForVideo();
+ }
+
+ mViewfinderControl.start();
+ setState(Ready);
+
+ // emit video prepare status
+ emit videoPrepareComplete(CxeError::None);
+
+
+ CX_DEBUG_EXIT_FUNCTION();
+}
+
+/*!
+ Prepare snapshot
+@Return symbian error code.
+ */
+int CxeVideoCaptureControlDesktop::prepareVideoSnapshot()
+{
+ CX_DEBUG_ENTER_FUNCTION();
+
+
+ int err = 0;
+ // Whether or not we have postcapture on, we need the snapshot for Thumbnail Manager.
+
+ mSnapshot = mCameraDevice.currentSnaphot();
+ handleSnapshotEvent(CxeError::None);
+
+ CX_DEBUG_EXIT_FUNCTION();
+
+ return err;
+}
+
+/*!
+* Camera events coming from ecam.
+*/
+void CxeVideoCaptureControlDesktop::handleCameraEvent(int eventUid, int error)
+{
+ CX_DEBUG_ENTER_FUNCTION();
+
+ Q_UNUSED(eventUid);
+ Q_UNUSED(error);
+
+ CX_DEBUG_EXIT_FUNCTION();
+}
+
+
+/*!
+* Handle Snapshot event from ecam
+*/
+void CxeVideoCaptureControlDesktop::handleSnapshotEvent(CxeError::Id error)
+{
+ CX_DEBUG_ENTER_FUNCTION();
+
+ if (state() == Idle) {
+ // we ignore this event, when we are not in active state(s)
+ CX_DEBUG(( "wrong state, ignoring snapshot" ));
+ CX_DEBUG_EXIT_FUNCTION();
+ return;
+ }
+ emit snapshotReady(error, QImage(), filename());
+ CX_DEBUG_EXIT_FUNCTION();
+}
+
+
+/*!
+* Resets the video snapshot and current video filename
+*/
+void CxeVideoCaptureControlDesktop::reset()
+{
+ CX_DEBUG_ENTER_FUNCTION();
+
+ // Snapshot will consume considerably memory.
+ // Replace it with null pixmap to have it freed.
+ mSnapshot = QPixmap();
+ // reset the current file name.
+ mCurrentFilename = QString("");
+
+ CX_DEBUG_EXIT_FUNCTION();
+}
+
+
+/*!
+*@Return current video filename
+*/
+QString CxeVideoCaptureControlDesktop::filename() const
+{
+ // Simply return the current contents of mCurrentFilename.
+ // If video recording was started then it returns proper filename
+ // otherwise an empty string is returned.
+ return mCurrentFilename;
+}
+
+
+/*!
+* @Return current video snapshot
+*/
+QPixmap CxeVideoCaptureControlDesktop::snapshot() const
+{
+ return mSnapshot;
+}
+
+/*!
+* @Return QList of all supported video quality details based on the camera index
+* (primary/secondary).
+*/
+QList<CxeVideoDetails> CxeVideoCaptureControlDesktop::supportedVideoQualities()
+{
+ return QList<CxeVideoDetails>();
+}
+
+/*!
+* Starts video recording if we are in appropriate state.
+*/
+void CxeVideoCaptureControlDesktop::record()
+{
+ CX_DEBUG_ENTER_FUNCTION();
+
+ if (state() == Ready || state() == Paused) {
+ //we skip the playing of the sound in the desktop state for now
+ setState(Recording);
+ mRecordElapseTimer.start();
+ }
+
+ CX_DEBUG_EXIT_FUNCTION();
+}
+
+
+/*!
+* Pauses video recording.
+*/
+void CxeVideoCaptureControlDesktop::pause()
+{
+ CX_DEBUG_ENTER_FUNCTION();
+
+ mRecordElapseTimer.stop();
+
+ setState(Paused);
+
+ CX_DEBUG_EXIT_FUNCTION();
+}
+
+
+/*!
+* Stops video recording.
+*/
+void CxeVideoCaptureControlDesktop::stop()
+{
+ CX_DEBUG_ENTER_FUNCTION();
+
+ if (state() == Recording || state() == Paused) {
+ mFilenameGenerator.raiseCounterValue();
+ }
+
+ mViewfinderControl.stop();
+ mRecordElapseTimer.stop();
+ mElapsedTime = 0;
+
+ setState(Stopping);
+ setState(Initialized);
+
+ CX_DEBUG_EXIT_FUNCTION();
+}
+
+
+/*!
+* camera reference changing, release resources
+*/
+void CxeVideoCaptureControlDesktop::prepareForCameraDelete()
+{
+ CX_DEBUG_ENTER_FUNCTION();
+ releaseResources();
+ CX_DEBUG_EXIT_FUNCTION();
+}
+
+/*!
+* prepare for camera release.
+*/
+void CxeVideoCaptureControlDesktop::prepareForRelease()
+{
+ CX_DEBUG_ENTER_FUNCTION();
+ deinit();
+ CX_DEBUG_EXIT_FUNCTION();
+}
+
+
+/*!
+* new camera available,
+*/
+void CxeVideoCaptureControlDesktop::handleCameraAllocated(CxeError::Id error)
+{
+ Q_UNUSED(error);
+ CX_DEBUG_IN_FUNCTION();
+}
+
+
+/*!
+* Initializes video recorder.
+*/
+void CxeVideoCaptureControlDesktop::createVideoRecorder()
+{
+ CX_DEBUG_IN_FUNCTION();
+}
+
+
+/*!
+* releases resources used by videocapture
+*/
+void CxeVideoCaptureControlDesktop::releaseResources()
+{
+ CX_DEBUG_ENTER_FUNCTION();
+
+ // first de-init videocapture control
+ deinit();
+ reset();
+
+ CX_DEBUG_EXIT_FUNCTION();
+}
+
+
+/*!
+@Returns current state of videocapture
+*/
+CxeVideoCaptureControl::State CxeVideoCaptureControlDesktop::state() const
+{
+ return mState;
+}
+
+/*!
+* Initialize states for videocapturecontrol
+*/
+void CxeVideoCaptureControlDesktop::initializeStates()
+{
+ CX_DEBUG_IN_FUNCTION();
+}
+
+/*!
+* calculates remaining video recording time.
+*/
+void CxeVideoCaptureControlDesktop::remainingTime(int &time)
+{
+ CX_DEBUG_ENTER_FUNCTION();
+
+ time = CXENGINE_MAXIMUM_VIDEO_TIME - mElapsedTime;
+ if (time < 0) {
+ time = 0;
+ }
+
+ CX_DEBUG_EXIT_FUNCTION();
+}
+
+
+/*!
+* Calculates elapsed recording time during video recording
+* @return Did fetching elapsed time succeed.
+*/
+bool CxeVideoCaptureControlDesktop::elapsedTime(int &time)
+{
+ CX_DEBUG_ENTER_FUNCTION();
+
+ time = mElapsedTime;
+
+ CX_DEBUG_EXIT_FUNCTION();
+
+ return true;
+}
+
+/*!
+* slot called when playing a sound has finished.
+*/
+void CxeVideoCaptureControlDesktop::handleSoundPlayed()
+{
+ // in case of video capture stop sound playing, nothing needs to be done
+ // meaning the state set elsewhere, and the video capture has been stopped already
+
+ CX_DEBUG_IN_FUNCTION();
+}
+
+
+/*!
+* setting has changed, check if we are interested.
+*/
+void CxeVideoCaptureControlDesktop::handleSettingValueChanged(const QString& settingId,
+ QVariant newValue)
+{
+ CX_DEBUG_ENTER_FUNCTION();
+
+ Q_UNUSED(newValue);
+
+ if (settingId == CxeSettingIds::VIDEO_QUALITY) {
+ // re-prepare for video
+ deinit();
+ init();
+ } else if (settingId == CxeSettingIds::VIDEO_MUTE_SETTING) {
+ // mute setting changed, apply the new setting and re-prepare.
+ prepare();
+ }
+
+ CX_DEBUG_EXIT_FUNCTION();
+}
+
+
+
+/*!
+* Video Scene mode changed, needs updated
+*/
+void CxeVideoCaptureControlDesktop::handleSceneChanged(CxeScene &scene)
+{
+ CX_DEBUG_ENTER_FUNCTION();
+ Q_UNUSED(scene);
+ CX_DEBUG_EXIT_FUNCTION();
+}
+
+void CxeVideoCaptureControlDesktop::handleElapseTimeout()
+{
+ mElapsedTime++;
+
+ CX_DEBUG( ("CxeVideoCaptureControlDesktop::handleElapseTimeout() <> mElapsedTime: %d", mElapsedTime ) );
+}
+
+void CxeVideoCaptureControlDesktop::setState(CxeVideoCaptureControl::State stateId, CxeError::Id error)
+{
+ mState = stateId;
+ CX_DEBUG( ("CxeVideoCaptureControlDesktop::setState <> mState: %d", mState ) );
+ emit stateChanged(mState, error);
+}
+// End of file
--- a/camerauis/cameraxui/cxengine/src/cxevideocapturecontrolsymbian.cpp Thu Jul 15 01:55:05 2010 +0300
+++ b/camerauis/cameraxui/cxengine/src/cxevideocapturecontrolsymbian.cpp Fri Jul 23 11:35:41 2010 +0300
@@ -40,6 +40,7 @@
#include "cxequalitypresetssymbian.h"
#include "cxeviewfindercontrolsymbian.h"
#include "cxediskmonitor.h"
+#include "cxesettingsmappersymbian.h"
#include "OstTraceDefinitions.h"
#ifdef OST_TRACE_COMPILER_IN_USE
@@ -123,8 +124,9 @@
// enabling setting change callbacks to videocapturecontrol
connect(&mSettings, SIGNAL(settingValueChanged(const QString&,QVariant)),
this, SLOT(handleSettingValueChanged(const QString&,QVariant)));
- connect(&mSettings, SIGNAL(sceneChanged(CxeScene&)),
- this, SLOT(handleSceneChanged(CxeScene&)));
+
+ mSettings.listenForSetting(CxeSettingIds::VIDEO_SCENE, this, SLOT(handleSceneChanged(const QVariant&)));
+
OstTrace0(camerax_performance, CXEVIDEOCAPTURECONTROLSYMBIAN_CREATE_M2, "msg: e_CX_ENGINE_CONNECT_SIGNALS 0");
OstTrace0(camerax_performance, CXEVIDEOCAPTURECONTROLSYMBIAN_CREATE_OUT, "msg: e_CX_VIDEOCAPTURECONTROL_NEW 0");
@@ -214,12 +216,12 @@
// Init needed only in Idle state
if (state() == Idle) {
try {
- // if video recorder is not created, do it now.
+ // If video recorder is not yet created, do it now.
createVideoRecorder();
- // update current video quality details from icm.
+ // Update current video quality details from ICM.
// Throws an error if unable to get the quality.
- getVideoQualityDetails(mCurrentVideoDetails);
+ updateVideoCaptureParameters();
// Video recorder is ready to open video file for recording.
setState(Initialized);
@@ -302,13 +304,11 @@
OstTrace0(camerax_performance, CXEVIDEOCAPTURECONTROL_PREPARE_1, "msg: e_CX_VIDCAPCONT_PREPARE 1");
QSize frameSize(mCurrentVideoDetails.mWidth, mCurrentVideoDetails.mHeight);
- int muteSetting = 0; // audio enabled
- mSettings.get(CxeSettingIds::VIDEO_MUTE_SETTING, muteSetting);
+ bool muteSetting = mSettings.get<bool>(CxeSettingIds::VIDEO_MUTE_SETTING, false);
// Check if scene defines frame rate.
// Use generic frame rate defined in video details, if no value is set in scene.
- int frameRate = 0;
- mSettings.get(CxeSettingIds::FRAME_RATE, frameRate);
+ int frameRate = mSettings.get<int>(CxeSettingIds::FRAME_RATE, 0);
if (frameRate <= 0) {
frameRate = mCurrentVideoDetails.mVideoFrameRate;
}
@@ -322,19 +322,13 @@
mVideoRecorder->setVideoFrameSize(frameSize);
mVideoRecorder->setVideoFrameRate(frameRate);
mVideoRecorder->setVideoBitRate(mCurrentVideoDetails.mVideoBitRate);
- mVideoRecorder->setAudioEnabled(muteSetting == 0);
+ mVideoRecorder->setAudioEnabled(!muteSetting);
// "No limit" value is handled in video recorder wrapper.
mVideoRecorder->setVideoMaxSize(mCurrentVideoDetails.mMaximumSizeInBytes);
// Settings have been applied successfully, start to prepare.
mVideoRecorder->prepare();
- // Prepare snapshot. Snapshot control throws error if problems.
- QSize snapshotSize = mSnapshotControl.calculateSnapshotSize(
- mViewfinderControl.deviceDisplayResolution(),
- mCurrentVideoDetails.mAspectRatio);
- mSnapshotControl.start(snapshotSize);
-
// Prepare zoom only when there are no errors during prepare.
emit prepareZoomForVideo();
emit videoPrepareComplete(CxeError::None);
@@ -348,29 +342,47 @@
}
/*!
-* Fetches video qualites details based on video quality setting.
+* Prepare video snapshot.
+* Throws exception on error.
*/
-void
-CxeVideoCaptureControlSymbian::getVideoQualityDetails(CxeVideoDetails &videoInfo)
+void CxeVideoCaptureControlSymbian::prepareSnapshot()
{
CX_DEBUG_ENTER_FUNCTION();
- OstTrace0( camerax_performance, CXEVIDEOCAPTURECONTROL_GETQUALITYDETAILS_1, "msg: e_CX_GET_QUALITY_DETAILS 1" );
+ OstTrace0( camerax_performance, CXEVIDEOCAPTURECONTROL_PREPARESNAP_1, "msg: e_CX_PREPARE_SNAPSHOT 1" );
+
+ // Prepare snapshot. Snapshot control throws error if problems.
+ QSize snapshotSize = mSnapshotControl.calculateSnapshotSize(
+ mViewfinderControl.deviceDisplayResolution(),
+ mCurrentVideoDetails.mAspectRatio);
+ mSnapshotControl.start(snapshotSize);
- int quality(0);
+ OstTrace0( camerax_performance, CXEVIDEOCAPTURECONTROL_PREPARESNAP_2, "msg: e_CX_PREPARE_SNAPSHOT 0" );
+ CX_DEBUG_EXIT_FUNCTION();
+}
+
+/*!
+ Fetch video quality details based on current video quality setting.
+*/
+void CxeVideoCaptureControlSymbian::updateVideoCaptureParameters()
+{
+ CX_DEBUG_ENTER_FUNCTION();
+ OstTrace0(camerax_performance, CXEVIDEOCAPTURECONTROL_UPDATEVIDEOCAPTUREPARAMETERS_1, "msg: e_CX_UPDATE_VIDEO_CAPTURE_PARAMETERS 1");
+
+ int quality = 0;
// Get quality index for primary camera. Only one quality for secondary camera.
if (mCameraDeviceControl.cameraIndex() == Cxe::PrimaryCameraIndex) {
- CxeException::throwIfError(mSettings.get(CxeSettingIds::VIDEO_QUALITY, quality));
+ quality = mSettings.get<int>(CxeSettingIds::VIDEO_QUALITY);
}
if (quality < 0 || quality >= mIcmSupportedVideoResolutions.count()) {
throw new CxeException(CxeError::NotFound);
}
- // get video quality details
- videoInfo = mIcmSupportedVideoResolutions.at(quality);
+ // Get video quality details
+ mCurrentVideoDetails = mIcmSupportedVideoResolutions.at(quality);
- OstTrace0( camerax_performance, CXEVIDEOCAPTURECONTROL_GETQUALITYDETAILS_2, "msg: e_CX_GET_QUALITY_DETAILS 0" );
+ OstTrace0(camerax_performance, CXEVIDEOCAPTURECONTROL_UPDATEVIDEOCAPTUREPARAMETERS_2, "msg: e_CX_UPDATE_VIDEO_CAPTURE_PARAMETERS 0");
CX_DEBUG_EXIT_FUNCTION();
}
@@ -504,11 +516,17 @@
CX_DEBUG(("CxeVideoCaptureControlSymbian::MvruoPrepareComplete, err=%d", aError));
if (state() == Preparing) {
- if (!aError) {
- setState(CxeVideoCaptureControl::Ready);
+ try {
+ // Check that no error coming in.
+ CxeException::throwIfError(aError);
+ // Start viewfinder
mViewfinderControl.start();
+ // Prepare snapshot (throws exception if fails).
+ prepareSnapshot();
+ // Ready for recording now.
+ setState(CxeVideoCaptureControl::Ready);
OstTrace0( camerax_performance, CXEVIDEOCAPTURECONTROLSYMBIAN_GOTOVIDEO, "msg: e_CX_GO_TO_VIDEO_MODE 0" );
- } else {
+ } catch (const std::exception &e) {
handlePrepareFailed();
}
}
@@ -855,7 +873,7 @@
* Scene mode changed. We need to know about it because frame rate
* might have changed.
*/
-void CxeVideoCaptureControlSymbian::handleSceneChanged(CxeScene& scene)
+void CxeVideoCaptureControlSymbian::handleSceneChanged(const QVariant& scene)
{
Q_UNUSED(scene)
CX_DEBUG_ENTER_FUNCTION();
@@ -895,6 +913,38 @@
}
/*!
+ Use ECam Use Case Hint Custom API to inform ECam of our intended use case
+ before calling Reserve().
+*/
+void CxeVideoCaptureControlSymbian::hintUseCase()
+{
+ CX_DEBUG_ENTER_FUNCTION();
+
+ // Make sure ECam knows we're doing video recording so it can prepare
+ // for the correct use case.
+ if (mCameraDeviceControl.mode() == Cxe::VideoMode) {
+ MCameraUseCaseHint *useCaseHintApi = mCameraDevice.useCaseHintApi();
+ if (useCaseHintApi) {
+ MCameraUseCaseHint::TVideoCodec codec =
+ MCameraUseCaseHint::ECodecUnknown;
+ MCameraUseCaseHint::TVideoProfile profile =
+ MCameraUseCaseHint::EProfileUnknown;
+
+ updateVideoCaptureParameters();
+ CxeSettingsMapperSymbian::Map2UseCaseHintVideoParameters(
+ mCurrentVideoDetails, codec, profile);
+
+ TSize resolution(mCurrentVideoDetails.mWidth,
+ mCurrentVideoDetails.mHeight);
+ TRAP_IGNORE(useCaseHintApi->HintDirectVideoCaptureL(codec, profile,
+ resolution));
+ }
+ }
+
+ CX_DEBUG_EXIT_FUNCTION();
+}
+
+/*!
* Returns QList of all supported video quality details based on the camera index
* (primary/secondary).
*/
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/camerauis/cameraxui/cxengine/src/cxeviewfindercontroldesktop.cpp Fri Jul 23 11:35:41 2010 +0300
@@ -0,0 +1,116 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#include <HbMainWindow>
+#include <HbView>
+#include <HbLabel>
+#include <QGraphicsLinearLayout>
+#include "cxeviewfindercontroldesktop.h"
+#include "cxecameradevicedesktop.h"
+#include "cxeviewfinderwidgetdesktop.h"
+#include "cxutils.h"
+
+const int KResWidth = 640;
+const int KResHeight = 360;
+
+CxeViewfinderControlDesktop::CxeViewfinderControlDesktop(CxeCameraDeviceDesktop &cameraDevice) :
+ mState(Uninitialized),
+ mResolution(KResWidth, KResHeight),
+ mCameraDevice(cameraDevice),
+ mViewfinderWidget(0)
+{
+ CX_DEBUG_IN_FUNCTION();
+}
+
+CxeViewfinderControlDesktop::~CxeViewfinderControlDesktop()
+{
+ CX_DEBUG_IN_FUNCTION();
+}
+
+/*!
+* Set Window ID
+*/
+void CxeViewfinderControlDesktop::setWindow(WId windowId)
+{
+ CX_DEBUG_ENTER_FUNCTION();
+ mWindowId = windowId;
+
+ if (state() != Running) {
+ mState = Ready;
+ emit stateChanged(mState, CxeError::None);
+ CX_DEBUG_EXIT_FUNCTION();
+ }
+
+
+ HbMainWindow* mainWindow = qobject_cast<HbMainWindow*>(QWidget::find(mWindowId));
+
+ if (mainWindow) {
+ if( !mViewfinderWidget) {
+ mViewfinderWidget = new CxeViewfinderWidgetDesktop();
+ connect(&mCameraDevice, SIGNAL(imageChanged(QPixmap)), mViewfinderWidget, SLOT(handleImageChange(QPixmap)));
+ }
+ HbView* view = mainWindow->currentView();
+ view->scene()->addItem(mViewfinderWidget);
+ mViewfinderWidget->setZValue(-1.0);
+ }
+}
+
+/*!
+* Start viewfinder
+* @return CxeEngine specific error code
+*/
+CxeError::Id CxeViewfinderControlDesktop::start()
+{
+ CX_DEBUG_ENTER_FUNCTION();
+ if (mState != Running) {
+ mState = Running;
+ emit stateChanged(mState, CxeError::None);
+ mCameraDevice.start();
+ }
+ CX_DEBUG_EXIT_FUNCTION();
+ return CxeError::None;
+}
+
+/*!
+* Stop viewfinder
+*/
+void CxeViewfinderControlDesktop::stop()
+{
+ CX_DEBUG_ENTER_FUNCTION();
+ mState = Ready;
+ emit stateChanged(mState, CxeError::None);
+ mCameraDevice.stop();
+ CX_DEBUG_EXIT_FUNCTION();
+}
+
+/*!
+* Current viewfinder state
+*/
+CxeViewfinderControl::State CxeViewfinderControlDesktop::state() const
+{
+ return mState;
+}
+
+/*!
+* Returns Device's Display resolution
+*/
+QSize CxeViewfinderControlDesktop::deviceDisplayResolution() const
+{
+ return mResolution;
+}
+
+// end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/camerauis/cameraxui/cxengine/src/cxeviewfinderwidgetdesktop.cpp Fri Jul 23 11:35:41 2010 +0300
@@ -0,0 +1,64 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+#include "cxeviewfinderwidgetdesktop.h"
+#include <QPainter>
+#include "cxutils.h"
+
+const double RES_WIDTH = 640.0;
+const double RES_HEIGHT = 360.0;
+
+/*!
+* Construtor
+*/
+CxeViewfinderWidgetDesktop::CxeViewfinderWidgetDesktop() :
+ QGraphicsWidget()
+{
+ CX_DEBUG_ENTER_FUNCTION();
+ mCurrentPixmap = QPixmap();
+ resize(RES_WIDTH, RES_HEIGHT);
+ CX_DEBUG_EXIT_FUNCTION();
+}
+
+/*!
+* Destrutor
+*/
+CxeViewfinderWidgetDesktop::~CxeViewfinderWidgetDesktop()
+{
+
+}
+
+/*!
+* Paint
+*/
+void CxeViewfinderWidgetDesktop::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)
+{
+ Q_UNUSED(option);
+ Q_UNUSED(widget);
+
+ painter->drawPixmap(rect().toRect(), mCurrentPixmap);
+}
+
+/*!
+* Handle image change
+*/
+void CxeViewfinderWidgetDesktop::handleImageChange(const QPixmap &newImage)
+{
+ CX_DEBUG_ENTER_FUNCTION();
+ mCurrentPixmap = newImage;
+ update();
+ CX_DEBUG_EXIT_FUNCTION();
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/camerauis/cameraxui/cxengine/src/cxezoomcontroldesktop.cpp Fri Jul 23 11:35:41 2010 +0300
@@ -0,0 +1,209 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#include "cxezoomcontroldesktop.h"
+#include "cxecameradevicecontrol.h"
+#include "cxutils.h"
+#include "cxenamespace.h"
+#include "cxestate.h"
+
+const int NOT_DEFINED = -1;
+
+/*!
+ * Constructor
+ */
+CxeZoomControlDesktop::CxeZoomControlDesktop(CxeCameraDeviceControl &cameraDeviceControl) :
+ mCameraDeviceControl(cameraDeviceControl)
+{
+ CX_DEBUG_ENTER_FUNCTION();
+
+ qRegisterMetaType<CxeZoomControl::State> ();
+
+ init();
+
+ CX_DEBUG_EXIT_FUNCTION();
+}
+
+/*!
+ * Destructor
+ */
+CxeZoomControlDesktop::~CxeZoomControlDesktop()
+{
+ CX_DEBUG_ENTER_FUNCTION();
+ CX_DEBUG_EXIT_FUNCTION();
+}
+
+/*!
+ * Get the minimum zoom index
+ */
+int CxeZoomControlDesktop::min() const
+{
+ return mMinZoomLevel;
+}
+
+/*!
+ * Get the maximum zoom index
+ */
+int CxeZoomControlDesktop::max() const
+{
+ return mMaxZoomLevel;
+}
+
+/*!
+ * Init
+ */
+void CxeZoomControlDesktop::init()
+{
+ CX_DEBUG_ENTER_FUNCTION();
+
+ // Initialize the variables
+ mMinZoomLevel = 0;
+ mMaxZoomLevel = 0;
+ mCurrentZoomLevel = 0;
+
+ mState = Idle;
+
+ CX_DEBUG_EXIT_FUNCTION();
+}
+
+/*!
+ * Re-initializes the zoom control
+ */
+void CxeZoomControlDesktop::reset()
+{
+ CX_DEBUG_ENTER_FUNCTION();
+
+ init();
+ emit zoomLevelChanged(mCurrentZoomLevel);
+
+ CX_DEBUG_EXIT_FUNCTION();
+}
+
+/*!
+* slot to prepare zoom control for still mode
+*/
+void CxeZoomControlDesktop::prepareZoomForStill(int ecamStillResolutionIndex)
+{
+ CX_DEBUG_ENTER_FUNCTION();
+
+ Q_UNUSED(ecamStillResolutionIndex);
+
+ if (mCameraDeviceControl.state() == CxeCameraDeviceControl::Ready) {
+ reset();
+ int error;
+ int imageQualityIndex;
+ CxeError::Id cxErr;
+ if (cxErr == CxeError::None && mStillMaxZoomLimits.count() > 0) {
+ // fetching the zoom limit based on the image quality
+ mMaxZoomLevel = mStillMaxZoomLimits[imageQualityIndex];
+ } else {
+ mMaxZoomLevel = NOT_DEFINED;
+ }
+
+ finalizeZoomPreparation(error);
+ }
+
+ CX_DEBUG_EXIT_FUNCTION();
+}
+
+/*!
+* slot to prepare zoom control for video mode
+*/
+void CxeZoomControlDesktop::prepareZoomForVideo()
+{
+ CX_DEBUG_ENTER_FUNCTION();
+
+ if (mCameraDeviceControl.state() == CxeCameraDeviceControl::Ready) {
+ reset();
+ int error;
+ if (mVideoMaxZoomLimits.count() > 0) {
+ // fetching the zoom limit based on the video quality
+ mMaxZoomLevel = mVideoMaxZoomLimits[0];
+ } else {
+ mMaxZoomLevel = NOT_DEFINED;
+ }
+
+ finalizeZoomPreparation(error);
+ }
+
+
+ CX_DEBUG_EXIT_FUNCTION();
+}
+
+/*!
+* Completes zoom control preparation.
+*/
+void CxeZoomControlDesktop::finalizeZoomPreparation(int error)
+{
+ CX_DEBUG_ENTER_FUNCTION();
+
+ CX_DEBUG(("Maximum zoom limit: %d", mMaxZoomLevel));
+
+ if (!error) {
+ // Note that this is called only after setting the resolution.
+ // emit the zoom changed signal so that clients can do any updates if necessary.
+ emit zoomLevelChanged(mCurrentZoomLevel);
+
+ mState = Ready;
+ emit stateChanged(mState, CxeError::None);
+ }
+
+ CX_DEBUG_EXIT_FUNCTION();
+}
+
+/*!
+* Zooms to the level specified in the parameter
+*/
+void CxeZoomControlDesktop::zoomTo(int value)
+{
+ CX_DEBUG_ENTER_FUNCTION();
+
+ CX_DEBUG(("Zoom to: %d, current zoom: %d", value, mCurrentZoomLevel));
+
+ // If not currently zooming and value falls between min & max
+ // then zoom to the passed level. Also there's no need to zoom if new zoom
+ // level is same as the current.
+ if (state() == CxeZoomControl::Ready && (value <= mMaxZoomLevel)
+ && (value >= mMinZoomLevel) && (mCurrentZoomLevel != value)) {
+
+ // Could also check the number of values in the array to avoid out of bounds indexing,
+ // though this is done in alternate way by the min and max limits.
+ mCurrentZoomLevel = value;
+
+ // Set the appropriate zooming state
+ if (value < mCurrentZoomLevel) {
+ mState = ZoomingOut;
+ } else {
+ mState = ZoomingIn;
+ }
+ emit stateChanged(mState, CxeError::None);
+
+ //! @todo: Wait for zoom callback: ECamEventZoomStateChanged ?
+ mState = Ready;
+ emit stateChanged(mState, CxeError::None);
+
+ // Emit the zoom level change signal
+ emit zoomLevelChanged(mCurrentZoomLevel);
+ }
+
+ CX_DEBUG_EXIT_FUNCTION();
+}
+
+CxeZoomControl::State CxeZoomControlDesktop::state() const
+{
+ return mState;
+}
--- a/camerauis/cameraxui/cxengine/src/cxezoomcontrolsymbian.cpp Thu Jul 15 01:55:05 2010 +0300
+++ b/camerauis/cameraxui/cxengine/src/cxezoomcontrolsymbian.cpp Fri Jul 23 11:35:41 2010 +0300
@@ -22,6 +22,7 @@
#include "cxutils.h"
#include "cxenamespace.h"
#include "cxestate.h"
+#include "cxeexception.h"
#include "OstTraceDefinitions.h"
#ifdef OST_TRACE_COMPILER_IN_USE
@@ -55,20 +56,14 @@
initializeStates();
// getting still max zoom limits from feature manager
- featureManager.configuredValues(CxeRuntimeKeys::STILL_MAX_ZOOM_LIMITS, mStillMaxZoomLimits);
- featureManager.configuredValues(CxeRuntimeKeys::VIDEO_MAX_ZOOM_LIMITS, mVideoMaxZoomLimits);
+ featureManager.configuredValues(CxeVariationKeys::STILL_MAX_ZOOM_LIMITS, mStillMaxZoomLimits);
+ featureManager.configuredValues(CxeVariationKeys::VIDEO_MAX_ZOOM_LIMITS, mVideoMaxZoomLimits);
connect(&mCameraDevice,
SIGNAL(prepareForCameraDelete()),
this,
SLOT(reset()));
- // enabling setting value change call backs
- connect(&mSettings,
- SIGNAL(settingValueChanged(const QString&,QVariant)),
- this,
- SLOT(handleSettingValueChanged(const QString&,QVariant)));
-
init();
CX_DEBUG_EXIT_FUNCTION();
@@ -141,23 +136,6 @@
-/**
- * Settings changed, needs updated
- */
-void CxeZoomControlSymbian::handleSettingValueChanged(const QString& settingId, QVariant /*newValue*/)
-{
- CX_DEBUG_ENTER_FUNCTION();
-
- if (settingId == CxeSettingIds::IMAGE_QUALITY ||
- settingId == CxeSettingIds::VIDEO_QUALITY) {
- reset();
- } else {
- // do nothing
- }
- CX_DEBUG_EXIT_FUNCTION();
-}
-
-
/*!
* slot to prepare zoom control for still mode
*/
@@ -167,7 +145,7 @@
OstTrace0(camerax_performance, CXEZOOMCONTROLSYMBIAN_PREPARESTILL_IN, "msg: e_CX_PREPARE_ZOOM 1");
if (mCameraDeviceControl.state() == CxeCameraDeviceControl::Ready) {
- init();
+ reset();
// For image mode
CCamera::TFormat format = CCamera::EFormatExif;
TBool isInfluencePossible = EFalse;
@@ -181,12 +159,14 @@
format,
isInfluencePossible));
- int imageQualityIndex;
- CxeError::Id cxErr = mSettings.get(CxeSettingIds::IMAGE_QUALITY, imageQualityIndex);
- if (cxErr == CxeError::None && mStillMaxZoomLimits.count() > 0) {
- // fetching the zoom limit based on the image quality
- mMaxZoomLevel = mStillMaxZoomLimits[imageQualityIndex];
- } else {
+
+ try {
+ int imageQualityIndex = mSettings.get<int>(CxeSettingIds::IMAGE_QUALITY);
+ if (mStillMaxZoomLimits.count() > 0 && imageQualityIndex < mStillMaxZoomLimits.count()) {
+ // fetching the zoom limit based on the image quality
+ mMaxZoomLevel = mStillMaxZoomLimits[imageQualityIndex];
+ }
+ } catch (CxeException &e) {
mMaxZoomLevel = NOT_DEFINED;
}
@@ -207,7 +187,7 @@
OstTrace0(camerax_performance, CXEZOOMCONTROLSYMBIAN_PREPAREVIDEO_IN, "msg: e_CX_PREPARE_ZOOM 1");
if (mCameraDeviceControl.state() == CxeCameraDeviceControl::Ready) {
- init();
+ reset();
// if CxeCameraDeviceControl is ready, this pointer is valid
CX_ASSERT_ALWAYS(mCameraDevice.advancedSettings());
int error = KErrNone;
--- a/camerauis/cameraxui/cxengine/tsrc/fakeclasses/cxefakesettings.cpp Thu Jul 15 01:55:05 2010 +0300
+++ b/camerauis/cameraxui/cxengine/tsrc/fakeclasses/cxefakesettings.cpp Fri Jul 23 11:35:41 2010 +0300
@@ -1,5 +1,5 @@
/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies).
* All rights reserved.
* This component and the accompanying materials are made available
* under the terms of "Eclipse Public License v1.0"
@@ -17,6 +17,7 @@
#include "cxefakesettings.h"
+
CxeFakeSettings::CxeFakeSettings()
{
}
@@ -25,28 +26,11 @@
{
}
-CxeError::Id CxeFakeSettings::get(const QString& key, int& value) const
-{
- value = mSettingKeyHash[key].toInt();
- return CxeError::None;
-}
-CxeError::Id CxeFakeSettings::get(const QString& key, QString &stringValue) const
-{
- stringValue = mSettingKeyHash[key].toString();
- return CxeError::None;
-}
-
-
-
-CxeError::Id CxeFakeSettings::get(const QString &key, qreal &value) const
-{
- value = mSettingKeyHash[key].toReal();
- return CxeError::None;
-}
-
-
-void CxeFakeSettings::get(long int uid, unsigned long int key, Cxe::SettingKeyType type, QVariant &value) const
+void CxeFakeSettings::get(long int uid,
+ unsigned long int key,
+ Cxe::SettingKeyType type,
+ QVariant &value) const
{
Q_UNUSED(uid);
Q_UNUSED(key);
@@ -54,31 +38,34 @@
Q_UNUSED(value);
}
-
-CxeError::Id CxeFakeSettings::set(const QString& key, int newValue)
+bool CxeFakeSettings::listenForSetting(const QString &settingKey, QObject *target, const char *slot)
{
- mSettingKeyHash[key] = QVariant(newValue);
- emit settingValueChanged(key, newValue);
+ Q_UNUSED(settingKey);
+ Q_UNUSED(target);
+ Q_UNUSED(slot);
+ return true;
+}
+
+CxeError::Id CxeFakeSettings::getVariationValue(const QString &key, QVariant &value)
+{
+ int variation = mVariationKeyHash[key];
+ value = QVariant(variation);
return CxeError::None;
}
-CxeError::Id CxeFakeSettings::set(const QString &key, const QString &newValue)
+void CxeFakeSettings::getValue(const QString &key, QVariant &value) const
{
- mSettingKeyHash[key] = QVariant(newValue);
- emit settingValueChanged(key, newValue);
- return CxeError::None;
+ value = mSettingKeyHash[key];
}
-
-
-CxeError::Id CxeFakeSettings::set(const QString &key, qreal newValue)
+void CxeFakeSettings::setValue(const QString &key, const QVariant &newValue)
{
- mSettingKeyHash[key] = QVariant(newValue);
+ mSettingKeyHash[key] = newValue;
emit settingValueChanged(key, newValue);
- return CxeError::None;
}
+
void CxeFakeSettings::reset()
{
}
--- a/camerauis/cameraxui/cxengine/tsrc/fakeclasses/cxefakesettings.h Thu Jul 15 01:55:05 2010 +0300
+++ b/camerauis/cameraxui/cxengine/tsrc/fakeclasses/cxefakesettings.h Fri Jul 23 11:35:41 2010 +0300
@@ -1,5 +1,5 @@
/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies).
* All rights reserved.
* This component and the accompanying materials are made available
* under the terms of "Eclipse Public License v1.0"
@@ -31,22 +31,24 @@
public: // from CxeSettings
- CxeError::Id get(const QString &key, int &value) const;
- CxeError::Id get(const QString &key, QString &stringValue) const;
- void get(long int uid, unsigned long int key, Cxe::SettingKeyType type, QVariant &value) const;
- CxeError::Id set(const QString &key, int newValue);
- CxeError::Id set(const QString &key,const QString &newValue);
- CxeError::Id get(const QString &key, qreal &value) const;
- CxeError::Id set(const QString &key, qreal newValue);
+ void get(long int uid,
+ unsigned long int key,
+ Cxe::SettingKeyType type,
+ QVariant &value) const;
void reset();
+ CxeError::Id getVariationValue(const QString &key, QVariant &value);
+ bool listenForSetting(const QString &settingKey, QObject *target, const char *slot);
+
+ protected:
+ void getValue(const QString &key, QVariant &value) const;
+ void setValue(const QString &key, const QVariant &newValue);
public: // methods for unit testing
-
void emulate(long int uid, unsigned long int key, QVariant value);
private: // data
QHash<QString, QVariant> mSettingKeyHash;
- QHash<QString, unsigned long int> mRuntimeKeyHash;
+ QHash<QString, unsigned long int> mVariationKeyHash;
private:
Q_DISABLE_COPY(CxeFakeSettings)
--- a/camerauis/cameraxui/cxengine/tsrc/unit/system_include/harvesterclient.h Thu Jul 15 01:55:05 2010 +0300
+++ b/camerauis/cameraxui/cxengine/tsrc/unit/system_include/harvesterclient.h Fri Jul 23 11:35:41 2010 +0300
@@ -1,5 +1,5 @@
/*
-* Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2006-2010 Nokia Corporation and/or its subsidiary(-ies).
* All rights reserved.
* This component and the accompanying materials are made available
* under the terms of "Eclipse Public License v1.0"
@@ -19,7 +19,7 @@
#ifndef __HARVESTER_CLIENT_H__
#define __HARVESTER_CLIENT_H__
-
+#include <e32std.h>
class MHarvestObserver
{
--- a/camerauis/cameraxui/cxengine/tsrc/unit/system_include/rlocationtrail.cpp Thu Jul 15 01:55:05 2010 +0300
+++ b/camerauis/cameraxui/cxengine/tsrc/unit/system_include/rlocationtrail.cpp Fri Jul 23 11:35:41 2010 +0300
@@ -1,5 +1,5 @@
/*
-* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies).
* All rights reserved.
* This component and the accompanying materials are made available
* under the terms of "Eclipse Public License v1.0"
@@ -15,9 +15,11 @@
*
*/
+#include <e32err.h>
#include "rlocationtrail.h"
RLocationTrail::RLocationTrail()
+ : mTrailConnected(false), mTrailStarted(false)
{
}
@@ -25,57 +27,40 @@
{
}
-TInt RLocationTrail::Connect()
+int RLocationTrail::StartLocationTrail(TTrailCaptureSetting /*aState*/)
{
- return KErrNone;
-}
-
-void RLocationTrail::Close()
-{
+ int err = KErrNone;
+
+ if (mTrailConnected) {
+ mTrailStarted = true;
+ } else {
+ err = KErrGeneral;
+ }
+
+ return err;
}
-TInt RLocationTrail::StartLocationTrail(TTrailCaptureSetting aState)
+int RLocationTrail::StopLocationTrail()
{
- return KErrNone;
+ int err = KErrNone;
+ if (!mTrailConnected || !mTrailStarted) {
+ err = KErrGeneral;
+ } else {
+ mTrailStarted = false;
+ }
+ return err;
}
-TInt RLocationTrail::StopLocationTrail()
+
+
+int RLocationTrail::Connect()
{
- return KErrNone;
-}
-
-TInt RLocationTrail::GetLocationTrailState( TTrailState& aState )
-{
+ mTrailConnected = true;
return KErrNone;
}
-void RLocationTrail::NotifyLocationTrailStateChange( TRequestStatus& aStatus )
-{
-}
-void RLocationTrail::CancelNotificationRequest()
+void RLocationTrail::Close()
{
-}
-
-TInt RLocationTrail::RetrieveLocation( const TTime& aTimeStamp,
- TLocationData& aLocationData,
- TTrailState& aState )
-{
- return KErrNone;
+ mTrailConnected = false;
}
-
-void RLocationTrail::CurrentLocation( TRequestStatus& aStatus,
- TLocationData& aLocationData)
-{
-}
-
-void RLocationTrail::CancelLocationRequest()
-{
-}
-
-TInt RLocationTrail::GetTrailCaptureSetting( TTrailCaptureSetting& aCaptureSetting )
-{
- return KErrNone;
-}
-
-// end of file
--- a/camerauis/cameraxui/cxengine/tsrc/unit/system_include/rlocationtrail.h Thu Jul 15 01:55:05 2010 +0300
+++ b/camerauis/cameraxui/cxengine/tsrc/unit/system_include/rlocationtrail.h Fri Jul 23 11:35:41 2010 +0300
@@ -1,5 +1,5 @@
/*
-* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2006-2010 Nokia Corporation and/or its subsidiary(-ies).
* All rights reserved.
* This component and the accompanying materials are made available
* under the terms of "Eclipse Public License v1.0"
@@ -11,27 +11,25 @@
*
* Contributors:
*
-* Description:
+* Description: An interface to Location Trail.
*
*/
#ifndef R_RLOCATIONTRAIL_H
#define R_RLOCATIONTRAIL_H
-#include <e32base.h>
-#include <etel3rdparty.h>
-#include <lbsposition.h>
-#include <locationdatatype.h>
-
-typedef TPckg<TLocality> TLocalityPckg;
/**
- * RLocationManager dummy.
- */
-class RLocationTrail
+ * Fake implementation of RLocationManager class which is used for creating a Location Manager session.
+ * Location Manager is used to start and stop the location trail, retrieve
+ * location information and write the location information to images.
+*/
+class RLocationTrail
{
public:
-
+ /**
+ * Location trail states.
+ */
enum TTrailState
{
ETrailStopped,
@@ -41,34 +39,54 @@
ETrailStopping,
ETrailStarting
};
+
enum TTrailCaptureSetting
- {
- EOff,
- ECaptureNetworkInfo,
- ECaptureAll
- };
+ {
+ EOff,
+ ECaptureNetworkInfo,
+ ECaptureAll
+ };
public:
- RLocationTrail();
- ~RLocationTrail();
+ RLocationTrail();
+
+ ~RLocationTrail();
- TInt Connect();
+ /**
+ * Starts recording location information to location trail.
+ * @since S60 3.2
+ * @param aState, an enumeration of ECaptureNetworkInfo
+ * (only cell ID stored) and ECaptureAll
+ * (GPS coordinates and cell ID stored).
+ * @return KErrNone if successful, otherwise one of the other
+ * system-wide error codes.
+ */
+ int StartLocationTrail(TTrailCaptureSetting aState);
+
+ /**
+ * Stops recording location information to location trail.
+ * @since S60 3.1
+ * @param None.
+ * @return KErrNone if successful, otherwise one of the other
+ * system-wide error codes.
+ */
+ int StopLocationTrail();
+
+
+ /**
+ * Connect to location trail server
+ * @return KErrNone if successful, otherwise one of the other
+ * system-wide error codes.
+ **/
+ int Connect();
+
void Close();
- TInt StartLocationTrail(TTrailCaptureSetting aState);
- TInt StopLocationTrail();
- TInt GetLocationTrailState( TTrailState& aState );
- void NotifyLocationTrailStateChange( TRequestStatus& aStatus );
- void CancelNotificationRequest();
- TInt RetrieveLocation( const TTime& aTimeStamp,
- TLocationData& aLocationData,
- TTrailState& aState );
- void CurrentLocation( TRequestStatus& aStatus,
- TLocationData& aLocationData);
- void CancelLocationRequest();
- TInt GetTrailCaptureSetting( TTrailCaptureSetting& aCaptureSetting );
+private:
+ bool mTrailConnected;
+ bool mTrailStarted;
};
-
+
#endif // R_RLOCATIONTRAIL_H
-// end of file
+//End of File
--- a/camerauis/cameraxui/cxengine/tsrc/unit/unittest.pri Thu Jul 15 01:55:05 2010 +0300
+++ b/camerauis/cameraxui/cxengine/tsrc/unit/unittest.pri Fri Jul 23 11:35:41 2010 +0300
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies).
# All rights reserved.
# This component and the accompanying materials are made available
# under the terms of "Eclipse Public License v1.0"
@@ -33,6 +33,8 @@
symbian {
TARGET.CAPABILITY = ALL -TCB -DRM
RSS_RULES = "group_name=\"Qt Camera\";"
+
+ DEFINES += CAMERAX_ENGINE_LIBRARY
}
--- a/camerauis/cameraxui/cxengine/tsrc/unit/unittest_cxediskmonitor/cxediskmonitorprivateunit.cpp Thu Jul 15 01:55:05 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,1 +0,0 @@
-
--- a/camerauis/cameraxui/cxengine/tsrc/unit/unittest_cxediskmonitor/cxediskmonitorprivateunit.h Thu Jul 15 01:55:05 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,29 +0,0 @@
-/*
-* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
-*
-*/
-
-#ifndef CXEDISKMONITORPRIVATEUNIT_H
-#define CXEDISKMONITORPRIVATEUNIT_H
-
-// Include files
-
-#include "cxediskmonitorprivate.h"
-
-class CxeDiskMonitorPrivateUnit;
-
-
-
-#endif // CXEDISKMONITORPRIVATEUNIT_H
--- a/camerauis/cameraxui/cxengine/tsrc/unit/unittest_cxediskmonitor/cxesysutil.cpp Thu Jul 15 01:55:05 2010 +0300
+++ b/camerauis/cameraxui/cxengine/tsrc/unit/unittest_cxediskmonitor/cxesysutil.cpp Fri Jul 23 11:35:41 2010 +0300
@@ -24,29 +24,24 @@
* Checks if free disk drive storage space is or will fall below critical
* level. Static configuration values stored in Central Repository are
* used to determine a critical level for each drive.
- *
+ *
* If aBytesToWrite is more than zero, function returns false otherwise true.
* By defining aBytesToWrite to zero it is possible to get fake fulldisk error.
- *
+ *
*/
-TBool CxeSysUtil::DiskSpaceBelowCriticalLevel(
+bool CxeSysUtil::DiskSpaceBelowCriticalLevel(
RFs* /*aFs*/,
TInt aBytesToWrite,
TInt /*aDrive*/ )
{
- CX_DEBUG_IN_FUNCTION();
-
- if (aBytesToWrite > 0) {
- return EFalse;
- }
- else {
- return ETrue;
- }
+ CX_DEBUG_IN_FUNCTION();
+
+ return (aBytesToWrite <= 0);
}
qint64 CxeSysUtil::spaceAvailable(
- RFs & /*fs*/,
- int /*index*/,
+ RFs & /*fs*/,
+ int /*index*/,
CxeSettings & /*settings*/)
{
CX_DEBUG_IN_FUNCTION();
--- a/camerauis/cameraxui/cxengine/tsrc/unit/unittest_cxediskmonitor/cxesysutil.h Thu Jul 15 01:55:05 2010 +0300
+++ b/camerauis/cameraxui/cxengine/tsrc/unit/unittest_cxediskmonitor/cxesysutil.h Fri Jul 23 11:35:41 2010 +0300
@@ -29,14 +29,14 @@
public:
- static TBool DiskSpaceBelowCriticalLevel(
+ static bool DiskSpaceBelowCriticalLevel(
RFs* aFs,
TInt aBytesToWrite,
TInt aDrive);
static qint64 spaceAvailable(RFs &fs, int index, CxeSettings &settings);
static void setSpaceAvailable(qint64 aSpaceAvailable);
-
+
static int getCameraDrive(RFs &fs);
public:
--- a/camerauis/cameraxui/cxengine/tsrc/unit/unittest_cxediskmonitor/unittest_cxediskmonitor.pro Thu Jul 15 01:55:05 2010 +0300
+++ b/camerauis/cameraxui/cxengine/tsrc/unit/unittest_cxediskmonitor/unittest_cxediskmonitor.pro Fri Jul 23 11:35:41 2010 +0300
@@ -16,6 +16,8 @@
DEPENDPATH = . ../../fakeclasses ../../../src/dummyengine ../utils
INCLUDEPATH = . ../../fakeclasses ../../../src/dummyengine ../utils ../../../traces
+LIBS += -lcone
+
DEFINES *= CXE_USE_DUMMY_CAMERA
SOURCES *= unittest_cxediskmonitor.cpp \
--- a/camerauis/cameraxui/cxengine/tsrc/unit/unittest_cxeenginesymbian/unittest_cxeenginesymbian.pro Thu Jul 15 01:55:05 2010 +0300
+++ b/camerauis/cameraxui/cxengine/tsrc/unit/unittest_cxeenginesymbian/unittest_cxeenginesymbian.pro Fri Jul 23 11:35:41 2010 +0300
@@ -44,6 +44,10 @@
LIBS *= -lxqserviceutil
LIBS *= -loommonitor
LIBS += -llocationmanager
+LIBS += -lcone
+LIBS *= -lws32
+LIBS += -lgdi
+LIBS += -lhal
SOURCES *= unittest_cxeenginesymbian.cpp \
@@ -106,13 +110,14 @@
cxesnapshotcontrolprivate.cpp \
cxefakesettingsmodel.cpp \
cxegeotaggingtrail.cpp \
- cxegeotaggingtrailprivate.cpp
+ cxegeotaggingtrail_symbian_p.cpp
HEADERS *= unittest_cxeenginesymbian.h \
cxeenginesymbianunit.h \
cxeenginesymbian.h \
+ cxengine_global.h \
cxeengine.h \
cxeautofocuscontrol.h \
cxeautofocuscontrolsymbian.h \
@@ -183,4 +188,4 @@
cxesnapshotcontrolprivate.h \
cxefakesettingsmodel.h \
cxegeotaggingtrail.h \
- cxegeotaggingtrailprivate.h
+ cxegeotaggingtrail_symbian_p.h
--- a/camerauis/cameraxui/cxengine/tsrc/unit/unittest_cxefilesavethreadsymbian/unittest_cxefilesavethreadsymbian.cpp Thu Jul 15 01:55:05 2010 +0300
+++ b/camerauis/cameraxui/cxengine/tsrc/unit/unittest_cxefilesavethreadsymbian/unittest_cxefilesavethreadsymbian.cpp Fri Jul 23 11:35:41 2010 +0300
@@ -1,5 +1,5 @@
/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies).
* All rights reserved.
* This component and the accompanying materials are made available
* under the terms of "Eclipse Public License v1.0"
@@ -23,7 +23,6 @@
#include "unittest_cxefilesavethreadsymbian.h"
#include "cxefilesavethreadsymbian.h"
#include "cxefakeimagedataitem.h"
-#include "cxeimagedataitem.h"
#include "cxetestutils.h"
--- a/camerauis/cameraxui/cxengine/tsrc/unit/unittest_cxefilesavethreadsymbian/unittest_cxefilesavethreadsymbian.pro Thu Jul 15 01:55:05 2010 +0300
+++ b/camerauis/cameraxui/cxengine/tsrc/unit/unittest_cxefilesavethreadsymbian/unittest_cxefilesavethreadsymbian.pro Fri Jul 23 11:35:41 2010 +0300
@@ -23,6 +23,7 @@
LIBS *= -lplatformenv
LIBS *= -lefsrv
LIBS *= -lcone
+LIBS *= -lthumbnailmanagerqt
SOURCES *= unittest_cxefilesavethreadsymbian.cpp \
thumbnailmanager_qt.cpp \
--- a/camerauis/cameraxui/cxengine/tsrc/unit/unittest_cxeimagedataitemsymbian/cxeimagedataitemunit.cpp Thu Jul 15 01:55:05 2010 +0300
+++ b/camerauis/cameraxui/cxengine/tsrc/unit/unittest_cxeimagedataitemsymbian/cxeimagedataitemunit.cpp Fri Jul 23 11:35:41 2010 +0300
@@ -1,5 +1,5 @@
/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies).
* All rights reserved.
* This component and the accompanying materials are made available
* under the terms of "Eclipse Public License v1.0"
@@ -30,17 +30,12 @@
CX_DEBUG_IN_FUNCTION();
}
-int CxeImageDataItemUnit::checkDiskSpace(RFs* aFs,
- TInt aBytesToWrite,
- TInt aDrive)
+bool CxeImageDataItemUnit::checkDiskSpace(RFs* aFs,
+ TInt aBytesToWrite,
+ TInt aDrive)
{
- CX_DEBUG_ENTER_FUNCTION();
- int value = CxeFakeSysUtil::DiskSpaceBelowCriticalLevel(
- aFs,
- aBytesToWrite,
- aDrive );
-
- return value;
+ CX_DEBUG_IN_FUNCTION();
+ return CxeFakeSysUtil::DiskSpaceBelowCriticalLevel(aFs, aBytesToWrite, aDrive);
}
// end of file
--- a/camerauis/cameraxui/cxengine/tsrc/unit/unittest_cxeimagedataitemsymbian/cxeimagedataitemunit.h Thu Jul 15 01:55:05 2010 +0300
+++ b/camerauis/cameraxui/cxengine/tsrc/unit/unittest_cxeimagedataitemsymbian/cxeimagedataitemunit.h Fri Jul 23 11:35:41 2010 +0300
@@ -1,5 +1,5 @@
/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies).
* All rights reserved.
* This component and the accompanying materials are made available
* under the terms of "Eclipse Public License v1.0"
@@ -31,19 +31,16 @@
* CxeCameraDeviceControlSymbian except for that CxeFakeCameraDevice is used
* instead of the real implementation.
*/
-class CxeImageDataItemUnit : public CxeImageDataItemSymbian
+class CxeImageDataItemUnit : public CxeImageDataItemSymbian
{
- Q_OBJECT
+ Q_OBJECT
public:
CxeImageDataItemUnit(int index, QByteArray data, QString filename, bool addLocation);
virtual ~CxeImageDataItemUnit();
- int checkDiskSpace(RFs* aFs,
- TInt aBytesToWrite,
- TInt aDrive);
-
-protected: // from CxeImageDataItemSymbian
- //int save();
+ bool checkDiskSpace(RFs* aFs,
+ TInt aBytesToWrite,
+ TInt aDrive);
};
#endif // CXEFAKECAMERADEVICECONTROL_H
--- a/camerauis/cameraxui/cxengine/tsrc/unit/unittest_cxeimagedataitemsymbian/unittest_cxeimagedataitemsymbian.cpp Thu Jul 15 01:55:05 2010 +0300
+++ b/camerauis/cameraxui/cxengine/tsrc/unit/unittest_cxeimagedataitemsymbian/unittest_cxeimagedataitemsymbian.cpp Fri Jul 23 11:35:41 2010 +0300
@@ -1,5 +1,5 @@
/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies).
* All rights reserved.
* This component and the accompanying materials are made available
* under the terms of "Eclipse Public License v1.0"
@@ -16,6 +16,7 @@
*/
#include <QDate>
#include <QTest>
+#include <QDir>
#include <QDebug>
#include <QSignalSpy>
@@ -25,11 +26,14 @@
#include "cxeimagedataitemunit.h"
#include "cxestillimagesymbian.h"
#include "cxutils.h"
+#include "cxeerror.h"
UnitTestCxeImageDataItemSymbian::UnitTestCxeImageDataItemSymbian()
-: mImageDataItem(NULL)
+: mImageDataItem(NULL),
+ mImageCounter(-1)
{
+ qRegisterMetaType<CxeError::Id>("CxeError::Id");
}
UnitTestCxeImageDataItemSymbian::~UnitTestCxeImageDataItemSymbian()
@@ -37,27 +41,86 @@
delete mImageDataItem;
}
+/*!
+* Initializes resources.
+*/
void UnitTestCxeImageDataItemSymbian::init()
{
CX_DEBUG_ENTER_FUNCTION();
- TInt index = 0;
- mPath = generateImageFileName(index);
+ mFilename = generateImageFileName();
QByteArray data = "1234";
+ mImageDataItem = new CxeImageDataItemUnit(mImageCounter, data, mFilename, false);
+ QVERIFY(mImageDataItem->state() == CxeImageDataItem::SavePending);
+ QCOMPARE(mImageDataItem->isLocationEnabled(), false);
+
+ CX_DEBUG_EXIT_FUNCTION();
+}
+
- mImageDataItem = new CxeImageDataItemUnit(index, data, mPath, false);
+/*!
+* cleans up resources for each test case
+*/
+void UnitTestCxeImageDataItemSymbian::cleanup()
+{
+ CX_DEBUG_ENTER_FUNCTION();
+
+ delete mImageDataItem;
+ mImageDataItem = NULL;
- QVERIFY(mImageDataItem->state() == CxeImageDataItem::SavePending);
CX_DEBUG_EXIT_FUNCTION();
}
-void UnitTestCxeImageDataItemSymbian::cleanup()
+
+
+/*!
+* Initializes resources before any test cases.
+*/
+void UnitTestCxeImageDataItemSymbian::initTestCase()
{
CX_DEBUG_ENTER_FUNCTION();
- delete mImageDataItem;
- mImageDataItem = NULL;
+
+ // create folder for storing temporary image files
+ QDir dir;
+ dir.mkpath(path());
+
CX_DEBUG_EXIT_FUNCTION();
}
+
+/*!
+* cleans up resources after last test case
+*/
+void UnitTestCxeImageDataItemSymbian::cleanupTestCase()
+{
+ CX_DEBUG_ENTER_FUNCTION();
+
+ // remove temporary image files and folder
+ QDir dir;
+ QString filepath = path();
+ dir.setPath(filepath);
+
+ QStringList filters;
+ filters << "*.jpg";
+ dir.setNameFilters(filters);
+
+ QStringList filenames = dir.entryList(filters);
+
+ // delete temporary created files
+ foreach(const QString &file, filenames) {
+ dir.remove(filepath + file);
+ }
+
+ // delete the directory created for temporary saving image files.
+ dir.rmpath(filepath);
+
+ CX_DEBUG_EXIT_FUNCTION();
+}
+
+
+
+/*!
+* UnitTestCxeImageDataItemSymbian::testState
+*/
void UnitTestCxeImageDataItemSymbian::testSave()
{
CX_DEBUG_ENTER_FUNCTION();
@@ -66,75 +129,63 @@
QSignalSpy deviceStateSpy(mImageDataItem, SIGNAL(imageSaved(CxeError::Id, const QString&, int)));
QVERIFY(deviceStateSpy.isValid());
- int returnValue = mImageDataItem->save();
+ CxeError::Id err = mImageDataItem->save();
QVERIFY(mImageDataItem->state() == CxeImageDataItem::Saved);
- QVERIFY(returnValue == KErrNone);
+ QCOMPARE(err, CxeError::None);
QCOMPARE( deviceStateSpy.count(), 1 );
if (deviceStateSpy.count() > 0) {
QList<QVariant> initModeArguments = deviceStateSpy.takeFirst();
- QVERIFY( initModeArguments.at(0).toInt() == CxeError::None );
- QVERIFY( initModeArguments.at(1).toString().compare(mPath) == 0);
+ QCOMPARE(initModeArguments.at(0).value<CxeError::Id>(), CxeError::None);
+ QVERIFY( initModeArguments.at(1).toString().compare(mFilename) == 0);
QVERIFY( initModeArguments.at(2).toInt() == id);
}
- CX_DEBUG_EXIT_FUNCTION();
-}
-
-void UnitTestCxeImageDataItemSymbian::testSaveFail()
-{
- CX_DEBUG_ENTER_FUNCTION();
- int returnValue;
- int index = 1;
- QString path = NULL;
+ // try to test possible fail cases.
+ QString filename = NULL;
QByteArray data = "";
- returnValue = mImageDataItem->save();
- QVERIFY(mImageDataItem->state() == CxeImageDataItem::Saved);
- QVERIFY(returnValue == KErrArgument);
-
- delete mImageDataItem;
- mImageDataItem = NULL;
- mImageDataItem = new CxeImageDataItemUnit( index, data, path, false );
- returnValue = mImageDataItem->save();
+ CX_DEBUG(("UnitTestCxeImageDataItemSymbian::testSave <> Invalid arguments"));
+ cleanup();
+ mImageDataItem = new CxeImageDataItemUnit(mImageCounter, data, filename, false);
+ err = mImageDataItem->save();
QVERIFY(mImageDataItem->state() == CxeImageDataItem::SaveFailed);
- QVERIFY(returnValue == KErrArgument);
+
+ // Arugments are not valid, leaves with KErrArgument which is mapped internally to CxError::General.
+ QCOMPARE(err, CxeError::General);
- delete mImageDataItem;
- mImageDataItem = NULL;
- QString filename = generateImageFileNameWithLetter(++index, "C");
- mImageDataItem = new CxeImageDataItemUnit( index, data, filename, false );
- returnValue = mImageDataItem->save();
+ CX_DEBUG(("UnitTestCxeImageDataItemSymbian::testSave <> Invalid path"));
+ cleanup();
+ filename = dummyPath("C");
+ mImageDataItem = new CxeImageDataItemUnit(mImageCounter, data, filename, false);
+ err = mImageDataItem->save();
QVERIFY(mImageDataItem->state() == CxeImageDataItem::SaveFailed);
- QVERIFY(returnValue != KErrNone);
+ QVERIFY(err != CxeError::None);
- qDebug() << "UnitTestCxeImageDataItemSymbian::testSaveFail3 =>";
- delete mImageDataItem;
- mImageDataItem = NULL;
- filename = generateImageFileNameWithLetter(++index, "");
- mImageDataItem = new CxeImageDataItemUnit( index, data, filename, false );
- returnValue = mImageDataItem->save();
+ CX_DEBUG(("UnitTestCxeImageDataItemSymbian::testSave <> invalid drive"));
+ cleanup();
+ filename = dummyPath("");
+ mImageDataItem = new CxeImageDataItemUnit(mImageCounter, data, filename, false);
+ err = mImageDataItem->save();
QVERIFY(mImageDataItem->state() == CxeImageDataItem::SaveFailed);
- QVERIFY(returnValue != KErrNone);
+ QVERIFY(err != CxeError::None);
- qDebug() << "UnitTestCxeImageDataItemSymbian::testSaveFail4 =>";
- delete mImageDataItem;
- mImageDataItem = NULL;
- filename = generateImageFileNameWithLetter(++index, "12");
- mImageDataItem = new CxeImageDataItemUnit( index, data, filename, false );
- returnValue = mImageDataItem->save();
+ CX_DEBUG(("UnitTestCxeImageDataItemSymbian::testSave <> invalid drive - 2"));
+ cleanup();
+ filename = dummyPath("12");
+ mImageDataItem = new CxeImageDataItemUnit(mImageCounter, data, filename, false);
+ err = mImageDataItem->save();
QVERIFY(mImageDataItem->state() == CxeImageDataItem::SaveFailed);
- QVERIFY(returnValue != KErrNone);
+ QVERIFY(err != CxeError::None);
- qDebug() << "UnitTestCxeImageDataItemSymbian::testSaveFail5 =>";
- delete mImageDataItem;
- mImageDataItem = NULL;
- filename = generateImageFileNameWithLetter(++index, "Edata");
- mImageDataItem = new CxeImageDataItemUnit( index, data, filename, false );
- returnValue = mImageDataItem->save();
+ CX_DEBUG(("UnitTestCxeImageDataItemSymbian::testSave <> invalid drive - 3"));
+ cleanup();
+ filename = dummyPath("Edata");
+ mImageDataItem = new CxeImageDataItemUnit(mImageCounter, data, filename, false);
+ err = mImageDataItem->save();
QVERIFY(mImageDataItem->state() == CxeImageDataItem::SaveFailed);
- QVERIFY(returnValue != KErrNone);
+ QVERIFY(err != CxeError::None);
CX_DEBUG_EXIT_FUNCTION();
}
@@ -142,33 +193,109 @@
void UnitTestCxeImageDataItemSymbian::testPath()
{
CX_DEBUG_ENTER_FUNCTION();
- QVERIFY(mImageDataItem->path().compare(mPath) == 0);
+ QVERIFY(mImageDataItem->path().compare(mFilename) == 0);
+ CX_DEBUG_EXIT_FUNCTION();
+}
+
+
+
+
+/*!
+* UnitTestCxeImageDataItemSymbian::testState
+*/
+void UnitTestCxeImageDataItemSymbian::testState()
+{
+ CX_DEBUG_ENTER_FUNCTION();
+ mImageDataItem->save();
+ QVERIFY(mImageDataItem->state() == CxeImageDataItem::Saved);
+ CX_DEBUG_EXIT_FUNCTION();
}
-QString UnitTestCxeImageDataItemSymbian::generateImageFileName(int counter)
+
+/*!
+* UnitTestCxeImageDataItemSymbian::testId
+*/
+void UnitTestCxeImageDataItemSymbian::testId()
+{
+ CX_DEBUG_ENTER_FUNCTION();
+ // checking if initialization of image data item is successful.
+ QCOMPARE(mImageDataItem->id(), mImageCounter);
+ mImageDataItem->save();
+ QCOMPARE(mImageDataItem->id(), mImageCounter);
+ CX_DEBUG_EXIT_FUNCTION();
+}
+
+
+/*!
+* UnitTestCxeImageDataItemSymbian::testIsLocationEnabled
+*/
+void UnitTestCxeImageDataItemSymbian::testIsLocationEnabled()
{
CX_DEBUG_ENTER_FUNCTION();
- QString monthName = QDate::currentDate().toString("yyyyMM");
+
+ // spl case to check if location is enabled
+ cleanup();
+ bool enableLocation(true);
+ QByteArray data = "1234";
+ QString filename = generateImageFileName();
+ mImageDataItem = new CxeImageDataItemUnit(mImageCounter, data, filename, enableLocation);
+ QCOMPARE(mImageDataItem->isLocationEnabled(), enableLocation);
+
+ CX_DEBUG_EXIT_FUNCTION();
+}
+
+
+/*!
+* Generates filename.
+* @param counter is associated with image file name.
+*/
+QString UnitTestCxeImageDataItemSymbian::generateImageFileName()
+{
+ CX_DEBUG_ENTER_FUNCTION();
+
+ mImageCounter++;
QString filename;
- filename.sprintf("E:\\Images\\Camera\\%s\\%sA0\\%04d_Nokia5800.jpg",
- monthName.toAscii().data(),
- monthName.toAscii().data(),
- counter);
+ filename.sprintf("%04d_Nokia.jpg", mImageCounter);
+ filename = path() + filename;
+
CX_DEBUG_EXIT_FUNCTION();
return filename;
}
-QString UnitTestCxeImageDataItemSymbian::generateImageFileNameWithLetter(int counter, QString letter)
+/*!
+* Create path for saving images to be used in testcases.
+*/
+QString UnitTestCxeImageDataItemSymbian::path()
{
CX_DEBUG_ENTER_FUNCTION();
- QString monthName = QDate::currentDate().toString("yyyyMM");
+
+ QString path;
+
+#ifdef __WINSCW__
+ path.sprintf("c:\\data\\testimages\\");
+#else
+ path.sprintf("e:\\testimages\\");
+#endif
+
+ CX_DEBUG_EXIT_FUNCTION();
+
+ return path;
+}
+
+
+
+/*!
+* Create a dummy invalid path for testcases.
+*/
+QString UnitTestCxeImageDataItemSymbian::dummyPath(const QString &drive)
+{
+ CX_DEBUG_ENTER_FUNCTION();
+ mImageCounter++;
QString filename;
- filename.sprintf("%s:\\Images\\Camera\\%s\\%sA0\\%04d_Nokia5800.jpg",
- letter.toAscii().data(),
- monthName.toAscii().data(),
- monthName.toAscii().data(),
- counter);
+ filename.sprintf("%s:\\Dummy\\Camera\\%04d_Nokia.jpg",
+ drive.toAscii().data(),
+ mImageCounter);
CX_DEBUG_EXIT_FUNCTION();
return filename;
}
--- a/camerauis/cameraxui/cxengine/tsrc/unit/unittest_cxeimagedataitemsymbian/unittest_cxeimagedataitemsymbian.h Thu Jul 15 01:55:05 2010 +0300
+++ b/camerauis/cameraxui/cxengine/tsrc/unit/unittest_cxeimagedataitemsymbian/unittest_cxeimagedataitemsymbian.h Fri Jul 23 11:35:41 2010 +0300
@@ -1,5 +1,5 @@
/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies).
* All rights reserved.
* This component and the accompanying materials are made available
* under the terms of "Eclipse Public License v1.0"
@@ -33,19 +33,33 @@
~UnitTestCxeImageDataItemSymbian();
private slots:
+
+ // for every test case
void init();
+
+ // for every test case
void cleanup();
+
+ // before any test cases
+ void initTestCase();
+ // after last test case
+ void cleanupTestCase();
+
void testSave();
- void testSaveFail();
void testPath();
+ void testState();
+ void testId();
+ void testIsLocationEnabled();
private:
- QString generateImageFileName(int counter);
- QString generateImageFileNameWithLetter(int counter, QString letter);
+ QString generateImageFileName();
+ QString dummyPath(const QString &drive);
+ QString path();
private:
CxeImageDataItemSymbian *mImageDataItem; // This will be recreated for each test
- QString mPath;
+ QString mFilename;
+ int mImageCounter;
};
#endif // UNITTEST_CXEIMAGEDATAITEMSYMBIAN_H
--- a/camerauis/cameraxui/cxengine/tsrc/unit/unittest_cxeimagedataitemsymbian/unittest_cxeimagedataitemsymbian.pro Thu Jul 15 01:55:05 2010 +0300
+++ b/camerauis/cameraxui/cxengine/tsrc/unit/unittest_cxeimagedataitemsymbian/unittest_cxeimagedataitemsymbian.pro Fri Jul 23 11:35:41 2010 +0300
@@ -49,4 +49,5 @@
unittest_cxeimagedataitemsymbian.h \
cxeimagedataitemunit.h \
cxesysutil.h \
- cxefakesysutil.h
+ cxefakesysutil.h \
+ cxeerror.h
--- a/camerauis/cameraxui/cxengine/tsrc/unit/unittest_cxesettmappersymbian/unittest_cxesettingsmappersymbian.cpp Thu Jul 15 01:55:05 2010 +0300
+++ b/camerauis/cameraxui/cxengine/tsrc/unit/unittest_cxesettmappersymbian/unittest_cxesettingsmappersymbian.cpp Fri Jul 23 11:35:41 2010 +0300
@@ -22,8 +22,10 @@
#include "cxenamespace.h"
#include "cxesettingsmappersymbian.h"
+#include "cxequalitydetails.h"
#include "unittest_cxesettingsmappersymbian.h"
+
// Enums
@@ -64,7 +66,7 @@
void UnitTestCxeSettingsMapperSymbian::testMap2CameraEffect()
{
CCamera::CCameraImageProcessing::TEffect result;
- int initialData = 99999;
+ Cxe::Colortone initialData = static_cast<Cxe::Colortone>(99999);
// case 0: check with unknown value
result = CxeSettingsMapperSymbian::Map2CameraEffect(initialData);
@@ -76,7 +78,8 @@
QVERIFY(result == CCamera::CCameraImageProcessing::EEffectSepia);
// case 2: try with direct value which is invalid
- result = CxeSettingsMapperSymbian::Map2CameraEffect(-1);
+ result = CxeSettingsMapperSymbian::Map2CameraEffect(
+ static_cast<Cxe::Colortone>(-1));
QVERIFY(result == CCamera::CCameraImageProcessing::EEffectNone);
}
@@ -84,7 +87,7 @@
void UnitTestCxeSettingsMapperSymbian::testMap2CameraExposureMode()
{
CCamera::TExposure result;
- int initialData = -1;
+ Cxe::ExposureMode initialData = static_cast<Cxe::ExposureMode>(-1);
// case 0: check with unknown value
result = CxeSettingsMapperSymbian::Map2CameraExposureMode(initialData);
@@ -96,14 +99,15 @@
QVERIFY(result == CCamera::EExposureNight);
// case 2: try with direct value which is invalid
- result = CxeSettingsMapperSymbian::Map2CameraExposureMode(99999);
+ result = CxeSettingsMapperSymbian::Map2CameraExposureMode(
+ static_cast<Cxe::ExposureMode>(99999));
QVERIFY(result == CCamera::EExposureAuto);
}
void UnitTestCxeSettingsMapperSymbian::testMap2CameraFlash()
{
CCamera::TFlash result;
- int initialData = -1;
+ Cxe::FlashMode initialData = static_cast<Cxe::FlashMode>(-1);
// case 0: check with unknown value
result = CxeSettingsMapperSymbian::Map2CameraFlash(initialData);
@@ -115,7 +119,8 @@
QVERIFY(result == CCamera::EFlashForced);
// case 2: try with direct value which is invalid
- result = CxeSettingsMapperSymbian::Map2CameraFlash(99999);
+ result = CxeSettingsMapperSymbian::Map2CameraFlash(
+ static_cast<Cxe::FlashMode>(99999));
QVERIFY(result == CCamera::EFlashAuto);
}
@@ -138,7 +143,7 @@
void UnitTestCxeSettingsMapperSymbian::testMap2CameraWb()
{
CCamera::TWhiteBalance result;
- int initialData = -1;
+ Cxe::Whitebalance initialData = static_cast<Cxe::Whitebalance>(-1);
// case 0: check with unknown value
result = CxeSettingsMapperSymbian::Map2CameraWb(initialData);
@@ -150,10 +155,62 @@
QVERIFY(result == CCamera::EWBDaylight);
// case 2: try with direct value which is invalid
- result = CxeSettingsMapperSymbian::Map2CameraWb(99999);
+ result = CxeSettingsMapperSymbian::Map2CameraWb(
+ static_cast<Cxe::Whitebalance>(99999));
QVERIFY(result == CCamera::EWBAuto);
}
+void UnitTestCxeSettingsMapperSymbian::testMap2UseCaseHintVideoParameters()
+{
+ CxeVideoDetails details;
+ MCameraUseCaseHint::TVideoCodec codec = MCameraUseCaseHint::ECodecUnknown;
+ MCameraUseCaseHint::TVideoProfile profile = MCameraUseCaseHint::EProfileUnknown;
+
+ details.mVideoCodecMimeType = "video/H263-2000";
+ CxeSettingsMapperSymbian::Map2UseCaseHintVideoParameters(details, codec, profile);
+ QCOMPARE(codec, MCameraUseCaseHint::ECodecH263);
+ QCOMPARE(profile, MCameraUseCaseHint::EProfileH263P0L10);
+
+ details.mVideoCodecMimeType = "video/mp4v-es; profile-level-id=2";
+ CxeSettingsMapperSymbian::Map2UseCaseHintVideoParameters(details, codec, profile);
+ QCOMPARE(codec, MCameraUseCaseHint::ECodecMpeg4);
+ QCOMPARE(profile, MCameraUseCaseHint::EProfileMPEG4SpL2);
+
+ details.mVideoCodecMimeType = "video/mp4v-es; profile-level-id=3";
+ CxeSettingsMapperSymbian::Map2UseCaseHintVideoParameters(details, codec, profile);
+ QCOMPARE(codec, MCameraUseCaseHint::ECodecMpeg4);
+ QCOMPARE(profile, MCameraUseCaseHint::EProfileMPEG4SpL3);
+
+ details.mVideoCodecMimeType = "video/mp4v-es; profile-level-id=4";
+ CxeSettingsMapperSymbian::Map2UseCaseHintVideoParameters(details, codec, profile);
+ QCOMPARE(codec, MCameraUseCaseHint::ECodecMpeg4);
+ QCOMPARE(profile, MCameraUseCaseHint::EProfileMPEG4SpL4a);
+
+ details.mVideoCodecMimeType = "video/mp4v-es; profile-level-id=foobar";
+ CxeSettingsMapperSymbian::Map2UseCaseHintVideoParameters(details, codec, profile);
+ QCOMPARE(codec, MCameraUseCaseHint::ECodecMpeg4);
+ QCOMPARE(profile, MCameraUseCaseHint::EProfileUnknown);
+
+ details.mVideoCodecMimeType = "video/H264; profile-level-id=42801E";
+ CxeSettingsMapperSymbian::Map2UseCaseHintVideoParameters(details, codec, profile);
+ QCOMPARE(codec, MCameraUseCaseHint::ECodecH264);
+ QCOMPARE(profile, MCameraUseCaseHint::EProfileH264BpL3);
+
+ details.mVideoCodecMimeType = "video/H264; profile-level-id=42801F";
+ CxeSettingsMapperSymbian::Map2UseCaseHintVideoParameters(details, codec, profile);
+ QCOMPARE(codec, MCameraUseCaseHint::ECodecH264);
+ QCOMPARE(profile, MCameraUseCaseHint::EProfileH264BpL3_1);
+
+ details.mVideoCodecMimeType = "video/H264; profile-level-id=foobar";
+ CxeSettingsMapperSymbian::Map2UseCaseHintVideoParameters(details, codec, profile);
+ QCOMPARE(codec, MCameraUseCaseHint::ECodecH264);
+ QCOMPARE(profile, MCameraUseCaseHint::EProfileUnknown);
+
+ details.mVideoCodecMimeType = "invalid";
+ CxeSettingsMapperSymbian::Map2UseCaseHintVideoParameters(details, codec, profile);
+ QCOMPARE(codec, MCameraUseCaseHint::ECodecUnknown);
+ QCOMPARE(profile, MCameraUseCaseHint::EProfileUnknown);
+}
+
// main() function non-GUI testing
-QTEST_APPLESS_MAIN(UnitTestCxeSettingsMapperSymbian)
-;
+QTEST_APPLESS_MAIN(UnitTestCxeSettingsMapperSymbian);
--- a/camerauis/cameraxui/cxengine/tsrc/unit/unittest_cxesettmappersymbian/unittest_cxesettingsmappersymbian.h Thu Jul 15 01:55:05 2010 +0300
+++ b/camerauis/cameraxui/cxengine/tsrc/unit/unittest_cxesettmappersymbian/unittest_cxesettingsmappersymbian.h Fri Jul 23 11:35:41 2010 +0300
@@ -40,6 +40,7 @@
void testMap2CameraEffect();
void testMap2CameraAutofocus();
void testMap2CameraOrientation();
+ void testMap2UseCaseHintVideoParameters();
};
--- a/camerauis/cameraxui/cxengine/tsrc/unit/unittest_cxethumbnailmanagersymbian/unittest_cxethumbnailmanagersymbian.cpp Thu Jul 15 01:55:05 2010 +0300
+++ b/camerauis/cameraxui/cxengine/tsrc/unit/unittest_cxethumbnailmanagersymbian/unittest_cxethumbnailmanagersymbian.cpp Fri Jul 23 11:35:41 2010 +0300
@@ -48,18 +48,33 @@
{
CX_DEBUG_ENTER_FUNCTION();
+ QSignalSpy thumbnailReadySpy(mThumbnailManager, SIGNAL(thumbnailReady(QPixmap, int)));
QString filename;
+ QVERIFY(thumbnailReadySpy.isValid());
+
// case 1: testing with wrong dummy file, we should get an error code with thumbnailready
// since filename is invalid
mThumbnailManager->createThumbnail(filename, QImage());
+ // we should not get any call back when we have invalid file name.
+ QCOMPARE(thumbnailReadySpy.count(), 0);
+
// case 1: testing with proper file name, we shouldnt get an error code with thumbnailready
// since filename is valid
filename = QString("c:\\test.jpg");
mThumbnailManager->createThumbnail(filename, QImage());
+ QTest::qWait(1500);
+
+ QCOMPARE( thumbnailReadySpy.count(), 1 );
+ if (thumbnailReadySpy.count() > 0) {
+ QList<QVariant> initModeArguments = thumbnailReadySpy.takeFirst();
+ // we are only interested in error code in this case 1
+ QCOMPARE(initModeArguments.at(1).toInt(), KErrNone);
+ }
+
CX_DEBUG_EXIT_FUNCTION();
}
--- a/camerauis/cameraxui/cxengine/tsrc/unit/unittest_cxethumbnailmanagersymbian/unittest_cxethumbnailmanagersymbian.pro Thu Jul 15 01:55:05 2010 +0300
+++ b/camerauis/cameraxui/cxengine/tsrc/unit/unittest_cxethumbnailmanagersymbian/unittest_cxethumbnailmanagersymbian.pro Fri Jul 23 11:35:41 2010 +0300
@@ -18,6 +18,8 @@
INCLUDEPATH *= ../system_include
DEPENDPATH *= ../system_include
+LIBS *= -lthumbnailmanagerqt
+
HEADERS *= unittest_cxethumbnailmanagersymbian.h \
cxethumbnailmanagersymbian.h \
thumbnailmanager_qt.h \
--- a/camerauis/cameraxui/cxui/cxui.pro Thu Jul 15 01:55:05 2010 +0300
+++ b/camerauis/cameraxui/cxui/cxui.pro Fri Jul 23 11:35:41 2010 +0300
@@ -29,6 +29,7 @@
# Fix for QMake translating INCLUDEPATH to SYSTEMINCLUDE
# and TraceCompiler needing USERINCLUDE.
MMP_RULES += "USERINCLUDE traces"
+ MMP_RULES += SMPSAFE
}
# export sound file
@@ -42,26 +43,45 @@
inc
INCLUDEPATH += inc \
traces
+!symbian {
+ DEPENDPATH += stubs_desktop/inc
+ INCLUDEPATH += ../cxengine/inc/api \
+ stubs_desktop/inc
+ DEFINES += CAMERAX_ENGINE_NO_LIBRARY
+}
-LIBS += -lecam \
- -lecamsnapshot \
- -lws32 \
- -lbitgdi \
- -lfbscli \
- -lcxengine \
- -lapmime \
- -lcommonui \
- -lxqutils \
- -lxqservice \
- -lxqserviceutil \
- -lshareui \
- -lcone \
- -lefsrv \
- -lws32 \
- -lgdi \
- -lapgrfx \
- -lusbman \
- -lthumbnailmanagerqt
+symbian {
+ LIBS += -lecam \
+ -lecamsnapshot \
+ -lws32 \
+ -lbitgdi \
+ -lfbscli \
+ -lcxengine \
+ -lapmime \
+ -lcommonui \
+ -lxqutils \
+ -lxqservice \
+ -lxqserviceutil \
+ -lshareui \
+ -lcone \
+ -lefsrv \
+ -lws32 \
+ -lgdi \
+ -lapgrfx \
+ -lusbman \
+ -lthumbnailmanagerqt
+} else {
+ win32 {
+ debug {
+ LIBS += ../cxengine/debug/libcxengine.a
+
+ } else {
+ LIBS += ../cxengine/release/libcxengine.a
+ }
+ } else {
+ LIBS += ../cxengine/libcxengine.a
+ }
+}
CONFIG += hb
CONFIG += service
@@ -72,7 +92,8 @@
HB += hbcore hbwidgets hbfeedback hbutils
# Input
-HEADERS += cxuiapplication.h \
+HEADERS += cxengine_global.h \
+ cxuiapplication.h \
cxuiapplicationframeworkmonitor.h \
cxuiapplicationframeworkmonitorprivate.h \
cxuiapplicationstate.h \
@@ -90,7 +111,6 @@
cxuisettingslider.h \
cxuiselftimer.h \
cxuisettingradiobuttonlist.h \
- cxuiscenelabel.h \
cxuierrormanager.h \
cxuisettingradiobuttonlistmodel.h \
cxuisettingsinfo.h \
@@ -99,8 +119,21 @@
cxuiscenemodeview.h \
cxuizoomslider.h \
cxuifullscreenpopup.h \
- cxuieventlog.h \
- traces/OstTraceDefinitions.h
+ cxuieventlog.h
+
+symbian {
+ HEADERS += traces/OstTraceDefinitions.h \
+ cxuicapturekeyhandler_symbian_p.h
+}
+else {
+ HEADERS += cxuimacrosdesktop.h \
+ cxuicapturekeyhandler_desktop_p.h \
+ shareui.h \
+ thumbnailmanager_qt.h \
+ xqappmgr.h \
+ xqserviceprovider.h \
+ XQUtils
+}
SOURCES += main.cpp \
cxuiapplication.cpp \
@@ -120,7 +153,6 @@
cxuisettingslider.cpp \
cxuiselftimer.cpp \
cxuisettingradiobuttonlist.cpp \
- cxuiscenelabel.cpp \
cxuierrormanager.cpp \
cxuisettingradiobuttonlistmodel.cpp \
cxuisettingsinfo.cpp \
@@ -131,6 +163,12 @@
cxuifullscreenpopup.cpp \
cxuieventlog.cpp
+symbian {
+ SOURCES += cxuicapturekeyhandler_symbian_p.cpp
+} else {
+ SOURCES += cxuicapturekeyhandler_desktop_p.cpp
+}
+
RESOURCES += cxui.qrc
# Variating internal and external icons for scene selection view
--- a/camerauis/cameraxui/cxui/inc/cxuicapturekeyhandler.h Thu Jul 15 01:55:05 2010 +0300
+++ b/camerauis/cameraxui/cxui/inc/cxuicapturekeyhandler.h Fri Jul 23 11:35:41 2010 +0300
@@ -1,5 +1,5 @@
/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies).
* All rights reserved.
* This component and the accompanying materials are made available
* under the terms of "Eclipse Public License v1.0"
@@ -14,20 +14,19 @@
* Description:
*
*/
+
#ifndef CXUICAPTUREKEYHANDLER_H
#define CXUICAPTUREKEYHANDLER_H
#include <QObject>
-class RWsSession;
-class RWindowGroup;
class QEvent;
class CxeEngine;
-
+class CxuiCaptureKeyHandlerPrivate;
class CxuiCaptureKeyHandler : public QObject
{
-Q_OBJECT
+ Q_OBJECT
public:
CxuiCaptureKeyHandler(CxeEngine &aEngine);
virtual ~CxuiCaptureKeyHandler();
@@ -49,23 +48,8 @@
void captureKeyReleased();
private:
- void listenKey(int key);
-
-private:
- bool mAutofocusKeyPressed;
- bool mCaptureKeyPressed;
-
- QList<int> mCapturedKeyHandles;
- QList<int> mCapturedKeyUpDownHandles;
-
- QList<int> mPrimaryCameraAutofocusKeys;
- QList<int> mPrimaryCameraCaptureKeys;
- QList<int> mSecondaryCameraCaptureKeys;
-
- CxeEngine &mEngine;
-
- RWsSession &mWsSession; // not own
- RWindowGroup &mWindowGroup; // not own
+ CxuiCaptureKeyHandlerPrivate *d_ptr;
+ Q_DECLARE_PRIVATE(CxuiCaptureKeyHandler)
};
#endif // CXUICAPTUREKEYHANDLER_H
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/camerauis/cameraxui/cxui/inc/cxuicapturekeyhandler_desktop_p.h Fri Jul 23 11:35:41 2010 +0300
@@ -0,0 +1,55 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#ifndef CXUICAPTUREKEYHANDLER_DESKTOP_P_H
+#define CXUICAPTUREKEYHANDLER_DESKTOP_P_H
+
+#include <QObject>
+
+class CxuiCaptureKeyHandler;
+class CxeEngine;
+
+class CxuiCaptureKeyHandlerPrivate : public QObject
+{
+ Q_OBJECT
+public:
+ CxuiCaptureKeyHandlerPrivate(CxeEngine &aEngine, CxuiCaptureKeyHandler *parent);
+ virtual ~CxuiCaptureKeyHandlerPrivate();
+
+public:
+ void listenKeys(bool listen);
+
+ bool isAutofocusKeyPressed();
+ bool isCaptureKeyPressed();
+
+ bool handleKeyEvent(QEvent *event);
+
+private: //private implementation patterns
+ CxuiCaptureKeyHandler *const q_ptr;
+ Q_DECLARE_PUBLIC(CxuiCaptureKeyHandler)
+
+private:
+ CxeEngine &mEngine;
+ bool mAutofocusKeyPressed;
+ bool mCaptureKeyPressed;
+
+private: // Stub / Dummy members
+ QList<int> mPrimaryCameraAutofocusKeys;
+
+};
+
+#endif // CXUICAPTUREKEYHANDLER_DESKTOP_P_H
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/camerauis/cameraxui/cxui/inc/cxuicapturekeyhandler_symbian_p.h Fri Jul 23 11:35:41 2010 +0300
@@ -0,0 +1,70 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#ifndef CXUICAPTUREKEYHANDLER_SYMBIAN_P_H
+#define CXUICAPTUREKEYHANDLER_SYMBIAN_P_H
+
+#include <QObject>
+
+class QEvent;
+class CxeEngine;
+class CxuiCaptureKeyHandler;
+
+class RWsSession;
+class RWindowGroup;
+
+class CxuiCaptureKeyHandlerPrivate : public QObject
+{
+ Q_OBJECT
+public:
+ CxuiCaptureKeyHandlerPrivate(CxeEngine &aEngine, CxuiCaptureKeyHandler *parent);
+ virtual ~CxuiCaptureKeyHandlerPrivate();
+
+public:
+ void listenKeys(bool listen);
+
+ bool isAutofocusKeyPressed();
+ bool isCaptureKeyPressed();
+
+ bool handleKeyEvent(QEvent *event);
+
+private:
+ void listenKey(int key);
+
+private: //private implementation pattern
+ CxuiCaptureKeyHandler *const q_ptr;
+ Q_DECLARE_PUBLIC(CxuiCaptureKeyHandler)
+
+private:
+ CxeEngine &mEngine;
+
+ bool mAutofocusKeyPressed;
+ bool mCaptureKeyPressed;
+
+ QList<int> mCapturedKeyHandles;
+ QList<int> mCapturedKeyUpDownHandles;
+
+ QList<int> mPrimaryCameraAutofocusKeys;
+ QList<int> mPrimaryCameraCaptureKeys;
+ QList<int> mSecondaryCameraCaptureKeys;
+
+ RWsSession &mWsSession; // not own
+ RWindowGroup &mWindowGroup; // not own
+
+};
+
+#endif // CXUICAPTUREKEYHANDLER_SYMBIAN_P_H
--- a/camerauis/cameraxui/cxui/inc/cxuienums.h Thu Jul 15 01:55:05 2010 +0300
+++ b/camerauis/cameraxui/cxui/inc/cxuienums.h Fri Jul 23 11:35:41 2010 +0300
@@ -109,8 +109,7 @@
static const char *VIDEO_PRE_CAPTURE_VIEWFINDER = "video_viewfinder_widget";
static const char *VIDEO_PRE_CAPTURE_ZOOM_SLIDER = "video_zoom";
static const char *VIDEO_PRE_CAPTURE_RECORDING_ICON = "video_recording_icon";
- static const char *VIDEO_PRE_CAPTURE_ELAPSED_TIME_LABEL = "video_elapsed_time";
- static const char *VIDEO_PRE_CAPTURE_REMAINING_TIME_LABEL = "video_remaining_time";
+ static const char *VIDEO_PRE_CAPTURE_VIDEO_TIME_LABEL = "video_elapsed_time";
static const char *VIDEO_PRE_CAPTURE_DEFAULT_MENU = "video_view_menu";
static const char *VIDEO_PRE_CAPTURE_VIDEO_QUALITY_ACTION = "cxui_video_action_quality";
static const char *VIDEO_PRE_CAPTURE_GOTO_STILL_ACTION = "cxui_video_action_gotostill";
--- a/camerauis/cameraxui/cxui/inc/cxuipostcaptureview.h Thu Jul 15 01:55:05 2010 +0300
+++ b/camerauis/cameraxui/cxui/inc/cxuipostcaptureview.h Fri Jul 23 11:35:41 2010 +0300
@@ -86,6 +86,7 @@
void handleDeleteDialogClosed(int action);
private:
+ bool isFileDeleted();
QString getCurrentFilename();
void startTimers();
@@ -93,7 +94,7 @@
void startReleaseTimers();
private slots:
- void handleThumbnailReady(QPixmap thumbnail, void *clientData, int id, int errorCode);
+ void handleThumbnailReady(QPixmap thumbnail);
private: // data
HbToolBar *mStillToolbar;
--- a/camerauis/cameraxui/cxui/inc/cxuiscenelabel.h Thu Jul 15 01:55:05 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,69 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
-*
-*/
-#ifndef CXUISCENELABEL_H_
-#define CXUISCENELABEL_H_
-
-#include <hblabel.h>
-
-class CxeEngine;
-
-class CxuiSceneLabel : public HbLabel
-{
- Q_OBJECT
- Q_PROPERTY(QString settingId READ settingId WRITE setSettingId)
- Q_PROPERTY(QStringList itemValues READ itemValues WRITE setItemValues)
- Q_PROPERTY(QStringList items READ items WRITE setItems)
-
-public:
- explicit CxuiSceneLabel(QGraphicsItem *parent, CxeEngine *engine);
-
- QString settingId() const;
- void setSettingId(const QString &id);
-
- QStringList itemValues() const;
- void setItemValues(const QStringList &values);
-
- QStringList items() const;
- void setItems(const QStringList &values);
-
-signals:
-
-public slots:
- void changeIcon(int);
-
-private:
- void setSceneIcon();
- Q_DISABLE_COPY(CxuiSceneLabel)
-
- QString mSettingId;
- QStringList mItemValues;
- QStringList mItems;
- CxeEngine *mEngine;
-};
-
-
-
-
-
-
-
-
-
-
-
-
-#endif /* CXUISCENELABEL_H_ */
--- a/camerauis/cameraxui/cxui/inc/cxuistillprecaptureview.h Thu Jul 15 01:55:05 2010 +0300
+++ b/camerauis/cameraxui/cxui/inc/cxuistillprecaptureview.h Fri Jul 23 11:35:41 2010 +0300
@@ -75,9 +75,7 @@
// from CxuiPrecaptureView
virtual void handleSettingValueChanged(const QString& key, QVariant newValue);
- // whenever a scene setting is changed on the engine side, an icon might need updating on the toolbar
- // connects to the sceneChanged signal of CxeSettings
- void handleSceneChanged(CxeScene &scene);
+ void handleSceneChanged(const QVariant &newSceneData);
// From CxuiPrecaptureView
virtual void enterStandby();
--- a/camerauis/cameraxui/cxui/inc/cxuivideoprecaptureview.h Thu Jul 15 01:55:05 2010 +0300
+++ b/camerauis/cameraxui/cxui/inc/cxuivideoprecaptureview.h Fri Jul 23 11:35:41 2010 +0300
@@ -63,12 +63,11 @@
// from CxuiPrecaptureView
virtual void handleSettingValueChanged(const QString& key, QVariant newValue);
- void handleSceneChanged(CxeScene &scene);
+ void handleSceneChanged(const QVariant &scene);
void handleQuitClicked();
protected slots:
- void handleSnapshot(CxeError::Id error);
void record();
void pause();
void stop();
@@ -86,7 +85,7 @@
protected:
- void setVideoTime(HbLabel* label, int time);
+ void setVideoTime(HbLabel* label, int elapsedTime, int remainingTime);
bool getElapsedTime();
void getRemainingTime();
bool allowShowControls() const;
@@ -99,7 +98,6 @@
bool isPostcaptureOn() const;
void updateSceneIcon(const QString& sceneId);
void updateQualityIcon();
- void setRecordingItemsVisibility(bool visible);
// from QObject
bool eventFilter(QObject *object, QEvent *event);
@@ -112,8 +110,7 @@
int mTimeElapsed;
int mTimeRemaining;
- HbLabel *mElapsedTimeText; // not own
- HbLabel *mRemainingTimeText; // not own
+ HbLabel *mVideoTimeText; // not own
HbLabel *mRecordingIcon; // not own
HbAction *mGoToStillAction; // not own
HbToolBar *mToolbarIdle; // not own
--- a/camerauis/cameraxui/cxui/inc/cxuiviewmanager.h Thu Jul 15 01:55:05 2010 +0300
+++ b/camerauis/cameraxui/cxui/inc/cxuiviewmanager.h Fri Jul 23 11:35:41 2010 +0300
@@ -71,12 +71,12 @@
CxuiView *createView(const QString &viewName);
CxuiPrecaptureView* getPrecaptureView(Cxe::CameraMode mode, Cxe::CameraIndex camera);
- void connectSignals(QObject *view);
- void disconnectSignals(QObject *view = NULL);
- void connectPreCaptureSignals();
+ void connectSignals(CxuiView *view);
+ void disconnectSignals(CxuiView *view = NULL);
+ void connectPreCaptureSignals(CxuiPrecaptureView *view);
void connectPostCaptureSignals();
void connectSceneModeSignals();
- void connectCaptureKeySignals();
+ void connectCaptureKeySignals(CxuiView *view);
void handleExitingNormalState();
void clearAllActivities();
--- a/camerauis/cameraxui/cxui/layouts/cxui.css Thu Jul 15 01:55:05 2010 +0300
+++ b/camerauis/cameraxui/cxui/layouts/cxui.css Fri Jul 23 11:35:41 2010 +0300
@@ -14,11 +14,11 @@
Selftimer
All HbLabel text and icons inside still_precapture_selftimer_container
*/
-HbWidget#still_precapture_selftimer_container > HbLabel::icon
+HbWidget#selftimer_icon_container > HbLabel::icon
{
color: var(qtc_popup_trans_normal);
}
-HbWidget#still_precapture_selftimer_container > HbLabel::text
+HbWidget#selftimer_icon_container > HbLabel::text
{
color: var(qtc_popup_trans_normal);
}
@@ -46,13 +46,8 @@
Bottom indicators (recording icon, time elapsed & left)
HbLabels defined separately since they should be colored differently
*/
-/* Elapsed time is a special case, it will always be red */
HbLabel#video_elapsed_time::text
{
-color: red;
-}
-HbLabel#video_remaining_time::text
-{
color: var(qtc_popup_trans_normal);
}
HbWidget#video_indicator_container_bottom > HbLabel::icon
--- a/camerauis/cameraxui/cxui/layouts/image_setting.xml Thu Jul 15 01:55:05 2010 +0300
+++ b/camerauis/cameraxui/cxui/layouts/image_setting.xml Fri Jul 23 11:35:41 2010 +0300
@@ -111,7 +111,7 @@
</setting_slider>
<!-- Still scene modes -->
- <setting_list id="still_scene_modes"
+ <setting_list id="still_scene_mode"
heading="txt_cam_title_scene_mode"
preview="0"
type="SingleLineListBox">
--- a/camerauis/cameraxui/cxui/layouts/setting_scenemode.docml Thu Jul 15 01:55:05 2010 +0300
+++ b/camerauis/cameraxui/cxui/layouts/setting_scenemode.docml Fri Jul 23 11:35:41 2010 +0300
@@ -67,6 +67,7 @@
<string name="title" value="Scene modes"/>
<bool name="contentFullScreen" value="TRUE"/>
<enums name="focusDelegation" value="FocusDelegationNone"/>
+ <enums name="viewFlags" value="ViewTitleBarTransparent|ViewTitleBarFloating|ViewTitleBarHidden|ViewStatusBarTransparent|ViewStatusBarFloating|ViewStatusBarHidden"/>
</widget>
<connect receiver="settings_scenes_view" sender="scene_ok_button" signal="released()" slot="handleOkButtonPress()"/>
<connect receiver="settings_scenes_view" sender="scene_cancel_button" signal="released()" slot="handleCancelButtonPress()"/>
--- a/camerauis/cameraxui/cxui/layouts/video_setting.xml Thu Jul 15 01:55:05 2010 +0300
+++ b/camerauis/cameraxui/cxui/layouts/video_setting.xml Fri Jul 23 11:35:41 2010 +0300
@@ -40,7 +40,7 @@
</setting_list>
<!-- Video scene modes -->
- <setting_list id="video_scene_modes"
+ <setting_list id="video_scene_mode"
heading="txt_cam_title_scene_mode_video"
preview="0"
type="SingleLineListBox">
--- a/camerauis/cameraxui/cxui/layouts/view_postcapture.docml Thu Jul 15 01:55:05 2010 +0300
+++ b/camerauis/cameraxui/cxui/layouts/view_postcapture.docml Fri Jul 23 11:35:41 2010 +0300
@@ -77,6 +77,7 @@
<string locid="txt_cam_title_camera" name="title" value="Camera"/>
<bool name="contentFullScreen" value="TRUE"/>
<bool name="visible" value="TRUE"/>
+ <enums name="viewFlags" value="ViewTitleBarTransparent|ViewTitleBarFloating|ViewTitleBarHidden|ViewStatusBarTransparent|ViewStatusBarFloating|ViewStatusBarHidden"/>
</widget>
<connect receiver="postcapture_view" sender="cxui_action_post_delete" signal="triggered(bool)" slot="showDeleteNote()"/>
<connect receiver="postcapture_view" sender="cxui_action_post_play" signal="triggered(bool)" slot="playVideo()"/>
--- a/camerauis/cameraxui/cxui/layouts/view_still_precapture.docml Thu Jul 15 01:55:05 2010 +0300
+++ b/camerauis/cameraxui/cxui/layouts/view_still_precapture.docml Fri Jul 23 11:35:41 2010 +0300
@@ -24,7 +24,7 @@
<object name="cxui_action_still_geotagging" type="HbAction">
<string name="settingskey" value="geotagging"/>
<string locid="txt_cam_opt_geotagging" name="text" value="Geotagging"/>
- </object>
+ </object>
<object name="cxui_action_capture" type="HbAction">
<icon iconName="qtg_mono_capture" name="icon"/>
</object>
@@ -52,6 +52,7 @@
</widget>
<string name="title" value="Camera"/>
<bool name="contentFullScreen" value="TRUE"/>
+ <enums name="viewFlags" value="ViewTitleBarTransparent|ViewTitleBarFloating|ViewTitleBarHidden|ViewStatusBarTransparent|ViewStatusBarFloating|ViewStatusBarHidden"/>
</widget>
<section name="still_capture_indicators">
<widget name="still_container" role="HbView:widget" type="HbWidget">
@@ -98,6 +99,10 @@
</layout>
</widget>
<layout type="anchor">
+ <anchoritem dst="transparent" dstEdge="LEFT" spacing="0un" src="" srcEdge="LEFT"/>
+ <anchoritem dst="transparent" dstEdge="TOP" spacing="0un" src="" srcEdge="TOP"/>
+ <anchoritem dst="transparent" dstEdge="RIGHT" spacing="0un" src="" srcEdge="RIGHT"/>
+ <anchoritem dst="transparent" dstEdge="BOTTOM" spacing="0un" src="" srcEdge="BOTTOM"/>
<anchoritem dst="indicatorContainer" dstEdge="LEFT" spacing="11un" src="" srcEdge="LEFT"/>
<anchoritem dst="indicatorContainer" dstEdge="TOP" spacing="var(hb-param-margin-gene-top)" src="" srcEdge="TOP"/>
</layout>
@@ -112,7 +117,7 @@
<real name="z" value="7"/>
<sizehint type="PREFERRED" width="var(hb-param-widget-toolbar-height)"/>
<enums name="orientation" value="Vertical"/>
- <bool name="visible" value="TRUE"/>
+ <bool name="visible" value="FALSE"/>
<ref object="cxui_action_capture" role="HbWidget:addAction"/>
<ref object="cxui_action_flash" role="HbWidget:addAction"/>
<ref object="cxui_action_scenemodes" role="HbWidget:addAction"/>
@@ -144,18 +149,13 @@
<sizepolicy horizontalPolicy="Fixed" horizontalStretch="0" verticalPolicy="Fixed" verticalStretch="0"/>
<sizehint type="FIXED" width="20un"/>
<string locid="txt_cam_button_start" name="text" value="Start"/>
- <bool name="visible" value="TRUE"/>
- <string name="state" value="normal"/>
<fontspec name="fontSpec" role="Undefined" textheight="var(hb-param-text-height-tiny)"/>
</widget>
<widget name="still_selftimer_cancel_button" type="HbPushButton">
<real name="z" value="4"/>
<sizepolicy horizontalPolicy="Fixed" horizontalStretch="0" verticalPolicy="Fixed" verticalStretch="0"/>
<sizehint type="FIXED" width="20un"/>
- <sizehint height="7un" type="PREFERRED" width="20un"/>
<string locid="txt_cam_button_cancel" name="text" value="Cancel"/>
- <bool name="visible" value="TRUE"/>
- <string name="state" value="normal"/>
<fontspec name="fontSpec" role="Undefined" textheight="var(hb-param-text-height-tiny)"/>
</widget>
<real name="z" value="0"/>
--- a/camerauis/cameraxui/cxui/layouts/view_video_precapture.docml Thu Jul 15 01:55:05 2010 +0300
+++ b/camerauis/cameraxui/cxui/layouts/view_video_precapture.docml Fri Jul 23 11:35:41 2010 +0300
@@ -56,6 +56,7 @@
</widget>
<string locid="txt_cam_title_camera" name="title" value="Camera"/>
<bool name="contentFullScreen" value="TRUE"/>
+ <enums name="viewFlags" value="ViewTitleBarTransparent|ViewTitleBarFloating|ViewTitleBarHidden|ViewStatusBarTransparent|ViewStatusBarFloating|ViewStatusBarHidden"/>
</widget>
<section name="video_capture_indicators">
<widget name="video_container" role="HbView:widget" type="HbWidget">
@@ -83,7 +84,6 @@
<icon iconName="qtg_mono_call_mute" name="icon"/>
<sizepolicy horizontalPolicy="Fixed" horizontalStretch="0" verticalPolicy="Fixed" verticalStretch="0"/>
<sizehint height="var(hb-param-graphic-size-primary-small)" type="FIXED" width="var(hb-param-graphic-size-primary-small)"/>
- <bool name="visible" value="FALSE"/>
</widget>
<real name="z" value="5"/>
<bool name="visible" value="TRUE"/>
@@ -96,6 +96,10 @@
</layout>
</widget>
<layout type="anchor">
+ <anchoritem dst="video_viewfinder_widget" dstEdge="RIGHT" spacing="0un" src="" srcEdge="RIGHT"/>
+ <anchoritem dst="video_viewfinder_widget" dstEdge="LEFT" spacing="0un" src="" srcEdge="LEFT"/>
+ <anchoritem dst="video_viewfinder_widget" dstEdge="TOP" spacing="0un" src="" srcEdge="TOP"/>
+ <anchoritem dst="video_viewfinder_widget" dstEdge="BOTTOM" spacing="0un" src="" srcEdge="BOTTOM"/>
<anchoritem dst="video_indicator_container_top" dstEdge="LEFT" spacing="11un" src="" srcEdge="LEFT"/>
<anchoritem dst="video_indicator_container_top" dstEdge="TOP" spacing="var(hb-param-margin-gene-top)" src="" srcEdge="TOP"/>
</layout>
@@ -139,31 +143,20 @@
<widget name="video_indicator_container_bottom" type="HbWidget">
<widget name="video_recording_icon" type="HbLabel">
<enums name="alignment" value="AlignVCenter|AlignHCenter"/>
- <icon iconName="qtg_small_record" name="icon"/>
+ <icon iconName="qtg_mono_pause" name="icon"/>
<sizepolicy horizontalPolicy="Fixed" horizontalStretch="0" verticalPolicy="Fixed" verticalStretch="0"/>
<sizehint height="var(hb-param-graphic-size-function)" type="FIXED" width="var(hb-param-graphic-size-function)"/>
</widget>
- <widget name="video_remaining_time" type="HbLabel">
- <enums name="alignment" value="AlignVCenter|AlignHCenter"/>
- <sizehint height="var(hb-param-graphic-size-function)" type="PREFERRED"/>
- <string name="textColor" value="#ffffff"/>
- <string name="plainText" value="00:00"/>
- <fontspec name="fontSpec" role="Undefined" textheight="var(hb-param-text-height-tiny)"/>
- </widget>
<widget name="video_elapsed_time" type="HbLabel">
<enums name="alignment" value="AlignVCenter|AlignHCenter"/>
<sizehint height="var(hb-param-graphic-size-function)" type="PREFERRED"/>
- <string name="textColor" value="#ffffff"/>
- <string name="plainText" value="00:00"/>
<fontspec name="fontSpec" role="Undefined" textheight="var(hb-param-text-height-tiny)"/>
</widget>
<real name="z" value="5"/>
- <bool name="visible" value="FALSE"/>
<layout orientation="Horizontal" spacing="var(hb-param-margin-gene-middle-horizontal)" type="linear">
<contentsmargins bottom="var(hb-param-margin-gene-middle-vertical)" left="var(hb-param-margin-gene-middle-horizontal)" right="var(hb-param-margin-gene-middle-horizontal)" top="var(hb-param-margin-gene-middle-vertical)"/>
<linearitem itemname="video_recording_icon"/>
<linearitem itemname="video_elapsed_time"/>
- <linearitem itemname="video_remaining_time"/>
</layout>
</widget>
<layout type="anchor">
@@ -229,63 +222,21 @@
</widget>
</section>
<section name="video_idle">
- <widget name="video_elapsed_time" type="HbLabel">
- <bool name="visible" value="FALSE"/>
- </widget>
<widget name="video_recording_icon" type="HbLabel">
- <bool name="visible" value="FALSE"/>
- </widget>
- <widget name="video_indicator_container_bottom" type="HbWidget">
- <bool name="visible" value="TRUE"/>
- <layout orientation="Horizontal" spacing="var(hb-param-margin-gene-middle-horizontal)" type="linear">
- <contentsmargins bottom="var(hb-param-margin-gene-middle-vertical)" left="var(hb-param-margin-gene-middle-horizontal)" right="var(hb-param-margin-gene-middle-horizontal)" top="var(hb-param-margin-gene-middle-vertical)"/>
- <linearitem itemname="video_remaining_time"/>
- </layout>
+ <icon iconName="qtg_mono_pause" name="icon"/>
</widget>
</section>
<section name="video_recording">
- <widget name="video_elapsed_time" type="HbLabel">
- <bool name="visible" value="TRUE"/>
- </widget>
- <widget name="video_remaining_time" type="HbLabel">
- <bool name="visible" value="TRUE"/>
- </widget>
<widget name="video_recording_icon" type="HbLabel">
- <bool name="visible" value="TRUE"/>
<icon iconName="qtg_small_record" name="icon"/>
</widget>
- <widget name="video_indicator_container_bottom" type="HbWidget">
- <bool name="visible" value="TRUE"/>
- <layout orientation="Horizontal" spacing="var(hb-param-margin-gene-middle-horizontal)" type="linear">
- <contentsmargins bottom="var(hb-param-margin-gene-middle-vertical)" left="var(hb-param-margin-gene-middle-horizontal)" right="var(hb-param-margin-gene-middle-horizontal)" top="var(hb-param-margin-gene-middle-vertical)"/>
- <linearitem itemname="video_recording_icon"/>
- <linearitem itemname="video_elapsed_time"/>
- <linearitem itemname="video_remaining_time"/>
- </layout>
- </widget>
</section>
<section name="video_paused">
- <widget name="video_elapsed_time" type="HbLabel">
- <bool name="visible" value="TRUE"/>
- </widget>
- <widget name="video_remaining_time" type="HbLabel">
- <string name="textColor" value="#ffffff"/>
- </widget>
<widget name="video_recording_icon" type="HbLabel">
<icon iconName="qtg_mono_pause" name="icon"/>
- <bool name="visible" value="TRUE"/>
- </widget>
- <widget name="video_indicator_container_bottom" type="HbWidget">
- <bool name="visible" value="TRUE"/>
- <layout orientation="Horizontal" spacing="var(hb-param-margin-gene-middle-horizontal)" type="linear">
- <contentsmargins bottom="var(hb-param-margin-gene-middle-vertical)" left="var(hb-param-margin-gene-middle-horizontal)" right="var(hb-param-margin-gene-middle-horizontal)" top="var(hb-param-margin-gene-middle-vertical)"/>
- <linearitem itemname="video_recording_icon"/>
- <linearitem itemname="video_elapsed_time"/>
- <linearitem itemname="video_remaining_time"/>
- </layout>
</widget>
</section>
- <metadata activeUIState="Paused" display="NHD-3.2-inch_landscape" unit="un">
+ <metadata activeUIState="Common ui state" display="NHD-3.2-inch_landscape" unit="un">
<uistate name="Common ui state" sections="#common"/>
<uistate name="All widgets" sections="#common video_capture_with_widgets"/>
<uistate name="video_standalone_mode" sections="#common video_capture_with_widgets video_standalone_mode"/>
--- a/camerauis/cameraxui/cxui/src/cxuicapturekeyhandler.cpp Thu Jul 15 01:55:05 2010 +0300
+++ b/camerauis/cameraxui/cxui/src/cxuicapturekeyhandler.cpp Fri Jul 23 11:35:41 2010 +0300
@@ -1,5 +1,5 @@
/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies).
* All rights reserved.
* This component and the accompanying materials are made available
* under the terms of "Eclipse Public License v1.0"
@@ -14,171 +14,66 @@
* Description:
*
*/
-#include <w32std.h>
+
#include <QVariant>
#include <QKeyEvent>
-#include <eikon.hrh>
-#include <coemain.h>
-#include <e32keys.h> // for EKeyCamera
-
#include "cxuicapturekeyhandler.h"
+#ifdef Q_OS_SYMBIAN
+#include "cxuicapturekeyhandler_symbian_p.h"
+#else
+#include "cxuicapturekeyhandler_desktop_p.h"
+#endif
+
#include "cxutils.h"
#include "cxeengine.h"
#include "cxenamespace.h"
#include "cxefeaturemanager.h"
-const int CXUI_KEY_PRIORITY = 100;
+
CxuiCaptureKeyHandler::CxuiCaptureKeyHandler(CxeEngine &aEngine) :
- mAutofocusKeyPressed(false), mCaptureKeyPressed(false), mEngine(aEngine), mWsSession(CCoeEnv::Static()->WsSession()),
- mWindowGroup(CCoeEnv::Static()->RootWin())
+ d_ptr(NULL)
{
- CX_DEBUG_ENTER_FUNCTION();
-
- // Autofocus key
- mEngine.featureManager().configuredValues(CxeRuntimeKeys::PRIMARY_CAMERA_AUTOFOCUS_KEYS,
- mPrimaryCameraAutofocusKeys);
-
- // Capture keys for primary camera
- mEngine.featureManager().configuredValues(CxeRuntimeKeys::PRIMARY_CAMERA_CAPTURE_KEYS,
- mPrimaryCameraCaptureKeys);
-
- listenKeys(true);
- CX_DEBUG_EXIT_FUNCTION();
+ d_ptr = new CxuiCaptureKeyHandlerPrivate(aEngine, this);
+
+ d_ptr->listenKeys(true);
}
CxuiCaptureKeyHandler::~CxuiCaptureKeyHandler()
-{
+{
CX_DEBUG_ENTER_FUNCTION();
- listenKeys(false);
+
+ Q_D(CxuiCaptureKeyHandler);
+ d->listenKeys(false);
+
+ delete d;
+
CX_DEBUG_EXIT_FUNCTION();
}
-/*!
-* Start or stop listening key events.
-* @param listen Should we start (true) or stop (false) listening key events.
-*/
void CxuiCaptureKeyHandler::listenKeys(bool listen)
{
- CX_DEBUG_ENTER_FUNCTION();
-
- if (listen) {
- // Protect from multiple calls
- if (mCapturedKeyUpDownHandles.empty() && mCapturedKeyHandles.empty()) {
-
- int key(0);
- foreach (key, mPrimaryCameraAutofocusKeys) {
- CX_DEBUG(("CxuiCaptureKeyHandler - hooking autofocus key with scan / key code: %d", key));
- listenKey(key);
- }
- foreach (key, mPrimaryCameraCaptureKeys) {
- CX_DEBUG(("CxuiCaptureKeyHandler - hooking capture key with scan / key code: %d", key));
- listenKey(key);
- }
- }
- } else {
-
- int handle(0);
- foreach (handle, mCapturedKeyUpDownHandles) {
- mWindowGroup.CancelCaptureKeyUpAndDowns(handle);
- }
- mCapturedKeyUpDownHandles.clear();
-
- foreach (handle, mCapturedKeyHandles) {
- mWindowGroup.CancelCaptureKey(handle);
- }
- mCapturedKeyHandles.clear();
- }
- CX_DEBUG_EXIT_FUNCTION();
+ Q_D(CxuiCaptureKeyHandler);
+ d->listenKeys(listen);
}
bool CxuiCaptureKeyHandler::isAutofocusKeyPressed()
{
- return mAutofocusKeyPressed;
+ Q_D(CxuiCaptureKeyHandler);
+ return d->isAutofocusKeyPressed();
}
bool CxuiCaptureKeyHandler::isCaptureKeyPressed()
{
- return mCaptureKeyPressed;
+ Q_D(CxuiCaptureKeyHandler);
+ return d->isCaptureKeyPressed();
}
bool CxuiCaptureKeyHandler::handleKeyEvent(QEvent *event)
{
- CX_DEBUG_ENTER_FUNCTION();
- bool eventWasConsumed = false;
-
- if (event->type() == QEvent::KeyPress) {
- QKeyEvent *keyEvent = static_cast<QKeyEvent*> (event);
- CX_DEBUG(("CxuiCaptureKeyHandler - key press with nativeVirtualKey(): %d", keyEvent->nativeVirtualKey()));
- CX_DEBUG(("CxuiCaptureKeyHandler - key press with nativeScanCode(): %d", keyEvent->nativeScanCode()));
-
- if ( mPrimaryCameraAutofocusKeys.contains(keyEvent->nativeScanCode())
- && !mAutofocusKeyPressed ) {
-
- mAutofocusKeyPressed = true;
- eventWasConsumed = true;
- emit autofocusKeyPressed();
-
- } else if (mPrimaryCameraCaptureKeys.contains(keyEvent->nativeScanCode())
- && !mCaptureKeyPressed) {
- mCaptureKeyPressed = true;
- eventWasConsumed = true;
- emit captureKeyPressed();
- }
- } else if (event->type() == QEvent::KeyRelease) {
- QKeyEvent *keyEvent = static_cast<QKeyEvent*> (event);
- CX_DEBUG(("CxuiCaptureKeyHandler - key press with nativeVirtualKey(): %d", keyEvent->nativeVirtualKey()));
- CX_DEBUG(("CxuiCaptureKeyHandler - key press with nativeScanCode(): %d", keyEvent->nativeScanCode()));
-
- if ( mPrimaryCameraAutofocusKeys.contains(keyEvent->nativeScanCode())
- && mAutofocusKeyPressed ) {
-
- mAutofocusKeyPressed = false;
- eventWasConsumed = true;
- emit autofocusKeyReleased();
-
- } else if (mPrimaryCameraCaptureKeys.contains(keyEvent->nativeScanCode())
- && mCaptureKeyPressed) {
-
- mCaptureKeyPressed = false;
- eventWasConsumed = true;
- emit captureKeyReleased();
- }
- }
- CX_DEBUG_EXIT_FUNCTION();
- return eventWasConsumed;
+ Q_D(CxuiCaptureKeyHandler);
+ return d->handleKeyEvent(event);
}
-/*!
-* Helper method to listen to given key (key code or scan code).
-* We need to listen to both "key up", "key down" and "key pressed" events to
-* get all the necessary events to handleKeyEvent(). If we e.g. just listen
-* to up/down events, the way native events are translated to QKeyEvents,
-* we only get QEvent::KeyRelease event when partially in background.
-* @param key Keycode or scancode for the key to listen. Both should be listened.
-*/
-void CxuiCaptureKeyHandler::listenKey(int key)
-{
- // Capture key down and up events
- int handle = mWindowGroup.CaptureKeyUpAndDowns(key, 0, 0, CXUI_KEY_PRIORITY);
-
- // Handle < 0 means error.
- if (handle >= 0) {
- mCapturedKeyUpDownHandles.append(handle);
- } else {
- CX_DEBUG(("[WARNING] CxuiCaptureKeyHandler - Problem hooking to key-up/key-down with code: %d", key));
- }
-
- // Capture key press events
- handle = mWindowGroup.CaptureKey(key, 0, 0, CXUI_KEY_PRIORITY);
-
- if (handle >= 0) {
- mCapturedKeyHandles.append(handle);
- } else {
- CX_DEBUG(("[WARNING] CxuiCaptureKeyHandler - Problem hooking to key-press with code: %d", key));
- }
-}
-
-
// end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/camerauis/cameraxui/cxui/src/cxuicapturekeyhandler_desktop_p.cpp Fri Jul 23 11:35:41 2010 +0300
@@ -0,0 +1,93 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+* Private implementation for CxuiCaptureKeyHandler
+*/
+
+#include <QVariant>
+#include <QKeyEvent>
+
+#include "cxuicapturekeyhandler.h"
+#include "cxuicapturekeyhandler_desktop_p.h"
+#include "cxutils.h"
+#include "cxeengine.h"
+#include "cxenamespace.h"
+#include "cxefeaturemanager.h"
+
+#define CXUIDESKTOP_SCANCODE_LOWERCASE_A 30
+#define CXUIDESKTOP_SCANCODE_LOWERCASE_C 46
+
+CxuiCaptureKeyHandlerPrivate::CxuiCaptureKeyHandlerPrivate(CxeEngine &aEngine, CxuiCaptureKeyHandler *parent) :
+ q_ptr(parent),
+ mEngine(aEngine),
+ mAutofocusKeyPressed(false),
+ mCaptureKeyPressed(false)
+{
+ CX_DEBUG_IN_FUNCTION();
+}
+
+CxuiCaptureKeyHandlerPrivate::~CxuiCaptureKeyHandlerPrivate()
+{
+ CX_DEBUG_IN_FUNCTION();
+}
+
+void CxuiCaptureKeyHandlerPrivate::listenKeys(bool listen)
+{
+ CX_DEBUG_IN_FUNCTION();
+}
+
+bool CxuiCaptureKeyHandlerPrivate::handleKeyEvent(QEvent *event)
+{
+ CX_DEBUG_ENTER_FUNCTION();
+ Q_Q(CxuiCaptureKeyHandler);
+
+ bool wasEventConsumed = false;
+
+ if (event->type() == QEvent::KeyPress) {
+ QKeyEvent *keyEvent = static_cast<QKeyEvent*> (event);
+ if (keyEvent->nativeScanCode() == CXUIDESKTOP_SCANCODE_LOWERCASE_A) {
+ mAutofocusKeyPressed = true;
+ wasEventConsumed = true;
+ emit q->autofocusKeyPressed();
+ } else if (keyEvent->nativeScanCode() == CXUIDESKTOP_SCANCODE_LOWERCASE_C) {
+ mCaptureKeyPressed = true;
+ wasEventConsumed = true;
+ emit q->captureKeyPressed();
+ }
+ } else if (event->type() == QEvent::KeyRelease) {
+ QKeyEvent *keyEvent = static_cast<QKeyEvent*> (event);
+ if (keyEvent->nativeScanCode() == CXUIDESKTOP_SCANCODE_LOWERCASE_A) {
+ mAutofocusKeyPressed = false;
+ wasEventConsumed = true;
+ emit q->autofocusKeyReleased();
+ } else if (keyEvent->nativeScanCode() == CXUIDESKTOP_SCANCODE_LOWERCASE_C) {
+ mCaptureKeyPressed = false;
+ wasEventConsumed = true;
+ emit q->captureKeyReleased();
+ }
+ }
+
+ CX_DEBUG_EXIT_FUNCTION();
+ return wasEventConsumed;
+}
+
+bool CxuiCaptureKeyHandlerPrivate::isAutofocusKeyPressed()
+{
+ return mAutofocusKeyPressed;
+}
+
+bool CxuiCaptureKeyHandlerPrivate::isCaptureKeyPressed()
+{
+ return mCaptureKeyPressed;
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/camerauis/cameraxui/cxui/src/cxuicapturekeyhandler_symbian_p.cpp Fri Jul 23 11:35:41 2010 +0300
@@ -0,0 +1,192 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+* Private implementation for CxuiCaptureKeyHandler
+*/
+
+#include <QVariant>
+#include <QKeyEvent>
+
+#include "cxuicapturekeyhandler_symbian_p.h"
+#include "cxuicapturekeyhandler.h"
+#include "cxutils.h"
+#include "cxeengine.h"
+#include "cxenamespace.h"
+#include "cxefeaturemanager.h"
+
+#include <w32std.h>
+#include <eikon.hrh>
+#include <coemain.h>
+#include <e32keys.h> // for EKeyCamera
+
+namespace {
+ const int CXUI_KEY_PRIORITY = 100;
+ const int CXUI_CAPTURE_KEY_CODE1 = 0xab;
+ const int CXUI_CAPTURE_KEY_CODE2 = 0xf849;
+ const int CXUI_AUTOFOCUS_KEY_CODE1 = 0xe2;
+ const int CXUI_AUTOFOCUS_KEY_CODE2 = 0xf880;
+
+}
+CxuiCaptureKeyHandlerPrivate::CxuiCaptureKeyHandlerPrivate(CxeEngine &aEngine, CxuiCaptureKeyHandler *parent) :
+ q_ptr(parent),
+ mEngine(aEngine),
+ mAutofocusKeyPressed(false),
+ mCaptureKeyPressed(false),
+ mWsSession(CCoeEnv::Static()->WsSession()),
+ mWindowGroup(CCoeEnv::Static()->RootWin())
+{
+ CX_DEBUG_ENTER_FUNCTION();
+
+ // key codes hardcoded for now
+ // Autofocus key
+ mPrimaryCameraAutofocusKeys.append(CXUI_AUTOFOCUS_KEY_CODE1);
+ mPrimaryCameraAutofocusKeys.append(CXUI_AUTOFOCUS_KEY_CODE2);
+
+ // Capture keys for primary camera
+ mPrimaryCameraCaptureKeys.append(CXUI_CAPTURE_KEY_CODE1);
+ mPrimaryCameraCaptureKeys.append(CXUI_CAPTURE_KEY_CODE2);
+
+ listenKeys(true);
+ CX_DEBUG_EXIT_FUNCTION();
+}
+
+CxuiCaptureKeyHandlerPrivate::~CxuiCaptureKeyHandlerPrivate()
+{
+ CX_DEBUG_ENTER_FUNCTION();
+ listenKeys(false);
+ CX_DEBUG_EXIT_FUNCTION();
+}
+
+/*!
+* Start or stop listening key events.
+* @param listen Should we start (true) or stop (false) listening key events.
+*/
+void CxuiCaptureKeyHandlerPrivate::listenKeys(bool listen)
+{
+ CX_DEBUG_ENTER_FUNCTION();
+
+ if (listen) {
+ // Protect from multiple calls
+ if (mCapturedKeyUpDownHandles.empty() && mCapturedKeyHandles.empty()) {
+
+ int key(0);
+ foreach (key, mPrimaryCameraAutofocusKeys) {
+ CX_DEBUG(("CxuiCaptureKeyHandlerPrivate - hooking autofocus key with scan / key code: %d", key));
+ listenKey(key);
+ }
+ foreach (key, mPrimaryCameraCaptureKeys) {
+ CX_DEBUG(("CxuiCaptureKeyHandlerPrivate - hooking capture key with scan / key code: %d", key));
+ listenKey(key);
+ }
+ }
+ } else {
+
+ int handle(0);
+ foreach (handle, mCapturedKeyUpDownHandles) {
+ mWindowGroup.CancelCaptureKeyUpAndDowns(handle);
+ }
+ mCapturedKeyUpDownHandles.clear();
+
+ foreach (handle, mCapturedKeyHandles) {
+ mWindowGroup.CancelCaptureKey(handle);
+ }
+ mCapturedKeyHandles.clear();
+ }
+ CX_DEBUG_EXIT_FUNCTION();
+}
+
+bool CxuiCaptureKeyHandlerPrivate::isAutofocusKeyPressed()
+{
+ return mAutofocusKeyPressed;
+}
+
+bool CxuiCaptureKeyHandlerPrivate::isCaptureKeyPressed()
+{
+ return mCaptureKeyPressed;
+}
+
+bool CxuiCaptureKeyHandlerPrivate::handleKeyEvent(QEvent *event)
+{
+ CX_DEBUG_ENTER_FUNCTION();
+ Q_Q(CxuiCaptureKeyHandler);
+ bool eventWasConsumed = false;
+
+ if (event->type() == QEvent::KeyPress) {
+ QKeyEvent *keyEvent = static_cast<QKeyEvent*> (event);
+ if ( mPrimaryCameraAutofocusKeys.contains(keyEvent->nativeScanCode())
+ && !mAutofocusKeyPressed ) {
+
+ mAutofocusKeyPressed = true;
+ eventWasConsumed = true;
+ emit q->autofocusKeyPressed();
+
+ } else if (mPrimaryCameraCaptureKeys.contains(keyEvent->nativeScanCode())
+ && !mCaptureKeyPressed) {
+ mCaptureKeyPressed = true;
+ eventWasConsumed = true;
+ emit q->captureKeyPressed();
+ }
+ } else if (event->type() == QEvent::KeyRelease) {
+ QKeyEvent *keyEvent = static_cast<QKeyEvent*> (event);
+
+ if ( mPrimaryCameraAutofocusKeys.contains(keyEvent->nativeScanCode())
+ && mAutofocusKeyPressed ) {
+
+ mAutofocusKeyPressed = false;
+ eventWasConsumed = true;
+ emit q->autofocusKeyReleased();
+
+ } else if (mPrimaryCameraCaptureKeys.contains(keyEvent->nativeScanCode())
+ && mCaptureKeyPressed) {
+
+ mCaptureKeyPressed = false;
+ eventWasConsumed = true;
+ emit q->captureKeyReleased();
+ }
+ }
+ CX_DEBUG_EXIT_FUNCTION();
+ return eventWasConsumed;
+}
+
+/*!
+* Helper method to listen to given key (key code or scan code).
+* We need to listen to both "key up", "key down" and "key pressed" events to
+* get all the necessary events to handleKeyEvent(). If we e.g. just listen
+* to up/down events, the way native events are translated to QKeyEvents,
+* we only get QEvent::KeyRelease event when partially in background.
+* @param key Keycode or scancode for the key to listen. Both should be listened.
+*/
+void CxuiCaptureKeyHandlerPrivate::listenKey(int key)
+{
+ // Capture key down and up events
+ int handle = mWindowGroup.CaptureKeyUpAndDowns(key, 0, 0, CXUI_KEY_PRIORITY);
+
+ // Handle < 0 means error.
+ if (handle >= 0) {
+ mCapturedKeyUpDownHandles.append(handle);
+ } else {
+ CX_DEBUG(("[WARNING] CxuiCaptureKeyHandlerPrivate - Problem hooking to key-up/key-down with code: %d", key));
+ }
+
+ // Capture key press events
+ handle = mWindowGroup.CaptureKey(key, 0, 0, CXUI_KEY_PRIORITY);
+
+ if (handle >= 0) {
+ mCapturedKeyHandles.append(handle);
+ } else {
+ CX_DEBUG(("[WARNING] CxuiCaptureKeyHandlerPrivate - Problem hooking to key-press with code: %d", key));
+ }
+}
+
+// end of file
--- a/camerauis/cameraxui/cxui/src/cxuidocumentloader.cpp Thu Jul 15 01:55:05 2010 +0300
+++ b/camerauis/cameraxui/cxui/src/cxuidocumentloader.cpp Fri Jul 23 11:35:41 2010 +0300
@@ -33,10 +33,12 @@
#include "cxeengine.h"
#include "cxuienums.h"
+#ifdef Q_OS_SYMBIAN
#include "OstTraceDefinitions.h"
#ifdef OST_TRACE_COMPILER_IN_USE
#include "cxuidocumentloaderTraces.h"
-#endif
+#endif // OST_TRACE_COMPILER_IN_USE
+#endif // Q_OS_SYMBIAN
CxuiDocumentLoader::CxuiDocumentLoader(CxeEngine *engine) : HbDocumentLoader(), mEngine(engine)
--- a/camerauis/cameraxui/cxui/src/cxuipostcaptureview.cpp Thu Jul 15 01:55:05 2010 +0300
+++ b/camerauis/cameraxui/cxui/src/cxuipostcaptureview.cpp Fri Jul 23 11:35:41 2010 +0300
@@ -31,6 +31,7 @@
#include <hbmessagebox.h>
#include <hbactivitymanager.h>
+#include <xqaiwdecl.h>
#include <shareui.h>
#include <thumbnailmanager_qt.h>
@@ -217,8 +218,7 @@
QString videoFile(getCurrentFilename());
- XQAiwRequest *videoRequest = mAppManager.create(
- "com.nokia.symbian.IVideoView","playMedia(QString)", true);
+ XQAiwRequest *videoRequest = mAppManager.create(XQI_VIDEO_PLAY, XQOP_VIDEO_PLAY, true);
if (videoRequest) {
QVariantList fileList;
@@ -230,7 +230,7 @@
bool res = videoRequest->send(result);
if (res) {
CX_DEBUG(("CxuiPostcaptureView: request sent, received \"%s\"",
- result.toString().toAscii().constData()));
+ qPrintable(result.toString())));
} else {
CX_DEBUG(("CxuiPostcaptureView: request sending failed, error=%d",
videoRequest->lastError()));
@@ -278,8 +278,7 @@
// Check that user confirmed delete
if (action == HbMessageBox::Yes) {
- QString filename = getCurrentFilename();
- QFileInfo fileInfo(filename);
+ QFileInfo fileInfo(getCurrentFilename());
if (fileInfo.exists()) {
//! @todo
// We can retry deletion if file deletion does'nt succeed,
@@ -407,7 +406,12 @@
*/
void CxuiPostcaptureView::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)
{
- OstTrace0(camerax_performance, CXUIPOSTCAPTUREVIEW_SNAPSHOT_DRAW, "msg: e_CX_SHOT_TO_SNAPSHOT 0");
+ // Performance trace for checking shot to snapshot time.
+ // Guard that we actually have the snapshot set before outputting the trace.
+ if (mImageLabel && !mImageLabel->icon().isNull()) {
+ OstTrace0(camerax_performance, CXUIPOSTCAPTUREVIEW_SNAPSHOT_DRAW, "msg: e_CX_SHOT_TO_SNAPSHOT 0");
+ }
+
QGraphicsWidget::paint(painter, option, widget);
}
@@ -424,7 +428,7 @@
// get filename. if filename is not found (toString() returns empty string)
// we will go back to pre-capture in updateSnapshotImage()
mFilename = data.toMap()[FILENAME_KEY].toString();
- CX_DEBUG(("Got filename %s from activity", mFilename.toAscii().data()));
+ CX_DEBUG(("Got filename [%s] from activity", qPrintable(mFilename)));
CX_DEBUG_EXIT_FUNCTION();
}
@@ -439,7 +443,7 @@
QVariantHash params;
QString filename = getCurrentFilename();
- CX_DEBUG(("Saving filename %s", filename.toAscii().data()));
+ CX_DEBUG(("Saving filename [%s]", qPrintable(filename)));
data.insert(FILENAME_KEY, filename);
QImage img(mMainWindow->rect().size(), QImage::Format_ARGB32_Premultiplied);
@@ -483,9 +487,17 @@
if (event->type() == QEvent::Show) {
QCoreApplication::instance()->installEventFilter(this);
+ // Update snapshot for current file.
+ // If the current file does not exist anymore, return to pre-capture view.
updateSnapshotImage();
- showControls();
- startTimers();
+
+ // If the image / video has been deleted, control returned to pre-capture view.
+ // No point to start timers or show controls then.
+ if (mMainWindow->currentView() == this) {
+ showControls();
+ startTimers();
+ }
+
event->accept();
}
@@ -573,73 +585,109 @@
{
CX_DEBUG_ENTER_FUNCTION();
- if (!mFilename.isNull()) {
- CX_DEBUG(("CxuiPostcaptureView::updateSnapshot restoring activity"));
+ if (isFileDeleted()) {
+ // File deleted, go to pre-capture view.
+ CX_DEBUG(("File has been deleted, going back to pre-capture"));
+ goToPrecaptureView();
+
+ } else if (!mFilename.isNull()) {
// filename set, we are restoring activity
- if (QFile::exists(mFilename)) {
- CX_DEBUG(("Filename ok, requesting thumbnail from TNM"));
- if (!mThumbnailManager) {
- mThumbnailManager = new ThumbnailManager();
- connect(mThumbnailManager, SIGNAL(thumbnailReady(QPixmap, void *, int, int)),
- this, SLOT(handleThumbnailReady(QPixmap, void*, int, int)));
- mThumbnailManager->setThumbnailSize(ThumbnailManager::ThumbnailLarge);
- }
- mThumbnailManager->getThumbnail(mFilename);
- CX_DEBUG(("Thumbnail requested"));
+ if (!mThumbnailManager) {
+ mThumbnailManager = new ThumbnailManager();
+ connect(mThumbnailManager, SIGNAL(thumbnailReady(QPixmap, void *, int, int)),
+ this, SLOT(handleThumbnailReady(QPixmap)));
+ mThumbnailManager->setThumbnailSize(ThumbnailManager::ThumbnailLarge);
+ }
+ mThumbnailManager->getThumbnail(mFilename);
+ CX_DEBUG(("Thumbnail requested"));
- } else {
- // file deleted
- CX_DEBUG(("File %s has been deleted, going back to pre-capture", mFilename.toAscii().data()));
- goToPrecaptureView();
- }
} else {
+ // Normal use of post-capture view
QPixmap snapshot;
if (mEngine->mode() == ImageMode) {
- if( mEngine->stillCaptureControl().imageCount() > 0 ) {
+
+ if (mEngine->stillCaptureControl().imageCount() > 0) {
snapshot = mEngine->stillCaptureControl()[0].snapshot();
}
} else {
snapshot = mEngine->videoCaptureControl().snapshot();
}
- if (mImageLabel) {
- mImageLabel->setIcon(HbIcon(QIcon(snapshot)));
- } else {
- // do nothing
- }
+
+ // Update the snapshot image
+ handleThumbnailReady(snapshot);
}
CX_DEBUG_EXIT_FUNCTION();
}
+/*!
+* Check if the file we show this post-capture view for is deleted.
+* This can happen e.g. if we send camera to background and delete
+* the file in other application. When used as activity, we may also
+* get the name of already deleted file as activity parameter.
+* @return True if the current file is deleted, false if not.
+*/
+bool CxuiPostcaptureView::isFileDeleted()
+{
+ CX_DEBUG_ENTER_FUNCTION();
+
+ bool deleted(false);
+
+ // Check how we entered this view.
+ if (mFilename.isNull()) {
+ CX_DEBUG(("Checking engine filename"));
+ // Normally entered post-capture view.
+ if (mEngine->mode() == ImageMode) {
+ // Check that the image have been saved already.
+ // If not, it cannot have been deleted in that case.
+ CxeStillImage &image(mEngine->stillCaptureControl()[0]);
+ CX_DEBUG(("Image filename [%s]", qPrintable(image.filename())));
+ CX_DEBUG(("Image file saved: %d exists: %d", image.saved(), QFile::exists(image.filename())));
+ deleted = image.saved() && !QFile::exists(image.filename());
+ } else {
+ // Check that video has been stopped fully.
+ // If it's still stopping, QFile may not work.
+ CX_DEBUG(("Video filename [%s]", qPrintable(mEngine->videoCaptureControl().filename())));
+ deleted = mEngine->videoCaptureControl().state() != CxeVideoCaptureControl::Stopping
+ && !QFile::exists(mEngine->videoCaptureControl().filename());
+ }
+ } else {
+ // Started as activity, check the filename given when restoring activity.
+ CX_DEBUG(("Checking filename saved in activity"));
+ deleted = !QFile::exists(mFilename);
+ }
+
+ CX_DEBUG_EXIT_FUNCTION();
+ return deleted;
+}
+
/* !
* gets the filename of the current file
*/
QString CxuiPostcaptureView::getCurrentFilename()
{
CX_DEBUG_ENTER_FUNCTION();
+ QString filename;
if (!mFilename.isNull()) {
// post-capture started by activity, engine doesn't contain correct
// filename anymore so use the stored one
CX_DEBUG(("Using filename saved in activity"));
- CX_DEBUG_EXIT_FUNCTION();
- return mFilename;
+ filename = mFilename;
+ } else {
+ CX_DEBUG(("Getting filename from engine"));
+ if (mEngine->mode() == Cxe::VideoMode) {
+ filename = mEngine->videoCaptureControl().filename();
+ } else {
+ //!@todo Currently only gets index 0 from the still capture control.
+ CxeStillCaptureControl& stillCaptureControl = mEngine->stillCaptureControl();
+ if (stillCaptureControl.imageCount() > 0) {
+ filename = stillCaptureControl[0].filename();
+ }
+ }
}
- CX_DEBUG(("Getting filename from engine"));
- QString filename;
-
- if (mEngine->mode() == Cxe::VideoMode) {
- filename = mEngine->videoCaptureControl().filename();
- } else {
- //!@todo Currently only gets index 0 from the still capture control.
- CxeStillCaptureControl& stillCaptureControl = mEngine->stillCaptureControl();
- if (stillCaptureControl.imageCount()) {
- filename = stillCaptureControl[0].filename();
- }
- }
- CX_DEBUG((filename.toAscii()));
-
+ CX_DEBUG(("Got filename [%s]", qPrintable(filename)));
CX_DEBUG_EXIT_FUNCTION();
return filename;
@@ -669,8 +717,12 @@
// Common functionality first.
CxuiView::exitStandby();
- //!@note We should not start timers until we receive the ShowEvent
- showControls();
+ // Update snapshot and check the current file is not deleted.
+ updateSnapshotImage();
+
+ if (mMainWindow->currentView() == this) {
+ showControls();
+ }
CX_DEBUG_EXIT_FUNCTION();
}
@@ -695,19 +747,13 @@
* Handle thumbnail received from ThumbnailManager.
*
* @param thumbnail Thumbnail as QPixmap
- * @param clientData Not used
- * @param id Thumbnail manager request id
- * @param errorCode Error code
*/
-void CxuiPostcaptureView::handleThumbnailReady(QPixmap thumbnail, void *clientData, int id, int errorCode)
+void CxuiPostcaptureView::handleThumbnailReady(QPixmap thumbnail)
{
CX_DEBUG_ENTER_FUNCTION();
- Q_UNUSED(clientData);
- Q_UNUSED(id);
-
if (thumbnail.isNull()) {
- CX_DEBUG(("Received null thumbnail from TNM, going to pre-capture. Error=%d", errorCode));
+ CX_DEBUG(("[WARNING] Received null thumbnail from TNM, going to pre-capture."));
// null thumbnail, go to precapture
goToPrecaptureView();
} else if (mImageLabel) {
@@ -757,9 +803,9 @@
}
if (!CxuiServiceProvider::isCameraEmbedded()) {
- CxeError::Id err = mEngine->settings().get(settingId, postCaptureTimeout);
+ postCaptureTimeout = mEngine->settings().get<int>(settingId, 0);
- if (postCaptureTimeout > 0 && err == CxeError::None) {
+ if (postCaptureTimeout > 0) {
mPostcaptureTimer.start(postCaptureTimeout);
} else {
// do nothing
--- a/camerauis/cameraxui/cxui/src/cxuiprecaptureview.cpp Thu Jul 15 01:55:05 2010 +0300
+++ b/camerauis/cameraxui/cxui/src/cxuiprecaptureview.cpp Fri Jul 23 11:35:41 2010 +0300
@@ -15,7 +15,6 @@
*
*/
-#include <coemain.h>
#include <QProcess>
#include <QApplication>
#include <hbmainwindow.h>
@@ -53,15 +52,19 @@
#include "cxuisettingradiobuttonlist.h"
#include "cxuisettingslider.h"
#include "cxuisettingsinfo.h"
+
+#ifdef Q_OS_SYMBIAN
#include "OstTraceDefinitions.h"
-#include "cxuiserviceprovider.h"
-#include "cxuizoomslider.h"
-#include "cxuifullscreenpopup.h"
#ifdef OST_TRACE_COMPILER_IN_USE
#include "cxuiprecaptureviewTraces.h"
#endif
-#include "cxegeotaggingtrail.h"
+
+#endif //Q_OS_SYMBIAN
+
+#include "cxuifullscreenpopup.h"
+#include "cxuiserviceprovider.h"
+#include "cxuizoomslider.h"
using namespace CxUiLayout;
using namespace CxUiSettings;
@@ -511,8 +514,8 @@
}
// disable geotagging disclaimer after geotagging setting is triggered from FirstTimeUse dialog
QString settingId = action->property(PROPERTY_KEY_SETTING_ID).toString();
- int value = Cxe::GeoTaggingDisclaimerDisabled;
- mEngine->settings().get(CxeSettingIds::GEOTAGGING_DISCLAIMER, value);
+ CX_DEBUG(("settingsKey=%s", settingId.toAscii().constData()));
+ Cxe::GeoTaggingDisclaimer value = mEngine->settings().get<Cxe::GeoTaggingDisclaimer>(CxeSettingIds::GEOTAGGING_DISCLAIMER, Cxe::GeoTaggingDisclaimerDisabled);
if (settingId == CxeSettingIds::GEOTAGGING && value == Cxe::GeoTaggingDisclaimerEnabled) {
// disable geotagging first-time-use dialog
disableGeotaggingDisclaimer();
@@ -890,10 +893,10 @@
HbMessageBox::MessageTypeInformation);
HbAction *okAction = new HbAction(hbTrId("txt_common_button_ok"));
- HbAction *settingsAction = new HbAction(hbTrId("txt_cam_opt_general_settings"));
+ HbAction *settingsAction = new HbAction(hbTrId("txt_cam_info_geotagging_ftu_note_settings_button"));
// connecting signals for dialog's actions
- connect(okAction,
+ connect(okAction,
SIGNAL(triggered()),
this,
SLOT(disableGeotaggingDisclaimer()));
@@ -929,7 +932,7 @@
/*!
-* Slot that launches geotagging setting dialog.
+* Slot that launches geotagging setting dialog.
*/
void CxuiPrecaptureView::launchGeoTaggingSetting()
{
--- a/camerauis/cameraxui/cxui/src/cxuiscenelabel.cpp Thu Jul 15 01:55:05 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,89 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
-*
-*/
-
-#include "cxuiscenelabel.h"
-#include "cxeengine.h"
-#include "cxesettings.h"
-#include "cxutils.h"
-
-CxuiSceneLabel::CxuiSceneLabel(QGraphicsItem *parent, CxeEngine *engine)
-: HbLabel(parent), mSettingId(), mItemValues(), mItems(), mEngine(engine)
-{
- CX_ASSERT_ALWAYS(engine);
-}
-
-QStringList CxuiSceneLabel::itemValues() const
-{
- return mItemValues;
-}
-
-void CxuiSceneLabel::setItemValues(const QStringList &values)
-{
- CX_DEBUG_ENTER_FUNCTION();
- mItemValues = values;
- CX_DEBUG_EXIT_FUNCTION();
-}
-
-QStringList CxuiSceneLabel::items() const
-{
- return mItems;
-}
-
-void CxuiSceneLabel::setItems(const QStringList &values)
-{
- CX_DEBUG_ENTER_FUNCTION();
- mItems = values;
- CX_DEBUG_EXIT_FUNCTION();
-}
-
-QString CxuiSceneLabel::settingId() const
-{
- return mSettingId;
-}
-
-void CxuiSceneLabel::setSettingId(const QString &id)
-{
- CX_DEBUG_ENTER_FUNCTION();
- mSettingId = id;
- setSceneIcon();
- CX_DEBUG_EXIT_FUNCTION();
-}
-
-void CxuiSceneLabel::setSceneIcon()
-{
- CX_DEBUG_ENTER_FUNCTION();
-
- QString scenevalue;
- if (!mSettingId.isEmpty() && !mItems.isEmpty() && !mItemValues.isEmpty()) {
- int err = mEngine->settings().get(mSettingId, scenevalue);
- int index = mItemValues.indexOf(scenevalue);
- CX_DEBUG((("err: %d index: %d"),err,index));
- setIcon(HbIcon(mItems.at(index)));
- }
-
- CX_DEBUG_EXIT_FUNCTION();
-}
-
-void CxuiSceneLabel::changeIcon(int index)
-{
- CX_DEBUG_ENTER_FUNCTION();
- if (!mItems.isEmpty()) {
- setIcon(HbIcon(mItems.at(index)));
- }
- CX_DEBUG_EXIT_FUNCTION();
-}
-
--- a/camerauis/cameraxui/cxui/src/cxuiscenemodeview.cpp Thu Jul 15 01:55:05 2010 +0300
+++ b/camerauis/cameraxui/cxui/src/cxuiscenemodeview.cpp Fri Jul 23 11:35:41 2010 +0300
@@ -171,8 +171,7 @@
}
if (mScenesBackground) {
- QString sceneId;
- mEngine->settings().get(data.mSettingId, sceneId);
+ QString sceneId = mEngine->settings().get<QString>(data.mSettingId);
HbIcon background(backgroundForScene(sceneId));
background.setMirroringMode(HbIcon::LayoutDirection);
mScenesBackground->setIcon(background);
--- a/camerauis/cameraxui/cxui/src/cxuiselftimer.cpp Thu Jul 15 01:55:05 2010 +0300
+++ b/camerauis/cameraxui/cxui/src/cxuiselftimer.cpp Fri Jul 23 11:35:41 2010 +0300
@@ -29,6 +29,7 @@
#include "cxesettings.h"
#include "cxenamespace.h" // CxeSettingIds
#include "cxeerror.h"
+#include "cxeexception.h"
using namespace CxUiLayout;
@@ -272,12 +273,11 @@
CX_DEBUG_ENTER_FUNCTION();
// get the current postcapture timeout
- CxeError::Id error = mSettings.get(CxeSettingIds::STILL_SHOWCAPTURED, mOldPostCaptureTimeOut);
-
- if (error == CxeError::None) {
+ try {
+ mOldPostCaptureTimeOut = mSettings.get<int>(CxeSettingIds::STILL_SHOWCAPTURED);
// set continuous postcapture (view is visible until dismissed)
mSettings.set(CxeSettingIds::STILL_SHOWCAPTURED, CONTINUOUS_POSTCAPTURE);
- } else {
+ } catch (CxeException &e) {
// if there was an error, don't modify the postcapture setting
mOldPostCaptureTimeOut = UNKNOWN;
}
--- a/camerauis/cameraxui/cxui/src/cxuiserviceprovider.cpp Thu Jul 15 01:55:05 2010 +0300
+++ b/camerauis/cameraxui/cxui/src/cxuiserviceprovider.cpp Fri Jul 23 11:35:41 2010 +0300
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+ * Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies).
* All rights reserved.
* This component and the accompanying materials are made available
* under the terms of "Eclipse Public License v1.0"
@@ -26,21 +26,13 @@
#include "cxuiserviceprovider.h"
#include "cxesettings.h"
-CxuiServiceProvider* CxuiServiceProvider::mInstance = NULL;
-
-// TODO: get these constants from header <xqaiwdecl.h>
-// will be released wk16
-const QString CXUI_SERVICE_NAME = "cxui.com.nokia.symbian.ICameraCapture";
+#include <xqaiwdecl.h>
-const QString CAMERA_INDEX = "CameraIndex";
-const QString QUALITY = "Quality";
-const QString ALLOW_MODE_SWITCH = "AllowModeSwitch";
-const QString ALLOW_CAMERA_SWITCH = "AllowCameraSwitch";
-const QString ALLOW_QUALITY_CHANGE = "AllowQualityChange";
+CxuiServiceProvider* CxuiServiceProvider::mInstance = NULL;
CxuiServiceProvider::CxuiServiceProvider(CxeEngine *engine)
:
- XQServiceProvider(CXUI_SERVICE_NAME),
+ XQServiceProvider("cxui." + XQI_CAMERA_CAPTURE),
mRequestIndex(-1),
mEngine(engine),
mRequestedMode(Cxe::ImageMode),
@@ -151,6 +143,7 @@
if (mRequestIndex == -1) {
CX_DEBUG(("CxuiServiceProvider: no request in progress"));
QCoreApplication::instance()->quit();
+ CX_DEBUG_EXIT_FUNCTION();
return;
}
@@ -159,6 +152,7 @@
CX_DEBUG(("CxuiServiceProvider: completing request"));
if (!completeRequest(mRequestIndex, QVariant(filename))) {
// if request completion fails call quit immediately because signal is not coming
+ CX_DEBUG(("completeRequest() failed, quitting now"));
QCoreApplication::instance()->quit();
}
mRequestIndex = -1;
@@ -236,22 +230,23 @@
CX_DEBUG_ENTER_FUNCTION();
CX_DEBUG(("Reading parameters"));
bool ok;
- mCameraIndex = parameters[CAMERA_INDEX].toInt(&ok);
+ mCameraIndex = parameters[XQCAMERA_INDEX].toInt(&ok);
if (!ok) {
- CX_DEBUG(("Error reading parameter %s", CAMERA_INDEX.toAscii().constData()));
+ CX_DEBUG(("Error reading parameter %s", XQCAMERA_INDEX.latin1()));
CX_DEBUG_EXIT_FUNCTION();
return false;
}
- mQuality = parameters[QUALITY].toInt(&ok);
+ mQuality = parameters[XQCAMERA_QUALITY].toInt(&ok);
if (!ok) {
- CX_DEBUG(("Error reading parameter %s", CAMERA_INDEX.toAscii().constData()));
+ CX_DEBUG(("Error reading parameter %s", XQCAMERA_QUALITY.latin1()));
CX_DEBUG_EXIT_FUNCTION();
return false;
}
- mAllowModeSwitching = parameters[ALLOW_MODE_SWITCH].toBool();
- mAllowQualityChange = parameters[ALLOW_QUALITY_CHANGE].toBool();
- mAllowCameraSwitching = parameters[ALLOW_CAMERA_SWITCH].toBool();
+ // ignore possible errors on these parameters. default values will be false
+ mAllowModeSwitching = parameters[XQCAMERA_MODE_SWITCH].toBool();
+ mAllowQualityChange = parameters[XQCAMERA_QUALITY_CHANGE].toBool();
+ mAllowCameraSwitching = parameters[XQCAMERA_INDEX_SWITCH].toBool();
CX_DEBUG_EXIT_FUNCTION();
return true;
--- a/camerauis/cameraxui/cxui/src/cxuisettingradiobuttonlist.cpp Thu Jul 15 01:55:05 2010 +0300
+++ b/camerauis/cameraxui/cxui/src/cxuisettingradiobuttonlist.cpp Fri Jul 23 11:35:41 2010 +0300
@@ -71,8 +71,7 @@
setListBoxType(data->mListboxType);
// Store the original setting value and focus matching item.
- QString value;
- mEngine->settings().get(mSettingId, value);
+ QString value = mEngine->settings().get<QString>(mSettingId, "");
CX_DEBUG(("CxuiSettingRadioButtonList - original value: [%s]", qPrintable(value)));
setOriginalSelectedItemByValue(QVariant(value));
}
@@ -205,11 +204,13 @@
// Don't set the value again, if it is the current value.
// For e.g. video quality it would result in re-preparation etc.
- int current(0);
- CxeError::Id status(mEngine->settings().get(mSettingId, current));
-
- if (status != CxeError::None || current != value.toInt()) {
- mEngine->settings().set(mSettingId, value.toInt());
+ try {
+ int current = mEngine->settings().get<int>(mSettingId);
+ if (current != value.toInt()) {
+ mEngine->settings().set(mSettingId, value.toInt());
+ }
+ } catch (CxeException &e) {
+ // ignore error
}
// inform interested clients about value changed event
emit valueSelected(value.toInt());
@@ -217,12 +218,14 @@
} else if (value.type() == QVariant::String) {
CX_DEBUG(("CxuiSettingRadioButtonList - index:%d value:[%s]", index, qPrintable(value.toString())));
- QString current;
- CxeError::Id status(mEngine->settings().get(mSettingId, current));
- CX_DEBUG(("CxuiSettingRadioButtonList - settings model value:[%s]", qPrintable(current)));
-
- if (status != CxeError::None || current != value.toString()) {
- mEngine->settings().set(mSettingId, value.toString());
+ try {
+ QString current = mEngine->settings().get<QString>(mSettingId);
+ CX_DEBUG(("CxuiSettingRadioButtonList - settings model value:[%s]", qPrintable(current)));
+ if (current != value.toString()) {
+ mEngine->settings().set(mSettingId, value.toString());
+ }
+ } catch (CxeException &e) {
+ // ignore error
}
}
}
--- a/camerauis/cameraxui/cxui/src/cxuisettingslider.cpp Thu Jul 15 01:55:05 2010 +0300
+++ b/camerauis/cameraxui/cxui/src/cxuisettingslider.cpp Fri Jul 23 11:35:41 2010 +0300
@@ -1,5 +1,5 @@
/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies).
* All rights reserved.
* This component and the accompanying materials are made available
* under the terms of "Eclipse Public License v1.0"
@@ -95,10 +95,7 @@
mSettingId = id;
// once the settingid is set, we can get the current value for the slider from the engine
- qreal value = 0;
-
- int err = mSettings->get(mSettingId, value);
- CX_DEBUG((("err: %d value: %d"),err,value));
+ qreal value = mSettings->get<qreal>(mSettingId, 0);
// engine value has to be scaled when set to slider
setValue(value * mSliderScaleValue);
--- a/camerauis/cameraxui/cxui/src/cxuistillprecaptureview.cpp Thu Jul 15 01:55:05 2010 +0300
+++ b/camerauis/cameraxui/cxui/src/cxuistillprecaptureview.cpp Fri Jul 23 11:35:41 2010 +0300
@@ -48,10 +48,16 @@
#include "cxesettings.h"
#include "cxefeaturemanager.h" // mEngine->featureManager()
#include "cxuidocumentloader.h"
+
+#ifdef Q_OS_SYMBIAN
#include "OstTraceDefinitions.h"
+
#ifdef OST_TRACE_COMPILER_IN_USE
#include "cxuistillprecaptureviewTraces.h"
#endif
+
+#endif //Q_OS_SYMBIAN
+
#include "cxuistillprecaptureview.h"
#include "cxuiserviceprovider.h"
#include "cxuisettingdialog.h"
@@ -112,23 +118,14 @@
this, SLOT(handleStillCaptureStateChanged(CxeStillCaptureControl::State, CxeError::Id)));
connect(&mEngine->viewfinderControl(), SIGNAL(stateChanged(CxeViewfinderControl::State, CxeError::Id)),
this, SLOT(handleViewfinderStateChanged(CxeViewfinderControl::State, CxeError::Id)));
- connect(&(mEngine->settings()), SIGNAL(sceneChanged(CxeScene&)),
- this, SLOT(handleSceneChanged(CxeScene&)));
connect(&mEngine->stillCaptureControl(), SIGNAL(availableImagesChanged()),
this, SLOT(updateImagesLeftLabel()));
+ mEngine->settings().listenForSetting(CxeSettingIds::IMAGE_SCENE_DATA, this, SLOT(handleSceneChanged(const QVariant&)));
+
loadDefaultWidgets();
hideControls();
- mSelfTimer = new CxuiSelfTimer(mEngine->settings());
- connect(mSelfTimer, SIGNAL(timerFinished()), this, SLOT(focusAndCapture()));
-
- int value = Cxe::GeoTaggingDisclaimerDisabled;
- mEngine->settings().get(CxeSettingIds::GEOTAGGING_DISCLAIMER, value);
- if (value == Cxe::GeoTaggingDisclaimerEnabled) {
- launchGeoTaggingDisclaimerDialog();
- }
-
OstTrace0( camerax_performance, DUP1_CXUISTILLPRECAPTUREVIEW_CONSTRUCT, "msg: e_CX_STILLPRECAPVIEW_CONSTRUCT 0" );
CX_DEBUG_EXIT_FUNCTION();
}
@@ -159,7 +156,7 @@
{
CX_DEBUG_ENTER_FUNCTION();
CX_ASSERT_ALWAYS(mDocumentLoader);
-
+
bool ok = false;
mDocumentLoader->load(STILL_1ST_XML, STILL_PRE_CAPTURE_INDICATORS_SECTION, &ok);
CX_ASSERT_ALWAYS(ok);
@@ -168,7 +165,7 @@
widget = mDocumentLoader->findWidget(STILL_PRE_CAPTURE_QUALITY_ICON);
mQualityIcon = qobject_cast<HbLabel *>(widget);
CX_ASSERT_ALWAYS(mQualityIcon);
-
+
widget = mDocumentLoader->findWidget(STILL_PRE_CAPTURE_FLASHBLINK_INDICATOR_ICON);
HbLabel *flashBlinkingIcon = qobject_cast<HbLabel *>(widget);
CX_ASSERT_ALWAYS(flashBlinkingIcon);
@@ -184,7 +181,7 @@
widget = mDocumentLoader->findWidget(STILL_PRE_CAPTURE_INDICATOR_CONTAINER);
mIndicators = qobject_cast<HbWidget *>(widget);
CX_ASSERT_ALWAYS(mIndicators);
-
+
QGraphicsLayout *layout = mIndicators->layout();
QGraphicsLayoutItem *graphicsLayoutItem = NULL;
QGraphicsItem *graphicsItem = NULL;
@@ -202,15 +199,15 @@
currentSettingValue = -1;
if (graphicsItem == mGeoTaggingIndicatorIcon) {
key = CxeSettingIds::GEOTAGGING;
- mEngine->settings().get(key, currentSettingValue);
+ currentSettingValue = mEngine->settings().get(key, currentSettingValue);
if (currentSettingValue == Cxe::GeoTaggingOff) {
isSettingOff = true;
}
} else if (graphicsItem == mFaceTrackingIcon) {
key = CxeSettingIds::FACE_TRACKING;
- mEngine->settings().get(key, currentSettingValue);
- // facetracking implementation does not use
- // enum for on/off values but instead
+ currentSettingValue = mEngine->settings().get(key, currentSettingValue);
+ // facetracking implementation does not use
+ // enum for on/off values but instead
// 0 for off and 1 for on.
if (currentSettingValue == 0) {
isSettingOff = true;
@@ -224,10 +221,10 @@
}
}
}
-
+
// create background for indicator container
createWidgetBackgroundGraphic(mIndicators, TRANSPARENT_BACKGROUND_GRAPHIC);
-
+
mIndicators->setVisible(true);
CX_DEBUG_EXIT_FUNCTION();
@@ -242,7 +239,7 @@
CX_DEBUG_ENTER_FUNCTION();
CX_ASSERT_ALWAYS(mDocumentLoader);
- if( mWidgetsLoaded ) {
+ if (mWidgetsLoaded) {
CX_DEBUG(("Widgets already loaded"));
CX_DEBUG_EXIT_FUNCTION();
return;
@@ -273,12 +270,6 @@
mSlider->addZoomButtons();
createWidgetBackgroundGraphic(mSlider, TRANSPARENT_BACKGROUND_GRAPHIC);
- if (mSelfTimer) {
- // let selftimer class get needed selftimer related widgets
- // from the documentloader
- mSelfTimer->loadSelftimerWidgets(mDocumentLoader);
- }
-
// create background for selftimer containers
HbWidget *container = NULL;
widget = mDocumentLoader->findWidget(STILL_PRE_CAPTURE_SELFTIMER_CONTAINER);
@@ -310,6 +301,13 @@
createWidgetBackgroundGraphic(mImagesLeftContainer, TRANSPARENT_BACKGROUND_GRAPHIC);
updateImagesLeftLabel();
+ // Create self timer.
+ // Let selftimer class get needed selftimer related widgets from the documentloader
+ mSelfTimer = new CxuiSelfTimer(mEngine->settings());
+ CX_ASSERT_ALWAYS(mSelfTimer);
+ connect(mSelfTimer, SIGNAL(timerFinished()), this, SLOT(focusAndCapture()));
+ mSelfTimer->loadSelftimerWidgets(mDocumentLoader);
+
if (CxuiServiceProvider::isCameraEmbedded()) {
CX_DEBUG(("EMBEDDED: camera in embedded mode"));
@@ -341,19 +339,20 @@
mWidgetsLoaded = true;
// Update toolbar flash mode icon
- int flash;
- if (mEngine->settings().get(CxeSettingIds::FLASH_MODE, flash) == CxeError::None) {
- handleSettingValueChanged(CxeSettingIds::FLASH_MODE, flash);
- }
+ int flash = mEngine->settings().get<int>(CxeSettingIds::FLASH_MODE);
+ handleSettingValueChanged(CxeSettingIds::FLASH_MODE, flash);
// Update toolbar scene mode icon
- QString sceneId;
- if (mEngine->settings().get(CxeSettingIds::SCENE_ID, sceneId) == CxeError::None) {
- updateSceneIcon(sceneId);
- }
+ updateSceneIcon(mEngine->settings().get<QString>(CxeSettingIds::IMAGE_SCENE));
hideControls();
+ // Check if we need to show the geotagging disclaimer for first time use.
+ Cxe::GeoTaggingDisclaimer value = mEngine->settings().get<Cxe::GeoTaggingDisclaimer>(CxeSettingIds::GEOTAGGING_DISCLAIMER, Cxe::GeoTaggingDisclaimerDisabled);
+ if (value == Cxe::GeoTaggingDisclaimerEnabled) {
+ launchGeoTaggingDisclaimerDialog();
+ }
+
// View is ready. Needed for startup performance automated testing.
emit viewReady();
@@ -459,7 +458,7 @@
// On error (missing settings) default to "postcapture on".
int showPostcapture(-1);
if(mEngine) {
- mEngine->settings().get(CxeSettingIds::STILL_SHOWCAPTURED, showPostcapture);
+ showPostcapture = mEngine->settings().get<int>(CxeSettingIds::STILL_SHOWCAPTURED, -1);
}
CX_DEBUG_EXIT_FUNCTION();
@@ -507,9 +506,7 @@
if (mQualityIcon && mEngine) {
QString icon = "";
- int currentValue = -1;
-
- mEngine->settings().get(CxeSettingIds::IMAGE_QUALITY, currentValue);
+ int currentValue = mEngine->settings().get<int>(CxeSettingIds::IMAGE_QUALITY, -1);
icon = getSettingItemIcon(CxeSettingIds::IMAGE_QUALITY, currentValue);
mQualityIcon->setIcon(HbIcon(icon));
@@ -562,12 +559,12 @@
// autofocus is not supported, so start capturing straight away
capture();
} else {
+ setCapturePending();
// start focusing
// Auto-focus can only work if viewfinder is running
if (mEngine->viewfinderControl().state() == CxeViewfinderControl::Running) {
mEngine->autoFocusControl().start(false);
}
- setCapturePending();
}
CX_DEBUG_EXIT_FUNCTION();
@@ -864,11 +861,12 @@
Slot for handling scene mode change
\param scene QVariantMap containing settings related to the new scene mode
*/
-void CxuiStillPrecaptureView::handleSceneChanged(CxeScene &scene)
+void CxuiStillPrecaptureView::handleSceneChanged(const QVariant &newSceneData)
{
CX_DEBUG_ENTER_FUNCTION();
if (mEngine->mode() == Cxe::ImageMode) {
+ CxeScene scene = newSceneData.toMap();
// update toolbar scene mode icon
updateSceneIcon(scene[CxeSettingIds::SCENE_ID].toString());
@@ -879,10 +877,10 @@
} else {
// No flash mode specified within the scene.
// Check from setting model what is it currently.
- int flashMode(Cxe::FlashAuto);
- mEngine->settings().get(CxeSettingIds::FLASH_MODE, flashMode);
+ Cxe::FlashMode flashMode = mEngine->settings().get<Cxe::FlashMode>(CxeSettingIds::FLASH_MODE, Cxe::FlashAuto);
handleSettingValueChanged(CxeSettingIds::FLASH_MODE, QVariant(flashMode));
}
+
}
CX_DEBUG_EXIT_FUNCTION();
@@ -984,10 +982,8 @@
launchSettingsDialog(action);
// special case to get value changed event to the selftimer class
if (settingsKey == CxeSettingIds::SELF_TIMER) {
- // if selftimer is active remember the previously selected value
- if (mSelfTimer->isEnabled()) {
- mSettingsDialogList->setOriginalSelectedItemByValue(mSelfTimer->getTimeout());
- }
+ // selftimer is not found in settings so set the value now
+ mSettingsDialogList->setOriginalSelectedItemByValue(mSelfTimer->getTimeout());
connect(mSettingsDialogList, SIGNAL(valueSelected(int)),
mSelfTimer, SLOT(changeTimeOut(int)));
}
@@ -1028,11 +1024,10 @@
if (mFaceTrackingIcon && mEngine) {
QString key = "";
QString icon = "";
- int currentValue = -1;
key = CxeSettingIds::FACE_TRACKING;
- mEngine->settings().get(key, currentValue);
+ int currentValue = mEngine->settings().get<int>(key, -1);
icon = getSettingItemIcon(key, currentValue);
mFaceTrackingIcon->setIcon(HbIcon(icon));
--- a/camerauis/cameraxui/cxui/src/cxuivideoprecaptureview.cpp Thu Jul 15 01:55:05 2010 +0300
+++ b/camerauis/cameraxui/cxui/src/cxuivideoprecaptureview.cpp Fri Jul 23 11:35:41 2010 +0300
@@ -15,7 +15,7 @@
*
*/
-#include <e32keys.h>
+
#include <QApplication>
#include <QGraphicsLayout>
@@ -48,11 +48,15 @@
#include "cxuidocumentloader.h"
#include "cxuiserviceprovider.h"
+#ifdef Q_OS_SYMBIAN
#include "OstTraceDefinitions.h"
+
#ifdef OST_TRACE_COMPILER_IN_USE
#include "cxuivideoprecaptureviewTraces.h"
#endif
+#include <e32keys.h>
+#endif //Q_OS_SYMBIAN
using namespace Cxe;
using namespace CxUiLayout;
@@ -66,6 +70,7 @@
//!@todo Localization?
static const char* VIDEO_TIME_FORMAT = "%02d:%02d";
+ const int POSTCAPTURE_ON = -1;
}
@@ -74,8 +79,7 @@
mElapsedTimer(this),
mTimeElapsed(0),
mTimeRemaining(0),
- mElapsedTimeText(NULL),
- mRemainingTimeText(NULL),
+ mVideoTimeText(NULL),
mRecordingIcon(NULL),
mGoToStillAction(NULL),
mToolbarIdle(NULL),
@@ -117,15 +121,13 @@
mVideoCaptureControl = &(engine->videoCaptureControl());
connect(&mElapsedTimer, SIGNAL(timeout()), this, SLOT(updateTimeLabels()));
- connect(mVideoCaptureControl, SIGNAL(snapshotReady(CxeError::Id, const QImage&, const QString&)),
- this, SLOT(handleSnapshot(CxeError::Id)));
connect(mVideoCaptureControl, SIGNAL(stateChanged(CxeVideoCaptureControl::State, CxeError::Id)),
this, SLOT(handleVideoStateChanged(CxeVideoCaptureControl::State,CxeError::Id)));
- connect(&(mEngine->settings()), SIGNAL(sceneChanged(CxeScene&)),
- this, SLOT(handleSceneChanged(CxeScene&)));
connect(mVideoCaptureControl, SIGNAL(remainingTimeChanged()),
this, SLOT(updateTimeLabels()));
+ mEngine->settings().listenForSetting(CxeSettingIds::VIDEO_SCENE, this, SLOT(handleSceneChanged(const QVariant&)));
+
mPauseTimer.setSingleShot(true);
connect(&mPauseTimer, SIGNAL(timeout()), this, SLOT(stop()));
mPauseTimer.setInterval(CXUI_PAUSE_TIMEOUT);
@@ -162,7 +164,7 @@
}
/*!
- * Loads default indicators from docml and modifies the visibility
+ * Loads default indicators from docml and modifies the visibility
* according to current settings.
*/
void CxuiVideoPrecaptureView::reloadIndicatorWidgets()
@@ -208,9 +210,9 @@
currentSettingValue = -1;
if (graphicsItem == videoaudiomuteIndicatorIcon) {
key = CxeSettingIds::VIDEO_MUTE_SETTING;
- mEngine->settings().get(key, currentSettingValue);
- // video mute implementation does not use
- // enum for on/off values but instead
+ currentSettingValue = mEngine->settings().get(key, currentSettingValue);
+ // video mute implementation does not use
+ // enum for on/off values but instead
// 0 for off and 1 for on.
if (currentSettingValue == 0) {
isSettingOff = true;
@@ -323,13 +325,9 @@
CX_ASSERT_ALWAYS(indicatorContainer);
createWidgetBackgroundGraphic(indicatorContainer, TRANSPARENT_BACKGROUND_GRAPHIC);
- widget = mDocumentLoader->findWidget(VIDEO_PRE_CAPTURE_ELAPSED_TIME_LABEL);
- mElapsedTimeText = qobject_cast<HbLabel *> (widget);
- CX_ASSERT_ALWAYS(mElapsedTimeText);
-
- widget = mDocumentLoader->findWidget(VIDEO_PRE_CAPTURE_REMAINING_TIME_LABEL);
- mRemainingTimeText = qobject_cast<HbLabel *> (widget);
- CX_ASSERT_ALWAYS(mRemainingTimeText);
+ widget = mDocumentLoader->findWidget(VIDEO_PRE_CAPTURE_VIDEO_TIME_LABEL);
+ mVideoTimeText = qobject_cast<HbLabel *> (widget);
+ CX_ASSERT_ALWAYS(mVideoTimeText);
widget = mDocumentLoader->findWidget(VIDEO_PRE_CAPTURE_RECORDING_ICON);
mRecordingIcon = qobject_cast<HbLabel *> (widget);
@@ -348,9 +346,10 @@
// Update toolbar scene mode icon.
- QString sceneId;
- if (mEngine->settings().get(CxeSettingIds::SCENE_ID, sceneId) == CxeError::None) {
- updateSceneIcon(sceneId);
+ try {
+ updateSceneIcon(mEngine->settings().get<QString>(CxeSettingIds::VIDEO_SCENE));
+ } catch (CxeException &e) {
+ // ignore error
}
// Initialize the video time counters.
@@ -425,6 +424,7 @@
}
}
+
/**
* Get if postcapture view should be shown or not.
* Postcapture view may be shown for a predefined time or
@@ -441,9 +441,9 @@
// Read the value from settings. Ignoring reading error.
// On error (missing settings) default to "postcapture on".
- int showPostcapture(-1);
+ int showPostcapture(POSTCAPTURE_ON);
if(mEngine) {
- mEngine->settings().get(CxeSettingIds::VIDEO_SHOWCAPTURED, showPostcapture);
+ showPostcapture = mEngine->settings().get<int>(CxeSettingIds::VIDEO_SHOWCAPTURED, POSTCAPTURE_ON);
}
CX_DEBUG_EXIT_FUNCTION();
@@ -490,9 +490,8 @@
if (mQualityIcon && mEngine) {
QString icon = "";
- int currentValue = -1;
- mEngine->settings().get(CxeSettingIds::VIDEO_QUALITY, currentValue);
+ int currentValue = mEngine->settings().get<int>(CxeSettingIds::VIDEO_QUALITY, -1);
icon = getSettingItemIcon(CxeSettingIds::VIDEO_QUALITY, currentValue);
mQualityIcon->setIcon(HbIcon(icon));
@@ -501,13 +500,6 @@
CX_DEBUG_EXIT_FUNCTION();
}
-void CxuiVideoPrecaptureView::handleSnapshot(CxeError::Id /*error*/)
-{
- CX_DEBUG_ENTER_FUNCTION();
-
- CX_DEBUG_EXIT_FUNCTION();
-}
-
void CxuiVideoPrecaptureView::record()
{
CX_DEBUG_ENTER_FUNCTION();
@@ -516,7 +508,9 @@
mVideoCaptureControl->remainingTime(time);
if (time) {
- mMenu = takeMenu();
+ if (!mMenu){ // Only take out menu, if we have not already done it
+ mMenu = takeMenu();
+ }
mVideoCaptureControl->record();
} else {
emit errorEncountered(CxeError::DiskFull);
@@ -652,7 +646,7 @@
{
CX_DEBUG_IN_FUNCTION();
- if (!mRemainingTimeText || !mElapsedTimeText) {
+ if (!mVideoTimeText) {
// Section not loaded yet. Skip update until created.
CX_DEBUG(("CxuiVideoPrecaptureView: video time labels not loaded yet!"));
CX_DEBUG_EXIT_FUNCTION();
@@ -685,8 +679,7 @@
break;
}
- setVideoTime(mRemainingTimeText, mTimeRemaining);
- setVideoTime(mElapsedTimeText, mTimeElapsed);
+ setVideoTime(mVideoTimeText, mTimeElapsed, mTimeRemaining);
CX_DEBUG_EXIT_FUNCTION();
}
@@ -709,16 +702,21 @@
/*!
* Helper method for formatting video time to requested label.
* @param label Text label to show the time.
-* @param time Time in seconds to be formatted to the label text.
+* @param elapsedTime Elapsed time in seconds to be formatted to the label text.
+* @param remainingTime Remaining time in seconds to be formatted to the label text.
*/
-void CxuiVideoPrecaptureView::setVideoTime(HbLabel* label, int time)
+void CxuiVideoPrecaptureView::setVideoTime(HbLabel* label,
+ int elapsedTime,
+ int remainingTime)
{
// Convert time (seconds) into mm:ss
// HbExtendedLocale wraps minutes at 60 so we can't use that.
// We need to show times over 1 hour, e.g. "90:00".
- QString timeString;
- timeString.sprintf(VIDEO_TIME_FORMAT, time/60, time%60);
- label->setPlainText(timeString);
+ QString elapsed, remaining;
+ elapsed.sprintf(VIDEO_TIME_FORMAT, elapsedTime/60, elapsedTime%60);
+ remaining.sprintf(VIDEO_TIME_FORMAT, remainingTime/60, remainingTime%60);
+
+ label->setPlainText(hbTrId("txt_cam_info_redorcding_time").arg(elapsed).arg(remaining));
}
bool CxuiVideoPrecaptureView::getElapsedTime()
@@ -784,6 +782,7 @@
if (mDocumentLoader){
mDocumentLoader->load(VIDEO_1ST_XML, VIDEO_PRE_CAPTURE_RECORDING);
}
+
mElapsedTimer.start(CXUI_ELAPSED_TIME_TIMEOUT);
disableFeedback();
@@ -837,8 +836,7 @@
// don't change anything
break;
default:
- // in any other state, just hide the controls
- setRecordingItemsVisibility(false);
+ // don't change anything
break;
}
@@ -956,36 +954,18 @@
* Handle scene mode change.
* @param scene The new active scene mode.
*/
-void CxuiVideoPrecaptureView::handleSceneChanged(CxeScene &scene)
+void CxuiVideoPrecaptureView::handleSceneChanged(const QVariant &scene)
{
CX_DEBUG_ENTER_FUNCTION();
// Ignore if not in video mode.
if (mEngine->mode() == Cxe::VideoMode) {
// Update toolbar scene mode icon.
- updateSceneIcon(scene[CxeSettingIds::SCENE_ID].toString());
+ updateSceneIcon(scene.toString());
}
CX_DEBUG_EXIT_FUNCTION();
}
-
-
-/*!
- Sets the visibility of recording icon and elapsed time text.
- \param visible True if widgets are to be shown, false if not.
-*/
-void CxuiVideoPrecaptureView::setRecordingItemsVisibility(bool visible) {
-
- if (mRecordingIcon) {
- mRecordingIcon->setVisible(visible);
- mRecordingIcon->setOpacity(1.0f);
- }
-
- if (mElapsedTimeText) {
- mElapsedTimeText->setVisible(visible);
- }
-}
-
/*!
* Overridden eventFilter() to restart the pause timer.
*/
--- a/camerauis/cameraxui/cxui/src/cxuiview.cpp Thu Jul 15 01:55:05 2010 +0300
+++ b/camerauis/cameraxui/cxui/src/cxuiview.cpp Fri Jul 23 11:35:41 2010 +0300
@@ -268,19 +268,8 @@
mHideControlsTimeout.stop();
}
- // Hide title bar and status bar.
- //!@todo: View flags property is missing from HbView, so can't set these in DocML.
- HbView::HbViewFlags flags(HbView::ViewTitleBarTransparent
- | HbView::ViewTitleBarFloating
- | HbView::ViewTitleBarHidden
- | HbView::ViewStatusBarTransparent
- | HbView::ViewStatusBarFloating
- | HbView::ViewStatusBarHidden);
- setViewFlags(flags);
- //!@todo: Once the flags are defined in DocML, we can just use these convenience functions
- // to hide the title bar and status bar here.
- //setTitleBarVisible(false);
- //setStatusBarVisible(false);
+ setTitleBarVisible(false);
+ setStatusBarVisible(false);
hideZoom();
--- a/camerauis/cameraxui/cxui/src/cxuiviewmanager.cpp Thu Jul 15 01:55:05 2010 +0300
+++ b/camerauis/cameraxui/cxui/src/cxuiviewmanager.cpp Fri Jul 23 11:35:41 2010 +0300
@@ -21,6 +21,7 @@
#include <hbstyleloader.h>
#include <hbactivitymanager.h>
#include <hbaction.h>
+#include <xqserviceutil.h>
#include "cxuiapplication.h"
#include "cxuiapplicationstate.h"
@@ -163,7 +164,7 @@
Q_UNUSED(oldState);
CX_DEBUG_ENTER_FUNCTION();
- CxuiView *view = qobject_cast<CxuiView *>(mMainWindow.currentView());
+ CxuiView *view = currentView();
CX_DEBUG(("CxuiViewManager - current view %d", view));
switch (newState) {
@@ -209,7 +210,7 @@
{
CX_DEBUG_ENTER_FUNCTION();
// Store view that is active now.
- CxuiView *view = qobject_cast<CxuiView *>(mMainWindow.currentView());
+ CxuiView *view = currentView();
CX_DEBUG(("CxuiViewManager - current view %d", view));
// Emit signal so current view can enter standby.
@@ -250,7 +251,6 @@
CxuiView* CxuiViewManager::currentView() const
{
CxuiView *view = qobject_cast<CxuiView*> (mMainWindow.currentView());
- CX_ASSERT_ALWAYS(view);
return view;
}
@@ -261,7 +261,12 @@
{
CX_DEBUG_ENTER_FUNCTION();
- if (mApplication.activateReason() == Hb::ActivationReasonService) {
+ if (mApplication.activateReason() == Hb::ActivationReasonService ||
+ // @todo: There's a bug in orbit and we never get Hb::ActivationReasonService as
+ // activation reason. Use XQServiceUtil to determine if starting service as
+ // a workaround for now
+ XQServiceUtil::isService()) {
+
// For embedded mode: don't create view yet, create when engine inits to correct mode.
// Connect signals to set up the view after image/video prepare
connect(&mEngine.stillCaptureControl(), SIGNAL(imagePrepareComplete(CxeError::Id)),
@@ -290,16 +295,12 @@
}
CxuiView *view = createView(viewName);
- mMainWindow.setCurrentView(view, false);
-
if (preCapture) {
- connectPreCaptureSignals();
+ connectPreCaptureSignals(static_cast<CxuiPrecaptureView *>(view));
} else {
connectPostCaptureSignals();
}
-
- // Check the current application state, signalled to handleApplicationStateChanged.
- mApplicationState->startMonitoring();
+ mMainWindow.setCurrentView(view, false);
// restore view from activity
bool ok = mApplication.activityManager()->waitActivity();
@@ -317,16 +318,15 @@
} else {
view = createView(STILL_PRE_CAPTURE_VIEW);
}
-
+ connectPreCaptureSignals(static_cast<CxuiPrecaptureView *>(view));
mMainWindow.setCurrentView(view, false);
- connectPreCaptureSignals();
-
- // Check the current application state, signalled to handleApplicationStateChanged.
- mApplicationState->startMonitoring();
clearAllActivities();
}
+ // Check the current application state, signalled to handleApplicationStateChanged.
+ mApplicationState->startMonitoring();
+
CX_DEBUG_EXIT_FUNCTION();
}
@@ -393,9 +393,9 @@
CX_ASSERT_ALWAYS(view);
view->loadBackgroundImages();
- mMainWindow.setCurrentView(view, false);
stopStandbyTimer();
connectSceneModeSignals();
+ mMainWindow.setCurrentView(view, false);
CX_DEBUG_EXIT_FUNCTION();
}
@@ -435,8 +435,6 @@
CxuiView *postCaptureView = createView(POSTCAPTURE_VIEW);
- mMainWindow.setCurrentView(postCaptureView, false);
-
// Connecting all necessary signals for postcapture view.
// Not connected yet if not in normal state. We connect the signals
// once we enter normal state again.
@@ -444,6 +442,11 @@
connectPostCaptureSignals();
}
+ // Connect signals before we set the post-capture view as current view.
+ // We need to have signals connected if post-capture view for example
+ // needs to move back to pre-capture view already in showEvent.
+ mMainWindow.setCurrentView(postCaptureView, false);
+
CX_DEBUG_EXIT_FUNCTION();
}
@@ -470,8 +473,12 @@
// Disconnect signals from old view.
disconnectSignals();
- HbView *view = getPrecaptureView(mEngine.mode(),
- mEngine.cameraDeviceControl().cameraIndex());
+ CxuiPrecaptureView *view =
+ getPrecaptureView(mEngine.mode(), mEngine.cameraDeviceControl().cameraIndex());
+
+ // Connect necessary pre-capture view signals.
+ connectPreCaptureSignals(view);
+
mMainWindow.setCurrentView(view, false);
// Release resources needed by scene view.
@@ -484,9 +491,6 @@
sceneView = NULL;
}
- // connecting necessary pre-capture view signals
- connectPreCaptureSignals();
-
// Make sure engine prepares for new image/video if necessary
mEngine.initMode(mEngine.mode());
@@ -515,11 +519,10 @@
}
CxuiPrecaptureView* view = getPrecaptureView(mEngine.mode(), nextCamera);
+ connectPreCaptureSignals(view);
mMainWindow.setCurrentView(view, false);
view->updateOrientation(nextViewOrientation);
- connectPreCaptureSignals();
-
mEngine.cameraDeviceControl().switchCamera(nextCamera);
CX_DEBUG_EXIT_FUNCTION();
@@ -577,7 +580,7 @@
/*!
* Connect signals specific to given view.
*/
-void CxuiViewManager::connectSignals(QObject *view)
+void CxuiViewManager::connectSignals(CxuiView *view)
{
CX_DEBUG_ENTER_FUNCTION();
OstTrace0(camerax_performance, CXUIVIEWMANAGER_CONNECTSIGNALS_1, "msg: e_CX_VIEWMANAGER_CONNECT_SIGNALS 1");
@@ -588,7 +591,7 @@
} else if (view == mViews[SCENE_MODE_VIEW]) {
connectSceneModeSignals();
} else {
- connectPreCaptureSignals();
+ connectPreCaptureSignals(static_cast<CxuiPrecaptureView *>(view));
}
}
@@ -601,7 +604,7 @@
* We don't want to send or receive signals with inactive views, so this is done every time changing a view.
* @param view View object from which signals are disconnected. If NULL is given, current view is used.
*/
-void CxuiViewManager::disconnectSignals(QObject *view)
+void CxuiViewManager::disconnectSignals(CxuiView *view)
{
CX_DEBUG_ENTER_FUNCTION();
OstTrace0(camerax_performance, CXUIVIEWMANAGER_DISCONNECT_1, "msg: e_CX_VIEWMANAGER_DISCONNECT_SIGNALS 1");
@@ -611,7 +614,7 @@
if (!view) {
// If view is not given, take current view.
- view = mMainWindow.currentView();
+ view = currentView();
}
CX_DEBUG(("CxuiViewManager - disconnecting from view %d", view));
@@ -629,42 +632,39 @@
/*!
* Connect signals to pre-capture view.
*/
-void CxuiViewManager::connectPreCaptureSignals()
+void CxuiViewManager::connectPreCaptureSignals(CxuiPrecaptureView *view)
{
CX_DEBUG_ENTER_FUNCTION();
+ // Disconnect from the current, "old" view
disconnectSignals();
- HbView *currentView = mMainWindow.currentView();
-
- if (currentView != mViews[POSTCAPTURE_VIEW]) {
- // connects all capture key signals.
- connectCaptureKeySignals();
+ // connecting pre-capture view signals to standby timer.
+ connect(view, SIGNAL(startStandbyTimer()), this, SLOT(startStandbyTimer()), Qt::UniqueConnection);
+ connect(view, SIGNAL(stopStandbyTimer()), this, SLOT(stopStandbyTimer()), Qt::UniqueConnection);
+ connect(view, SIGNAL(changeToPrecaptureView()), this, SLOT(startStandbyTimer()), Qt::UniqueConnection);
+ connect(view, SIGNAL(changeToPostcaptureView()), this, SLOT(stopStandbyTimer()), Qt::UniqueConnection);
- // connecting pre-capture view signals to standby timer.
- connect(currentView, SIGNAL(startStandbyTimer()), this, SLOT(startStandbyTimer()), Qt::UniqueConnection);
- connect(currentView, SIGNAL(stopStandbyTimer()), this, SLOT(stopStandbyTimer()), Qt::UniqueConnection);
- connect(currentView, SIGNAL(changeToPrecaptureView()), this, SLOT(startStandbyTimer()), Qt::UniqueConnection);
- connect(currentView, SIGNAL(changeToPostcaptureView()), this, SLOT(stopStandbyTimer()), Qt::UniqueConnection);
+ // connecting pre-capture view signals to viewmanager slots
+ connect(view, SIGNAL(changeToPostcaptureView()), this, SLOT(changeToPostcaptureView()), Qt::UniqueConnection);
+ connect(view, SIGNAL(changeToPrecaptureView()), this, SLOT(changeToPrecaptureView()), Qt::UniqueConnection);
+
+ //connecting scene modes signal
+ connect(view, SIGNAL(showScenesView()), this, SLOT(showScenesView()), Qt::UniqueConnection);
- // connecting pre-capture view signals to viewmanager slots
- connect(currentView, SIGNAL(changeToPostcaptureView()), this, SLOT(changeToPostcaptureView()), Qt::UniqueConnection);
- connect(currentView, SIGNAL(changeToPrecaptureView()), this, SLOT(changeToPrecaptureView()), Qt::UniqueConnection);
+ connect(view, SIGNAL(switchCamera()), this, SLOT(switchCamera()), Qt::UniqueConnection);
- //connecting scene modes signal
- connect(currentView, SIGNAL(showScenesView()), this, SLOT(showScenesView()), Qt::UniqueConnection);
-
- connect(currentView, SIGNAL(switchCamera()), this, SLOT(switchCamera()), Qt::UniqueConnection);
+ // connecting error signals from precapture view to application state.
+ connect(view, SIGNAL(errorEncountered(CxeError::Id)),
+ mApplicationState, SLOT(handleApplicationError(CxeError::Id)),
+ Qt::UniqueConnection);
- // connecting error signals from precapture view to application state.
- connect(currentView, SIGNAL(errorEncountered(CxeError::Id)),
- mApplicationState, SLOT(handleApplicationError(CxeError::Id)),
- Qt::UniqueConnection);
+ // Standby signals
+ connect(this, SIGNAL(normalStateEntered()), view, SLOT(exitStandby()), Qt::UniqueConnection);
+ connect(this, SIGNAL(normalStateExited()), view, SLOT(enterStandby()), Qt::UniqueConnection);
- // Standby signals
- connect(this, SIGNAL(normalStateEntered()), currentView, SLOT(exitStandby()), Qt::UniqueConnection);
- connect(this, SIGNAL(normalStateExited()), currentView, SLOT(enterStandby()), Qt::UniqueConnection);
- }
+ // connects all capture key signals.
+ connectCaptureKeySignals(view);
CX_DEBUG_EXIT_FUNCTION();
}
@@ -676,20 +676,20 @@
{
CX_DEBUG_ENTER_FUNCTION();
+ // Disconnect from the current, "old" view
disconnectSignals();
- QObject *currentView = mMainWindow.currentView();
- if (currentView == mViews[POSTCAPTURE_VIEW]) {
- connect(currentView, SIGNAL(changeToPrecaptureView()), this, SLOT(changeToPrecaptureView()), Qt::UniqueConnection);
+ CxuiView *view = mViews[POSTCAPTURE_VIEW];
+ if (view) {
+ connect(view, SIGNAL(changeToPrecaptureView()), this, SLOT(changeToPrecaptureView()), Qt::UniqueConnection);
// Standby signals
- connect(this, SIGNAL(normalStateEntered()), currentView, SLOT(exitStandby()), Qt::UniqueConnection);
- connect(this, SIGNAL(normalStateExited()), currentView, SLOT(enterStandby()), Qt::UniqueConnection);
+ connect(this, SIGNAL(normalStateEntered()), view, SLOT(exitStandby()), Qt::UniqueConnection);
+ connect(this, SIGNAL(normalStateExited()), view, SLOT(enterStandby()), Qt::UniqueConnection);
// connect necessary capturekey signals
- connectCaptureKeySignals();
+ connectCaptureKeySignals(view);
}
-
CX_DEBUG_EXIT_FUNCTION();
}
@@ -699,20 +699,20 @@
void CxuiViewManager::connectSceneModeSignals()
{
CX_DEBUG_ENTER_FUNCTION();
+
+ // Disconnect from the current, "old" view
disconnectSignals();
- HbView *currentView = mMainWindow.currentView();
-
- if (currentView == mViews[SCENE_MODE_VIEW]) {
-
- connectCaptureKeySignals();
-
+ CxuiView *view = mViews[SCENE_MODE_VIEW];
+ if (view) {
// Standby signals for releasing camera
- connect(this, SIGNAL(normalStateEntered()), currentView, SLOT(exitStandby()));
- connect(this, SIGNAL(normalStateExited()), currentView, SLOT(enterStandby()));
+ connect(this, SIGNAL(normalStateEntered()), view, SLOT(exitStandby()));
+ connect(this, SIGNAL(normalStateExited()), view, SLOT(enterStandby()));
// Moving back to pre-capture view
- connect(currentView, SIGNAL(viewCloseEvent()), this, SLOT(changeToPrecaptureView()));
+ connect(view, SIGNAL(viewCloseEvent()), this, SLOT(changeToPrecaptureView()));
+
+ connectCaptureKeySignals(view);
}
CX_DEBUG_EXIT_FUNCTION();
}
@@ -720,22 +720,20 @@
/*!
* Connect key handler capture key signals.
*/
-void CxuiViewManager::connectCaptureKeySignals()
+void CxuiViewManager::connectCaptureKeySignals(CxuiView *view)
{
CX_DEBUG_ENTER_FUNCTION();
// Disconnect all existing capture key signals
mKeyHandler->disconnect();
- QObject *currentView = mMainWindow.currentView();
-
- if (currentView) {
+ if (view) {
// If the view class does not implement the named slot, the connect will fail
// and output some warnings as debug prints. This is by design.
- connect(mKeyHandler, SIGNAL(autofocusKeyPressed()), currentView, SLOT(handleAutofocusKeyPressed()));
- connect(mKeyHandler, SIGNAL(autofocusKeyReleased()), currentView, SLOT(handleAutofocusKeyReleased()));
- connect(mKeyHandler, SIGNAL(captureKeyPressed()), currentView, SLOT(handleCaptureKeyPressed()));
- connect(mKeyHandler, SIGNAL(captureKeyReleased()), currentView, SLOT(handleCaptureKeyReleased()));
+ connect(mKeyHandler, SIGNAL(autofocusKeyPressed()), view, SLOT(handleAutofocusKeyPressed()));
+ connect(mKeyHandler, SIGNAL(autofocusKeyReleased()), view, SLOT(handleAutofocusKeyReleased()));
+ connect(mKeyHandler, SIGNAL(captureKeyPressed()), view, SLOT(handleCaptureKeyPressed()));
+ connect(mKeyHandler, SIGNAL(captureKeyReleased()), view, SLOT(handleCaptureKeyReleased()));
}
CX_DEBUG_EXIT_FUNCTION();
--- a/camerauis/cameraxui/cxui/src/main.cpp Thu Jul 15 01:55:05 2010 +0300
+++ b/camerauis/cameraxui/cxui/src/main.cpp Fri Jul 23 11:35:41 2010 +0300
@@ -21,6 +21,7 @@
#include <QLocale>
#include <HbTranslator>
#include <hbmainwindow.h>
+#include <xqserviceutil.h>
#ifdef Q_OS_SYMBIAN
#include <coemain.h>
@@ -72,7 +73,11 @@
CxeEngine *engine = CxeEngine::createEngine();
OstTrace0( camerax_performance, DUP8__MAIN, "msg: e_CX_CREATE_ENGINE 0" );
- if (app.activateReason() == Hb::ActivationReasonService) {
+ if (app.activateReason() == Hb::ActivationReasonService ||
+ // @todo: There's a bug in orbit and we never get Hb::ActivationReasonService as
+ // activation reason. Use XQServiceUtil to determine if starting service as
+ // a workaround for now
+ XQServiceUtil::isService()) {
CX_DEBUG(("CxUI: Camera started as service"));
// Embedded mode. Engine is inited to correct mode
// by service provider when request arrives
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/camerauis/cameraxui/cxui/stubs_desktop/inc/XQUtils Fri Jul 23 11:35:41 2010 +0300
@@ -0,0 +1,32 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#ifndef XQUTILS
+#define XQUTILS
+
+#include <QObject>
+
+class XQUtils : public QObject
+{
+ Q_OBJECT
+public:
+ XQUtils(QObject *parent = 0) : QObject(parent) {}
+
+public slots:
+ void resetInactivityTime() {}
+};
+#endif // XQUTILS
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/camerauis/cameraxui/cxui/stubs_desktop/inc/shareui.h Fri Jul 23 11:35:41 2010 +0300
@@ -0,0 +1,29 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#ifndef SHAREUIDESKTOP_H
+#define SHAREUIDESKTOP_H
+
+class QStringList;
+
+class ShareUi
+{
+public:
+ inline void send(QStringList, bool) {}
+};
+
+#endif // SHAREUIDESKTOP_H
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/camerauis/cameraxui/cxui/stubs_desktop/inc/thumbnailmanager_qt.h Fri Jul 23 11:35:41 2010 +0300
@@ -0,0 +1,42 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#ifndef THUMBNAILMANAGER_QT_H
+#define THUMBNAILMANAGER_QT_H
+
+#include <QObject>
+#include <QPixmap>
+
+class ThumbnailManager : public QObject
+{
+ Q_OBJECT
+
+public:
+ enum ThumbnailSize {
+ ThumbnailLarge
+ };
+
+public:
+ ThumbnailManager(){}
+ inline void setThumbnailSize(ThumbnailSize size){}
+ inline void getThumbnail(QString filename){}
+
+signals:
+ void thumbnailReady(QPixmap thumbnail, void *clientData, int id, int errorCode);
+};
+
+#endif // THUMBNAILMANAGER_QT_H
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/camerauis/cameraxui/cxui/stubs_desktop/inc/xqappmgr.h Fri Jul 23 11:35:41 2010 +0300
@@ -0,0 +1,48 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#ifndef XQAPPMGRDESKTOP_H
+#define XQAPPMGRDESKTOP_H
+
+#include <QVariant>
+
+class XQAiwRequest
+{
+public:
+ inline void setArguments(QVariantList &fileList) {}
+ inline bool send(QVariant &result) {return false;}
+ inline int lastError() {return 1;}
+};
+
+class XQApplicationManager
+{
+public:
+ XQApplicationManager() : videoRequest(NULL) { }
+ inline XQAiwRequest *create(const QString &service, const QString &operation, bool embedded = true)
+ {
+ videoRequest = new XQAiwRequest();
+ return videoRequest;
+ }
+
+ inline ~XQApplicationManager() {if (videoRequest) delete videoRequest;}
+
+private:
+ // Owned
+ XQAiwRequest *videoRequest;
+};
+
+#endif // XQAPPMGRDESKTOP_H
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/camerauis/cameraxui/cxui/stubs_desktop/inc/xqserviceprovider.h Fri Jul 23 11:35:41 2010 +0300
@@ -0,0 +1,37 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+* Stub used by CxuiServiceProvider
+*/
+
+#ifndef XQSERVICEPROVIDER_H
+#define XQSERVICEPROVIDER_H
+
+#include <QObject>
+#include <QString>
+
+class XQServiceProvider : public QObject
+{
+ Q_OBJECT
+public:
+ XQServiceProvider(const QString &service, QObject *parent = 0) : QObject(parent) {Q_UNUSED(service)}
+ virtual ~XQServiceProvider() {}
+protected:
+ virtual void publishAll(){}
+ bool completeRequest(int index, const QVariant &retValue) {return true;}
+ int setCurrentRequestAsync() {return 0;}
+
+};
+
+#endif // XQSERVICEPROVIDER_H
--- a/camerauis/cameraxui/cxui/tsrc/cxuitest.pro Thu Jul 15 01:55:05 2010 +0300
+++ b/camerauis/cameraxui/cxui/tsrc/cxuitest.pro Fri Jul 23 11:35:41 2010 +0300
@@ -30,8 +30,7 @@
./cxui \
../traces
QT += testlib
-HB += hbcore hbwidgets hbutils hbfeedback
-CONFIG += qtestlib hb symbian_test
+CONFIG += qtestlib hb
LIBS += -lcxengine \
-lcommonui \
-lapmime \
@@ -56,7 +55,6 @@
cxuisettingslider.cpp \
cxuisettingradiobuttonlist.cpp \
cxuisettingscenemoderadiobuttonlist.cpp \
- cxuiscenelabel.cpp \
cxuisettingbuttoncontainer.cpp \
cxuifakestillcapturecontrol.cpp \
cxuifakecameradevicecontrol.cpp \
@@ -76,7 +74,6 @@
cxuisettingslider.h \
cxuisettingradiobuttonlist.h \
cxuisettingscenemoderadiobuttonlist.h \
- cxuiscenelabel.h \
cxuisettingbuttoncontainer.h\
cxuidocumentloader.h \
cxuienums.h \
--- a/camerauis/cameraxui/cxui/tsrc/cxuitestbat.cpp Thu Jul 15 01:55:05 2010 +0300
+++ b/camerauis/cameraxui/cxui/tsrc/cxuitestbat.cpp Fri Jul 23 11:35:41 2010 +0300
@@ -108,7 +108,7 @@
QCOMPARE( deviceStateSpy.count(), 3 );
QList<QVariant> initModeArguments = deviceStateSpy.takeAt(0);
- QVERIFY( initModeArguments.at(0).value<CxeVideoCaptureControl::State>() == CxeVideoCaptureControl::Open );
+ QVERIFY( initModeArguments.at(0).value<CxeVideoCaptureControl::State>() == CxeVideoCaptureControl::Initialized );
QVERIFY( initModeArguments.at(1).toInt() == 0 );
initModeArguments = deviceStateSpy.takeAt(0);
QVERIFY( initModeArguments.at(1).toInt() == 0 );
@@ -252,7 +252,7 @@
QCOMPARE(deviceStateSpy.count(), 3);
if (deviceStateSpy.count() > 0) {
QList<QVariant> initModeArguments = deviceStateSpy.takeAt(0);
- QVERIFY( initModeArguments.at(0).value<CxeVideoCaptureControl::State>() == CxeVideoCaptureControl::Open );
+ QVERIFY( initModeArguments.at(0).value<CxeVideoCaptureControl::State>() == CxeVideoCaptureControl::Initialized );
QVERIFY( initModeArguments.at(1).toInt() == 0 );
initModeArguments = deviceStateSpy.takeAt(0);
QVERIFY( initModeArguments.at(1).toInt() == 0 );
--- a/camerauis/cameraxui/cxui/tsrc/cxuitestbat.pro Thu Jul 15 01:55:05 2010 +0300
+++ b/camerauis/cameraxui/cxui/tsrc/cxuitestbat.pro Fri Jul 23 11:35:41 2010 +0300
@@ -34,8 +34,8 @@
../traces
QT += testlib
-CONFIG += qtestlib hb symbian_test
-HB += hbcore hbwidgets hbfeedback hbutils
+CONFIG += qtestlib hb
+HB += hbcore hbwidgets hbtools hbfeedback
LIBS += -lcxengine \
-lcommonui \
@@ -62,7 +62,6 @@
cxuisettingslider.cpp \
cxuisettingradiobuttonlist.cpp \
cxuisettingscenemoderadiobuttonlist.cpp \
- cxuiscenelabel.cpp \
cxuiselftimer.cpp \
cxuierrormanager.cpp \
cxuistandby.cpp
@@ -78,12 +77,11 @@
cxuienums.h \
cxuidocumentloader.h \
cxuidisplaypropertyhandler.h \
- cxuisettingslider.h \
+ cxuisettingslider.h \
cxuisettingradiobuttonlist.h \
cxuisettingscenemoderadiobuttonlist.h \
- cxuiscenelabel.h \
cxuiselftimer.h \
- cxuierrormanager.h \
+ cxuierrormanager.h \
cxuistandby.h \
../traces/OstTraceDefinitions.h