# HG changeset patch
# User hgs
# Date 1273775419 -10800
# Node ID 3075d9b614e65448b968195bd587dde41944b86f
# Parent d9aefe59d54480964ad9c2e34e28c852e66af220
201017_1
diff -r d9aefe59d544 -r 3075d9b614e6 camerauis/cameraxui/cxengine/conf/cameraxvariation.confml
--- a/camerauis/cameraxui/cxengine/conf/cameraxvariation.confml Fri Apr 16 14:51:30 2010 +0300
+++ b/camerauis/cameraxui/cxengine/conf/cameraxvariation.confml Thu May 13 21:30:19 2010 +0300
@@ -3,29 +3,33 @@
CameraX Runtime Variation
- PrimaryCameraCaptureKeysCr defines the key scan codes that are configured
- as capture keys for primary camera.
+ PrimaryCameraCaptureKeysCr defines the capture keys for primary camera.
+ Both key code and scan code are needed for full functionality.
- SecondaryCameraCaptureKeysCr defines the key scan codes that are configured
+ SecondaryCameraCaptureKeysCr defines the key scan codes that are configured
as capture keys for secondary camera.
- PrimaryCameraAutofocusKeysCr defines the key scan codes that are configured
- as autofocus keys for primary camera.
+ PrimaryCameraAutofocusKeysCr defines the autofocus keys for primary camera.
+ Both key code and scan code are needed for full functionality.
-
- ContrastItemsCr defines the range which incluse the min value to max along with step size. e.g. -4, 4, 1
+
+ FreeMemoryLevelsCr defines the trigger levels for freeing memory and required levels of free memory.
+ All values are defined in bytes. There are 4 items in comma-separated list. Items are defined as follows:
+ 1. Trigger level of free RAM when camera is started. If free RAM is below this, more free memory is requested.
+ 2. Level of free RAM requested and required for camera to start, if trigger level (item 1) is met.
+
-
+
- Key defines maximum zoom limit specific to each image quality. The firt item represent max zoom limit
+ Key defines maximum zoom limit specific to each image quality. The first item represent max zoom limit
for highest still resoultion and so on. We have only 5 entries, since we dont expect to have more than 5 still resoultions
in any product. Use -1 when zoom limit is not supported for a particular resolution.
Note: ECAM already has some limits which should be taken into account.
@@ -33,9 +37,9 @@
- Key defines maximum zoom limit specific to each video quality. The firt item represent max zoom limit
+ Key defines maximum zoom limit specific to each video quality. The first item represent max zoom limit
for highest video resoultion and so on. We have only 5 entries, since we dont expect to have more than 5 video resoultions
- in any product. Use -1 when zoom limit is not supported for a particular resolution.
+ in any product. Use -1 when zoom limit is not supported for a particular resolution.
Note: ECAM already has some limits which should be taken into account.
@@ -44,10 +48,10 @@
- 0xab
+ 0xab,0xf849
0xab,0xa7
- 0xe2
- -4,4,1
+ 0xe2,0xf880
+ 8000000,10000000
32,32,32,32,32
40,40,40,-1,-1
diff -r d9aefe59d544 -r 3075d9b614e6 camerauis/cameraxui/cxengine/conf/cameraxvariation_20027018.crml
--- a/camerauis/cameraxui/cxengine/conf/cameraxvariation_20027018.crml Fri Apr 16 14:51:30 2010 +0300
+++ b/camerauis/cameraxui/cxengine/conf/cameraxvariation_20027018.crml Thu May 13 21:30:19 2010 +0300
@@ -13,7 +13,7 @@
-
+
diff -r d9aefe59d544 -r 3075d9b614e6 camerauis/cameraxui/cxengine/cxengine.pro
--- a/camerauis/cameraxui/cxengine/cxengine.pro Fri Apr 16 14:51:30 2010 +0300
+++ b/camerauis/cameraxui/cxengine/cxengine.pro Thu May 13 21:30:19 2010 +0300
@@ -23,15 +23,20 @@
inc/sensor \
inc/api \
src/dummyengine \
- ../traces \
+ traces \
../extensions/inc
VPATH += src
CONFIG += dll
MOC_DIR = tmp
-TARGET.CAPABILITY = ALL -TCB -DRM
-TARGET.UID3 = 0x20027016
+symbian {
+ TARGET.CAPABILITY = ALL -TCB -DRM
+ TARGET.UID3 = 0x20027016
+ # Fix for QMake translating INCLUDEPATH to SYSTEMINCLUDE
+ # and TraceCompiler needing USERINCLUDE.
+ MMP_RULES += "USERINCLUDE traces"
+}
# Libs
LIBS += -lecam
@@ -59,6 +64,8 @@
LIBS += -lharvesterclient
LIBS += -lthumbnailmanagerqt
LIBS += -lxqserviceutil
+LIBS += -loommonitor
+LIBS += -lhal
symbian {
TARGET.EPOCALLOWDLLDATA = 1 // TODO: check this out??
@@ -145,13 +152,17 @@
cxequalitypresetssymbian.h \
cxeharvestercontrolsymbian.h \
cxethumbnailmanagersymbian.h \
+ cxememorymonitor.h \
+ cxememorymonitorprivate.h \
+ cxediskmonitor.h \
+ cxediskmonitorprivate.h \
sensor/xqsensor.h \
sensor/xqaccsensor.h \
sensor/xqdeviceorientation.h \
sensor/xqdeviceorientation_p.h \
sensor/xqsensor_p.h \
sensor/xqaccsensor_p.h \
- ../traces/OstTraceDefinitions.h
+ traces/OstTraceDefinitions.h
SOURCES += cxecameradevicecontrolsymbian.cpp \
cxeengine.cpp \
@@ -187,6 +198,10 @@
cxequalitypresetssymbian.cpp \
cxeharvestercontrolsymbian.cpp \
cxethumbnailmanagersymbian.cpp \
+ cxememorymonitor.cpp \
+ cxememorymonitorprivate.cpp \
+ cxediskmonitor.cpp \
+ cxediskmonitorprivate.cpp \
sensor/xqsensor.cpp \
sensor/xqaccsensor.cpp \
sensor/xqdeviceorientation.cpp \
@@ -196,3 +211,4 @@
+
diff -r d9aefe59d544 -r 3075d9b614e6 camerauis/cameraxui/cxengine/inc/api/cxeautofocuscontrol.h
--- a/camerauis/cameraxui/cxengine/inc/api/cxeautofocuscontrol.h Fri Apr 16 14:51:30 2010 +0300
+++ b/camerauis/cameraxui/cxengine/inc/api/cxeautofocuscontrol.h Thu May 13 21:30:19 2010 +0300
@@ -77,8 +77,9 @@
/**
* Starts Autofocus.
+ * \param soundEnabled indicates if the auto focus sound should be played
*/
- virtual CxeError::Id start() = 0;
+ virtual CxeError::Id start(bool soundEnabled = true) = 0;
/**
* Cancels Autofocus.
@@ -105,6 +106,11 @@
* Check if Autofocus is Supported or Not.
*/
virtual bool supported() const = 0; // true when AF is supported
+
+ /**
+ * Check if auto focus sound is enabled
+ */
+ virtual bool isSoundEnabled() const = 0;
signals:
void stateChanged( CxeAutoFocusControl::State newState, CxeError::Id error );
diff -r d9aefe59d544 -r 3075d9b614e6 camerauis/cameraxui/cxengine/inc/api/cxeengine.h
--- a/camerauis/cameraxui/cxengine/inc/api/cxeengine.h Fri Apr 16 14:51:30 2010 +0300
+++ b/camerauis/cameraxui/cxengine/inc/api/cxeengine.h Thu May 13 21:30:19 2010 +0300
@@ -17,7 +17,7 @@
#ifndef CXEENGINE_H
#define CXEENGINE_H
-#include
+#include
#include "cxenamespace.h"
class CxeCameraDeviceControl;
@@ -29,11 +29,12 @@
class CxeImageDataQueue;
class CxeFeatureManager;
class CxeSettings;
+class CxeMemoryMonitor;
/**
* CxeEngine provides the the entry point into CameraX engine. This is the
* first class the client needs to initialize. CxeEngine then provides
- * references to other CameraX engine objects.
+ * references to other CameraX engine objects.
*/
class CxeEngine : public QObject
{
@@ -81,9 +82,18 @@
* Access the settings model.
*/
virtual CxeSettings &settings() = 0;
+
+ /**
+ * Access the feature manager.
+ */
virtual CxeFeatureManager &featureManager() = 0;
/**
+ * Memory monitor utility.
+ */
+ virtual CxeMemoryMonitor &memoryMonitor() = 0;
+
+ /**
* Get current camera mode.
*/
virtual Cxe::CameraMode mode() const = 0;
diff -r d9aefe59d544 -r 3075d9b614e6 camerauis/cameraxui/cxengine/inc/api/cxefeaturemanager.h
--- a/camerauis/cameraxui/cxengine/inc/api/cxefeaturemanager.h Fri Apr 16 14:51:30 2010 +0300
+++ b/camerauis/cameraxui/cxengine/inc/api/cxefeaturemanager.h Thu May 13 21:30:19 2010 +0300
@@ -44,7 +44,7 @@
/*!
* We retrieve all the configured values for the given key
*/
- virtual CxeError::Id configuredValues(const QString& key,QList& values) = 0;
+ virtual CxeError::Id configuredValues(const QString& key, QList& values) = 0;
protected:
CxeFeatureManager() {}
diff -r d9aefe59d544 -r 3075d9b614e6 camerauis/cameraxui/cxengine/inc/api/cxememorymonitor.h
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/camerauis/cameraxui/cxengine/inc/api/cxememorymonitor.h Thu May 13 21:30:19 2010 +0300
@@ -0,0 +1,57 @@
+/*
+* 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 CXEMEMORYMONITOR_H
+#define CXEMEMORYMONITOR_H
+
+#include
+
+class CxeFeatureManager;
+class CxeMemoryMonitorPrivate;
+
+/*!
+* Memory monitor class.
+* Memory monitor requests a pre-defined value of startup memory
+* at the time it is created, and throws error if it cannot get
+* enough memory freed. After creating, it can be set to monitor
+* free memory and try to keep it above pre-defined level.
+* Pre-defined levels are read from Feature Manager.
+*/
+class CxeMemoryMonitor : public QObject
+{
+ Q_OBJECT
+
+public:
+ explicit CxeMemoryMonitor(CxeFeatureManager &features);
+ ~CxeMemoryMonitor();
+
+public:
+ int free() const;
+
+public slots:
+ void startMonitoring();
+ void stopMonitoring();
+
+private:
+ bool requestFreeMemory(int requiredFreeMemory);
+
+private:
+ CxeMemoryMonitorPrivate *p;
+};
+
+#endif // CXEMEMORYMONITOR_H
+
diff -r d9aefe59d544 -r 3075d9b614e6 camerauis/cameraxui/cxengine/inc/api/cxenamespace.h
--- a/camerauis/cameraxui/cxengine/inc/api/cxenamespace.h Fri Apr 16 14:51:30 2010 +0300
+++ b/camerauis/cameraxui/cxengine/inc/api/cxenamespace.h Thu May 13 21:30:19 2010 +0300
@@ -84,9 +84,9 @@
enum Sharpness
{
- SharpnessHard = 100,
+ SharpnessHard = 2,
SharpnessNormal = 0,
- SharpnessSoft = -100
+ SharpnessSoft = -2
};
enum LightSensitivity
@@ -117,6 +117,15 @@
Repository, // repository key
PublishAndSubscribe // P&S key
};
+
+ /*!
+ * Index to CxeRuntimeKeys::FREE_MEMORY_LEVELS comma separated values
+ */
+ enum FreeMemoryIndex
+ {
+ FreeMemoryTrigger = 0,
+ FreeMemoryTarget
+ };
}
namespace CxeSettingIds
@@ -147,24 +156,23 @@
static const char* FNAME_VIDEO_COUNTER = "video_counter";
// scene mode keys
- static const char* IMAGE_SCENE = "image_scene";
- static const char* VIDEO_SCENE = "video_scene";
+ static const char* IMAGE_SCENE = "still_scene_modes";
+ static const char* VIDEO_SCENE = "video_scene_modes";
// image scene mode key values
- static const char* IMAGE_SCENE_AUTO = "ImageSceneAuto";
- static const char* IMAGE_SCENE_PORTRAIT = "ImageScenePortrait";
- static const char* IMAGE_SCENE_SCENERY = "ImageSceneScenery";
- static const char* IMAGE_SCENE_MACRO = "ImageSceneMacro";
- static const char* IMAGE_SCENE_SPORTS = "ImageSceneSports";
- static const char* IMAGE_SCENE_NIGHT = "ImageSceneNight";
- static const char* IMAGE_SCENE_NIGHTPORTRAIT = "ImageSceneNightPortrait";
- static const char* IMAGE_SCENE_CLOSEUP = "ImageSceneCloseUp";
+ static const char* IMAGE_SCENE_AUTO = "image_scene_auto";
+ static const char* IMAGE_SCENE_PORTRAIT = "image_scene_portrait";
+ static const char* IMAGE_SCENE_SCENERY = "image_scene_scenery";
+ static const char* IMAGE_SCENE_MACRO = "image_scene_macro";
+ static const char* IMAGE_SCENE_SPORTS = "image_scene_sports";
+ static const char* IMAGE_SCENE_NIGHT = "image_scene_night";
+ static const char* IMAGE_SCENE_NIGHTPORTRAIT = "image_scene_night_portrait";
// video scene setting key values
- static const char* VIDEO_SCENE_AUTO = "VideoSceneAuto";
- static const char* VIDEO_SCENE_NIGHTPORTRAIT = "VideoSceneNightPortrait";
- static const char* VIDEO_SCENE_LOWLIGHT = "VideoSceneLowLight";
- static const char* VIDEO_SCENE_NIGHT = "VideoSceneNight";
+ static const char* VIDEO_SCENE_AUTO = "video_scene_auto";
+ static const char* VIDEO_SCENE_NIGHTPORTRAIT = "video_scene_night_portrait";
+ static const char* VIDEO_SCENE_LOWLIGHT = "video_scene_low_light";
+ static const char* VIDEO_SCENE_NIGHT = "video_scene_night";
// setting keys for post capture timeout
static const char* STILL_SHOWCAPTURED = "still_showcaptured";
@@ -181,7 +189,7 @@
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";
- static const char* CONTRAST_ITEMS = "contrast_items";
+ 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";
}
diff -r d9aefe59d544 -r 3075d9b614e6 camerauis/cameraxui/cxengine/inc/api/cxequalitydetails.h
--- a/camerauis/cameraxui/cxengine/inc/api/cxequalitydetails.h Fri Apr 16 14:51:30 2010 +0300
+++ b/camerauis/cameraxui/cxengine/inc/api/cxequalitydetails.h Thu May 13 21:30:19 2010 +0300
@@ -25,6 +25,8 @@
*/
struct CxeImageDetails
{
+ static const int UNKNOWN = -1;
+
int mWidth;
int mHeight;
int mEstimatedSize; // size in bytes
@@ -42,6 +44,8 @@
*/
struct CxeVideoDetails
{
+ static const int UNKNOWN = -1;
+
int mWidth;
int mHeight;
int mRemainingTime;
diff -r d9aefe59d544 -r 3075d9b614e6 camerauis/cameraxui/cxengine/inc/api/cxestillcapturecontrol.h
--- a/camerauis/cameraxui/cxengine/inc/api/cxestillcapturecontrol.h Fri Apr 16 14:51:30 2010 +0300
+++ b/camerauis/cameraxui/cxengine/inc/api/cxestillcapturecontrol.h Thu May 13 21:30:19 2010 +0300
@@ -158,6 +158,11 @@
void snapshotReady(CxeError::Id error, const QPixmap& snapshot, int id);
void imageCaptured(CxeError::Id error, int id);
+ /**
+ * Amount of images that can be captured has changed.
+ */
+ void availableImagesChanged();
+
protected:
CxeStillCaptureControl() {} // protected empty contructor so that derived class construction works
diff -r d9aefe59d544 -r 3075d9b614e6 camerauis/cameraxui/cxengine/inc/api/cxevideocapturecontrol.h
--- a/camerauis/cameraxui/cxengine/inc/api/cxevideocapturecontrol.h Fri Apr 16 14:51:30 2010 +0300
+++ b/camerauis/cameraxui/cxengine/inc/api/cxevideocapturecontrol.h Thu May 13 21:30:19 2010 +0300
@@ -93,6 +93,7 @@
void videoComposed(CxeError::Id error, const QString& filename);
void stateChanged(CxeVideoCaptureControl::State newState, CxeError::Id error);
void snapshotReady(CxeError::Id error, const QPixmap& snapshot, const QString& filename);
+ void remainingTimeChanged();
protected:
CxeVideoCaptureControl() {}
diff -r d9aefe59d544 -r 3075d9b614e6 camerauis/cameraxui/cxengine/inc/cxeautofocuscontrolsymbian.h
--- a/camerauis/cameraxui/cxengine/inc/cxeautofocuscontrolsymbian.h Fri Apr 16 14:51:30 2010 +0300
+++ b/camerauis/cameraxui/cxengine/inc/cxeautofocuscontrolsymbian.h Thu May 13 21:30:19 2010 +0300
@@ -44,7 +44,7 @@
CxeAutoFocusControlSymbian( CxeCameraDevice &cameraDevice );
virtual ~CxeAutoFocusControlSymbian();
- CxeError::Id start();
+ CxeError::Id start(bool soundEnabled = true);
void cancel();
void setMode( CxeAutoFocusControl::Mode newMode );
CxeAutoFocusControl::Mode mode() const;
@@ -52,6 +52,8 @@
CxeAutoFocusControl::State state() const;
bool supported() const;
+ bool isSoundEnabled() const;
+
protected: // from CxeStateMachine
void handleStateChanged( int newStateId, CxeError::Id error );
@@ -91,6 +93,7 @@
CxeAutoFocusControl::Mode mAfMode;
CCamera::CCameraAdvancedSettings::TFocusRange mAFRange;
bool mCancelled;
+ bool mSoundEnabled;
};
#endif // CXEAUTOFOCUSCONTROLSYMBIAN_H
diff -r d9aefe59d544 -r 3075d9b614e6 camerauis/cameraxui/cxengine/inc/cxecenrepkeys.h
--- a/camerauis/cameraxui/cxengine/inc/cxecenrepkeys.h Fri Apr 16 14:51:30 2010 +0300
+++ b/camerauis/cameraxui/cxengine/inc/cxecenrepkeys.h Thu May 13 21:30:19 2010 +0300
@@ -34,9 +34,10 @@
const unsigned long int PrimaryCameraCaptureKeysCr = 0x1;
const unsigned long int SecondaryCameraCaptureKeysCr = 0x2;
const unsigned long int PrimaryCameraAutofocusKeysCr = 0x3;
-const unsigned long int ContrastItemsCr = 0x4;
+const unsigned long int FreeMemoryLevelsCr = 0x4;
const unsigned long int StillMaxZoomLimitsCr = 0x5;
const unsigned long int VideoMaxZoomLimitsCr = 0x6;
#endif // CXECENREPKEYS_H
+
diff -r d9aefe59d544 -r 3075d9b614e6 camerauis/cameraxui/cxengine/inc/cxediskmonitor.h
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/camerauis/cameraxui/cxengine/inc/cxediskmonitor.h Thu May 13 21:30:19 2010 +0300
@@ -0,0 +1,51 @@
+/*
+* 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 CXEDISKMONITOR_H
+#define CXEDISKMONITOR_H
+
+#include
+
+class CxeSettings;
+class CxeDiskMonitorPrivate;
+
+class CxeDiskMonitor : public QObject
+{
+ Q_OBJECT
+
+public:
+ explicit CxeDiskMonitor(CxeSettings &settings);
+ ~CxeDiskMonitor();
+
+signals:
+ void diskSpaceLow();
+ void diskSpaceChanged();
+
+public slots:
+ void setLowWarningLevel(qint64 bytes);
+ void start();
+ void stop();
+
+public:
+ bool isMonitoring() const;
+ qint64 free(bool cached = true) const;
+
+private:
+ CxeDiskMonitorPrivate *p;
+};
+
+#endif // CXEDISKMONITORPRIVATE_H
diff -r d9aefe59d544 -r 3075d9b614e6 camerauis/cameraxui/cxengine/inc/cxediskmonitorprivate.h
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/camerauis/cameraxui/cxengine/inc/cxediskmonitorprivate.h Thu May 13 21:30:19 2010 +0300
@@ -0,0 +1,66 @@
+/*
+* 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 CXEDISKMONITORPRIVATE_H
+#define CXEDISKMONITORPRIVATE_H
+
+#include
+#include
+#ifdef Q_OS_SYMBIAN
+#include
+#endif // Q_OS_SYMBIAN
+
+class CxeSettings;
+
+class CxeDiskMonitorPrivate : public QObject
+{
+ Q_OBJECT
+
+ // Owner of this private implementation.
+ friend class CxeDiskMonitor;
+
+private:
+ explicit CxeDiskMonitorPrivate(CxeSettings &settings);
+ ~CxeDiskMonitorPrivate();
+
+signals:
+ void diskSpaceLow();
+ void diskSpaceChanged();
+
+private slots:
+ void checkSpace();
+
+private:
+ void setLowWarningLevel(qint64 bytes);
+ void start();
+ void stop();
+ bool isMonitoring() const;
+ qint64 free(bool cached = true) const;
+
+private:
+ CxeSettings &mSettings;
+ QTimer mTimer;
+#ifdef Q_OS_SYMBIAN
+ RFs& mFs;
+ int mCameraDrive;
+#endif // Q_OS_SYMBIAN
+ qint64 mTriggerLevelBytes;
+ qint64 mLatestFreeBytes;
+};
+
+
+#endif // CXEDISKMONITORPRIVATE_H
diff -r d9aefe59d544 -r 3075d9b614e6 camerauis/cameraxui/cxengine/inc/cxeenginesymbian.h
--- a/camerauis/cameraxui/cxengine/inc/cxeenginesymbian.h Fri Apr 16 14:51:30 2010 +0300
+++ b/camerauis/cameraxui/cxengine/inc/cxeenginesymbian.h Thu May 13 21:30:19 2010 +0300
@@ -21,6 +21,7 @@
#include "cxeengine.h"
#include "cxefilenamegenerator.h"
+class CxeCameraDevice;
class CxeCameraDeviceControl;
class CxeViewfinderControl;
class CxeStillCaptureControl;
@@ -36,7 +37,8 @@
class CxeFilenameGenerator;
class CxeQualityPresets;
class CxeFileSaveThread;
-
+class CxeDiskMonitor;
+class CxeMemoryMonitor;
class CxeEngineSymbian : public CxeEngine
@@ -46,8 +48,6 @@
CxeEngineSymbian();
virtual ~CxeEngineSymbian();
- void construct();
-
CxeCameraDeviceControl &cameraDeviceControl();
CxeViewfinderControl &viewfinderControl();
CxeStillCaptureControl &stillCaptureControl();
@@ -57,14 +57,19 @@
CxeSettings &settings();
CxeSensorEventHandler &sensorEventHandler();
CxeFeatureManager &featureManager();
+ CxeMemoryMonitor &memoryMonitor();
Cxe::CameraMode mode() const;
void initMode(Cxe::CameraMode cameraMode);
bool isEngineReady();
+signals:
+ void reserveStarted();
+
protected:
virtual void createControls();
private slots:
+ void construct();
void doInit();
private:
@@ -72,9 +77,11 @@
bool reserveNeeded();
bool initNeeded();
bool startViewfinderNeeded();
+ void reserve();
protected:
CxeCameraDeviceControl *mCameraDeviceControl;
+ CxeCameraDevice *mCameraDevice; // not own
CxeViewfinderControl *mViewfinderControl;
CxeStillCaptureControl *mStillCaptureControl;
CxeVideoCaptureControl *mVideoCaptureControl;
@@ -88,8 +95,11 @@
CxeSensorEventHandler* mSensorEventHandler;
CxeQualityPresets *mQualityPresets;
CxeFileSaveThread *mFileSaveThread;
+ CxeDiskMonitor *mDiskMonitor;
+ CxeMemoryMonitor *mMemoryMonitor;
};
#endif // CXEENGINESYMBIAN_H
+
diff -r d9aefe59d544 -r 3075d9b614e6 camerauis/cameraxui/cxengine/inc/cxefilenamegeneratorsymbian.h
--- a/camerauis/cameraxui/cxengine/inc/cxefilenamegeneratorsymbian.h Fri Apr 16 14:51:30 2010 +0300
+++ b/camerauis/cameraxui/cxengine/inc/cxefilenamegeneratorsymbian.h Thu May 13 21:30:19 2010 +0300
@@ -22,8 +22,8 @@
#include "cxenamespace.h"
#include "cxeerror.h"
+class RFs;
class CxeSettings;
-class RFs;
static const int KCamMonthFolderNameLength = 8;
/**
diff -r d9aefe59d544 -r 3075d9b614e6 camerauis/cameraxui/cxengine/inc/cxememorymonitorprivate.h
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/camerauis/cameraxui/cxengine/inc/cxememorymonitorprivate.h Thu May 13 21:30:19 2010 +0300
@@ -0,0 +1,61 @@
+/*
+* 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 CXEMEMORYMONITORPRIVATE_H
+#define CXEMEMORYMONITORPRIVATE_H
+
+#include
+#include
+#include
+#ifdef Q_OS_SYMBIAN
+#include
+#endif // Q_OS_SYMBIAN
+
+class CxeFeatureManager;
+
+class CxeMemoryMonitorPrivate : public QObject
+{
+ Q_OBJECT
+
+ // Owner of this private implementation.
+ friend class CxeMemoryMonitor;
+
+private:
+ explicit CxeMemoryMonitorPrivate(CxeFeatureManager &features);
+ ~CxeMemoryMonitorPrivate();
+
+private:
+ int free() const;
+ bool requestFreeMemory(int requiredFreeMemory);
+
+ void startMonitoring();
+ void stopMonitoring();
+
+private slots:
+ void checkMemory();
+
+private:
+ CxeFeatureManager &mFeatures;
+ QTimer mTimer;
+ QList mLevels;
+#ifdef Q_OS_SYMBIAN
+ ROomMonitorSession mOomMonitor;
+#endif // Q_OS_SYMBIAN
+};
+
+#endif // CXEMEMORYMONITORPRIVATE_H
+
diff -r d9aefe59d544 -r 3075d9b614e6 camerauis/cameraxui/cxengine/inc/cxesettingscontrolsymbian.h
--- a/camerauis/cameraxui/cxengine/inc/cxesettingscontrolsymbian.h Fri Apr 16 14:51:30 2010 +0300
+++ b/camerauis/cameraxui/cxengine/inc/cxesettingscontrolsymbian.h Thu May 13 21:30:19 2010 +0300
@@ -48,6 +48,7 @@
void updateLightSensitivitySetting(QVariant newValue);
void updateSharpnessSetting(QVariant newValue);
void updateContrastSetting(QVariant newValue);
+ void updateBrightnessSetting(QVariant newValue);
void updateExposureModeSetting(QVariant newValue);
void updateExposureCompensationSetting(QVariant newValue);
diff -r d9aefe59d544 -r 3075d9b614e6 camerauis/cameraxui/cxengine/inc/cxesettingsmodelimp.h
--- a/camerauis/cameraxui/cxengine/inc/cxesettingsmodelimp.h Fri Apr 16 14:51:30 2010 +0300
+++ b/camerauis/cameraxui/cxengine/inc/cxesettingsmodelimp.h Thu May 13 21:30:19 2010 +0300
@@ -64,7 +64,7 @@
void loadSceneData(CxeScene ¤tScene, CxeScene &sceneDefaultSettings);
CxeError::Id sceneSettingValue(const QString &key, QVariant &value);
- CxeError::Id setSceneSettingValue(const QString &key, int newValue);
+ CxeError::Id setSceneSettingValue(const QString &key, QVariant newValue);
void supportedKeys(QList &runtimeKeys);
diff -r d9aefe59d544 -r 3075d9b614e6 camerauis/cameraxui/cxengine/inc/cxestatemachinebase.h
--- a/camerauis/cameraxui/cxengine/inc/cxestatemachinebase.h Fri Apr 16 14:51:30 2010 +0300
+++ b/camerauis/cameraxui/cxengine/inc/cxestatemachinebase.h Thu May 13 21:30:19 2010 +0300
@@ -118,6 +118,9 @@
//! Hash table of all states. stateId as key
QHash mStates;
+ //! All states ORed together
+ int mStateBitsUsed;
+
//! Current state
int mStateId;
diff -r d9aefe59d544 -r 3075d9b614e6 camerauis/cameraxui/cxengine/inc/cxestillcapturecontrolsymbian.h
--- a/camerauis/cameraxui/cxengine/inc/cxestillcapturecontrolsymbian.h Fri Apr 16 14:51:30 2010 +0300
+++ b/camerauis/cameraxui/cxengine/inc/cxestillcapturecontrolsymbian.h Thu May 13 21:30:19 2010 +0300
@@ -21,7 +21,6 @@
#include
#include
#include
-#include
#include "cxestillcapturecontrol.h"
#include "cxeautofocuscontrol.h"
@@ -44,7 +43,7 @@
class CxeAutoFocusControl;
class CxeSettings;
class CxeQualityPresets;
-
+class CxeDiskMonitor;
/**
@@ -66,7 +65,8 @@
CxeAutoFocusControl &autoFocusControl,
CxeSettings &settings,
CxeQualityPresets &qualityPresets,
- CxeFileSaveThread &fileSaveThread);
+ CxeFileSaveThread &fileSaveThread,
+ CxeDiskMonitor &diskMonitor);
virtual ~CxeStillCaptureControlSymbian();
@@ -111,6 +111,9 @@
// settings call back
void handleSettingValueChanged(const QString& settingId,QVariant newValue);
+ // Disk space change
+ void handleDiskSpaceChanged();
+
// Autofocus events
void handleAutofocusStateChanged(CxeAutoFocusControl::State newState, CxeError::Id error);
@@ -131,7 +134,7 @@
void initializeStates();
void prepare();
void updateRemainingImagesCounter();
- int calculateRemainingImages(int estimatedImagesize) ;
+ int calculateRemainingImages(int estimatedImagesize);
private: // private data
@@ -145,6 +148,7 @@
CxeSettings &mSettings;
CxeQualityPresets &mQualityPresets;
CxeFileSaveThread &mFileSaveThread;
+ CxeDiskMonitor &mDiskMonitor;
CxeSoundPlayerSymbian *mCaptureSoundPlayer;
CxeSoundPlayerSymbian *mAutoFocusSoundPlayer;
CaptureMode mMode;
diff -r d9aefe59d544 -r 3075d9b614e6 camerauis/cameraxui/cxengine/inc/cxesysutil.h
--- a/camerauis/cameraxui/cxengine/inc/cxesysutil.h Fri Apr 16 14:51:30 2010 +0300
+++ b/camerauis/cameraxui/cxengine/inc/cxesysutil.h Thu May 13 21:30:19 2010 +0300
@@ -39,7 +39,7 @@
static int getCameraDrive(RFs &fs);
- static qint64 spaceAvailable(RFs &fs, CxeSettings &settings);
+ static qint64 spaceAvailable(RFs &fs, int index, CxeSettings &settings);
};
#endif // CXESYSUTIL_H
diff -r d9aefe59d544 -r 3075d9b614e6 camerauis/cameraxui/cxengine/inc/cxevideocapturecontrolsymbian.h
--- a/camerauis/cameraxui/cxengine/inc/cxevideocapturecontrolsymbian.h Fri Apr 16 14:51:30 2010 +0300
+++ b/camerauis/cameraxui/cxengine/inc/cxevideocapturecontrolsymbian.h Thu May 13 21:30:19 2010 +0300
@@ -22,7 +22,6 @@
#include
#include
#include
-#include
#include "cxesettings.h"
#include "cxequalitypresets.h"
@@ -33,26 +32,6 @@
#include "cxenamespace.h"
-// constants
-const TInt KOneSecond = 1000000;
-
-//CamCControllerCustomCommands.h.
-
-// Controller UId, can be used by the client to identify the controller, e.g. if the custom command can be used
-const TUid KCamCControllerImplementationUid = {0x101F8503};
-const int KMaintainAspectRatio = false;
-// TMMFEvent UIDs for Async stop
-const TUid KCamCControllerCCVideoRecordStopped = {0x2000E546};
-const TUid KCamCControllerCCVideoFileComposed = {0x2000E547};
-
-// Custom command for setting a new filename without closing & reopening the controller
-enum TCamCControllerCustomCommands
- {
- ECamCControllerCCNewFilename = 0,
- ECamCControllerCCVideoStopAsync
- };
-
-
// forward declarations
class CxeSettings;
class CxeCameraDevice;
@@ -63,6 +42,7 @@
class CxeSoundPlayerSymbian;
class CxeCameraDeviceControl;
class CxeVideoRecorderUtility;
+class CxeDiskMonitor;
class CxeVideoCaptureControlSymbian : public CxeVideoCaptureControl,
@@ -73,12 +53,13 @@
public: // constructors
- CxeVideoCaptureControlSymbian( CxeCameraDevice &cameraDevice,
- CxeViewfinderControl &viewfinderControl,
- CxeCameraDeviceControl &cameraDeviceControl,
- CxeFilenameGenerator &nameGenerator,
- CxeSettings &settings,
- CxeQualityPresets &qualityPresets);
+ CxeVideoCaptureControlSymbian(CxeCameraDevice &cameraDevice,
+ CxeViewfinderControl &viewfinderControl,
+ CxeCameraDeviceControl &cameraDeviceControl,
+ CxeFilenameGenerator &nameGenerator,
+ CxeSettings &settings,
+ CxeQualityPresets &qualityPresets,
+ CxeDiskMonitor &diskMonitor);
virtual ~CxeVideoCaptureControlSymbian();
@@ -127,6 +108,10 @@
void handleCameraEvent(int eventUid, int error);
// settings call back
void handleSettingValueChanged(const QString& settingId,QVariant newValue);
+ // scene mode change
+ void handleSceneChanged(CxeScene& scene);
+ // Disk space change
+ void handleDiskSpaceChanged();
private: // helper methods
CxeError::Id findVideoController(const TDesC8& aMimeType, const TDesC& aPreferredSupplier);
@@ -136,7 +121,7 @@
int prepareVideoSnapshot();
void initVideoRecorder();
void open();
- void prepare();
+ void prepare();
TSize getSnapshotSize() const;
virtual void createVideoRecorder();
void calculateRemainingTime(CxeVideoDetails videoDetails, int &time);
@@ -159,6 +144,7 @@
CxeFilenameGenerator &mFilenameGenerator;
CxeSettings &mSettings;
CxeQualityPresets &mQualityPresets;
+ CxeDiskMonitor &mDiskMonitor;
//! Snapshot image.
QPixmap mSnapshot;
//! Soundplayers, own
diff -r d9aefe59d544 -r 3075d9b614e6 camerauis/cameraxui/cxengine/src/cxeautofocuscontrolsymbian.cpp
--- a/camerauis/cameraxui/cxengine/src/cxeautofocuscontrolsymbian.cpp Fri Apr 16 14:51:30 2010 +0300
+++ b/camerauis/cameraxui/cxengine/src/cxeautofocuscontrolsymbian.cpp Thu May 13 21:30:19 2010 +0300
@@ -52,6 +52,7 @@
initializeStates();
+ OstTrace0(camerax_performance, CXEAUTOFOCUSCONTROLSYMBIAN_CREATE_MID1, "msg: e_CX_ENGINE_CONNECT_SIGNALS 1");
// connect signals from cameraDevice, so we recieve events when camera reference changes
QObject::connect( &cameraDevice,
SIGNAL(prepareForCameraDelete()),
@@ -64,6 +65,7 @@
QObject::connect( &cameraDevice,
SIGNAL(prepareForRelease()),
this,SLOT(prepareForRelease()) );
+ OstTrace0(camerax_performance, CXEAUTOFOCUSCONTROLSYMBIAN_CREATE_MID2, "msg: e_CX_ENGINE_CONNECT_SIGNALS 0");
initializeResources();
@@ -84,11 +86,14 @@
/*
* Start Autofocus
+* \param soundEnabled False if the auto focus sound don't need to be played
+* Default value for soundEnabled is true
*/
-CxeError::Id CxeAutoFocusControlSymbian::start()
+CxeError::Id CxeAutoFocusControlSymbian::start(bool soundEnabled)
{
- CX_DEBUG( ("CxeAutoFocusControlSymbian::start() <> state: %d", state() ) );
-
+ CX_DEBUG( ("CxeAutoFocusControlSymbian::start() <> state: %d, sound enabled: %d",
+ state(), soundEnabled ) );
+ mSoundEnabled = soundEnabled;
int err = KErrNone;
CX_ASSERT_ALWAYS(mAdvancedSettings);
@@ -104,7 +109,6 @@
}
CX_DEBUG( ("CxeAutoFocusControlSymbian::start() <= err : %d", err ) );
-
return CxeErrorHandlingSymbian::map(err);
}
@@ -199,7 +203,8 @@
// We're only interested in autofocus events
if ( eventUid == KUidECamEventCameraSettingsOptimalFocusUidValue ||
- eventUid == KUidECamEventCameraSettingAutoFocusType2UidValue ) {
+ eventUid == KUidECamEventCameraSettingAutoFocusType2UidValue ||
+ eventUid == KUidECamEventCameraSettingFocusRangeUidValue) {
// Autofocus Event handle it.
handleAfEvent(eventUid, error);
}
@@ -410,6 +415,13 @@
} else {
setState(CxeAutoFocusControl::Failed, 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);
+ }
}
break;
}
@@ -433,6 +445,16 @@
break;
} // end switch
+ CX_DEBUG_EXIT_FUNCTION();
+}
+
+/*!
+ * Public method for checking if auto focus sound is enabled
+ * \return true if enabled
+ */
+bool CxeAutoFocusControlSymbian::isSoundEnabled() const
+{
+ return mSoundEnabled;
}
// end of file
diff -r d9aefe59d544 -r 3075d9b614e6 camerauis/cameraxui/cxengine/src/cxecameradevice.cpp
--- a/camerauis/cameraxui/cxengine/src/cxecameradevice.cpp Fri Apr 16 14:51:30 2010 +0300
+++ b/camerauis/cameraxui/cxengine/src/cxecameradevice.cpp Thu May 13 21:30:19 2010 +0300
@@ -20,8 +20,14 @@
#include "cxecameradevice.h"
#include "cxeerrormappingsymbian.h"
#include "cxutils.h"
+#include "cxedummycamera.h"
-#include "cxedummycamera.h"
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "cxecameradeviceTraces.h"
+#endif
+
+
CxeCameraDevice::CxeCameraDevice() :
mCamera(NULL),
@@ -184,6 +190,8 @@
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");
+
CX_DEBUG(("Cxe: using camera index %d", cameraIndex));
CX_DEBUG_ASSERT(cameraIndex == Cxe::PrimaryCameraIndex || cameraIndex == Cxe::SecondaryCameraIndex);
@@ -202,6 +210,7 @@
setCamera(camera);
}
+ OstTrace0(camerax_performance, CXECAMERADEVICE_NEWCAMERA_OUT, "msg: e_CX_CAMERADEVICE_CREATE_CCAMERA 0");
CX_DEBUG_EXIT_FUNCTION();
return CxeErrorHandlingSymbian::map(err);
}
diff -r d9aefe59d544 -r 3075d9b614e6 camerauis/cameraxui/cxengine/src/cxediskmonitor.cpp
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/camerauis/cameraxui/cxengine/src/cxediskmonitor.cpp Thu May 13 21:30:19 2010 +0300
@@ -0,0 +1,93 @@
+/*
+* 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 "cxutils.h"
+#include "cxediskmonitor.h"
+#include "cxediskmonitorprivate.h"
+
+/*!
+* Constructor.
+*/
+CxeDiskMonitor::CxeDiskMonitor(CxeSettings &settings)
+{
+ CX_DEBUG_ENTER_FUNCTION();
+ p = new CxeDiskMonitorPrivate(settings);
+ CX_ASSERT_ALWAYS(p);
+ CX_DEBUG_EXIT_FUNCTION();
+}
+
+/*!
+* Destructor.
+*/
+CxeDiskMonitor::~CxeDiskMonitor()
+{
+ delete p;
+}
+
+/*!
+* Set the warning level of free disk space.
+* When free disk space falls below this limit, diskSpaceLow() signal is emitted.
+* @param bytes Limit in bytes.
+*/
+void CxeDiskMonitor::setLowWarningLevel(qint64 bytes)
+{
+ if (p) {
+ p->setLowWarningLevel(bytes);
+ }
+}
+
+/*!
+* Slot to start monitoring disk space.
+*/
+void CxeDiskMonitor::start()
+{
+ if (p) {
+ connect(p, SIGNAL(diskSpaceLow()), this, SIGNAL(diskSpaceLow()), Qt::UniqueConnection);
+ connect(p, SIGNAL(diskSpaceChanged()), this, SIGNAL(diskSpaceChanged()), Qt::UniqueConnection);
+ p->start();
+ }
+}
+
+/*!
+* Slot to stop monitoring disk space.
+*/
+void CxeDiskMonitor::stop()
+{
+ if (p) {
+ p->stop();
+ disconnect(p, SIGNAL(diskSpaceChanged()), this, SIGNAL(diskSpaceChanged()));
+ disconnect(p, SIGNAL(diskSpaceLow()), this, SIGNAL(diskSpaceLow()));
+ }
+}
+
+/*!
+* Is monitoring ongoing at the moment.
+*/
+bool CxeDiskMonitor::isMonitoring() const
+{
+ return p ? p->isMonitoring() : false;
+}
+
+/*!
+* Get free disk space for Camera use in bytes.
+*/
+qint64 CxeDiskMonitor::free(bool cached) const
+{
+ return p ? p->free(cached) : 0;
+}
+
+// end of file
diff -r d9aefe59d544 -r 3075d9b614e6 camerauis/cameraxui/cxengine/src/cxediskmonitorprivate.cpp
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/camerauis/cameraxui/cxengine/src/cxediskmonitorprivate.cpp Thu May 13 21:30:19 2010 +0300
@@ -0,0 +1,155 @@
+/*
+* 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 // Compiler flags, keep first
+#ifdef Q_OS_SYMBIAN
+#include
+#endif // Q_OS_SYMBIAN
+#include "cxutils.h"
+#include "cxesysutil.h"
+#include "cxesettings.h"
+#include "cxediskmonitor.h"
+#include "cxediskmonitorprivate.h"
+
+
+namespace
+{
+ const int MONITORING_INTERVAL = 2*1000; // in milliseconds
+ const int UNKNOWN = -1;
+}
+
+
+/*!
+* Constructor.
+*/
+CxeDiskMonitorPrivate::CxeDiskMonitorPrivate(CxeSettings &settings)
+ : mSettings(settings),
+ mTimer(),
+#ifdef Q_OS_SYMBIAN
+ mFs(CCoeEnv::Static()->FsSession()),
+ mCameraDrive(CxeSysUtil::getCameraDrive(mFs)),
+#endif // Q_OS_SYMBIAN
+ mTriggerLevelBytes(UNKNOWN),
+ mLatestFreeBytes(UNKNOWN)
+{
+ CX_DEBUG_ENTER_FUNCTION();
+ CX_DEBUG_EXIT_FUNCTION();
+}
+
+/*!
+* Destructor.
+*/
+CxeDiskMonitorPrivate::~CxeDiskMonitorPrivate()
+{
+ CX_DEBUG_ENTER_FUNCTION();
+ stop();
+ CX_DEBUG_EXIT_FUNCTION();
+}
+
+/*!
+* Slot for checking if the available disk space is below warning trigger level.
+*/
+void CxeDiskMonitorPrivate::checkSpace()
+{
+ CX_DEBUG_ENTER_FUNCTION();
+
+ qint64 previousFree(mLatestFreeBytes);
+
+ // Get the current free space.
+ mLatestFreeBytes = free(false);
+
+ // TESTING >>>
+ /*
+ static qint64 TEST = 20*1000*1000;
+ TEST /= 2;
+ mLatestFreeBytes = TEST;
+ */
+ // <<< TESTING
+
+ // If space has changed during monitoring, signal it now.
+ if (previousFree != mLatestFreeBytes && isMonitoring()) {
+ CX_DEBUG(("CxeDiskMonitorPrivate - Disk space changed %d -> %d bytes", previousFree, mLatestFreeBytes));
+ emit diskSpaceChanged();
+ }
+
+ // Only emit warning if trigger level is set to some positive value.
+ // Otherwise updating cached free space value is enough.
+ if (mTriggerLevelBytes != UNKNOWN && mLatestFreeBytes < mTriggerLevelBytes) {
+ CX_DEBUG(("[WARNING] CxeDiskMonitorPrivate - Disk space low!"));
+ emit diskSpaceLow();
+ }
+
+ CX_DEBUG_EXIT_FUNCTION();
+}
+
+/*!
+* Set the warning level of free disk space.
+* When free disk space falls below this limit, diskSpaceLow() signal is emitted.
+* @param bytes Limit in bytes.
+*/
+void CxeDiskMonitorPrivate::setLowWarningLevel(qint64 bytes)
+{
+ mTriggerLevelBytes = bytes;
+}
+
+/*!
+* Start monitoring disk space.
+*/
+void CxeDiskMonitorPrivate::start()
+{
+ if (!mTimer.isActive()) {
+ connect(&mTimer, SIGNAL(timeout()), this, SLOT(checkSpace()), Qt::UniqueConnection);
+ mTimer.start(MONITORING_INTERVAL);
+ }
+}
+
+/*!
+* Stop monitoring disk space.
+*/
+void CxeDiskMonitorPrivate::stop()
+{
+ mTimer.stop();
+ mLatestFreeBytes = UNKNOWN;
+}
+
+/*!
+* Is monitoring ongoing at the moment.
+*/
+bool CxeDiskMonitorPrivate::isMonitoring() const
+{
+ return mTimer.isActive();
+}
+
+/*!
+* Get free disk space for Camera use in bytes.
+* @param cached Can cached value be used.
+* If true (default value), value of last constant-interval-check is used (if it exists).
+* If false (or there's no cached value), forced reading of free space is done now.
+* This may cause significant delay compared to returning cached value.
+*/
+qint64 CxeDiskMonitorPrivate::free(bool cached) const
+{
+ qint64 value(0);
+ if (cached && mLatestFreeBytes != UNKNOWN) {
+ value = mLatestFreeBytes;
+ } else {
+ value = CxeSysUtil::spaceAvailable(mFs, mCameraDrive, mSettings);
+ }
+ return value;
+}
+
+// end of file
diff -r d9aefe59d544 -r 3075d9b614e6 camerauis/cameraxui/cxengine/src/cxeengine.cpp
--- a/camerauis/cameraxui/cxengine/src/cxeengine.cpp Fri Apr 16 14:51:30 2010 +0300
+++ b/camerauis/cameraxui/cxengine/src/cxeengine.cpp Thu May 13 21:30:19 2010 +0300
@@ -26,7 +26,6 @@
CX_DEBUG_ENTER_FUNCTION();
CxeEngineSymbian *res = new CxeEngineSymbian();
- res->construct();
CX_DEBUG_EXIT_FUNCTION();
return res;
diff -r d9aefe59d544 -r 3075d9b614e6 camerauis/cameraxui/cxengine/src/cxeenginesymbian.cpp
--- a/camerauis/cameraxui/cxengine/src/cxeenginesymbian.cpp Fri Apr 16 14:51:30 2010 +0300
+++ b/camerauis/cameraxui/cxengine/src/cxeenginesymbian.cpp Thu May 13 21:30:19 2010 +0300
@@ -14,6 +14,9 @@
* Description:
*
*/
+
+#include
+
#include "cxeenginesymbian.h"
#include "cxecameradevicecontrolsymbian.h"
#include "cxestillcapturecontrolsymbian.h"
@@ -33,17 +36,20 @@
#include "cxesensoreventhandlersymbian.h"
#include "cxefilesavethread.h"
#include "cxecameradevice.h"
+#include "cxememorymonitor.h"
+#include "cxediskmonitor.h"
#include "OstTraceDefinitions.h"
#ifdef OST_TRACE_COMPILER_IN_USE
#include "cxeenginesymbianTraces.h"
#endif
-#include
+
// Member Functions
CxeEngineSymbian::CxeEngineSymbian()
: mCameraDeviceControl(NULL),
+ mCameraDevice(NULL),
mViewfinderControl(NULL),
mStillCaptureControl(NULL),
mVideoCaptureControl(NULL),
@@ -58,7 +64,25 @@
mQualityPresets(NULL),
mFileSaveThread(NULL)
{
- CX_DEBUG_IN_FUNCTION();
+ CX_DEBUG_ENTER_FUNCTION();
+
+ // Do secondary construction during reserve call.
+ //! @todo temporarily commented as part of a hack to change the startup sequence
+ // to avoid GOOM issues
+ // connect(this, SIGNAL(reserveStarted()), this, SLOT(construct()));
+
+ CxeCameraDeviceControlSymbian *deviceControl = new CxeCameraDeviceControlSymbian();
+ mCameraDeviceControl = deviceControl;
+ mCameraDevice = deviceControl->cameraDevice();
+ CX_ASSERT_ALWAYS(mCameraDeviceControl);
+ CX_ASSERT_ALWAYS(mCameraDevice);
+
+ mCameraDeviceControl->init();
+ //! @todo calling construct here is a hack to change the startup sequence
+ // to avoid GOOM issues
+ construct();
+
+ CX_DEBUG_EXIT_FUNCTION();
}
@@ -77,69 +101,77 @@
/*!
- Create all control classes
+ Create all control classes.
+ Note: Throws an error, if free memory request by CxeMemoryMonitor constructor fails!
*/
void CxeEngineSymbian::createControls()
{
CX_DEBUG_ENTER_FUNCTION();
- if (!mVideoCaptureControl) {
- CxeCameraDeviceControlSymbian *deviceControl =
- new CxeCameraDeviceControlSymbian();
+ // Check we do this only once.
+ if (!mSettingsModel) {
+ OstTrace0(camerax_performance, CXEENGINESYMBIAN_CREATECONTROLS_IN, "e_CX_ENGINE_CREATE_CONTROLS 1");
- mCameraDeviceControl = deviceControl;
- CxeCameraDevice *cameraDevice = deviceControl->cameraDevice();
-
- CxeSettingsCenRepStore *settingsStore;
-
+ CxeSettingsCenRepStore *settingsStore(NULL);
if (XQServiceUtil::isService()) {
settingsStore = new CxeSettingsLocalStore();
} else {
settingsStore = new CxeSettingsCenRepStore();
}
-
//ownership of settings store transferred to the settings model.
- mSettingsModel = new CxeSettingsModelImp(
- settingsStore);
-
+ mSettingsModel = new CxeSettingsModelImp(settingsStore);
// assert if settings model fails to intialize
CX_DEBUG_ASSERT(mSettingsModel);
+
mSettings = new CxeSettingsImp(*mSettingsModel);
-
+
+ //! @todo a temporary hack to change the startup sequence to avoid GOOM problems
+ static_cast(mSettings)->loadSettings(mode());
+
+
+ // Connect P&S key updates to settings signal.
connect(settingsStore, SIGNAL(settingValueChanged(long int, unsigned long int, QVariant)),
mSettings, SIGNAL(settingValueChanged(long int, unsigned long int, QVariant)));
+ mFeatureManager = new CxeFeatureManagerImp(*mSettingsModel);
+
+ // Memory monitor needed as early as possible to request free memory.
+ // Note: Throws error if enough memory cannot be freed!
+ mMemoryMonitor = new CxeMemoryMonitor(*mFeatureManager);
+
+ mDiskMonitor = new CxeDiskMonitor(*mSettings);
+
mQualityPresets = new CxeQualityPresetsSymbian(*mSettings);
CX_DEBUG_ASSERT(mQualityPresets);
- mFeatureManager = new CxeFeatureManagerImp(*mSettingsModel);
-
// sensor event handler initialization
mSensorEventHandler = new CxeSensorEventHandlerSymbian();
mFilenameGenerator = new CxeFilenameGeneratorSymbian(*mSettings,
mode());
- mViewfinderControl = new CxeViewfinderControlSymbian(*cameraDevice,
- *deviceControl);
+ mViewfinderControl = new CxeViewfinderControlSymbian(*mCameraDevice,
+ *mCameraDeviceControl);
- mAutoFocusControl = new CxeAutoFocusControlSymbian(*cameraDevice);
+ mAutoFocusControl = new CxeAutoFocusControlSymbian(*mCameraDevice);
mFileSaveThread = CxeFileSaveThreadFactory::createFileSaveThread();
mStillCaptureControl = new CxeStillCaptureControlSymbian(
- *cameraDevice, *mViewfinderControl, *deviceControl,
+ *mCameraDevice, *mViewfinderControl, *mCameraDeviceControl,
*mFilenameGenerator, *mSensorEventHandler, *mAutoFocusControl,
- *mSettings, *mQualityPresets, *mFileSaveThread);
+ *mSettings, *mQualityPresets, *mFileSaveThread, *mDiskMonitor);
- mZoomControl = new CxeZoomControlSymbian( *cameraDevice,
- *deviceControl, *mSettings, *mFeatureManager);
+ mZoomControl = new CxeZoomControlSymbian( *mCameraDevice,
+ *mCameraDeviceControl, *mSettings, *mFeatureManager);
mVideoCaptureControl = new CxeVideoCaptureControlSymbian(
- *cameraDevice, *mViewfinderControl, *deviceControl,
- *mFilenameGenerator, *mSettings, *mQualityPresets);
+ *mCameraDevice, *mViewfinderControl, *mCameraDeviceControl,
+ *mFilenameGenerator, *mSettings, *mQualityPresets, *mDiskMonitor);
- mSettingsControl = new CxeSettingsControlSymbian(*cameraDevice, *mSettings);
+ mSettingsControl = new CxeSettingsControlSymbian(*mCameraDevice, *mSettings);
+
+ OstTrace0(camerax_performance, CXEENGINESYMBIAN_CREATECONTROLS_OUT, "e_CX_ENGINE_CREATE_CONTROLS 0");
}
CX_DEBUG_EXIT_FUNCTION();
@@ -151,6 +183,7 @@
void CxeEngineSymbian::connectSignals()
{
CX_DEBUG_ENTER_FUNCTION();
+ OstTrace0(camerax_performance, CXEENGINESYMBIAN_CONNECTSIGNALS_IN, "e_CX_ENGINE_CONNECT_SIGNALS 1");
// enabling scene setting change callbacks to Autofocus control
connect(mSettings,
@@ -219,11 +252,7 @@
mFileSaveThread,
SLOT(handleSnapshotReady(CxeError::Id, const QPixmap&, const QString&)));
-
-
- // init camera device control. We init the camera device control
- // when all necessary engine classes are constructed.
- mCameraDeviceControl->init();
+ OstTrace0(camerax_performance, CXEENGINESYMBIAN_CONNECTSIGNALS_OUT, "e_CX_ENGINE_CONNECT_SIGNALS 0");
CX_DEBUG_EXIT_FUNCTION();
}
@@ -239,6 +268,8 @@
delete mVideoCaptureControl;
delete mViewfinderControl;
delete mFilenameGenerator;
+ delete mDiskMonitor;
+ delete mMemoryMonitor;
delete mFeatureManager;
delete mSettings;
delete mSettingsModel;
@@ -292,11 +323,19 @@
}
-CxeFeatureManager& CxeEngineSymbian::featureManager()
+CxeFeatureManager &CxeEngineSymbian::featureManager()
{
return *mFeatureManager;
}
+/*!
+* Get memory monitor utility handle.
+*/
+CxeMemoryMonitor &CxeEngineSymbian::memoryMonitor()
+{
+ return *mMemoryMonitor;
+}
+
/*
* Returns true, if the engine is ready or else false.
*/
@@ -325,7 +364,7 @@
void CxeEngineSymbian::doInit()
{
CX_DEBUG_ENTER_FUNCTION();
- OstTrace0(camerax_performance, CXEENGINESYMBIAN_DOINIT, "e_CX_ENGINE_DO_INIT 1");
+ OstTrace0(camerax_performance, CXEENGINESYMBIAN_DOINIT_IN, "e_CX_ENGINE_DO_INIT 1");
mFilenameGenerator->init(mode());
// load settings whenever we change mode or start camera or switch camera
@@ -343,7 +382,7 @@
mVideoCaptureControl->init();
}
- OstTrace0(camerax_performance, DUP1_CXEENGINESYMBIAN_DOINIT, "e_CX_ENGINE_DO_INIT 0");
+ OstTrace0(camerax_performance, CXEENGINESYMBIAN_DOINIT_OUT, "e_CX_ENGINE_DO_INIT 0");
CX_DEBUG_EXIT_FUNCTION();
}
@@ -429,7 +468,7 @@
// Camera needs to be reserved. Initialization will continue
// when we get the deviceReady() signal.
CX_DEBUG(("initMode() - calling reserve()"));
- mCameraDeviceControl->reserve();
+ reserve();
} else if (initNeeded()) {
// Camera is reserved and ready, but we need to prepare still image control or
// video capture control
@@ -455,7 +494,7 @@
if (reserveNeeded()) {
CX_DEBUG(("initMode() - calling reserve()"));
- mCameraDeviceControl->reserve();
+ reserve();
} else if (mCameraDeviceControl->state() == CxeCameraDeviceControl::Ready) {
CX_DEBUG(("initMode() - calling doInit()"));
// Camera device is ready... we only need to prepare video or still
@@ -472,4 +511,12 @@
CX_DEBUG_EXIT_FUNCTION();
}
+void CxeEngineSymbian::reserve()
+{
+ CX_DEBUG_ENTER_FUNCTION();
+ mCameraDeviceControl->reserve();
+ emit reserveStarted();
+ CX_DEBUG_EXIT_FUNCTION();
+}
+
// End of file
diff -r d9aefe59d544 -r 3075d9b614e6 camerauis/cameraxui/cxengine/src/cxememorymonitor.cpp
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/camerauis/cameraxui/cxengine/src/cxememorymonitor.cpp Thu May 13 21:30:19 2010 +0300
@@ -0,0 +1,72 @@
+/*
+* 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 "cxememorymonitor.h"
+#include "cxememorymonitorprivate.h"
+
+/*!
+* Constructor
+*/
+CxeMemoryMonitor::CxeMemoryMonitor(CxeFeatureManager &features)
+{
+ p = new CxeMemoryMonitorPrivate(features);
+}
+
+/*!
+* Destructor
+*/
+CxeMemoryMonitor::~CxeMemoryMonitor()
+{
+ delete p;
+}
+
+/*!
+* Get the amount of free memory (RAM).
+* @return Free RAM in bytes.
+*/
+int CxeMemoryMonitor::free() const
+{
+ return p->free();
+}
+
+/*!
+* Request to free memory (RAM) to achieve asked level.
+* @param required Required free memory after this call.
+* @return Was it possible to achieve the required level of free memory.
+*/
+bool CxeMemoryMonitor::requestFreeMemory(int required)
+{
+ return p->requestFreeMemory(required);
+}
+
+/*!
+* Slot to start monitoring free memory.
+*/
+void CxeMemoryMonitor::startMonitoring()
+{
+ p->startMonitoring();
+}
+
+/*!
+* Slot to stop monitoring free memory.
+*/
+void CxeMemoryMonitor::stopMonitoring()
+{
+ p->stopMonitoring();
+}
+
+// end of file
diff -r d9aefe59d544 -r 3075d9b614e6 camerauis/cameraxui/cxengine/src/cxememorymonitorprivate.cpp
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/camerauis/cameraxui/cxengine/src/cxememorymonitorprivate.cpp Thu May 13 21:30:19 2010 +0300
@@ -0,0 +1,147 @@
+/*
+* 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
+
+#include "cxutils.h"
+#include "cxenamespace.h"
+#include "cxefeaturemanager.h"
+#include "cxememorymonitorprivate.h"
+
+namespace
+{
+ const int FREEING_RETRIES = 2;
+ const int MONITORING_INTERVAL = 10*1000; // in milliseconds
+}
+
+/*!
+* Constructor
+*/
+CxeMemoryMonitorPrivate::CxeMemoryMonitorPrivate(CxeFeatureManager &features)
+ : mFeatures(features)
+{
+ CX_DEBUG_ENTER_FUNCTION();
+
+ mFeatures.configuredValues(CxeRuntimeKeys::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)));
+
+#ifdef Q_OS_SYMBIAN
+ // Request free memory as defined in Feature Manager.
+ // If we cannot have enough free memory, throw error.
+ bool ok = requestFreeMemory(mLevels.value(Cxe::FreeMemoryTarget));
+ qt_symbian_throwIfError(ok ? KErrNone : KErrNoMemory);
+#endif // Q_OS_SYMBIAN
+
+ CX_DEBUG_EXIT_FUNCTION();
+}
+
+/*!
+* Destructor
+*/
+CxeMemoryMonitorPrivate::~CxeMemoryMonitorPrivate()
+{
+ CX_DEBUG_ENTER_FUNCTION();
+ stopMonitoring();
+ CX_DEBUG_EXIT_FUNCTION();
+}
+
+
+/*!
+* Get the amount of free memory (RAM).
+* @return Free RAM in bytes.
+*/
+int CxeMemoryMonitorPrivate::free() const
+{
+#ifdef Q_OS_SYMBIAN
+ int ram(0);
+ HAL::Get(HALData::EMemoryRAMFree, ram);
+ return ram;
+#else
+ //!@todo: real implementation for desktop etc?
+ return 1024*1024*1024;
+#endif // Q_OS_SYMBIAN
+}
+
+
+/*!
+* Request to free memory (RAM) to achieve asked level.
+* @param required Required free memory after this call.
+* @return Was it possible to achieve the required level of free memory.
+*/
+bool CxeMemoryMonitorPrivate::requestFreeMemory(int required)
+{
+ CX_DEBUG_ENTER_FUNCTION();
+
+ if (free() < required) {
+#ifdef Q_OS_SYMBIAN
+ qt_symbian_throwIfError(mOomMonitor.Connect());
+
+ int i(0);
+ int status(KErrGeneral);
+ do {
+ status = mOomMonitor.RequestFreeMemory(required);
+ } while (status != KErrNone && ++i < FREEING_RETRIES);
+
+ mOomMonitor.Close();
+#endif // Q_OS_SYMBIAN
+ }
+
+ // If we have the free RAM we were asked for, all good.
+ bool ok = free() >= required;
+
+ CX_DEBUG_EXIT_FUNCTION();
+ return ok;
+}
+
+/*!
+* Start monitoring free memory.
+*/
+void CxeMemoryMonitorPrivate::startMonitoring()
+{
+ if (!mTimer.isActive()) {
+ connect(&mTimer, SIGNAL(timeout()), this, SLOT(checkMemory()), Qt::UniqueConnection);
+ mTimer.start(MONITORING_INTERVAL);
+ }
+}
+
+/*!
+* Stop monitoring free memory.
+*/
+void CxeMemoryMonitorPrivate::stopMonitoring()
+{
+ mTimer.stop();
+}
+
+/*!
+* Check free memory. Try to release memory if below trigger level.
+*/
+void CxeMemoryMonitorPrivate::checkMemory()
+{
+ CX_DEBUG_ENTER_FUNCTION();
+
+ if(free() < mLevels.value(Cxe::FreeMemoryTrigger)) {
+ // Memory too low, request more free memory.
+ CX_DEBUG(("[WARNING] CxeMemoryMonitorPrivate - memory low, requesting more.."));
+ requestFreeMemory(mLevels.value(Cxe::FreeMemoryTarget));
+ }
+ CX_DEBUG_EXIT_FUNCTION();
+}
+
+
+// end of file
diff -r d9aefe59d544 -r 3075d9b614e6 camerauis/cameraxui/cxengine/src/cxequalitypresetssymbian.cpp
--- a/camerauis/cameraxui/cxengine/src/cxequalitypresetssymbian.cpp Fri Apr 16 14:51:30 2010 +0300
+++ b/camerauis/cameraxui/cxengine/src/cxequalitypresetssymbian.cpp Thu May 13 21:30:19 2010 +0300
@@ -18,7 +18,7 @@
*/
#include // For Symbian types used in mmsenginedomaincrkeys.h
-#include
+#include
#include "cxutils.h"
#include "cxenamespace.h"
@@ -26,6 +26,10 @@
#include "cxequalitydetails.h"
#include "cxequalitypresetssymbian.h"
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "cxequalitypresetssymbianTraces.h"
+#endif
// constants
namespace
@@ -83,6 +87,7 @@
QList CxeQualityPresetsSymbian::imageQualityPresets(Cxe::CameraIndex cameraId)
{
CX_DEBUG_ENTER_FUNCTION();
+ OstTrace0(camerax_performance, CXEQUALITYPRESETSSYMBIAN_GETIMAGEPRESETS_IN, "msg: e_CX_QUALITYPRESETS_GETIMAGEPRESETS 1");
QList presetList;
@@ -127,6 +132,7 @@
delete levels;
levels = NULL;
+ OstTrace0(camerax_performance, CXEQUALITYPRESETSSYMBIAN_GETIMAGEPRESETS_OUT, "msg: e_CX_QUALITYPRESETS_GETIMAGEPRESETS 0");
CX_DEBUG_EXIT_FUNCTION();
return presetList;
}
@@ -142,6 +148,7 @@
QList CxeQualityPresetsSymbian::videoQualityPresets(Cxe::CameraIndex cameraId)
{
CX_DEBUG_ENTER_FUNCTION();
+ OstTrace0(camerax_performance, CXEQUALITYPRESETSSYMBIAN_GETVIDEOPRESETS_IN, "msg: e_CX_QUALITYPRESETS_GETVIDEOPRESETS 1");
QList presetList;
@@ -192,6 +199,7 @@
mIcm->GetCamcorderMMFPluginSettings(mmfPluginSettings);
mCMRAvgVideoBitRateScaler = mmfPluginSettings.iCMRAvgVideoBitRateScaler;
+ OstTrace0(camerax_performance, CXEQUALITYPRESETSSYMBIAN_GETVIDEOPRESETS_OUT, "msg: e_CX_QUALITYPRESETS_GETVIDEOPRESETS 0");
CX_DEBUG_EXIT_FUNCTION();
return presetList;
}
@@ -209,10 +217,11 @@
// set setting values from quality set
newPreset.mWidth = set.iImageWidth;
newPreset.mHeight = set.iImageHeight;
- newPreset.mImageFileExtension = toString(set.iImageFileExtension);
newPreset.mEstimatedSize = set.iEstimatedSize;
newPreset.mMpxCount = calculateMegaPixelCount(set.iImageWidth,
set.iImageHeight);
+ newPreset.mPossibleImages = CxeImageDetails::UNKNOWN;
+ newPreset.mImageFileExtension = toString(set.iImageFileExtension);
newPreset.mAspectRatio = calculateAspectRatio(set.iImageWidth,
set.iImageHeight);
@@ -231,6 +240,8 @@
newPreset.mWidth = set.iVideoWidth;
newPreset.mHeight = set.iVideoHeight;
+ newPreset.mRemainingTime = CxeVideoDetails::UNKNOWN;
+
// Check if this is a sharing (mms) quality, and set size limit accordingly.
if (set.iCamcorderVisible < MMS_QUALITY_CAMCORDERVISIBLE_LIMIT) {
QVariant size;
diff -r d9aefe59d544 -r 3075d9b614e6 camerauis/cameraxui/cxengine/src/cxesettingscenrepstore.cpp
--- a/camerauis/cameraxui/cxengine/src/cxesettingscenrepstore.cpp Fri Apr 16 14:51:30 2010 +0300
+++ b/camerauis/cameraxui/cxengine/src/cxesettingscenrepstore.cpp Thu May 13 21:30:19 2010 +0300
@@ -331,8 +331,8 @@
XQSettingsManager::TypeString,
true);
- addKeyMapping(CxeRuntimeKeys::CONTRAST_ITEMS,
- ContrastItemsCr,
+ addKeyMapping(CxeRuntimeKeys::FREE_MEMORY_LEVELS,
+ FreeMemoryLevelsCr,
XQSettingsManager::TypeString,
true);
diff -r d9aefe59d544 -r 3075d9b614e6 camerauis/cameraxui/cxengine/src/cxesettingscontrolsymbian.cpp
--- a/camerauis/cameraxui/cxengine/src/cxesettingscontrolsymbian.cpp Fri Apr 16 14:51:30 2010 +0300
+++ b/camerauis/cameraxui/cxengine/src/cxesettingscontrolsymbian.cpp Thu May 13 21:30:19 2010 +0300
@@ -73,6 +73,8 @@
updateSharpnessSetting(newValue);
} else if (settingId == CxeSettingIds::CONTRAST) {
updateContrastSetting(newValue);
+ } else if (settingId == CxeSettingIds::BRIGHTNESS) {
+ updateBrightnessSetting(newValue);
} else if (settingId == CxeSettingIds::EXPOSURE_MODE) {
updateExposureModeSetting(newValue);
} else if (settingId == CxeSettingIds::EV_COMPENSATION_VALUE) {
@@ -189,9 +191,9 @@
CX_ASSERT_ALWAYS(mCameraDevice.imageProcessor());
- // Scale UI values of -10..10 to ECAM range -100..100.
+ // Scale UI values of -2..2 to ECAM range -100..100.
int currentSharpness = mCameraDevice.imageProcessor()->TransformationValue(KUidECamEventImageProcessingAdjustSharpness);
- int newSharpness = newValue.toInt()*10;
+ 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));
@@ -215,9 +217,9 @@
CX_DEBUG_ENTER_FUNCTION();
CX_ASSERT_ALWAYS(mCameraDevice.imageProcessor());
- // Scale UI values of -10..10 to ECAM range -100..100.
+ // Scale UI values of -2..2 to ECAM range -100..100.
int currentContrast = mCameraDevice.imageProcessor()->TransformationValue(KUidECamEventImageProcessingAdjustContrast);
- int newContrast = newValue.toInt()*10;
+ 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));
@@ -233,6 +235,29 @@
/*!
*
*/
+void CxeSettingsControlSymbian::updateBrightnessSetting(QVariant newValue)
+{
+ CX_DEBUG_ENTER_FUNCTION();
+ 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;
+
+ 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_EXIT_FUNCTION();
+}
+
+/*!
+*
+*/
void CxeSettingsControlSymbian::updateExposureModeSetting(QVariant newValue)
{
CX_DEBUG_ENTER_FUNCTION();
diff -r d9aefe59d544 -r 3075d9b614e6 camerauis/cameraxui/cxengine/src/cxesettingsimp.cpp
--- a/camerauis/cameraxui/cxengine/src/cxesettingsimp.cpp Fri Apr 16 14:51:30 2010 +0300
+++ b/camerauis/cameraxui/cxengine/src/cxesettingsimp.cpp Thu May 13 21:30:19 2010 +0300
@@ -34,6 +34,10 @@
#include "cxenamespace.h"
#include "cxeerror.h"
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "cxesettingsimpTraces.h"
+#endif
@@ -44,6 +48,8 @@
void CxeSettingsImp::loadSettings(Cxe::CameraMode mode)
{
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);
@@ -54,6 +60,7 @@
emit sceneChanged(mSettingsModel.currentVideoScene());
}
+ OstTrace0(camerax_performance, CXESETTINGSIMP_LOADSETTINGS_OUT, "msg: e_CX_SETTINGS_LOADSETTINGS 0");
CX_DEBUG_EXIT_FUNCTION();
}
@@ -123,7 +130,7 @@
QVariant value;
CxeError::Id err = getSceneMode(key, stringValue);
-
+
if (err == CxeError::NotFound) {
// read from settings store
err = mSettingsModel.getSettingValue(key, value);
@@ -180,14 +187,14 @@
} else {
err = CxeError::NotFound;
}
-
- if (err == CxeError::None) {
+
+ 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;
@@ -244,7 +251,7 @@
key.toAscii().data(), newValue.toAscii().data()));
CxeError::Id err = setSceneMode(key, newValue);
-
+
if (err == CxeError::NotFound) {
// not scene mode setting, try setting value to settings store
mSettingsModel.set(key, newValue);
@@ -281,12 +288,12 @@
} else {
err = CxeError::NotFound;
}
-
+
if (err == CxeError::None) {
// scene mode set, inform clients about scene mode change
emit sceneChanged(scene);
}
-
+
CX_DEBUG_EXIT_FUNCTION();
return err;
diff -r d9aefe59d544 -r 3075d9b614e6 camerauis/cameraxui/cxengine/src/cxesettingsmappersymbian.cpp
--- a/camerauis/cameraxui/cxengine/src/cxesettingsmappersymbian.cpp Fri Apr 16 14:51:30 2010 +0300
+++ b/camerauis/cameraxui/cxengine/src/cxesettingsmappersymbian.cpp Thu May 13 21:30:19 2010 +0300
@@ -130,7 +130,7 @@
value = CCamera::CCameraAdvancedSettings::EFocusRangeMacro;
break;
case CxeAutoFocusControl::Portrait:
- value = CCamera::CCameraAdvancedSettings::EFocusRangePortrait;
+ value = CCamera::CCameraAdvancedSettings::EFocusRangeAuto;
break;
case CxeAutoFocusControl::Infinity:
value = CCamera::CCameraAdvancedSettings::EFocusRangeInfinite;
diff -r d9aefe59d544 -r 3075d9b614e6 camerauis/cameraxui/cxengine/src/cxesettingsmodelimp.cpp
--- a/camerauis/cameraxui/cxengine/src/cxesettingsmodelimp.cpp Fri Apr 16 14:51:30 2010 +0300
+++ b/camerauis/cameraxui/cxengine/src/cxesettingsmodelimp.cpp Thu May 13 21:30:19 2010 +0300
@@ -178,7 +178,7 @@
// If this is one of scene settings,
// store it as modification of current scene.
- CxeError::Id err = setSceneSettingValue(key, newValue.toInt());
+ CxeError::Id err = setSceneSettingValue(key, newValue);
CX_DEBUG(( "status storing to scene data: %d", err));
// If not scene specific, store the setting value.
@@ -240,14 +240,13 @@
CxeError::Id err = CxeError::None;
- mCurrentImgScene.clear();
-
// load the scene setting default values for the new scene id = "newScene"
CxeScene sceneSettings;
err = imageScene(newScene, sceneSettings);
// create of copy of the new scene as we use it for accessing the scene settings later.
if (CxeError::None == err) {
+ mCurrentImgScene.clear();
loadSceneData(mCurrentImgScene, sceneSettings);
}
@@ -267,14 +266,13 @@
CxeError::Id err = CxeError::None;
- mCurrentVidScene.clear();
-
// load the scene setting default values for the new scene id = "newScene"
CxeScene sceneSettings;
err = videoScene(newScene, sceneSettings);
// create of copy of the new scene as we use it for accessing the scene settings later.
if (CxeError::None == err) {
+ mCurrentVidScene.clear();
loadSceneData(mCurrentVidScene, sceneSettings);
}
@@ -380,7 +378,7 @@
/*
* set scene setting value associated with the key
*/
-CxeError::Id CxeSettingsModelImp::setSceneSettingValue(const QString &key, int newValue)
+CxeError::Id CxeSettingsModelImp::setSceneSettingValue(const QString &key, QVariant newValue)
{
CX_DEBUG_ENTER_FUNCTION();
@@ -416,7 +414,7 @@
runtimeKeys.append(CxeRuntimeKeys::PRIMARY_CAMERA_CAPTURE_KEYS);
runtimeKeys.append(CxeRuntimeKeys::PRIMARY_CAMERA_AUTOFOCUS_KEYS);
runtimeKeys.append(CxeRuntimeKeys::SECONDARY_CAMERA_CAPTURE_KEYS);
- runtimeKeys.append(CxeRuntimeKeys::CONTRAST_ITEMS);
+ runtimeKeys.append(CxeRuntimeKeys::FREE_MEMORY_LEVELS);
runtimeKeys.append(CxeRuntimeKeys::STILL_MAX_ZOOM_LIMITS);
runtimeKeys.append(CxeRuntimeKeys::VIDEO_MAX_ZOOM_LIMITS);
@@ -466,7 +464,7 @@
vidSceneLowLight.insert(CxeSettingIds::SCENE_ID, CxeSettingIds::VIDEO_SCENE_LOWLIGHT);
vidSceneLowLight.insert(CxeSettingIds::FOCAL_RANGE, CxeAutoFocusControl::Hyperfocal);
vidSceneLowLight.insert(CxeSettingIds::WHITE_BALANCE, WhitebalanceAutomatic);
- vidSceneLowLight.insert(CxeSettingIds::EXPOSURE_MODE, ExposureNight);
+ vidSceneLowLight.insert(CxeSettingIds::EXPOSURE_MODE, ExposureAuto);
vidSceneLowLight.insert(CxeSettingIds::COLOR_TONE, ColortoneNormal);
vidSceneLowLight.insert(CxeSettingIds::CONTRAST, 0);
vidSceneLowLight.insert(CxeSettingIds::FRAME_RATE, 15); //fps
diff -r d9aefe59d544 -r 3075d9b614e6 camerauis/cameraxui/cxengine/src/cxestatemachinebase.cpp
--- a/camerauis/cameraxui/cxengine/src/cxestatemachinebase.cpp Fri Apr 16 14:51:30 2010 +0300
+++ b/camerauis/cameraxui/cxengine/src/cxestatemachinebase.cpp Thu May 13 21:30:19 2010 +0300
@@ -20,7 +20,7 @@
#include "cxestate.h"
CxeStateMachineBase::CxeStateMachineBase( const char* stateMachineName ) :
- mStateId(0), mName(stateMachineName)
+ mStateBitsUsed(0), mStateId(0), mName(stateMachineName)
{
}
@@ -32,25 +32,14 @@
bool CxeStateMachineBase::addState( CxeState* state )
{
- bool success = true;
-
- if (!state) {
- // given parameter is null pointer
- success = false;
- } else {
- // Make sure any of the existing stateId don't have overlapping bits.
- // We need to be able to use bitwise AND operator for stateIds.
- QList stateIds = mStates.keys();
- foreach(int i, stateIds) {
- if ((i & state->stateId()) != 0) {
- success = false;
- break;
- }
- }
- }
+ bool success( state // non-null state object
+ && state->stateId() // state id is not zero
+ && !(mStateBitsUsed & state->stateId()) // no overlapping bits
+ );
// if no errors
if (success) {
+ mStateBitsUsed |= state->stateId();
mStates[state->stateId()] = state; // state is now owned by the state machine
}
diff -r d9aefe59d544 -r 3075d9b614e6 camerauis/cameraxui/cxengine/src/cxestillcapturecontrolsymbian.cpp
--- a/camerauis/cameraxui/cxengine/src/cxestillcapturecontrolsymbian.cpp Fri Apr 16 14:51:30 2010 +0300
+++ b/camerauis/cameraxui/cxengine/src/cxestillcapturecontrolsymbian.cpp Thu May 13 21:30:19 2010 +0300
@@ -16,6 +16,7 @@
*/
+#include
#include
#include
#include
@@ -29,7 +30,6 @@
#include "cxefilenamegenerator.h"
#include "cxefilesavethread.h"
#include "cxutils.h"
-#include "cxesysutil.h"
#include "cxecameradevicecontrol.h"
#include "cxecameradevice.h"
#include "cxesoundplayersymbian.h"
@@ -44,6 +44,7 @@
#include "cxesensoreventhandler.h"
#include "cxesensoreventhandler.h"
#include "cxequalitypresetssymbian.h"
+#include "cxediskmonitor.h"
#include "OstTraceDefinitions.h"
#ifdef OST_TRACE_COMPILER_IN_USE
@@ -60,34 +61,43 @@
* Constructor.
*/
CxeStillCaptureControlSymbian::CxeStillCaptureControlSymbian(
- CxeCameraDevice &cameraDevice,
- CxeViewfinderControl &viewfinderControl,
- CxeCameraDeviceControl &cameraDeviceControl,
- CxeFilenameGenerator &nameGenerator,
- CxeSensorEventHandler &sensorEventHandler,
- CxeAutoFocusControl &autoFocusControl,
- CxeSettings &settings,
- CxeQualityPresets &qualityPresets,
- CxeFileSaveThread &fileSaveThread)
-: CxeStateMachine("CxeStillCaptureControlSymbian"),
- mCameraDevice(cameraDevice),
- mViewfinderControl(viewfinderControl),
- mCameraDeviceControl(cameraDeviceControl),
- mFilenameGenerator(nameGenerator),
- mSensorEventHandler(sensorEventHandler),
- mAutoFocusControl(autoFocusControl),
- mSettings(settings),
- mQualityPresets(qualityPresets),
- mFileSaveThread(fileSaveThread),
- mMode(SingleImageCapture),
- mAfState(CxeAutoFocusControl::Unknown)
+ CxeCameraDevice &cameraDevice,
+ CxeViewfinderControl &viewfinderControl,
+ CxeCameraDeviceControl &cameraDeviceControl,
+ CxeFilenameGenerator &nameGenerator,
+ CxeSensorEventHandler &sensorEventHandler,
+ CxeAutoFocusControl &autoFocusControl,
+ CxeSettings &settings,
+ CxeQualityPresets &qualityPresets,
+ CxeFileSaveThread &fileSaveThread,
+ CxeDiskMonitor &diskMonitor)
+ : CxeStateMachine("CxeStillCaptureControlSymbian"),
+ mCameraDevice(cameraDevice),
+ mViewfinderControl(viewfinderControl),
+ mCameraDeviceControl(cameraDeviceControl),
+ mFilenameGenerator(nameGenerator),
+ mSensorEventHandler(sensorEventHandler),
+ mAutoFocusControl(autoFocusControl),
+ mSettings(settings),
+ mQualityPresets(qualityPresets),
+ mFileSaveThread(fileSaveThread),
+ mDiskMonitor(diskMonitor),
+ mMode(SingleImageCapture),
+ mAfState(CxeAutoFocusControl::Unknown)
{
CX_DEBUG_ENTER_FUNCTION();
+ OstTrace0(camerax_performance, CXESTILLCAPTURECONTROLSYMBIAN_CREATE_IN, "msg: e_CX_STILLCAPTURECONTROL_NEW 1");
qRegisterMetaType();
initializeStates();
reset();
+ // If camera is already allocated, call the slot ourselves.
+ if (mCameraDevice.camera()) {
+ handleCameraAllocated(CxeError::None);
+ }
+
+ OstTrace0(camerax_performance, CXESTILLCAPTURECONTROLSYMBIAN_CREATE_MID1, "msg: e_CX_ENGINE_CONNECT_SIGNALS 1");
// connect signals from cameraDevice to recieve events when camera reference changes
connect(&cameraDevice, SIGNAL(prepareForCameraDelete()),
this, SLOT(prepareForCameraDelete()));
@@ -110,10 +120,13 @@
connect(&mCameraDeviceControl, SIGNAL(cameraEvent(int,int)),
this, SLOT(handleCameraEvent(int,int)));
+ OstTrace0(camerax_performance, CXESTILLCAPTURECONTROLSYMBIAN_CREATE_MID2, "msg: e_CX_ENGINE_CONNECT_SIGNALS 0");
+
mImageDataQueue = new CxeImageDataQueueSymbian();
mAutoFocusSoundPlayer = new CxeSoundPlayerSymbian(CxeSoundPlayerSymbian::AutoFocus);
mCaptureSoundPlayer = new CxeSoundPlayerSymbian(CxeSoundPlayerSymbian::StillCapture);
+ OstTrace0(camerax_performance, CXESTILLCAPTURECONTROLSYMBIAN_CREATE_OUT, "msg: e_CX_STILLCAPTURECONTROL_NEW 0");
CX_DEBUG_EXIT_FUNCTION();
}
@@ -171,7 +184,7 @@
void CxeStillCaptureControlSymbian::init()
{
CX_DEBUG_ENTER_FUNCTION();
- OstTrace0(camerax_performance, CXESTILLCAPTURECONTROLSYMBIAN_INIT, "msg: e_CX_STILL_CAPCONT_INIT 1");
+ OstTrace0(camerax_performance, CXESTILLCAPTURECONTROLSYMBIAN_INIT_IN, "msg: e_CX_STILL_CAPCONT_INIT 1");
if (state() == Uninitialized) {
prepare();
@@ -179,7 +192,7 @@
mSensorEventHandler.init();
}
- OstTrace0(camerax_performance, DUP1_CXESTILLCAPTURECONTROLSYMBIAN_INIT, "msg: e_CX_STILL_CAPCONT_INIT 0");
+ OstTrace0(camerax_performance, CXESTILLCAPTURECONTROLSYMBIAN_INIT_OUT, "msg: e_CX_STILL_CAPCONT_INIT 0");
CX_DEBUG_EXIT_FUNCTION();
}
@@ -189,13 +202,18 @@
void CxeStillCaptureControlSymbian::deinit()
{
CX_DEBUG_ENTER_FUNCTION();
- OstTrace0( camerax_performance, CXESTILLCAPTURECONTROLSYMBIAN_DEINIT, "msg: e_CX_STILL_CAPCONT_DEINIT 1" );
if (state() == Uninitialized) {
// nothing to do
return;
}
+ OstTrace0( camerax_performance, CXESTILLCAPTURECONTROLSYMBIAN_DEINIT_IN, "msg: e_CX_STILL_CAPCONT_DEINIT 1" );
+
+ // Stop monitoring disk space.
+ mDiskMonitor.stop();
+ disconnect(&mDiskMonitor, SIGNAL(diskSpaceChanged()), this, SLOT(handleDiskSpaceChanged()));
+
//stop viewfinder
mViewfinderControl.stop();
@@ -211,7 +229,7 @@
}
setState(Uninitialized);
- OstTrace0( camerax_performance, DUP1_CXESTILLCAPTURECONTROLSYMBIAN_DEINIT, "msg: e_CX_STILL_CAPCONT_DEINIT 0" );
+ OstTrace0( camerax_performance, CXESTILLCAPTURECONTROLSYMBIAN_DEINIT_OUT, "msg: e_CX_STILL_CAPCONT_DEINIT 0" );
CX_DEBUG_EXIT_FUNCTION();
}
@@ -228,7 +246,7 @@
return;
}
- OstTrace0( camerax_performance, CXESTILLCAPTURECONTROLSYMBIAN_PREPARE, "msg: e_CX_STILLCAPCONT_PREPARE 1" );
+ OstTrace0( camerax_performance, CXESTILLCAPTURECONTROLSYMBIAN_PREPARE_IN, "msg: e_CX_STILLCAPCONT_PREPARE 1" );
int err = KErrNone;
CxeError::Id cxErr = getImageQualityDetails(mCurrentImageDetails);
@@ -253,9 +271,9 @@
// Prepare Image capture
CCamera::TFormat imgFormat = supportedStillFormat(mCameraDeviceControl.cameraIndex());
- OstTrace0(camerax_performance, DUP2_CXESTILLCAPTURECONTROLSYMBIAN_PREPARE, "msg: e_CX_PREPARE_IMAGE_CAPTURE 1");
+ OstTrace0(camerax_performance, CXESTILLCAPTURECONTROLSYMBIAN_PREPARE_MID1, "msg: e_CX_PREPARE_IMAGE_CAPTURE 1");
TRAP(err, mCameraDevice.camera()->PrepareImageCaptureL(imgFormat, ecamStillResolutionIndex));
- OstTrace0(camerax_performance, DUP3_CXESTILLCAPTURECONTROLSYMBIAN_PREPARE, "msg: e_CX_PREPARE_IMAGE_CAPTURE 0");
+ OstTrace0(camerax_performance, CXESTILLCAPTURECONTROLSYMBIAN_PREPARE_MID2, "msg: e_CX_PREPARE_IMAGE_CAPTURE 0");
CX_DEBUG(("PrepareImageCaptureL done, err=%d, resolution index = %d", err, ecamStillResolutionIndex));
@@ -268,18 +286,23 @@
}
if (!err) {
- MCameraFaceTracking *faceTracking = mCameraDevice.faceTracking();
- if (faceTracking) {
- // Enable AF reticule drawing by adaptation
- TRAP_IGNORE(faceTracking->EnableFaceIndicatorsL(ETrue));
- }
-
// 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();
+ // 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) {
+ TRAP_IGNORE(faceTracking->EnableFaceIndicatorsL(ETrue));
+ }
+
// Still capture and still snapshot are OK.
// We can safely set state to READY.
setState(Ready);
@@ -295,7 +318,7 @@
// Inform interested parties that image mode has been prepared for capture
emit imagePrepareComplete(CxeErrorHandlingSymbian::map(err));
- OstTrace0( camerax_performance, DUP1_CXESTILLCAPTURECONTROLSYMBIAN_PREPARE, "msg: e_CX_STILLCAPCONT_PREPARE 0" );
+ OstTrace0( camerax_performance, CXESTILLCAPTURECONTROLSYMBIAN_PREPARE_OUT, "msg: e_CX_STILLCAPCONT_PREPARE 0" );
CX_DEBUG_EXIT_FUNCTION();
}
@@ -410,16 +433,31 @@
CX_DEBUG_ENTER_FUNCTION();
CX_ASSERT_ALWAYS(mCameraDevice.camera());
- // Play the capture sound and start image capture
- mCaptureSoundPlayer->play();
-
- setState(Capturing);
+ // Start the image capture as fast as possible to minimize lag.
+ // Check e.g. space available *after* this.
mCameraDevice.camera()->CaptureImage();
- //! @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();
+ if (imagesLeft() > 0) {
+ mCaptureSoundPlayer->play();
+ setState(Capturing);
+
+ //! @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();
+ }
+ } else {
+ // There's no space for the image.
+ // Cancel started capturing.
+ mCameraDevice.camera()->CancelCaptureImage();
+
+ // Report error.
+ // Ui notification has anyway some delays, hence handling VF after this.
+ emit imageCaptured(CxeError::DiskFull, CxeStillImage::INVALID_ID);
+
+ // Capturing stops viewfinder, so restart it now.
+ mViewfinderControl.stop();
+ mViewfinderControl.start();
}
CX_DEBUG_EXIT_FUNCTION();
@@ -496,6 +534,7 @@
prepareFilename(stillImage);
}
+ OstTrace0( camerax_performance, DUP1_CXESTILLCAPTURECONTROLSYMBIAN_HANDLESNAPSHOTEVENT, "msg: e_CX_HANDLE_SNAPSHOT 0" );
CX_DEBUG_EXIT_FUNCTION();
}
@@ -553,7 +592,7 @@
/**
* handleImageData: Image data received from ECam
*/
-void CxeStillCaptureControlSymbian::handleImageData( MCameraBuffer* cameraBuffer, int error )
+void CxeStillCaptureControlSymbian::handleImageData(MCameraBuffer* cameraBuffer, int error)
{
CX_DEBUG_ENTER_FUNCTION();
@@ -641,6 +680,31 @@
CX_DEBUG_EXIT_FUNCTION();
}
+/*!
+* Disk space changed.
+* Emit remaining images changed signal, if space change affects it.
+*/
+void CxeStillCaptureControlSymbian::handleDiskSpaceChanged()
+{
+ CX_DEBUG_ENTER_FUNCTION();
+
+ // Ignore updates on other states.
+ if (state() == CxeStillCaptureControl::Ready) {
+
+ int images = calculateRemainingImages(mCurrentImageDetails.mEstimatedSize);
+
+ if (images != mCurrentImageDetails.mPossibleImages) {
+ CX_DEBUG(("CxeStillCaptureControlSymbian - available images changed %d -> %d",
+ mCurrentImageDetails.mPossibleImages, images));
+
+ mCurrentImageDetails.mPossibleImages = images;
+ emit availableImagesChanged();
+ }
+ }
+
+ CX_DEBUG_EXIT_FUNCTION();
+}
+
/**
* ECam reference changing, release resources
*/
@@ -843,19 +907,23 @@
/*!
* Slot to handle Autofocus events.
+* \param newState Indicates current state of the auto focus
+* \param error Contains possible error code
*/
void CxeStillCaptureControlSymbian::handleAutofocusStateChanged(
CxeAutoFocusControl::State newState,
- CxeError::Id /*error*/ )
+ CxeError::Id error )
{
CX_DEBUG_ENTER_FUNCTION();
+ Q_UNUSED(error);
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) {
+ mode != CxeAutoFocusControl::Infinity &&
+ mAutoFocusControl.isSoundEnabled()) {
mAutoFocusSoundPlayer->play();
}
CX_DEBUG_EXIT_FUNCTION();
@@ -917,7 +985,14 @@
*/
int CxeStillCaptureControlSymbian::imagesLeft()
{
- return calculateRemainingImages(mCurrentImageDetails.mEstimatedSize);
+ CX_DEBUG_ENTER_FUNCTION();
+
+ if (mCurrentImageDetails.mPossibleImages == CxeImageDetails::UNKNOWN) {
+ mCurrentImageDetails.mPossibleImages = calculateRemainingImages(mCurrentImageDetails.mEstimatedSize);
+ }
+
+ CX_DEBUG_EXIT_FUNCTION();
+ return mCurrentImageDetails.mPossibleImages;
}
@@ -932,19 +1007,12 @@
{
CX_DEBUG_ENTER_FUNCTION();
- //Check the memory in-use setting
- qint64 memoryfree = CxeSysUtil::spaceAvailable(CCoeEnv::Static()->FsSession(), mSettings);
-
- memoryfree = memoryfree - KMinRequiredSpaceImage;
-
- if (memoryfree < 0) {
- memoryfree = 0; // exception, inform ui
- }
- qint64 images = memoryfree / estimatedImagesize;
+ qint64 space = mDiskMonitor.free() - KMinRequiredSpaceImage;
+ int images = std::max(qint64(0), space / estimatedImagesize);
CX_DEBUG_EXIT_FUNCTION();
- return images;
+ return images;
}
// end of file
diff -r d9aefe59d544 -r 3075d9b614e6 camerauis/cameraxui/cxengine/src/cxesysutil.cpp
--- a/camerauis/cameraxui/cxengine/src/cxesysutil.cpp Fri Apr 16 14:51:30 2010 +0300
+++ b/camerauis/cameraxui/cxengine/src/cxesysutil.cpp Thu May 13 21:30:19 2010 +0300
@@ -137,20 +137,17 @@
/*!
* Return space available for Camera to use.
* @param fs File Server session
+* @param index Index for the drive to be checked.
* @param settings Camera settings instance
* @return Amount of bytes free for Camera usage.
*/
-qint64 CxeSysUtil::spaceAvailable(RFs &fs, CxeSettings &settings)
+qint64 CxeSysUtil::spaceAvailable(RFs &fs, int index, CxeSettings &settings)
{
CX_DEBUG_ENTER_FUNCTION();
qint64 freeSpace(0);
try {
- // Get drive index
- int index(getCameraDrive(fs));
- qt_symbian_throwIfError(index);
-
// Get volume info
TVolumeInfo volumeInfo;
int status(fs.Volume(volumeInfo, index));
@@ -169,7 +166,7 @@
settings.get(KCRUidDiskLevel.iUid, KDiskCriticalThreshold, Cxe::Repository, criticalThreshold);
// Calculate space that we can still use. A small safety buffer is used above critical value.
- freeSpace = std::max(volumeInfo.iFree - criticalThreshold.toInt() - KDiskSafetyLimit, (qint64)0);
+ freeSpace = std::max(qint64(0), volumeInfo.iFree - criticalThreshold.toInt() - KDiskSafetyLimit);
} catch(const std::exception& e) {
Q_UNUSED(e);
diff -r d9aefe59d544 -r 3075d9b614e6 camerauis/cameraxui/cxengine/src/cxevideocapturecontrolsymbian.cpp
--- a/camerauis/cameraxui/cxengine/src/cxevideocapturecontrolsymbian.cpp Fri Apr 16 14:51:30 2010 +0300
+++ b/camerauis/cameraxui/cxengine/src/cxevideocapturecontrolsymbian.cpp Thu May 13 21:30:19 2010 +0300
@@ -30,57 +30,87 @@
#include "cxestillimagesymbian.h"
#include "cxecameradevice.h"
#include "cxutils.h"
-#include "cxesysutil.h"
#include "cxestate.h"
#include "cxesettings.h"
#include "cxenamespace.h"
-#include "OstTraceDefinitions.h"
#include "cxesoundplayersymbian.h"
#include "cxequalitypresetssymbian.h"
#include "cxeviewfindercontrolsymbian.h"
+#include "cxediskmonitor.h"
+
+#include "OstTraceDefinitions.h"
#ifdef OST_TRACE_COMPILER_IN_USE
#include "cxevideocapturecontrolsymbianTraces.h"
#endif
// constants
-const TInt64 KMinRequiredSpaceVideo = 4000000;
-const uint KOneMillion = 1000000;
-const qreal KMetaDataCoeff = 1.03; // Coefficient to estimate metadata amount
-const uint KCamCMaxClipDurationInSecs = 5400; // Maximun video clip duration in seconds
-const qreal KCMRAvgVideoBitRateScaler = 0.9; // avg video bit rate scaler
+namespace
+{
+ // Controller UId, can be used by the client to identify the controller, e.g. if the custom command can be used
+ const TUid KCamCControllerImplementationUid = {0x101F8503};
+ // TMMFEvent UIDs for Async stop
+ const TUid KCamCControllerCCVideoRecordStopped = {0x2000E546};
+ const TUid KCamCControllerCCVideoFileComposed = {0x2000E547};
+
+ // Custom command for setting a new filename without closing & reopening the controller
+ enum TCamCControllerCustomCommands
+ {
+ ECamCControllerCCNewFilename = 0,
+ ECamCControllerCCVideoStopAsync
+ };
+
+ const TInt KOneSecond = 1000000;
+ const int KMaintainAspectRatio = false;
+ const TInt64 KMinRequiredSpaceVideo = 4000000;
+ const uint KOneMillion = 1000000;
+ const qreal KMetaDataCoeff = 1.03; // Coefficient to estimate metadata amount
+ const uint KCamCMaxClipDurationInSecs = 5400; // Maximun video clip duration in seconds
+ const qreal KCMRAvgVideoBitRateScaler = 0.9; // avg video bit rate scaler
+}
/*!
* CxeVideoCaptureControlSymbian::CxeVideoCaptureControlSymbian
*/
-CxeVideoCaptureControlSymbian::CxeVideoCaptureControlSymbian(CxeCameraDevice &cameraDevice,
- CxeViewfinderControl &viewfinderControl,
- CxeCameraDeviceControl &cameraDeviceControl,
- CxeFilenameGenerator &nameGenerator,
- CxeSettings &settings,
- CxeQualityPresets &qualityPresets) :
- CxeStateMachine("CxeVideoCaptureControlSymbian"),
- mVideoRecorder(NULL),
- mCameraDevice(cameraDevice),
- mCameraDeviceControl(cameraDeviceControl),
- mViewfinderControl(viewfinderControl),
- mFilenameGenerator(nameGenerator),
- mSettings(settings),
- mQualityPresets(qualityPresets),
- mSnapshot(),
- mNewFileName(""),
- mCurrentFilename("")
+CxeVideoCaptureControlSymbian::CxeVideoCaptureControlSymbian(
+ CxeCameraDevice &cameraDevice,
+ CxeViewfinderControl &viewfinderControl,
+ CxeCameraDeviceControl &cameraDeviceControl,
+ CxeFilenameGenerator &nameGenerator,
+ CxeSettings &settings,
+ CxeQualityPresets &qualityPresets,
+ CxeDiskMonitor &diskMonitor)
+ : CxeStateMachine("CxeVideoCaptureControlSymbian"),
+ mVideoRecorder(NULL),
+ mCameraDevice(cameraDevice),
+ mCameraDeviceControl(cameraDeviceControl),
+ mViewfinderControl(viewfinderControl),
+ mFilenameGenerator(nameGenerator),
+ mSettings(settings),
+ mQualityPresets(qualityPresets),
+ mDiskMonitor(diskMonitor),
+ mSnapshot(),
+ mNewFileName(""),
+ mCurrentFilename("")
{
CX_DEBUG_ENTER_FUNCTION();
+ OstTrace0(camerax_performance, CXEVIDEOCAPTURECONTROLSYMBIAN_CREATE_IN, "msg: e_CX_VIDEOCAPTURECONTROL_NEW 1");
qRegisterMetaType ();
initializeStates();
+
mVideoStopSoundPlayer = new
CxeSoundPlayerSymbian(CxeSoundPlayerSymbian::VideoCaptureStop);
mVideoStartSoundPlayer = new
CxeSoundPlayerSymbian(CxeSoundPlayerSymbian::VideoCaptureStart);
+ // If camera is already allocated, call the slot ourselves.
+ if (mCameraDevice.camera()) {
+ handleCameraAllocated(CxeError::None);
+ }
+
+ OstTrace0(camerax_performance, CXEVIDEOCAPTURECONTROLSYMBIAN_CREATE_M1, "msg: e_CX_ENGINE_CONNECT_SIGNALS 1");
// connect signals from cameraDevice, so we recieve events when camera reference changes
connect(&cameraDevice, SIGNAL(prepareForCameraDelete()),
this, SLOT(prepareForCameraDelete()));
@@ -96,6 +126,11 @@
connect(&mSettings, SIGNAL(settingValueChanged(const QString&,QVariant)),
this, SLOT(handleSettingValueChanged(const QString&,QVariant)));
+ connect(&mSettings, SIGNAL(sceneChanged(CxeScene&)), this, SLOT(handleSceneChanged(CxeScene&)));
+
+ 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");
CX_DEBUG_EXIT_FUNCTION();
}
@@ -144,13 +179,14 @@
void CxeVideoCaptureControlSymbian::deinit()
{
CX_DEBUG_ENTER_FUNCTION();
- OstTrace0( camerax_performance, CXEVIDEOCAPTURECONTROLSYMBIAN_DEINIT, "msg: e_CX_VIDEO_CAPCONT_DEINIT 1" );
if(state() == Idle) {
// nothing to do
return;
}
+ OstTrace0( camerax_performance, CXEVIDEOCAPTURECONTROLSYMBIAN_DEINIT, "msg: e_CX_VIDEO_CAPCONT_DEINIT 1" );
+
// first stop viewfinder
mViewfinderControl.stop();
@@ -338,7 +374,6 @@
CX_DEBUG(("Video resoulution (%d,%d)", mCurrentVideoDetails.mWidth,
mCurrentVideoDetails.mHeight));
CX_DEBUG(("Video bitrate = %d)", mCurrentVideoDetails.mVideoBitRate));
- CX_DEBUG(("Video frame rate = %f)", mCurrentVideoDetails.mVideoFrameRate));
OstTrace0(camerax_performance, CXEVIDEOCAPTURECONTROLSYMBIAN_PREPARE, "msg: e_CX_VIDCAPCONT_PREPARE 1");
TSize frameSize;
@@ -347,10 +382,20 @@
int muteSetting = 0; // audio enabled
mSettings.get(CxeSettingIds::VIDEO_MUTE_SETTING, muteSetting);
+ // 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);
+ if (frameRate <= 0) {
+ frameRate = mCurrentVideoDetails.mVideoFrameRate;
+ }
+
+ CX_DEBUG(("Video frame rate = %d)", frameRate));
+
TRAPD(err,
{
mVideoRecorder->SetVideoFrameSizeL(frameSize);
- mVideoRecorder->SetVideoFrameRateL(mCurrentVideoDetails.mVideoFrameRate);
+ mVideoRecorder->SetVideoFrameRateL(frameRate);
mVideoRecorder->SetVideoBitRateL(mCurrentVideoDetails.mVideoBitRate);
mVideoRecorder->SetAudioEnabledL(muteSetting == 0);
// "No limit" value is handled in video recorder wrapper.
@@ -631,6 +676,8 @@
setState(CxeVideoCaptureControl::Paused);
TRAPD(pauseErr, mVideoRecorder->PauseL());
+ // play the sound, but not changing the state
+ mVideoStopSoundPlayer->play();
if (pauseErr) {
CX_DEBUG(("[WARNING] Error %d pausing!", pauseErr));
//pause operation failed, report it
@@ -718,6 +765,7 @@
if (!aError) {
setState(CxeVideoCaptureControl::Ready);
mViewfinderControl.start();
+ OstTrace0( camerax_performance, CXEVIDEOCAPTURECONTROLSYMBIAN_GOTOVIDEO, "msg: e_CX_GO_TO_VIDEO_MODE 0" );
} else {
deinit();
// report error to interested parties
@@ -980,6 +1028,22 @@
*/
void CxeVideoCaptureControlSymbian::handleStateChanged(int newStateId, CxeError::Id error)
{
+ switch (newStateId) {
+ case Ready:
+ if (error == CxeError::None && !mDiskMonitor.isMonitoring()) {
+ mDiskMonitor.start();
+ connect(&mDiskMonitor, SIGNAL(diskSpaceChanged()), this, SLOT(handleDiskSpaceChanged()));
+ }
+ break;
+ default:
+ // Stop monitoring when video mode is released.
+ // Same goes during recording, as video times come from recorder.
+ if (mDiskMonitor.isMonitoring()) {
+ mDiskMonitor.stop();
+ disconnect(&mDiskMonitor, SIGNAL(diskSpaceChanged()), this, SLOT(handleDiskSpaceChanged()));
+ }
+ break;
+ }
emit stateChanged(static_cast (newStateId), error);
}
@@ -1027,13 +1091,18 @@
{
CX_DEBUG_ENTER_FUNCTION();
- if (state() == CxeVideoCaptureControl::Recording) {
+ if (state() == CxeVideoCaptureControl::Recording ||
+ state() == CxeVideoCaptureControl::Paused) {
TTimeIntervalMicroSeconds remaining = 0;
remaining = mVideoRecorder->RecordTimeAvailable();
time = remaining.Int64() * 1.0 / KOneSecond;
CX_DEBUG(( "timeRemaining2: %d", time ));
} else {
- calculateRemainingTime(mCurrentVideoDetails, time);
+ // Check if we need to recalculate the remaining time.
+ if (mCurrentVideoDetails.mRemainingTime == CxeVideoDetails::UNKNOWN) {
+ calculateRemainingTime(mCurrentVideoDetails, mCurrentVideoDetails.mRemainingTime);
+ }
+ time = mCurrentVideoDetails.mRemainingTime;
}
CX_DEBUG_EXIT_FUNCTION();
@@ -1054,7 +1123,7 @@
// get available space in the drive selected in the settings
// for storing videos
- qint64 availableSpace = CxeSysUtil::spaceAvailable(CCoeEnv::Static()->FsSession(), mSettings);
+ qint64 availableSpace = mDiskMonitor.free();
availableSpace = availableSpace - KMinRequiredSpaceVideo;
@@ -1120,7 +1189,8 @@
TTimeIntervalMicroSeconds timeElapsed = 0;
bool ok = false;
- if (state() == CxeVideoCaptureControl::Recording) {
+ if (state() == CxeVideoCaptureControl::Recording ||
+ state() == CxeVideoCaptureControl::Paused) {
TRAPD( err, timeElapsed = mVideoRecorder->DurationL() );
if (!err) {
time = timeElapsed.Int64() * 1.0 / KOneSecond;
@@ -1144,6 +1214,7 @@
// start recording, if we were playing capture sound
if (state() == CxeVideoCaptureControl::PlayingStartSound) {
setState(CxeVideoCaptureControl::Recording);
+
mVideoRecorder->Record();
}
@@ -1168,14 +1239,21 @@
// re-prepare for video
if (state() == Ready) {
// release resources
- deinit();
+ deinit();
// initialize video recording again
- init();
- }
+ init();
+ }
} else if (settingId == CxeSettingIds::VIDEO_MUTE_SETTING) {
// mute setting changed, apply the new setting and re-prepare.
setState(Preparing);
prepare();
+ } else if (settingId == CxeSettingIds::FRAME_RATE){
+ // Frame rate setting changed. Need to re-prepare if we are prepared already.
+ // Otherwise can wait for next init call.
+ if (state() == Ready) {
+ setState(Preparing);
+ prepare();
+ }
} else {
// Setting not relevant to video mode
}
@@ -1184,6 +1262,48 @@
CX_DEBUG_EXIT_FUNCTION();
}
+/*!
+ * Scene mode changed. We need to know about it because frame rate
+ * might have changed.
+ */
+void CxeVideoCaptureControlSymbian::handleSceneChanged(CxeScene& scene)
+{
+ CX_DEBUG_ENTER_FUNCTION();
+
+ // make sure we are in video mode
+ if (mCameraDeviceControl.mode() == Cxe::VideoMode) {
+ // Frame rate setting might have changed so re-prepare.
+ if (state() == Ready) {
+ setState(Preparing);
+ prepare();
+ }
+
+ }
+ CX_DEBUG_EXIT_FUNCTION();
+}
+
+/*!
+* Disk space changed.
+* Emit remaining time changed signal, if space change affects it.
+*/
+void CxeVideoCaptureControlSymbian::handleDiskSpaceChanged()
+{
+ CX_DEBUG_ENTER_FUNCTION();
+
+ // Ignore updates on preparing phase.
+ if (state() == CxeVideoCaptureControl::Ready) {
+
+ int time(0);
+ calculateRemainingTime(mCurrentVideoDetails, time);
+
+ if (time != mCurrentVideoDetails.mRemainingTime) {
+ mCurrentVideoDetails.mRemainingTime = time;
+ emit remainingTimeChanged();
+ }
+ }
+
+ CX_DEBUG_EXIT_FUNCTION();
+}
/*!
* Returns QList of all supported video quality details based on the camera index
diff -r d9aefe59d544 -r 3075d9b614e6 camerauis/cameraxui/cxengine/src/cxeviewfindercontrolsymbian.cpp
--- a/camerauis/cameraxui/cxengine/src/cxeviewfindercontrolsymbian.cpp Fri Apr 16 14:51:30 2010 +0300
+++ b/camerauis/cameraxui/cxengine/src/cxeviewfindercontrolsymbian.cpp Thu May 13 21:30:19 2010 +0300
@@ -166,7 +166,6 @@
TInt err = KErrNone;
if ( state() == Running ) {
- OstTrace0( camerax_performance, CXEVIEWFINDERCONTROLSYMBIAN_START, "msg: e_CX_GO_TO_VIDEO_MODE 0" );
CX_DEBUG( ( "Viewfinder already running - ignored start()" ) );
CX_DEBUG_EXIT_FUNCTION();
return CxeError::None;
@@ -212,7 +211,7 @@
CCoeEnv::Static()->WsSession(),
*CCoeEnv::Static()->ScreenDevice(),
*mVideoWindow, activeViewfinderRect));
- OstTrace0(camerax_performance, DUP1_CXEVIEWFINDERCONTROLSYMBIAN_START, "msg: e_CX_STARTUP 0");
+ OstTrace0(camerax_performance, CXEVIEWFINDERCONTROLSYMBIAN_START, "msg: e_CX_STARTUP 0");
setState(Running);
break;
}
diff -r d9aefe59d544 -r 3075d9b614e6 camerauis/cameraxui/cxengine/src/cxezoomcontrolsymbian.cpp
--- a/camerauis/cameraxui/cxengine/src/cxezoomcontrolsymbian.cpp Fri Apr 16 14:51:30 2010 +0300
+++ b/camerauis/cameraxui/cxengine/src/cxezoomcontrolsymbian.cpp Thu May 13 21:30:19 2010 +0300
@@ -23,7 +23,15 @@
#include "cxenamespace.h"
#include "cxestate.h"
-const int NOT_DEFINED = -1;
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "cxezoomcontrolsymbianTraces.h"
+#endif
+
+namespace
+{
+ const int NOT_DEFINED = -1;
+}
// ---------------------------------------------------------------------------
// CxeZoomControlSymbian::CxeZoomControlSymbian
@@ -156,6 +164,7 @@
void CxeZoomControlSymbian::prepareZoomForStill(int ecamStillResolutionIndex)
{
CX_DEBUG_ENTER_FUNCTION();
+ OstTrace0(camerax_performance, CXEZOOMCONTROLSYMBIAN_PREPARESTILL_IN, "msg: e_CX_PREPARE_ZOOM 1");
if (mCameraDeviceControl.state() == CxeCameraDeviceControl::Ready) {
init();
@@ -184,6 +193,7 @@
finalizeZoomPreparation(error);
}
+ OstTrace0(camerax_performance, CXEZOOMCONTROLSYMBIAN_PREPARESTILL_OUT, "msg: e_CX_PREPARE_ZOOM 0");
CX_DEBUG_EXIT_FUNCTION();
}
@@ -194,6 +204,7 @@
void CxeZoomControlSymbian::prepareZoomForVideo()
{
CX_DEBUG_ENTER_FUNCTION();
+ OstTrace0(camerax_performance, CXEZOOMCONTROLSYMBIAN_PREPAREVIDEO_IN, "msg: e_CX_PREPARE_ZOOM 1");
if (mCameraDeviceControl.state() == CxeCameraDeviceControl::Ready) {
init();
@@ -214,7 +225,7 @@
finalizeZoomPreparation(error);
}
-
+ OstTrace0(camerax_performance, CXEZOOMCONTROLSYMBIAN_PREPAREVIDEO_OUT, "msg: e_CX_PREPARE_ZOOM 0");
CX_DEBUG_EXIT_FUNCTION();
}
diff -r d9aefe59d544 -r 3075d9b614e6 camerauis/cameraxui/cxengine/tsrc/fakeclasses/cxefakesettingsmodel.cpp
--- a/camerauis/cameraxui/cxengine/tsrc/fakeclasses/cxefakesettingsmodel.cpp Fri Apr 16 14:51:30 2010 +0300
+++ b/camerauis/cameraxui/cxengine/tsrc/fakeclasses/cxefakesettingsmodel.cpp Thu May 13 21:30:19 2010 +0300
@@ -98,30 +98,27 @@
mDummyScene.clear();
// image scene mode key values
- if(newScene == "ImageSceneAuto") {
+ if(newScene == CxeSettingIds::IMAGE_SCENE_AUTO) {
mDummyScene.insert(CxeSettingIds::IMAGE_SCENE, CxeSettingIds::IMAGE_SCENE_AUTO);
}
- else if(newScene == "ImageScenePortrait") {
+ else if(newScene == CxeSettingIds::IMAGE_SCENE_PORTRAIT) {
mDummyScene.insert(CxeSettingIds::IMAGE_SCENE, CxeSettingIds::IMAGE_SCENE_PORTRAIT);
}
- else if(newScene == "ImageSceneScenery") {
+ else if(newScene == CxeSettingIds::IMAGE_SCENE_SCENERY) {
mDummyScene.insert(CxeSettingIds::IMAGE_SCENE, CxeSettingIds::IMAGE_SCENE_SCENERY);
}
- else if(newScene == "ImageSceneMacro") {
+ else if(newScene == CxeSettingIds::IMAGE_SCENE_MACRO) {
mDummyScene.insert(CxeSettingIds::IMAGE_SCENE, CxeSettingIds::IMAGE_SCENE_MACRO);
}
- else if(newScene == "ImageSceneSports") {
+ else if(newScene == CxeSettingIds::IMAGE_SCENE_SPORTS) {
mDummyScene.insert(CxeSettingIds::IMAGE_SCENE, CxeSettingIds::IMAGE_SCENE_SPORTS);
}
- else if(newScene == "ImageSceneNight") {
+ else if(newScene == CxeSettingIds::IMAGE_SCENE_NIGHT) {
mDummyScene.insert(CxeSettingIds::IMAGE_SCENE, CxeSettingIds::IMAGE_SCENE_NIGHT);
}
- else if(newScene == "ImageSceneNightPortrait") {
+ else if(newScene == CxeSettingIds::IMAGE_SCENE_NIGHTPORTRAIT) {
mDummyScene.insert(CxeSettingIds::IMAGE_SCENE, CxeSettingIds::IMAGE_SCENE_NIGHTPORTRAIT);
}
- else if(newScene == "ImageSceneCloseUp") {
- mDummyScene.insert(CxeSettingIds::IMAGE_SCENE, CxeSettingIds::IMAGE_SCENE_CLOSEUP);
- }
else {
return CxeError::NotFound;
}
@@ -134,16 +131,16 @@
mDummyScene.clear();
// image scene mode key values
- if(newScene == "VideoSceneAuto") {
+ if(newScene == CxeSettingIds::VIDEO_SCENE_AUTO) {
mDummyScene.insert(CxeSettingIds::VIDEO_SCENE, CxeSettingIds::VIDEO_SCENE_AUTO);
}
- else if(newScene == "VideoSceneNightPortrait") {
+ else if(newScene == CxeSettingIds::VIDEO_SCENE_NIGHTPORTRAIT) {
mDummyScene.insert(CxeSettingIds::VIDEO_SCENE, CxeSettingIds::VIDEO_SCENE_NIGHTPORTRAIT);
}
- else if(newScene == "VideoSceneLowLight") {
+ else if(newScene == CxeSettingIds::VIDEO_SCENE_LOWLIGHT) {
mDummyScene.insert(CxeSettingIds::VIDEO_SCENE, CxeSettingIds::VIDEO_SCENE_LOWLIGHT);
}
- else if(newScene == "VideoSceneNight") {
+ else if(newScene == CxeSettingIds::VIDEO_SCENE_NIGHT) {
mDummyScene.insert(CxeSettingIds::VIDEO_SCENE, CxeSettingIds::VIDEO_SCENE_NIGHT);
}
else {
@@ -159,13 +156,14 @@
void CxeFakeSettingsModel::initDefaultCameraSettings()
{
CX_DEBUG_ENTER_FUNCTION();
- mSettingStore.insert(CxeSettingIds::BRIGHTNESS, QVariant(1));
mSettingStore.insert(CxeSettingIds::FNAME_FOLDER_SUFFIX, QVariant(1));
mSettingStore.insert(CxeSettingIds::FNAME_MONTH_FOLDER, QVariant(1));
mSettingStore.insert(CxeSettingIds::FNAME_IMAGE_COUNTER, QVariant(1));
mSettingStore.insert(CxeSettingIds::FNAME_VIDEO_COUNTER, QVariant(1));
mSettingStore.insert(CxeSettingIds::COLOR_TONE, QVariant(1));
+ mSettingStore.insert(CxeSettingIds::SHARPNESS, QVariant(1));
mSettingStore.insert(CxeSettingIds::CONTRAST, QVariant(1));
+ mSettingStore.insert(CxeSettingIds::BRIGHTNESS, QVariant(1));
mSettingStore.insert(CxeSettingIds::EV_COMPENSATION_VALUE, QVariant(1));
mSettingStore.insert(CxeSettingIds::EXPOSURE_MODE, QVariant(1));
mSettingStore.insert(CxeSettingIds::FLASH_MODE, QVariant(1));
@@ -174,7 +172,6 @@
mSettingStore.insert(CxeSettingIds::IMAGE_QUALITY, QVariant(1));
mSettingStore.insert(CxeSettingIds::IMAGE_SCENE, QVariant(1));
mSettingStore.insert(CxeSettingIds::IMAGE_SCENE_AUTO, QVariant(1));
- mSettingStore.insert(CxeSettingIds::IMAGE_SCENE_CLOSEUP, QVariant(1));
mSettingStore.insert(CxeSettingIds::IMAGE_SCENE_MACRO, QVariant(1));
mSettingStore.insert(CxeSettingIds::IMAGE_SCENE_NIGHT, QVariant(1));
mSettingStore.insert(CxeSettingIds::IMAGE_SCENE_NIGHTPORTRAIT, QVariant(1));
@@ -185,7 +182,6 @@
mSettingStore.insert(CxeSettingIds::SCENE_ID, QVariant(1));
mSettingStore.insert(CxeSettingIds::SECONDARY_CAMERA, QVariant(1));
mSettingStore.insert(CxeSettingIds::SELF_TIMER, QVariant(1));
- mSettingStore.insert(CxeSettingIds::SHARPNESS, QVariant(1));
mSettingStore.insert(CxeSettingIds::VIDEO_SCENE, QVariant(1));
mSettingStore.insert(CxeSettingIds::VIDEO_SCENE_AUTO, QVariant(1));
mSettingStore.insert(CxeSettingIds::VIDEO_SCENE_LOWLIGHT, QVariant(1));
diff -r d9aefe59d544 -r 3075d9b614e6 camerauis/cameraxui/cxengine/tsrc/unit/cxeunitrunner/cxetestrunner.cpp
--- a/camerauis/cameraxui/cxengine/tsrc/unit/cxeunitrunner/cxetestrunner.cpp Fri Apr 16 14:51:30 2010 +0300
+++ b/camerauis/cameraxui/cxengine/tsrc/unit/cxeunitrunner/cxetestrunner.cpp Thu May 13 21:30:19 2010 +0300
@@ -62,11 +62,11 @@
<< "unittest_cxezoomcontrolsymbian"
<< "unittest_cxestillcapturecontrolsymbian"
<< "unittest_cxefeaturemanagerimp"
- << "unittest_cxeenginesymbian"
<< "unittest_cxesettingsimp"
<< "unittest_cxethumbnailmanagersymbian"
<< "unittest_cxeharvestercontrolsymbian"
- << "unittest_cxesettingscontrolsymbian";
+ << "unittest_cxesettingscontrolsymbian"
+ << "unittest_cxeenginesymbian";
QDir dir;
dir.mkpath(logFileFolder);
diff -r d9aefe59d544 -r 3075d9b614e6 camerauis/cameraxui/cxengine/tsrc/unit/cxeunitrunner/cxeunitrunner.pro
--- a/camerauis/cameraxui/cxengine/tsrc/unit/cxeunitrunner/cxeunitrunner.pro Fri Apr 16 14:51:30 2010 +0300
+++ b/camerauis/cameraxui/cxengine/tsrc/unit/cxeunitrunner/cxeunitrunner.pro Thu May 13 21:30:19 2010 +0300
@@ -18,10 +18,10 @@
TEMPLATE = app
TARGET =
-DEPENDPATH += .
-INCLUDEPATH += .
+DEPENDPATH *= .
+INCLUDEPATH *= .
-CONFIG += symbian_test
+CONFIG *= symbian_test
symbian {
TARGET.CAPABILITY = ALL -TCB -DRM
@@ -29,7 +29,7 @@
}
# Input
-SOURCES += main.cpp \
+SOURCES *= main.cpp \
cxetestrunner.cpp
-HEADERS += cxetestrunner.h
+HEADERS *= cxetestrunner.h
diff -r d9aefe59d544 -r 3075d9b614e6 camerauis/cameraxui/cxengine/tsrc/unit/unit.pro
--- a/camerauis/cameraxui/cxengine/tsrc/unit/unit.pro Fri Apr 16 14:51:30 2010 +0300
+++ b/camerauis/cameraxui/cxengine/tsrc/unit/unit.pro Thu May 13 21:30:19 2010 +0300
@@ -44,4 +44,4 @@
unittest_cxeharvestercontrolsymbian \
unittest_cxesettingscontrolsymbian
-CONFIG += ordered
+CONFIG *= ordered
diff -r d9aefe59d544 -r 3075d9b614e6 camerauis/cameraxui/cxengine/tsrc/unit/unittest_cxeautofocuscontrolsymbian/unittest_cxeautofocuscontrolsymbian.pro
--- a/camerauis/cameraxui/cxengine/tsrc/unit/unittest_cxeautofocuscontrolsymbian/unittest_cxeautofocuscontrolsymbian.pro Fri Apr 16 14:51:30 2010 +0300
+++ b/camerauis/cameraxui/cxengine/tsrc/unit/unittest_cxeautofocuscontrolsymbian/unittest_cxeautofocuscontrolsymbian.pro Thu May 13 21:30:19 2010 +0300
@@ -8,19 +8,21 @@
# Nokia Corporation - initial contribution.
# Contributors:
# Description:
+
include(../unittest.pri)
+
TARGET = unittest_cxeautofocuscontrolsymbian
-LIBS += -lecamadvsettings
-LIBS += -lecam
-LIBS += -lecampluginsupport
-LIBS += -lfbscli
-LIBS += -lbitgdi
-LIBS += -lecamsnapshot
-DEFINES += CXE_USE_DUMMY_CAMERA
-DEFINES = $$unique(DEFINES)
+LIBS *= -lecamadvsettings
+LIBS *= -lecam
+LIBS *= -lecampluginsupport
+LIBS *= -lfbscli
+LIBS *= -lbitgdi
+LIBS *= -lecamsnapshot
-SOURCES += unittest_cxeautofocuscontrolsymbian.cpp \
+DEFINES *= CXE_USE_DUMMY_CAMERA
+
+SOURCES *= unittest_cxeautofocuscontrolsymbian.cpp \
cxeautofocuscontrolsymbian.cpp \
cxestatemachine.cpp \
cxestate.cpp \
@@ -32,7 +34,7 @@
cxefakecameradevice.cpp \
cxecameradevicecontrolsymbian.cpp \
cxefakecameradevicecontrol.cpp
-HEADERS += unittest_cxeautofocuscontrolsymbian.h \
+HEADERS *= unittest_cxeautofocuscontrolsymbian.h \
cxeautofocuscontrol.h \
cxeautofocuscontrolsymbian.h \
cxestatemachine.h \
diff -r d9aefe59d544 -r 3075d9b614e6 camerauis/cameraxui/cxengine/tsrc/unit/unittest_cxecameradevice/unittest_cxecameradevice.pro
--- a/camerauis/cameraxui/cxengine/tsrc/unit/unittest_cxecameradevice/unittest_cxecameradevice.pro Fri Apr 16 14:51:30 2010 +0300
+++ b/camerauis/cameraxui/cxengine/tsrc/unit/unittest_cxecameradevice/unittest_cxecameradevice.pro Thu May 13 21:30:19 2010 +0300
@@ -8,26 +8,28 @@
# Nokia Corporation - initial contribution.
# Contributors:
# Description:
+
include(../unittest.pri)
+
TARGET = unittest_cxecameradevice
-LIBS += -lecamadvsettings
-LIBS += -lecamsnapshot
-LIBS += -lecam
-LIBS += -lecampluginsupport
-LIBS += -lfbscli
-LIBS += -lbitgdi
-DEFINES += CXE_USE_DUMMY_CAMERA
-DEFINES = $$unique(DEFINES)
+LIBS *= -lecamadvsettings
+LIBS *= -lecamsnapshot
+LIBS *= -lecam
+LIBS *= -lecampluginsupport
+LIBS *= -lfbscli
+LIBS *= -lbitgdi
-SOURCES += unittest_cxecameradevice.cpp \
+DEFINES *= CXE_USE_DUMMY_CAMERA
+
+SOURCES *= unittest_cxecameradevice.cpp \
cxestate.cpp \
cxestatemachinebase.cpp \
cxestatemachine.cpp \
cxedummycamera.cpp \
cxecameradevice.cpp \
cxeerrormappingsymbian.cpp
-HEADERS += unittest_cxecameradevice.h \
+HEADERS *= unittest_cxecameradevice.h \
cxestate.h \
cxestatemachinebase.h \
cxestatemachine.h \
diff -r d9aefe59d544 -r 3075d9b614e6 camerauis/cameraxui/cxengine/tsrc/unit/unittest_cxecameradevicecontrolsymbian/unittest_cxecameradevicecontrolsymbian.pro
--- a/camerauis/cameraxui/cxengine/tsrc/unit/unittest_cxecameradevicecontrolsymbian/unittest_cxecameradevicecontrolsymbian.pro Fri Apr 16 14:51:30 2010 +0300
+++ b/camerauis/cameraxui/cxengine/tsrc/unit/unittest_cxecameradevicecontrolsymbian/unittest_cxecameradevicecontrolsymbian.pro Thu May 13 21:30:19 2010 +0300
@@ -18,19 +18,18 @@
TARGET = unittest_cxecameradevicecontrolsymbian
-LIBS += -lplatformenv
-LIBS += -lecamadvsettings
-LIBS += -lecamsnapshot
-LIBS += -lecam
-LIBS += -lecampluginsupport
-LIBS += -lfbscli
-LIBS += -lbitgdi
+LIBS *= -lplatformenv
+LIBS *= -lecamadvsettings
+LIBS *= -lecamsnapshot
+LIBS *= -lecam
+LIBS *= -lecampluginsupport
+LIBS *= -lfbscli
+LIBS *= -lbitgdi
+LIBS *= -lsysutil
-DEFINES += CXE_USE_DUMMY_CAMERA
-DEFINES = $$unique(DEFINES)
+DEFINES *= CXE_USE_DUMMY_CAMERA
-
-SOURCES += unittest_cxecameradevicecontrolsymbian.cpp \
+SOURCES *= unittest_cxecameradevicecontrolsymbian.cpp \
cxecameradevicecontrolsymbian.cpp \
cxecameradevicecontrolunit.cpp \
cxecameradevice.cpp \
@@ -40,9 +39,10 @@
cxestatemachine.cpp \
cxestate.cpp \
cxestatemachinebase.cpp \
- cxedummycamera.cpp
+ cxedummycamera.cpp \
+ cxesysutil.cpp
-HEADERS += unittest_cxecameradevicecontrolsymbian.h \
+HEADERS *= unittest_cxecameradevicecontrolsymbian.h \
cxecameradevicecontrolsymbian.h \
cxecameradevicecontrolunit.h \
cxecameradevicecontrol.h \
@@ -51,7 +51,8 @@
cxestatemachine.h \
cxestate.h \
cxestatemachinebase.h \
- cxefilenamegenerator.h
+ cxefilenamegenerator.h \
+ cxesysutil.h
diff -r d9aefe59d544 -r 3075d9b614e6 camerauis/cameraxui/cxengine/tsrc/unit/unittest_cxeenginesymbian/unittest_cxeenginesymbian.cpp
--- a/camerauis/cameraxui/cxengine/tsrc/unit/unittest_cxeenginesymbian/unittest_cxeenginesymbian.cpp Fri Apr 16 14:51:30 2010 +0300
+++ b/camerauis/cameraxui/cxengine/tsrc/unit/unittest_cxeenginesymbian/unittest_cxeenginesymbian.cpp Thu May 13 21:30:19 2010 +0300
@@ -42,7 +42,7 @@
delete mEngine;
mEngine = NULL;
mEngine = new CxeEngineSymbianUnit();
- mEngine->construct();
+ mEngine->initMode(Cxe::ImageMode);
mCameraDeviceControl = qobject_cast(
&mEngine->cameraDeviceControl());
diff -r d9aefe59d544 -r 3075d9b614e6 camerauis/cameraxui/cxengine/tsrc/unit/unittest_cxeenginesymbian/unittest_cxeenginesymbian.pro
--- a/camerauis/cameraxui/cxengine/tsrc/unit/unittest_cxeenginesymbian/unittest_cxeenginesymbian.pro Fri Apr 16 14:51:30 2010 +0300
+++ b/camerauis/cameraxui/cxengine/tsrc/unit/unittest_cxeenginesymbian/unittest_cxeenginesymbian.pro Thu May 13 21:30:19 2010 +0300
@@ -18,36 +18,36 @@
TARGET = unittest_cxeenginesymbian
-DEFINES += CXE_USE_DUMMY_CAMERA
-DEFINES = $$unique(DEFINES)
+DEFINES *= CXE_USE_DUMMY_CAMERA
-INCLUDEPATH += ../../../inc/sensor
+INCLUDEPATH *= ../../../inc/sensor
-LIBS += -lecam
-LIBS += -lecamadvsettings
-LIBS += -lecamsnapshot
-LIBS += -lecamdirectviewfinder
-LIBS += -lfbscli
-LIBS += -lbitgdi
-LIBS += -lxqsettingsmanager
-LIBS += -lecampluginsupport
-LIBS += -lmediaclientvideo
-LIBS += -lefsrv
-LIBS += -lsysutil
-LIBS += -lbafl
-LIBS += -lmediaclientaudio
-LIBS += -lecom
-LIBS += -lmmfcontrollerframework
-LIBS += -lplatformenv
-LIBS += -lsensrvclient
-LIBS += -lsensrvutil
-LIBS += -limagingconfigmanager
-LIBS += -lalfclient
-LIBS += -lalfdecoderserverclient
-LIBS += -lxqserviceutil
+LIBS *= -lecam
+LIBS *= -lecamadvsettings
+LIBS *= -lecamsnapshot
+LIBS *= -lecamdirectviewfinder
+LIBS *= -lfbscli
+LIBS *= -lbitgdi
+LIBS *= -lxqsettingsmanager
+LIBS *= -lecampluginsupport
+LIBS *= -lmediaclientvideo
+LIBS *= -lefsrv
+LIBS *= -lsysutil
+LIBS *= -lbafl
+LIBS *= -lmediaclientaudio
+LIBS *= -lecom
+LIBS *= -lmmfcontrollerframework
+LIBS *= -lplatformenv
+LIBS *= -lsensrvclient
+LIBS *= -lsensrvutil
+LIBS *= -limagingconfigmanager
+LIBS *= -lalfclient
+LIBS *= -lalfdecoderserverclient
+LIBS *= -lxqserviceutil
+LIBS *= -loommonitor
-SOURCES += unittest_cxeenginesymbian.cpp \
+SOURCES *= unittest_cxeenginesymbian.cpp \
cxeenginesymbianunit.cpp \
cxeenginesymbian.cpp \
cxeengine.cpp \
@@ -99,14 +99,17 @@
sensor/xqaccsensor_p.cpp \
cxefakequalitypresets.cpp \
cxequalitypresetssymbian.cpp \
+ cxediskmonitor.cpp \
+ cxediskmonitorprivate.cpp \
+ cxememorymonitor.cpp \
+ cxememorymonitorprivate.cpp
-HEADERS += unittest_cxeenginesymbian.h \
+HEADERS *= unittest_cxeenginesymbian.h \
cxeenginesymbianunit.h \
cxeenginesymbian.h \
cxeengine.h \
- cxesettingscontrolsymbian.h \
cxeautofocuscontrol.h \
cxeautofocuscontrolsymbian.h \
cxefakeautofocuscontrol.h \
@@ -126,25 +129,25 @@
cxevideocontainer.h \
cxevideocapturecontrol.h \
cxefakevideocapturecontrol.h \
+ cxevideocapturecontrolsymbian.h \
cxestatemachine.h \
cxestatemachinebase.h \
cxestate.h \
- cxesettingsmodel.h \
+ cxesettings.h \
cxesettingsimp.h \
+ cxefakesettings.h \
+ cxesettingsmodel.h \
cxesettingscenrepstore.h \
+ cxesettingsmappersymbian.h \
+ cxesettingscontrolsymbian.h \
cxefilenamegeneratorsymbian.h \
cxefakefilenamegenerator.h \
cxezoomcontrolsymbian.h \
cxefakezoomcontrol.h \
cxezoomcontrol.h \
- cxevideocapturecontrolsymbian.h \
- cxevideocapturecontrol.h \
cxefeaturemanager.h \
cxefeaturemanagerimp.h \
cxefakefeaturemanager.h \
- cxesettings.h \
- cxefakesettings.h \
- cxesettingsmappersymbian.h \
cxesoundplayersymbian.h \
cxesensoreventhandlersymbian.h \
cxesensoreventhandler.h \
@@ -167,4 +170,8 @@
sensor/xqaccsensor_p.h \
cxequalitypresets.h \
cxefakequalitypresets.h \
- cxequalitypresetssymbian.h
+ cxequalitypresetssymbian.h \
+ cxediskmonitor.h \
+ cxediskmonitorprivate.h \
+ cxememorymonitor.h \
+ cxememorymonitorprivate.h
diff -r d9aefe59d544 -r 3075d9b614e6 camerauis/cameraxui/cxengine/tsrc/unit/unittest_cxeerrormappersymbian/unittest_cxeerrormappersymbian.pro
--- a/camerauis/cameraxui/cxengine/tsrc/unit/unittest_cxeerrormappersymbian/unittest_cxeerrormappersymbian.pro Fri Apr 16 14:51:30 2010 +0300
+++ b/camerauis/cameraxui/cxengine/tsrc/unit/unittest_cxeerrormappersymbian/unittest_cxeerrormappersymbian.pro Thu May 13 21:30:19 2010 +0300
@@ -8,11 +8,14 @@
# Nokia Corporation - initial contribution.
# Contributors:
# Description:
+
include(../unittest.pri)
+
TARGET = unittest_cxeerrormappersymbian
-SOURCES += unittest_cxeerrormappersymbian.cpp \
+SOURCES *= unittest_cxeerrormappersymbian.cpp \
cxeerrormappingsymbian.cpp
-HEADERS += unittest_cxeerrormappersymbian.h \
+
+HEADERS *= unittest_cxeerrormappersymbian.h \
cxeerrormappingsymbian.h \
cxeerror.h
diff -r d9aefe59d544 -r 3075d9b614e6 camerauis/cameraxui/cxengine/tsrc/unit/unittest_cxefeaturemanagerimp/unittest_cxefeaturemanagerimp.pro
--- a/camerauis/cameraxui/cxengine/tsrc/unit/unittest_cxefeaturemanagerimp/unittest_cxefeaturemanagerimp.pro Fri Apr 16 14:51:30 2010 +0300
+++ b/camerauis/cameraxui/cxengine/tsrc/unit/unittest_cxefeaturemanagerimp/unittest_cxefeaturemanagerimp.pro Thu May 13 21:30:19 2010 +0300
@@ -8,13 +8,15 @@
# Nokia Corporation - initial contribution.
# Contributors:
# Description:
+
include(../unittest.pri)
+
TARGET = unittest_cxefeaturemanagerimp
-SOURCES += unittest_cxefeaturemanagerimp.cpp \
+SOURCES *= unittest_cxefeaturemanagerimp.cpp \
cxefeaturemanagerimp.cpp \
cxefakesettingsmodel.cpp
-HEADERS += unittest_cxefeaturemanagerimp.h \
+HEADERS *= unittest_cxefeaturemanagerimp.h \
cxefeaturemanagerimp.h \
cxefakesettingsmodel.h \
cxeerror.h
diff -r d9aefe59d544 -r 3075d9b614e6 camerauis/cameraxui/cxengine/tsrc/unit/unittest_cxefilenamegeneratorsymbian/unittest_cxefilenamegeneratorsymbian.pro
--- a/camerauis/cameraxui/cxengine/tsrc/unit/unittest_cxefilenamegeneratorsymbian/unittest_cxefilenamegeneratorsymbian.pro Fri Apr 16 14:51:30 2010 +0300
+++ b/camerauis/cameraxui/cxengine/tsrc/unit/unittest_cxefilenamegeneratorsymbian/unittest_cxefilenamegeneratorsymbian.pro Thu May 13 21:30:19 2010 +0300
@@ -18,17 +18,18 @@
TARGET = unittest_cxefilenamegeneratorsymbian
-LIBS += -lplatformenv
+LIBS *= -lplatformenv
+LIBS *= -lsysutil
-SOURCES += unittest_cxefilenamegeneratorsymbian.cpp \
+SOURCES *= unittest_cxefilenamegeneratorsymbian.cpp \
cxefakesettings.cpp \
+ cxesysutil.cpp \
cxeerrormappingsymbian.cpp \
- cxefilenamegeneratorsymbian.cpp \
- cxesysutil.cpp
+ cxefilenamegeneratorsymbian.cpp
-HEADERS += unittest_cxefilenamegeneratorsymbian.h \
+HEADERS *= unittest_cxefilenamegeneratorsymbian.h \
cxefakesettings.h \
- cxesettings.h \
- cxesysutil.h
+ cxesysutil.h \
+ cxesettings.h
diff -r d9aefe59d544 -r 3075d9b614e6 camerauis/cameraxui/cxengine/tsrc/unit/unittest_cxefilesavethreadsymbian/unittest_cxefilesavethreadsymbian.pro
--- a/camerauis/cameraxui/cxengine/tsrc/unit/unittest_cxefilesavethreadsymbian/unittest_cxefilesavethreadsymbian.pro Fri Apr 16 14:51:30 2010 +0300
+++ b/camerauis/cameraxui/cxengine/tsrc/unit/unittest_cxefilesavethreadsymbian/unittest_cxefilesavethreadsymbian.pro Thu May 13 21:30:19 2010 +0300
@@ -10,18 +10,20 @@
# Description:
# This unit test doesn't want to include system include path of real xqsettingsmanager api
-CONFIG += cxeunit_no_system_paths
+CONFIG *= cxeunit_no_system_paths
include(../unittest.pri)
-INCLUDEPATH += ../system_include
-DEPENDPATH += ../system_include
+INCLUDEPATH *= ../system_include
+DEPENDPATH *= ../system_include
TARGET = unittest_cxefilesavethreadsymbian
-LIBS += -lsysutil
+LIBS *= -lsysutil
+LIBS *= -lplatformenv
-SOURCES += unittest_cxefilesavethreadsymbian.cpp \
+
+SOURCES *= unittest_cxefilesavethreadsymbian.cpp \
thumbnailmanager_qt.cpp \
harvesterclient.cpp \
cxefilesavethread.cpp \
@@ -36,7 +38,7 @@
cxestate.cpp \
cxeerrormappingsymbian.cpp
-HEADERS += unittest_cxefilesavethreadsymbian.h \
+HEADERS *= unittest_cxefilesavethreadsymbian.h \
thumbnailmanager_qt.h \
harvesterclient.h \
cxefilesavethread.h \
diff -r d9aefe59d544 -r 3075d9b614e6 camerauis/cameraxui/cxengine/tsrc/unit/unittest_cxeharvestercontrolsymbian/unittest_cxeharvestercontrolsymbian.pro
--- a/camerauis/cameraxui/cxengine/tsrc/unit/unittest_cxeharvestercontrolsymbian/unittest_cxeharvestercontrolsymbian.pro Fri Apr 16 14:51:30 2010 +0300
+++ b/camerauis/cameraxui/cxengine/tsrc/unit/unittest_cxeharvestercontrolsymbian/unittest_cxeharvestercontrolsymbian.pro Thu May 13 21:30:19 2010 +0300
@@ -9,22 +9,22 @@
# Contributors:
# Description:
-CONFIG += cxeunit_no_system_paths
+CONFIG *= cxeunit_no_system_paths
include(../unittest.pri)
TARGET = unittest_cxeharvestercontrolsymbian
-INCLUDEPATH += ../system_include
-DEPENDPATH += ../system_include
+INCLUDEPATH *= ../system_include
+DEPENDPATH *= ../system_include
-HEADERS += unittest_cxeharvestercontrolsymbian.h \
+HEADERS *= unittest_cxeharvestercontrolsymbian.h \
cxeerrormappingsymbian.h \
cxeharvestercontrolsymbian.h \
harvesterclient.h \
cxutils.h
-SOURCES += unittest_cxeharvestercontrolsymbian.cpp \
+SOURCES *= unittest_cxeharvestercontrolsymbian.cpp \
cxeerrormappingsymbian.cpp \
harvesterclient.cpp \
cxeharvestercontrolsymbian.cpp
diff -r d9aefe59d544 -r 3075d9b614e6 camerauis/cameraxui/cxengine/tsrc/unit/unittest_cxeimagedataitemsymbian/unittest_cxeimagedataitemsymbian.pro
--- a/camerauis/cameraxui/cxengine/tsrc/unit/unittest_cxeimagedataitemsymbian/unittest_cxeimagedataitemsymbian.pro Fri Apr 16 14:51:30 2010 +0300
+++ b/camerauis/cameraxui/cxengine/tsrc/unit/unittest_cxeimagedataitemsymbian/unittest_cxeimagedataitemsymbian.pro Thu May 13 21:30:19 2010 +0300
@@ -18,16 +18,16 @@
TARGET = unittest_cxeimagedataitemsymbian
-LIBS += -lplatformenv
-LIBS += -lsysutil
-LIBS += -lbitgdi
-LIBS += -lws32
-LIBS += -lsysutil
-LIBS += -lecom
-LIBS += -lecampluginsupport
+LIBS *= -lplatformenv
+LIBS *= -lsysutil
+LIBS *= -lbitgdi
+LIBS *= -lws32
+LIBS *= -lsysutil
+LIBS *= -lecom
+LIBS *= -lecampluginsupport
-SOURCES += cxeimagedataitemsymbian.cpp \
+SOURCES *= cxeimagedataitemsymbian.cpp \
cxeerrormappingsymbian.cpp \
cxestatemachine.cpp \
cxestate.cpp \
@@ -39,7 +39,7 @@
cxefakesysutil.cpp
-HEADERS += cxeimagedataitemsymbian.h \
+HEADERS *= cxeimagedataitemsymbian.h \
cxestatemachine.h \
cxestatemachinebase.h \
cxestate.h \
diff -r d9aefe59d544 -r 3075d9b614e6 camerauis/cameraxui/cxengine/tsrc/unit/unittest_cxeimagedataqueuesymbian/unittest_cxeimagedataqueuesymbian.pro
--- a/camerauis/cameraxui/cxengine/tsrc/unit/unittest_cxeimagedataqueuesymbian/unittest_cxeimagedataqueuesymbian.pro Fri Apr 16 14:51:30 2010 +0300
+++ b/camerauis/cameraxui/cxengine/tsrc/unit/unittest_cxeimagedataqueuesymbian/unittest_cxeimagedataqueuesymbian.pro Thu May 13 21:30:19 2010 +0300
@@ -12,10 +12,12 @@
include(../unittest.pri)
TARGET = unittest_cxeimagedataqueuesymbian
-LIBS += -lsysutil
-SOURCES += unittest_cxeimagedataqueuesymbian.cpp \
- cxeimagedataqueuesymbian.cpp \
+LIBS *= -lsysutil
+LIBS *= -lplatformenv
+
+SOURCES *= unittest_cxeimagedataqueuesymbian.cpp \
+ cxeimagedataqueuesymbian.cpp \
cxeimagedataqueueunit.cpp \
cxeimagedataitemsymbian.cpp \
cxefakeimagedataitem.cpp \
@@ -24,8 +26,8 @@
cxestatemachinebase.cpp \
cxeerrormappingsymbian.cpp \
cxesysutil.cpp
-
-HEADERS += unittest_cxeimagedataqueuesymbian.h \
+
+HEADERS *= unittest_cxeimagedataqueuesymbian.h \
cxeimagedataqueue.h \
cxeimagedataqueuesymbian.h \
cxeimagedataqueueunit.h \
diff -r d9aefe59d544 -r 3075d9b614e6 camerauis/cameraxui/cxengine/tsrc/unit/unittest_cxequalitypresetssymbian/unittest_cxequalitypresetssymbian.pro
--- a/camerauis/cameraxui/cxengine/tsrc/unit/unittest_cxequalitypresetssymbian/unittest_cxequalitypresetssymbian.pro Fri Apr 16 14:51:30 2010 +0300
+++ b/camerauis/cameraxui/cxengine/tsrc/unit/unittest_cxequalitypresetssymbian/unittest_cxequalitypresetssymbian.pro Thu May 13 21:30:19 2010 +0300
@@ -14,7 +14,7 @@
TARGET = unittest_cxequalitypresetssymbian
-HEADERS += unittest_cxequalitypresetssymbian.h \
+HEADERS *= unittest_cxequalitypresetssymbian.h \
cxequalitypresetssymbian.h \
imagingconfigmanager.h \
cxenamespace.h \
@@ -22,7 +22,7 @@
cxefakesettings.h \
cxequalitydetails.h
-SOURCES += unittest_cxequalitypresetssymbian.cpp \
+SOURCES *= unittest_cxequalitypresetssymbian.cpp \
cxequalitypresetssymbian.cpp \
imagingconfigmanager.cpp \
cxefakesettings.cpp
diff -r d9aefe59d544 -r 3075d9b614e6 camerauis/cameraxui/cxengine/tsrc/unit/unittest_cxesettingscenrepstore/unittest_cxesettingscenrepstore.cpp
--- a/camerauis/cameraxui/cxengine/tsrc/unit/unittest_cxesettingscenrepstore/unittest_cxesettingscenrepstore.cpp Fri Apr 16 14:51:30 2010 +0300
+++ b/camerauis/cameraxui/cxengine/tsrc/unit/unittest_cxesettingscenrepstore/unittest_cxesettingscenrepstore.cpp Thu May 13 21:30:19 2010 +0300
@@ -127,7 +127,7 @@
keys.append(CxeRuntimeKeys::PRIMARY_CAMERA_CAPTURE_KEYS);
keys.append(CxeRuntimeKeys::PRIMARY_CAMERA_AUTOFOCUS_KEYS);
keys.append(CxeRuntimeKeys::SECONDARY_CAMERA_CAPTURE_KEYS);
- keys.append(CxeRuntimeKeys::CONTRAST_ITEMS);
+ keys.append(CxeRuntimeKeys::FREE_MEMORY_LEVELS);
QHash runtimesettings = mSettingsCenrepStore->loadRuntimeSettings(keys);
foreach(QString runtimekey, keys) {
diff -r d9aefe59d544 -r 3075d9b614e6 camerauis/cameraxui/cxengine/tsrc/unit/unittest_cxesettingscenrepstore/unittest_cxesettingscenrepstore.pro
--- a/camerauis/cameraxui/cxengine/tsrc/unit/unittest_cxesettingscenrepstore/unittest_cxesettingscenrepstore.pro Fri Apr 16 14:51:30 2010 +0300
+++ b/camerauis/cameraxui/cxengine/tsrc/unit/unittest_cxesettingscenrepstore/unittest_cxesettingscenrepstore.pro Thu May 13 21:30:19 2010 +0300
@@ -14,12 +14,12 @@
TARGET = unittest_cxesettingscenrepstore
-LIBS += -lxqsettingsmanager
+LIBS *= -lxqsettingsmanager
-SOURCES += unittest_cxesettingscenrepstore.cpp \
+SOURCES *= unittest_cxesettingscenrepstore.cpp \
cxesettingscenrepstore.cpp
-HEADERS += unittest_cxesettingscenrepstore.h \
+HEADERS *= unittest_cxesettingscenrepstore.h \
cxutils.h \
cxeerror.h \
cxenamespace.h \
diff -r d9aefe59d544 -r 3075d9b614e6 camerauis/cameraxui/cxengine/tsrc/unit/unittest_cxesettingscontrolsymbian/unittest_cxesettingscontrolsymbian.pro
--- a/camerauis/cameraxui/cxengine/tsrc/unit/unittest_cxesettingscontrolsymbian/unittest_cxesettingscontrolsymbian.pro Fri Apr 16 14:51:30 2010 +0300
+++ b/camerauis/cameraxui/cxengine/tsrc/unit/unittest_cxesettingscontrolsymbian/unittest_cxesettingscontrolsymbian.pro Thu May 13 21:30:19 2010 +0300
@@ -11,20 +11,19 @@
include(../unittest.pri)
-DEFINES += CXE_USE_DUMMY_CAMERA
-DEFINES = $$unique(DEFINES)
+DEFINES *= CXE_USE_DUMMY_CAMERA
TARGET = unittest_cxesettingscontrolsymbian
-LIBS += -lbitgdi
-LIBS += -lfbscli
-LIBS += -lecam
-LIBS += -lecamadvsettings
-LIBS += -lecamsnapshot
-LIBS += -lecamdirectviewfinder
-LIBS += -lecampluginsupport
+LIBS *= -lbitgdi
+LIBS *= -lfbscli
+LIBS *= -lecam
+LIBS *= -lecamadvsettings
+LIBS *= -lecamsnapshot
+LIBS *= -lecamdirectviewfinder
+LIBS *= -lecampluginsupport
-HEADERS += unittest_cxesettingscontrolsymbian.h \
+HEADERS *= unittest_cxesettingscontrolsymbian.h \
cxesettingscontrolsymbian.h \
cxesettings.h \
cxefakesettings.h \
@@ -36,7 +35,7 @@
cxeerrormappingsymbian.h \
cxedummycamera.h
-SOURCES += unittest_cxesettingscontrolsymbian.cpp \
+SOURCES *= unittest_cxesettingscontrolsymbian.cpp \
cxesettingscontrolsymbian.cpp \
cxefakesettings.cpp \
cxecameradevice.cpp \
diff -r d9aefe59d544 -r 3075d9b614e6 camerauis/cameraxui/cxengine/tsrc/unit/unittest_cxesettingsimp/unittest_cxesettingsimp.cpp
--- a/camerauis/cameraxui/cxengine/tsrc/unit/unittest_cxesettingsimp/unittest_cxesettingsimp.cpp Fri Apr 16 14:51:30 2010 +0300
+++ b/camerauis/cameraxui/cxengine/tsrc/unit/unittest_cxesettingsimp/unittest_cxesettingsimp.cpp Thu May 13 21:30:19 2010 +0300
@@ -172,11 +172,6 @@
mSettingsModel->getSettingValue(CxeSettingIds::IMAGE_SCENE_AUTO, testValue);
QCOMPARE(stringValue, QString(testValue.toString()));
- err = mSettingsImp->get(CxeSettingIds::IMAGE_SCENE_CLOSEUP, stringValue);
- QCOMPARE(err, CxeError::None);
- mSettingsModel->getSettingValue(CxeSettingIds::IMAGE_SCENE_CLOSEUP, testValue);
- QCOMPARE(stringValue, QString(testValue.toString()));
-
err = mSettingsImp->get(CxeSettingIds::IMAGE_SCENE_MACRO, stringValue);
QCOMPARE(err, CxeError::None);
mSettingsModel->getSettingValue(CxeSettingIds::IMAGE_SCENE_MACRO, testValue);
@@ -427,11 +422,6 @@
mSettingsModel->getSettingValue(CxeSettingIds::IMAGE_SCENE_AUTO, checkValue);
QCOMPARE(int(checkValue.toInt()), range);
- error = mSettingsImp->set(CxeSettingIds::IMAGE_SCENE_CLOSEUP, range);
- QCOMPARE(error, CxeError::None);
- mSettingsModel->getSettingValue(CxeSettingIds::IMAGE_SCENE_CLOSEUP, checkValue);
- QCOMPARE(int(checkValue.toInt()), range);
-
error = mSettingsImp->set(CxeSettingIds::IMAGE_SCENE_MACRO, range);
QCOMPARE(error, CxeError::None);
mSettingsModel->getSettingValue(CxeSettingIds::IMAGE_SCENE_MACRO, checkValue);
diff -r d9aefe59d544 -r 3075d9b614e6 camerauis/cameraxui/cxengine/tsrc/unit/unittest_cxesettingsimp/unittest_cxesettingsimp.pro
--- a/camerauis/cameraxui/cxengine/tsrc/unit/unittest_cxesettingsimp/unittest_cxesettingsimp.pro Fri Apr 16 14:51:30 2010 +0300
+++ b/camerauis/cameraxui/cxengine/tsrc/unit/unittest_cxesettingsimp/unittest_cxesettingsimp.pro Thu May 13 21:30:19 2010 +0300
@@ -8,9 +8,12 @@
# Nokia Corporation - initial contribution.
# Contributors:
# Description:
+
include(../unittest.pri)
+
TARGET = unittest_cxesettingsimp
-HEADERS += unittest_cxesettingsimp.h \
+
+HEADERS *= unittest_cxesettingsimp.h \
cxefakesettingsmodel.h \
cxesettings.h \
cxesettingsimp.h \
@@ -18,7 +21,8 @@
cxenamespace.h \
cxeerror.h \
cxesettingsmodel.h
-SOURCES += unittest_cxesettingsimp.cpp \
+
+SOURCES *= unittest_cxesettingsimp.cpp \
cxesettingsimp.cpp \
cxefakesettingsmodel.cpp
-
\ No newline at end of file
+
diff -r d9aefe59d544 -r 3075d9b614e6 camerauis/cameraxui/cxengine/tsrc/unit/unittest_cxesettingsmodelimp/unittest_cxesettingsmodelimp.pro
--- a/camerauis/cameraxui/cxengine/tsrc/unit/unittest_cxesettingsmodelimp/unittest_cxesettingsmodelimp.pro Fri Apr 16 14:51:30 2010 +0300
+++ b/camerauis/cameraxui/cxengine/tsrc/unit/unittest_cxesettingsmodelimp/unittest_cxesettingsmodelimp.pro Thu May 13 21:30:19 2010 +0300
@@ -8,12 +8,16 @@
# Nokia Corporation - initial contribution.
# Contributors:
# Description:
+
include(../unittest.pri)
+
TARGET = unittest_cxesettingsmodelimp
-SOURCES += unittest_cxesettingsmodelimp.cpp \
+
+SOURCES *= unittest_cxesettingsmodelimp.cpp \
cxesettingsmodelimp.cpp \
cxefakesettingsstore.cpp
-HEADERS += unittest_cxesettingsmodelimp.h \
+
+HEADERS *= unittest_cxesettingsmodelimp.h \
cxesettingsmodel.h \
cxesettingsmodelimp.h \
cxeerror.h \
diff -r d9aefe59d544 -r 3075d9b614e6 camerauis/cameraxui/cxengine/tsrc/unit/unittest_cxesettmappersymbian/unittest_cxesettmappersymbian.pro
--- a/camerauis/cameraxui/cxengine/tsrc/unit/unittest_cxesettmappersymbian/unittest_cxesettmappersymbian.pro Fri Apr 16 14:51:30 2010 +0300
+++ b/camerauis/cameraxui/cxengine/tsrc/unit/unittest_cxesettmappersymbian/unittest_cxesettmappersymbian.pro Thu May 13 21:30:19 2010 +0300
@@ -8,11 +8,16 @@
# Nokia Corporation - initial contribution.
# Contributors:
# Description:
+
include(../unittest.pri)
+
TARGET = unittest_cxesettmappersymbian
-LIBS += -lplatformenv
-SOURCES += unittest_cxesettingsmappersymbian.cpp \
+
+LIBS *= -lplatformenv
+
+SOURCES *= unittest_cxesettingsmappersymbian.cpp \
cxesettingsmappersymbian.cpp
-HEADERS += unittest_cxesettingsmappersymbian.h \
+
+HEADERS *= unittest_cxesettingsmappersymbian.h \
cxesettingsmappersymbian.h \
cxesettings.h
diff -r d9aefe59d544 -r 3075d9b614e6 camerauis/cameraxui/cxengine/tsrc/unit/unittest_cxestate/unittest_cxestate.pro
--- a/camerauis/cameraxui/cxengine/tsrc/unit/unittest_cxestate/unittest_cxestate.pro Fri Apr 16 14:51:30 2010 +0300
+++ b/camerauis/cameraxui/cxengine/tsrc/unit/unittest_cxestate/unittest_cxestate.pro Thu May 13 21:30:19 2010 +0300
@@ -8,10 +8,15 @@
# Nokia Corporation - initial contribution.
# Contributors:
# Description:
+
include(../unittest.pri)
+
TARGET = unittest_cxestate
-LIBS += -lplatformenv
-SOURCES += unittest_cxestate.cpp \
+
+LIBS *= -lplatformenv
+
+SOURCES *= unittest_cxestate.cpp \
cxestate.cpp
-HEADERS += unittest_cxestate.h \
+
+HEADERS *= unittest_cxestate.h \
cxestate.h
diff -r d9aefe59d544 -r 3075d9b614e6 camerauis/cameraxui/cxengine/tsrc/unit/unittest_cxestatemachine/unittest_cxestatemachine.pro
--- a/camerauis/cameraxui/cxengine/tsrc/unit/unittest_cxestatemachine/unittest_cxestatemachine.pro Fri Apr 16 14:51:30 2010 +0300
+++ b/camerauis/cameraxui/cxengine/tsrc/unit/unittest_cxestatemachine/unittest_cxestatemachine.pro Thu May 13 21:30:19 2010 +0300
@@ -8,15 +8,20 @@
# Nokia Corporation - initial contribution.
# Contributors:
# Description:
+
include(../unittest.pri)
+
TARGET = unittest_cxestatemachine
-LIBS += -lplatformenv
-SOURCES += unittest_cxestatemachine.cpp \
+
+LIBS *= -lplatformenv
+
+SOURCES *= unittest_cxestatemachine.cpp \
cxestatemachineunit.cpp \
cxestatemachinebase.cpp \
cxeerrormappingsymbian.cpp \
cxestate.cpp
-HEADERS += unittest_cxestatemachine.h \
+
+HEADERS *= unittest_cxestatemachine.h \
cxestatemachineunit.h \
cxestatemachinebase.h \
cxeerrormappingsymbian.h \
diff -r d9aefe59d544 -r 3075d9b614e6 camerauis/cameraxui/cxengine/tsrc/unit/unittest_cxestillcapturecontrolsymbian/unittest_cxestillcapturecontrolsymbian.cpp
--- a/camerauis/cameraxui/cxengine/tsrc/unit/unittest_cxestillcapturecontrolsymbian/unittest_cxestillcapturecontrolsymbian.cpp Fri Apr 16 14:51:30 2010 +0300
+++ b/camerauis/cameraxui/cxengine/tsrc/unit/unittest_cxestillcapturecontrolsymbian/unittest_cxestillcapturecontrolsymbian.cpp Thu May 13 21:30:19 2010 +0300
@@ -36,6 +36,7 @@
#include "cxefakesettings.h"
#include "cxefakequalitypresets.h"
#include "cxefakefilesavethread.h"
+#include "cxediskmonitor.h"
UnitTestCxeStillCaptureControlSymbian::UnitTestCxeStillCaptureControlSymbian()
: mFakeCameraDeviceControl(0)
@@ -70,6 +71,9 @@
mFakeAutoFocusControl = new CxeFakeAutoFocusControl();
mFakeQualityPresets = new CxeFakeQualityPresets();
mFakeFileSaveThread = new CxeFakeFileSaveThread();
+
+ mDiskMonitor = new CxeDiskMonitor(*mFakeSettings);
+
mStillCaptureControl = new CxeStillCaptureControlSymbian(
*mFakeCameraDevice,
@@ -80,7 +84,8 @@
*mFakeAutoFocusControl,
*mFakeSettings,
*mFakeQualityPresets,
- *mFakeFileSaveThread);
+ *mFakeFileSaveThread,
+ *mDiskMonitor);
// init supported qualities.
mStillCaptureControl->supportedImageQualities();
@@ -111,6 +116,8 @@
mSpyState = 0;
delete mFakeQualityPresets;
mFakeQualityPresets = 0;
+ delete mDiskMonitor;
+ mDiskMonitor = 0;
delete mFakeFileSaveThread;
mFakeFileSaveThread = 0;
}
diff -r d9aefe59d544 -r 3075d9b614e6 camerauis/cameraxui/cxengine/tsrc/unit/unittest_cxestillcapturecontrolsymbian/unittest_cxestillcapturecontrolsymbian.h
--- a/camerauis/cameraxui/cxengine/tsrc/unit/unittest_cxestillcapturecontrolsymbian/unittest_cxestillcapturecontrolsymbian.h Fri Apr 16 14:51:30 2010 +0300
+++ b/camerauis/cameraxui/cxengine/tsrc/unit/unittest_cxestillcapturecontrolsymbian/unittest_cxestillcapturecontrolsymbian.h Thu May 13 21:30:19 2010 +0300
@@ -36,6 +36,7 @@
class CxeFakeSettings;
class CxeFakeQualityPresets;
class CxeFakeFileSaveThread;
+class CxeDiskMonitor;
class UnitTestCxeStillCaptureControlSymbian : public QObject
{
@@ -75,6 +76,7 @@
QSignalSpy *mSpyState;
CxeFakeQualityPresets *mFakeQualityPresets;
CxeFakeFileSaveThread *mFakeFileSaveThread;
+ CxeDiskMonitor *mDiskMonitor;
};
#endif // UNITTEST_CXESTILLCAPTURECONTROLSYMBIAN_H
diff -r d9aefe59d544 -r 3075d9b614e6 camerauis/cameraxui/cxengine/tsrc/unit/unittest_cxestillcapturecontrolsymbian/unittest_cxestillcapturecontrolsymbian.pro
--- a/camerauis/cameraxui/cxengine/tsrc/unit/unittest_cxestillcapturecontrolsymbian/unittest_cxestillcapturecontrolsymbian.pro Fri Apr 16 14:51:30 2010 +0300
+++ b/camerauis/cameraxui/cxengine/tsrc/unit/unittest_cxestillcapturecontrolsymbian/unittest_cxestillcapturecontrolsymbian.pro Thu May 13 21:30:19 2010 +0300
@@ -10,30 +10,30 @@
# Description:
include(../unittest.pri)
+
TARGET = unittest_cxestillcapturecontrolsymbian
-LIBS += -lecamadvsettings
-LIBS += -lecamsnapshot
-LIBS += -lecamdirectviewfinder
-LIBS += -lfbscli
-LIBS += -lbitgdi
-LIBS += -lsysutil
-LIBS += -lbafl
-LIBS += -lmediaclientaudio
-LIBS += -lecom
-LIBS += -lecam
-LIBS += -lecamsnapshot
-LIBS += -lecampluginsupport
-LIBS += -lmmfcontrollerframework
-LIBS += -lxqsettingsmanager
-LIBS += -lsensrvclient
-LIBS += -lsensrvutil
-LIBS += -lplatformenv
+LIBS *= -lecamadvsettings
+LIBS *= -lecamsnapshot
+LIBS *= -lecamdirectviewfinder
+LIBS *= -lfbscli
+LIBS *= -lbitgdi
+LIBS *= -lsysutil
+LIBS *= -lbafl
+LIBS *= -lmediaclientaudio
+LIBS *= -lecom
+LIBS *= -lecam
+LIBS *= -lecamsnapshot
+LIBS *= -lecampluginsupport
+LIBS *= -lmmfcontrollerframework
+LIBS *= -lxqsettingsmanager
+LIBS *= -lsensrvclient
+LIBS *= -lsensrvutil
+LIBS *= -lplatformenv
-DEFINES += CXE_USE_DUMMY_CAMERA
-DEFINES = $$unique(DEFINES)
+DEFINES *= CXE_USE_DUMMY_CAMERA
-SOURCES += unittest_cxestillcapturecontrolsymbian.cpp \
+SOURCES *= unittest_cxestillcapturecontrolsymbian.cpp \
cxestillcapturecontrolsymbian.cpp \
cxestatemachine.cpp \
cxestate.cpp \
@@ -66,9 +66,11 @@
cxefakeautofocuscontrol.cpp \
cxefakesettings.cpp \
cxefilesavethread.cpp \
+ cxediskmonitor.cpp \
+ cxediskmonitorprivate.cpp \
cxefakefilesavethread.cpp
-HEADERS += unittest_cxestillcapturecontrolsymbian.h \
+HEADERS *= unittest_cxestillcapturecontrolsymbian.h \
cxestillcapturecontrolsymbian.h \
cxestate.h \
cxestatemachine.h \
@@ -84,6 +86,7 @@
cxutils.h \
cxeimagedataitem.h \
cxeimagedataitemsymbian.h \
+ cxeimagedataqueue.h \
cxeimagedataqueuesymbian.h \
cxestillcapturecontrol.h \
cxefakefilenamegenerator.h \
@@ -91,9 +94,6 @@
cxestillimagesymbian.h \
cxesensoreventhandler.h \
cxesensoreventhandlersymbian.h \
- cxeimagedataqueue.h \
- cxeimagedataitem.h \
- cxeimagedataitemsymbian.h \
sensor/xqdeviceorientation.h \
sensor/xqdeviceorientation_p.h \
sensor/xqaccsensor.h \
@@ -114,4 +114,6 @@
cxefakequalitypresets.h \
cxefakefilesavethread.h \
cxefilesavethread.h \
+ cxediskmonitor.h \
+ cxediskmonitorprivate.h \
cxequalitypresets.h
diff -r d9aefe59d544 -r 3075d9b614e6 camerauis/cameraxui/cxengine/tsrc/unit/unittest_cxestillimagesymbian/unittest_cxestillimagesymbian.pro
--- a/camerauis/cameraxui/cxengine/tsrc/unit/unittest_cxestillimagesymbian/unittest_cxestillimagesymbian.pro Fri Apr 16 14:51:30 2010 +0300
+++ b/camerauis/cameraxui/cxengine/tsrc/unit/unittest_cxestillimagesymbian/unittest_cxestillimagesymbian.pro Thu May 13 21:30:19 2010 +0300
@@ -8,11 +8,15 @@
# Nokia Corporation - initial contribution.
# Contributors:
# Description:
+
include(../unittest.pri)
+
TARGET = unittest_cxestillimagesymbian
-LIBS += -lplatformenv
-LIBS += -lsysutil
-SOURCES += unittest_cxestillimagesymbian.cpp \
+
+LIBS *= -lplatformenv
+LIBS *= -lsysutil
+
+SOURCES *= unittest_cxestillimagesymbian.cpp \
cxeimagedataitemsymbian.cpp \
cxestatemachine.cpp \
cxestatemachinebase.cpp \
@@ -20,7 +24,8 @@
cxeerrormappingsymbian.cpp \
cxestillimagesymbian.cpp \
cxesysutil.cpp
-HEADERS += unittest_cxestillimagesymbian.h \
+
+HEADERS *= unittest_cxestillimagesymbian.h \
cxestillimagesymbian.h \
cxeimagedataitemsymbian.h \
cxeimagedataitem.h \
@@ -30,4 +35,4 @@
cxeerrormappingsymbian.h \
cxutils.h \
cxesysutil.h
-
\ No newline at end of file
+
diff -r d9aefe59d544 -r 3075d9b614e6 camerauis/cameraxui/cxengine/tsrc/unit/unittest_cxetestutils/unittest_cxetestutils.pro
--- a/camerauis/cameraxui/cxengine/tsrc/unit/unittest_cxetestutils/unittest_cxetestutils.pro Fri Apr 16 14:51:30 2010 +0300
+++ b/camerauis/cameraxui/cxengine/tsrc/unit/unittest_cxetestutils/unittest_cxetestutils.pro Thu May 13 21:30:19 2010 +0300
@@ -13,14 +13,14 @@
TARGET = unittest_cxetestutils
-SOURCES += unittest_cxetestutils.cpp \
+SOURCES *= unittest_cxetestutils.cpp \
cxedummystatemachine.cpp \
cxestatemachine.cpp \
cxestate.cpp \
cxestatemachinebase.cpp \
cxeerrormappingsymbian.cpp
-HEADERS += unittest_cxetestutils.h \
+HEADERS *= unittest_cxetestutils.h \
cxedummystatemachine.h \
cxestatemachine.h \
cxestate.h \
diff -r d9aefe59d544 -r 3075d9b614e6 camerauis/cameraxui/cxengine/tsrc/unit/unittest_cxethumbnailmanagersymbian/unittest_cxethumbnailmanagersymbian.pro
--- a/camerauis/cameraxui/cxengine/tsrc/unit/unittest_cxethumbnailmanagersymbian/unittest_cxethumbnailmanagersymbian.pro Fri Apr 16 14:51:30 2010 +0300
+++ b/camerauis/cameraxui/cxengine/tsrc/unit/unittest_cxethumbnailmanagersymbian/unittest_cxethumbnailmanagersymbian.pro Thu May 13 21:30:19 2010 +0300
@@ -9,20 +9,20 @@
# Contributors:
# Description:
-CONFIG += cxeunit_no_system_paths
+CONFIG *= cxeunit_no_system_paths
include(../unittest.pri)
TARGET = unittest_cxethumbnailmanagersymbian
-INCLUDEPATH += ../system_include
-DEPENDPATH += ../system_include
+INCLUDEPATH *= ../system_include
+DEPENDPATH *= ../system_include
-HEADERS += unittest_cxethumbnailmanagersymbian.h \
+HEADERS *= unittest_cxethumbnailmanagersymbian.h \
cxethumbnailmanagersymbian.h \
thumbnailmanager_qt.h \
cxutils.h
-SOURCES += unittest_cxethumbnailmanagersymbian.cpp \
+SOURCES *= unittest_cxethumbnailmanagersymbian.cpp \
thumbnailmanager_qt.cpp \
cxethumbnailmanagersymbian.cpp
diff -r d9aefe59d544 -r 3075d9b614e6 camerauis/cameraxui/cxengine/tsrc/unit/unittest_cxevideocapturecontrolsymbian/cxevideocapturecontrolsymbianunit.cpp
--- a/camerauis/cameraxui/cxengine/tsrc/unit/unittest_cxevideocapturecontrolsymbian/cxevideocapturecontrolsymbianunit.cpp Fri Apr 16 14:51:30 2010 +0300
+++ b/camerauis/cameraxui/cxengine/tsrc/unit/unittest_cxevideocapturecontrolsymbian/cxevideocapturecontrolsymbianunit.cpp Thu May 13 21:30:19 2010 +0300
@@ -21,6 +21,7 @@
#include "cxevideocapturecontrolsymbianunit.h"
#include "cxefakeVideorecorderutility.h"
#include "cxutils.h"
+#include "cxediskmonitor.h"
CxeVideoCaptureControlSymbianUnit::CxeVideoCaptureControlSymbianUnit(
CxeCameraDevice &cameraDevice,
@@ -28,10 +29,11 @@
CxeCameraDeviceControl &cameraDeviceControl,
CxeFilenameGenerator &nameGenerator,
CxeSettings &settings,
- CxeQualityPresets &qualityPresets)
+ CxeQualityPresets &qualityPresets,
+ CxeDiskMonitor &diskMonitor)
: CxeVideoCaptureControlSymbian(cameraDevice, viewfinderControl,
cameraDeviceControl, nameGenerator,
- settings, qualityPresets)
+ settings, qualityPresets, diskMonitor)
{
CX_DEBUG_IN_FUNCTION();
}
diff -r d9aefe59d544 -r 3075d9b614e6 camerauis/cameraxui/cxengine/tsrc/unit/unittest_cxevideocapturecontrolsymbian/cxevideocapturecontrolsymbianunit.h
--- a/camerauis/cameraxui/cxengine/tsrc/unit/unittest_cxevideocapturecontrolsymbian/cxevideocapturecontrolsymbianunit.h Fri Apr 16 14:51:30 2010 +0300
+++ b/camerauis/cameraxui/cxengine/tsrc/unit/unittest_cxevideocapturecontrolsymbian/cxevideocapturecontrolsymbianunit.h Thu May 13 21:30:19 2010 +0300
@@ -37,7 +37,8 @@
CxeCameraDeviceControl &cameraDeviceControl,
CxeFilenameGenerator &nameGenerator,
CxeSettings &settings,
- CxeQualityPresets &qualityPresets);
+ CxeQualityPresets &qualityPresets,
+ CxeDiskMonitor &diskMonitor);
virtual ~CxeVideoCaptureControlSymbianUnit();
void createVideoRecorder();
diff -r d9aefe59d544 -r 3075d9b614e6 camerauis/cameraxui/cxengine/tsrc/unit/unittest_cxevideocapturecontrolsymbian/unittest_cxevideocapturecontrolsymbian.cpp
--- a/camerauis/cameraxui/cxengine/tsrc/unit/unittest_cxevideocapturecontrolsymbian/unittest_cxevideocapturecontrolsymbian.cpp Fri Apr 16 14:51:30 2010 +0300
+++ b/camerauis/cameraxui/cxengine/tsrc/unit/unittest_cxevideocapturecontrolsymbian/unittest_cxevideocapturecontrolsymbian.cpp Thu May 13 21:30:19 2010 +0300
@@ -29,6 +29,8 @@
#include "cxefakequalitypresets.h"
#include "cxefakesettings.h"
#include "cxutils.h"
+#include "cxediskmonitor.h"
+
// Enums
@@ -68,12 +70,14 @@
mFilenameGeneratorSymbian = new CxeFakeFilenameGenerator();
mFilenameGeneratorSymbian->init(Cxe::VideoMode);
mFakeQualityPresets = new CxeFakeQualityPresets();
+ mDiskMonitor = new CxeDiskMonitor(*mSettings);
mCxeVideoCaptureControlSymbian = new CxeVideoCaptureControlSymbianUnit(*mCameraDevice,
*mViewfinderControl,
*mCameraDeviceControl,
*mFilenameGeneratorSymbian,
*mSettings,
- *mFakeQualityPresets);
+ *mFakeQualityPresets,
+ *mDiskMonitor);
mCameraDevice->newCamera(mCameraDeviceControl->cameraIndex(), mCameraDeviceControl);
mSpyState = new QSignalSpy(mCxeVideoCaptureControlSymbian,
@@ -104,6 +108,8 @@
mCameraDevice = 0;
delete mFakeQualityPresets;
mFakeQualityPresets = 0;
+ delete mDiskMonitor;
+ mDiskMonitor = 0;
delete mSettings;
mSettings = 0;
delete mSpyState;
diff -r d9aefe59d544 -r 3075d9b614e6 camerauis/cameraxui/cxengine/tsrc/unit/unittest_cxevideocapturecontrolsymbian/unittest_cxevideocapturecontrolsymbian.h
--- a/camerauis/cameraxui/cxengine/tsrc/unit/unittest_cxevideocapturecontrolsymbian/unittest_cxevideocapturecontrolsymbian.h Fri Apr 16 14:51:30 2010 +0300
+++ b/camerauis/cameraxui/cxengine/tsrc/unit/unittest_cxevideocapturecontrolsymbian/unittest_cxevideocapturecontrolsymbian.h Thu May 13 21:30:19 2010 +0300
@@ -28,6 +28,7 @@
class CxeFakeFilenameGenerator;
class QSignalSpy;
class CxeFakeQualityPresets;
+class CxeDiskMonitor;
class UnitTestCxeVideoCaptureControlSymbian : public QObject
{
@@ -74,6 +75,7 @@
CxeFakeFilenameGenerator *mFilenameGeneratorSymbian;
QSignalSpy *mSpyState;
CxeFakeQualityPresets *mFakeQualityPresets;
+ CxeDiskMonitor *mDiskMonitor;
};
#endif // UNITTEST_CXESTILLIMAGESYMBIAN_H
diff -r d9aefe59d544 -r 3075d9b614e6 camerauis/cameraxui/cxengine/tsrc/unit/unittest_cxevideocapturecontrolsymbian/unittest_cxevideocapturecontrolsymbian.pro
--- a/camerauis/cameraxui/cxengine/tsrc/unit/unittest_cxevideocapturecontrolsymbian/unittest_cxevideocapturecontrolsymbian.pro Fri Apr 16 14:51:30 2010 +0300
+++ b/camerauis/cameraxui/cxengine/tsrc/unit/unittest_cxevideocapturecontrolsymbian/unittest_cxevideocapturecontrolsymbian.pro Thu May 13 21:30:19 2010 +0300
@@ -8,26 +8,28 @@
# Nokia Corporation - initial contribution.
# Contributors:
# Description:
+
include(../unittest.pri)
+
TARGET = unittest_cxevideocapturecontrolsymbian
-LIBS += -lecamadvsettings
-LIBS += -lecam
-LIBS += -lecampluginsupport
-LIBS += -lfbscli
-LIBS += -lbitgdi
-LIBS += -lecamdirectviewfinder
-LIBS += -lecamsnapshot
-
-LIBS += -lmediaclientvideo
-LIBS += -lmediaclientaudio
-LIBS += -lmmfcontrollerframework
-LIBS += -lplatformenv
+LIBS *= -lecamadvsettings
+LIBS *= -lecam
+LIBS *= -lecampluginsupport
+LIBS *= -lfbscli
+LIBS *= -lbitgdi
+LIBS *= -lecamdirectviewfinder
+LIBS *= -lecamsnapshot
+LIBS *= -lmediaclientvideo
+LIBS *= -lmediaclientaudio
+LIBS *= -lmmfcontrollerframework
+LIBS *= -lplatformenv
+LIBS *= -lsysutil
-DEFINES += CXE_USE_DUMMY_CAMERA
-DEFINES = $$unique(DEFINES)
-SOURCES += unittest_cxevideocapturecontrolsymbian.cpp \
+DEFINES *= CXE_USE_DUMMY_CAMERA
+
+SOURCES *= unittest_cxevideocapturecontrolsymbian.cpp \
cxevideocapturecontrolsymbian.cpp \
cxevideocapturecontrolsymbianunit.cpp \
cxefakevideorecorderutility.cpp \
@@ -48,9 +50,11 @@
cxesoundplayersymbian.cpp \
cxeerrormappingsymbian.cpp \
cxefakequalitypresets.cpp \
+ cxediskmonitor.cpp \
+ cxediskmonitorprivate.cpp \
cxesysutil.cpp
-HEADERS += unittest_cxevideocapturecontrolsymbian.h \
+HEADERS *= unittest_cxevideocapturecontrolsymbian.h \
cxevideocapturecontrolsymbian.h \
cxevideocapturecontrolsymbianunit.h \
cxevideorecorderutility.h \
@@ -63,6 +67,7 @@
cxecameradevice.h \
cxefakeviewfindercontrol.h \
cxeviewfindercontrol.h \
+ cxecameradevicecontrol.h \
cxefakecameradevicecontrol.h \
cxesettingsimp.h \
cxesettings.h \
@@ -72,9 +77,10 @@
cxestate.h \
cxeerrormappingsymbian.h \
cxestatemachinebase.h \
- cxecameradevicecontrol.h \
cxesettingsmappersymbian.h \
cxesoundplayersymbian.h \
+ cxefakequalitypresets.h \
cxutils.h \
- cxefakequalitypresets.h \
+ cxediskmonitor.h \
+ cxediskmonitorprivate.h \
cxesysutil.h
diff -r d9aefe59d544 -r 3075d9b614e6 camerauis/cameraxui/cxengine/tsrc/unit/unittest_cxeviewfindercontrolsymbian/unittest_cxeviewfindercontrolsymbian.pro
--- a/camerauis/cameraxui/cxengine/tsrc/unit/unittest_cxeviewfindercontrolsymbian/unittest_cxeviewfindercontrolsymbian.pro Fri Apr 16 14:51:30 2010 +0300
+++ b/camerauis/cameraxui/cxengine/tsrc/unit/unittest_cxeviewfindercontrolsymbian/unittest_cxeviewfindercontrolsymbian.pro Thu May 13 21:30:19 2010 +0300
@@ -8,23 +8,25 @@
# Nokia Corporation - initial contribution.
# Contributors:
# Description:
+
include(../unittest.pri)
+
TARGET = unittest_cxeviewfindercontrolsymbian
-LIBS += -lecamadvsettings
-LIBS += -lecam
-LIBS += -lecamsnapshot
-LIBS += -lecampluginsupport
-LIBS += -lecamdirectviewfinder
-LIBS += -lfbscli
-LIBS += -lbitgdi
-LIBS += -lcone
-LIBS += -lalfclient
-LIBS += -lalfdecoderserverclient
-DEFINES += CXE_USE_DUMMY_CAMERA
-DEFINES = $$unique(DEFINES)
+LIBS *= -lecamadvsettings
+LIBS *= -lecam
+LIBS *= -lecamsnapshot
+LIBS *= -lecampluginsupport
+LIBS *= -lecamdirectviewfinder
+LIBS *= -lfbscli
+LIBS *= -lbitgdi
+LIBS *= -lcone
+LIBS *= -lalfclient
+LIBS *= -lalfdecoderserverclient
-SOURCES += unittest_cxeviewfindercontrolsymbian.cpp \
+DEFINES *= CXE_USE_DUMMY_CAMERA
+
+SOURCES *= unittest_cxeviewfindercontrolsymbian.cpp \
cxeviewfindercontrolsymbian.cpp \
cxestatemachine.cpp \
cxestate.cpp \
@@ -38,7 +40,8 @@
cxefakecameradevicecontrol.cpp \
cxefakecontainer.cpp \
cxevideocontainer.cpp
-HEADERS += unittest_cxeviewfindercontrolsymbian.h \
+
+HEADERS *= unittest_cxeviewfindercontrolsymbian.h \
cxeviewfindercontrol.h \
cxeviewfindercontrolsymbian.h \
cxestatemachine.h \
diff -r d9aefe59d544 -r 3075d9b614e6 camerauis/cameraxui/cxengine/tsrc/unit/unittest_cxezoomcontrolsymbian/unittest_cxezoomcontrolsymbian.pro
--- a/camerauis/cameraxui/cxengine/tsrc/unit/unittest_cxezoomcontrolsymbian/unittest_cxezoomcontrolsymbian.pro Fri Apr 16 14:51:30 2010 +0300
+++ b/camerauis/cameraxui/cxengine/tsrc/unit/unittest_cxezoomcontrolsymbian/unittest_cxezoomcontrolsymbian.pro Thu May 13 21:30:19 2010 +0300
@@ -8,22 +8,21 @@
# Nokia Corporation - initial contribution.
# Contributors:
# Description:
+
include(../unittest.pri)
+
TARGET = unittest_cxezoomcontrolsymbian
-#LIBS += -lplatformenv
-LIBS += -lecamsnapshot
-LIBS += -lecamadvsettings
-LIBS += -lecam
-LIBS += -lecampluginsupport
-LIBS += -lfbscli
-LIBS += -lbitgdi
+LIBS *= -lecamsnapshot
+LIBS *= -lecamadvsettings
+LIBS *= -lecam
+LIBS *= -lecampluginsupport
+LIBS *= -lfbscli
+LIBS *= -lbitgdi
-DEFINES += CXE_USE_DUMMY_CAMERA
-DEFINES = $$unique(DEFINES)
+DEFINES *= CXE_USE_DUMMY_CAMERA
-
-SOURCES += unittest_cxezoomcontrolsymbian.cpp \
+SOURCES *= unittest_cxezoomcontrolsymbian.cpp \
cxezoomcontrolsymbian.cpp \
cxestate.cpp \
cxestatemachine.cpp \
@@ -38,7 +37,7 @@
cxefakecameradevicecontrol.cpp \
cxeerrormappingsymbian.cpp
-HEADERS += unittest_cxezoomcontrolsymbian.h \
+HEADERS *= unittest_cxezoomcontrolsymbian.h \
cxezoomcontrolsymbian.h \
cxezoomcontrol.h \
cxestate.h \
diff -r d9aefe59d544 -r 3075d9b614e6 camerauis/cameraxui/cxui/cxui.pro
--- a/camerauis/cameraxui/cxui/cxui.pro Fri Apr 16 14:51:30 2010 +0300
+++ b/camerauis/cameraxui/cxui/cxui.pro Thu May 13 21:30:19 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,13 +26,16 @@
TARGET.EPOCHEAPSIZE = 0x020000 0x1000000
ICON = ./icons/cxui.svg
RSS_RULES = "group_name=\"Qt Camera\";"
+ # Fix for QMake translating INCLUDEPATH to SYSTEMINCLUDE
+ # and TraceCompiler needing USERINCLUDE.
+ MMP_RULES += "USERINCLUDE traces"
}
DEPENDPATH += ../cxengine/inc/api
VPATH += src \
inc
INCLUDEPATH += inc \
- ../traces
+ traces
LIBS += -lecam \
-lecamsnapshot \
@@ -44,10 +47,14 @@
-lcommonui \
-lxqsettingsmanager \
-lxqutils \
- -lalfclient \
-lxqservice \
-lxqserviceutil \
- -lshareui
+ -lshareui \
+ -lcone \
+ -lefsrv \
+ -lws32 \
+ -lgdi \
+ -lapgrfx
CONFIG += hb
CONFIG += service
@@ -55,61 +62,71 @@
SERVICE.FILE = cxui_service_conf.xml
SERVICE.OPTIONS = embeddable
-HB += hbcore hbwidgets hbutils hbtools hbfeedback
+HB += hbcore hbwidgets hbfeedback hbutils
# Input
-HEADERS += cxuiprecaptureview.h \
+HEADERS += cxuiapplication.h \
+ cxuiapplicationframeworkmonitor.h \
+ cxuiapplicationframeworkmonitorprivate.h \
+ cxuiprecaptureview.h \
cxuistillprecaptureview.h \
- cxuistillprecaptureview2.h \
cxuivideoprecaptureview.h \
- cxuivideoprecaptureview2.h \
cxuipostcaptureview.h \
cxestillcapturecontrol.h \
cxuicapturekeyhandler.h \
cxuiviewmanager.h \
- ../traces/OstTraceDefinitions.h \
cxuidocumentloader.h \
cxuidisplaypropertyhandler.h \
cxuisettingdialog.h \
- cxuisettingbutton.h \
cxuisettingslider.h \
cxuiselftimer.h \
cxuisettingradiobuttonlist.h \
cxuiscenelabel.h \
- cxuisettingbuttoncontainer.h \
cxuierrormanager.h \
cxuistandby.h \
cxuisettingradiobuttonlistmodel.h \
cxuisettingsinfo.h \
cxuisettingxmlreader.h \
- cxuiserviceprovider.h
+ cxuiserviceprovider.h \
+ cxuiscenemodeview.h \
+ cxuizoomslider.h \
+ traces/OstTraceDefinitions.h
SOURCES += main.cpp \
+ cxuiapplication.cpp \
+ cxuiapplicationframeworkmonitor.cpp \
+ cxuiapplicationframeworkmonitorprivate.cpp \
cxuiprecaptureview.cpp \
cxuivideoprecaptureview.cpp \
- cxuivideoprecaptureview2.cpp \
cxuistillprecaptureview.cpp \
- cxuistillprecaptureview2.cpp \
cxuipostcaptureview.cpp \
cxuicapturekeyhandler.cpp \
cxuiviewmanager.cpp \
cxuidocumentloader.cpp \
cxuidisplaypropertyhandler.cpp \
cxuisettingdialog.cpp \
- cxuisettingbutton.cpp \
cxuisettingslider.cpp \
cxuiselftimer.cpp \
cxuisettingradiobuttonlist.cpp \
cxuiscenelabel.cpp \
- cxuisettingbuttoncontainer.cpp \
cxuierrormanager.cpp \
cxuistandby.cpp \
cxuisettingradiobuttonlistmodel.cpp \
cxuisettingsinfo.cpp \
cxuisettingxmlreader.cpp \
- cxuiserviceprovider.cpp
-
+ cxuiserviceprovider.cpp \
+ cxuiscenemodeview.cpp \
+ cxuizoomslider.cpp
RESOURCES += cxui.qrc
+# Variating internal and external icons for scene selection view
+SCENEICONDIR = ../internal/icons
+exists($$SCENEICONDIR) {
+ RESOURCES += cxuiinternalsceneimages.qrc
+}
+else {
+ RESOURCES += cxuiexternalsceneimages.qrc
+}
+
TRANSLATIONS = camera.ts
diff -r d9aefe59d544 -r 3075d9b614e6 camerauis/cameraxui/cxui/cxui.qrc
--- a/camerauis/cameraxui/cxui/cxui.qrc Fri Apr 16 14:51:30 2010 +0300
+++ b/camerauis/cameraxui/cxui/cxui.qrc Thu May 13 21:30:19 2010 +0300
@@ -1,81 +1,11 @@
- icons/blackbg.png
- icons/qgn_indi_cam4_antired.svg
- icons/qgn_indi_cam4_autoflash.svg
- icons/qgn_indi_cam4_camera.svg
- icons/qgn_indi_cam4_camera_second.svg
- icons/qgn_indi_cam4_colour.svg
- icons/qgn_indi_cam4_colour_bw.svg
- icons/qgn_indi_cam4_colour_negative.svg
- icons/qgn_indi_cam4_colour_normal.svg
- icons/qgn_indi_cam4_colour_sepia.svg
- icons/qgn_indi_cam4_colour_vivid.svg
- icons/qgn_indi_cam4_contrast.svg
- icons/qgn_indi_cam4_exposure.svg
- icons/qgn_indi_cam4_flash_off.svg
- icons/qgn_indi_cam4_flash_on.svg
- icons/qgn_indi_cam4_goto_gallery.svg
- icons/qgn_indi_cam4_gridviewer.svg
- icons/qgn_indi_cam4_iso.svg
- icons/qgn_indi_cam4_iso_auto.svg
- icons/qgn_indi_cam4_iso_high.svg
- icons/qgn_indi_cam4_iso_low.svg
- icons/qgn_indi_cam4_iso_medium.svg
- icons/qgn_indi_cam4_light_off.svg
- icons/qgn_indi_cam4_light_on.svg
- icons/qgn_indi_cam4_mode_auto.svg
- icons/qgn_indi_cam4_mode_camera.svg
- icons/qgn_indi_cam4_mode_closeup.svg
- icons/qgn_indi_cam4_mode_landscape.svg
- icons/qgn_indi_cam4_mode_night.svg
- icons/qgn_indi_cam4_mode_portrait.svg
- icons/qgn_indi_cam4_mode_portrait_night.svg
- icons/qgn_indi_cam4_mode_sport.svg
- icons/qgn_indi_cam4_selftimer.svg
- icons/qgn_indi_cam4_sequence_burst.svg
- icons/qgn_indi_cam4_sharpness.svg
- icons/qgn_indi_cam4_tb_capture.svg
- icons/qgn_indi_cam4_tb_delete.svg
- icons/qgn_indi_cam4_tb_extension.svg
- icons/qgn_indi_cam4_tb_flash.svg
- icons/qgn_indi_cam4_tb_play.svg
- icons/qgn_indi_cam4_tb_record.svg
- icons/qgn_indi_cam4_tb_switch_still.svg
- icons/qgn_indi_cam4_tb_switch_video.svg
- icons/qgn_indi_cam4_tb_upload.svg
- icons/qgn_indi_cam4_wb.svg
- icons/qgn_indi_cam4_wb_auto.svg
- icons/qgn_indi_cam4_wb_cloudy.svg
- icons/qgn_indi_cam4_wb_fluorecent.svg
- icons/qgn_indi_cam4_wb_sunny.svg
- icons/qgn_indi_cam4_wb_tungsten.svg
- icons/qgn_indi_cams_tb_rec_pause.svg
- icons/qgn_indi_cams_tb_rec_stop.svg
- icons/qgn_indi_tb_zoom.svg
- icons/qgn_indi_vid4_video.svg
- icons/qgn_prop_vc_media_play.svg
- icons/scene_automatic.png
- icons/scene_landscape.png
- icons/scene_lowlight.png
- icons/scene_macro.png
- icons/scene_night.png
- icons/scene_nightportrait.png
- icons/scene_portrait.png
- icons/scene_sport.png
- icons/whitebg.png
- icons/zoomin.svg
- icons/zoomout.svg
- icons/qtg_mono_tick.svg
- layouts/setting_still_scenemode.docml
- layouts/setting_video_scenemode.docml
+ layouts/setting_scenemode.docml
layouts/standbymode_popup.docml
layouts/view_still_precapture.docml
- layouts/view_still_precapture_secondary.docml
layouts/view_video_precapture.docml
- layouts/view_video_precapture_secondary.docml
layouts/view_postcapture.docml
layouts/errornote_popup.docml
layouts/setting.docml
diff -r d9aefe59d544 -r 3075d9b614e6 camerauis/cameraxui/cxui/cxui_service_conf.xml
--- a/camerauis/cameraxui/cxui/cxui_service_conf.xml Fri Apr 16 14:51:30 2010 +0300
+++ b/camerauis/cameraxui/cxui/cxui_service_conf.xml Thu May 13 21:30:19 2010 +0300
@@ -1,7 +1,7 @@
-
+
Camera Service for taking pictures and videos
-
+
Camera interface
diff -r d9aefe59d544 -r 3075d9b614e6 camerauis/cameraxui/cxui/cxuiexternalsceneimages.qrc
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/camerauis/cameraxui/cxui/cxuiexternalsceneimages.qrc Thu May 13 21:30:19 2010 +0300
@@ -0,0 +1,12 @@
+
+
+ icons/scene_automatic.png
+ icons/scene_close-up.png
+ icons/scene_landscape.png
+ icons/scene_night.png
+ icons/scene_nightportrait.png
+ icons/scene_sport.png
+ icons/scene_lowlight.png
+ icons/scene_portrait.png
+
+
\ No newline at end of file
diff -r d9aefe59d544 -r 3075d9b614e6 camerauis/cameraxui/cxui/cxuiinternalsceneimages.qrc
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/camerauis/cameraxui/cxui/cxuiinternalsceneimages.qrc Thu May 13 21:30:19 2010 +0300
@@ -0,0 +1,12 @@
+
+
+ ../internal/icons/scene_automatic.png
+ ../internal/icons/scene_close-up.png
+ ../internal/icons/scene_landscape.png
+ ../internal/icons/scene_night.png
+ ../internal/icons/scene_nightportrait.png
+ ../internal/icons/scene_sport.png
+ ../internal/icons/scene_lowlight.png
+ ../internal/icons/scene_portrait.png
+
+
\ No newline at end of file
diff -r d9aefe59d544 -r 3075d9b614e6 camerauis/cameraxui/cxui/icons/blackbg.png
Binary file camerauis/cameraxui/cxui/icons/blackbg.png has changed
diff -r d9aefe59d544 -r 3075d9b614e6 camerauis/cameraxui/cxui/icons/qgn_indi_cam4_antired.svg
--- a/camerauis/cameraxui/cxui/icons/qgn_indi_cam4_antired.svg Fri Apr 16 14:51:30 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,13 +0,0 @@
-
-
-
diff -r d9aefe59d544 -r 3075d9b614e6 camerauis/cameraxui/cxui/icons/qgn_indi_cam4_autoflash.svg
--- a/camerauis/cameraxui/cxui/icons/qgn_indi_cam4_autoflash.svg Fri Apr 16 14:51:30 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,10 +0,0 @@
-
-
-
diff -r d9aefe59d544 -r 3075d9b614e6 camerauis/cameraxui/cxui/icons/qgn_indi_cam4_camera.svg
--- a/camerauis/cameraxui/cxui/icons/qgn_indi_cam4_camera.svg Fri Apr 16 14:51:30 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,11 +0,0 @@
-
-
-
diff -r d9aefe59d544 -r 3075d9b614e6 camerauis/cameraxui/cxui/icons/qgn_indi_cam4_camera_second.svg
--- a/camerauis/cameraxui/cxui/icons/qgn_indi_cam4_camera_second.svg Fri Apr 16 14:51:30 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,12 +0,0 @@
-
-
-
diff -r d9aefe59d544 -r 3075d9b614e6 camerauis/cameraxui/cxui/icons/qgn_indi_cam4_colour.svg
--- a/camerauis/cameraxui/cxui/icons/qgn_indi_cam4_colour.svg Fri Apr 16 14:51:30 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,14 +0,0 @@
-
-
-
diff -r d9aefe59d544 -r 3075d9b614e6 camerauis/cameraxui/cxui/icons/qgn_indi_cam4_colour_bw.svg
--- a/camerauis/cameraxui/cxui/icons/qgn_indi_cam4_colour_bw.svg Fri Apr 16 14:51:30 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,12 +0,0 @@
-
-
-
diff -r d9aefe59d544 -r 3075d9b614e6 camerauis/cameraxui/cxui/icons/qgn_indi_cam4_colour_negative.svg
--- a/camerauis/cameraxui/cxui/icons/qgn_indi_cam4_colour_negative.svg Fri Apr 16 14:51:30 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,11 +0,0 @@
-
-
-
diff -r d9aefe59d544 -r 3075d9b614e6 camerauis/cameraxui/cxui/icons/qgn_indi_cam4_colour_normal.svg
--- a/camerauis/cameraxui/cxui/icons/qgn_indi_cam4_colour_normal.svg Fri Apr 16 14:51:30 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,14 +0,0 @@
-
-
-
diff -r d9aefe59d544 -r 3075d9b614e6 camerauis/cameraxui/cxui/icons/qgn_indi_cam4_colour_sepia.svg
--- a/camerauis/cameraxui/cxui/icons/qgn_indi_cam4_colour_sepia.svg Fri Apr 16 14:51:30 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,14 +0,0 @@
-
-
-
diff -r d9aefe59d544 -r 3075d9b614e6 camerauis/cameraxui/cxui/icons/qgn_indi_cam4_colour_vivid.svg
--- a/camerauis/cameraxui/cxui/icons/qgn_indi_cam4_colour_vivid.svg Fri Apr 16 14:51:30 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,18 +0,0 @@
-
-
-
diff -r d9aefe59d544 -r 3075d9b614e6 camerauis/cameraxui/cxui/icons/qgn_indi_cam4_contrast.svg
--- a/camerauis/cameraxui/cxui/icons/qgn_indi_cam4_contrast.svg Fri Apr 16 14:51:30 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,7 +0,0 @@
-
-
-
diff -r d9aefe59d544 -r 3075d9b614e6 camerauis/cameraxui/cxui/icons/qgn_indi_cam4_exposure.svg
--- a/camerauis/cameraxui/cxui/icons/qgn_indi_cam4_exposure.svg Fri Apr 16 14:51:30 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,11 +0,0 @@
-
-
-
diff -r d9aefe59d544 -r 3075d9b614e6 camerauis/cameraxui/cxui/icons/qgn_indi_cam4_flash_off.svg
--- a/camerauis/cameraxui/cxui/icons/qgn_indi_cam4_flash_off.svg Fri Apr 16 14:51:30 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,13 +0,0 @@
-
-
-
diff -r d9aefe59d544 -r 3075d9b614e6 camerauis/cameraxui/cxui/icons/qgn_indi_cam4_flash_on.svg
--- a/camerauis/cameraxui/cxui/icons/qgn_indi_cam4_flash_on.svg Fri Apr 16 14:51:30 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,11 +0,0 @@
-
-
-
diff -r d9aefe59d544 -r 3075d9b614e6 camerauis/cameraxui/cxui/icons/qgn_indi_cam4_goto_gallery.svg
--- a/camerauis/cameraxui/cxui/icons/qgn_indi_cam4_goto_gallery.svg Fri Apr 16 14:51:30 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,14 +0,0 @@
-
-
-
diff -r d9aefe59d544 -r 3075d9b614e6 camerauis/cameraxui/cxui/icons/qgn_indi_cam4_gridviewer.svg
--- a/camerauis/cameraxui/cxui/icons/qgn_indi_cam4_gridviewer.svg Fri Apr 16 14:51:30 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,13 +0,0 @@
-
-
-
diff -r d9aefe59d544 -r 3075d9b614e6 camerauis/cameraxui/cxui/icons/qgn_indi_cam4_iso.svg
--- a/camerauis/cameraxui/cxui/icons/qgn_indi_cam4_iso.svg Fri Apr 16 14:51:30 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,11 +0,0 @@
-
-
-
diff -r d9aefe59d544 -r 3075d9b614e6 camerauis/cameraxui/cxui/icons/qgn_indi_cam4_iso_auto.svg
--- a/camerauis/cameraxui/cxui/icons/qgn_indi_cam4_iso_auto.svg Fri Apr 16 14:51:30 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,21 +0,0 @@
-
-
-
diff -r d9aefe59d544 -r 3075d9b614e6 camerauis/cameraxui/cxui/icons/qgn_indi_cam4_iso_high.svg
--- a/camerauis/cameraxui/cxui/icons/qgn_indi_cam4_iso_high.svg Fri Apr 16 14:51:30 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,17 +0,0 @@
-
-
-
diff -r d9aefe59d544 -r 3075d9b614e6 camerauis/cameraxui/cxui/icons/qgn_indi_cam4_iso_low.svg
--- a/camerauis/cameraxui/cxui/icons/qgn_indi_cam4_iso_low.svg Fri Apr 16 14:51:30 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,17 +0,0 @@
-
-
-
diff -r d9aefe59d544 -r 3075d9b614e6 camerauis/cameraxui/cxui/icons/qgn_indi_cam4_iso_medium.svg
--- a/camerauis/cameraxui/cxui/icons/qgn_indi_cam4_iso_medium.svg Fri Apr 16 14:51:30 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,17 +0,0 @@
-
-
-
diff -r d9aefe59d544 -r 3075d9b614e6 camerauis/cameraxui/cxui/icons/qgn_indi_cam4_light_off.svg
--- a/camerauis/cameraxui/cxui/icons/qgn_indi_cam4_light_off.svg Fri Apr 16 14:51:30 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,9 +0,0 @@
-
-
-
\ No newline at end of file
diff -r d9aefe59d544 -r 3075d9b614e6 camerauis/cameraxui/cxui/icons/qgn_indi_cam4_light_on.svg
--- a/camerauis/cameraxui/cxui/icons/qgn_indi_cam4_light_on.svg Fri Apr 16 14:51:30 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,14 +0,0 @@
-
-
-
\ No newline at end of file
diff -r d9aefe59d544 -r 3075d9b614e6 camerauis/cameraxui/cxui/icons/qgn_indi_cam4_mode_auto.svg
--- a/camerauis/cameraxui/cxui/icons/qgn_indi_cam4_mode_auto.svg Fri Apr 16 14:51:30 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,11 +0,0 @@
-
-
-
diff -r d9aefe59d544 -r 3075d9b614e6 camerauis/cameraxui/cxui/icons/qgn_indi_cam4_mode_camera.svg
--- a/camerauis/cameraxui/cxui/icons/qgn_indi_cam4_mode_camera.svg Fri Apr 16 14:51:30 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,9 +0,0 @@
-
-
-
diff -r d9aefe59d544 -r 3075d9b614e6 camerauis/cameraxui/cxui/icons/qgn_indi_cam4_mode_closeup.svg
--- a/camerauis/cameraxui/cxui/icons/qgn_indi_cam4_mode_closeup.svg Fri Apr 16 14:51:30 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,13 +0,0 @@
-
-
-
diff -r d9aefe59d544 -r 3075d9b614e6 camerauis/cameraxui/cxui/icons/qgn_indi_cam4_mode_landscape.svg
--- a/camerauis/cameraxui/cxui/icons/qgn_indi_cam4_mode_landscape.svg Fri Apr 16 14:51:30 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,10 +0,0 @@
-
-
-
diff -r d9aefe59d544 -r 3075d9b614e6 camerauis/cameraxui/cxui/icons/qgn_indi_cam4_mode_night.svg
--- a/camerauis/cameraxui/cxui/icons/qgn_indi_cam4_mode_night.svg Fri Apr 16 14:51:30 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,11 +0,0 @@
-
-
-
diff -r d9aefe59d544 -r 3075d9b614e6 camerauis/cameraxui/cxui/icons/qgn_indi_cam4_mode_portrait.svg
--- a/camerauis/cameraxui/cxui/icons/qgn_indi_cam4_mode_portrait.svg Fri Apr 16 14:51:30 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,10 +0,0 @@
-
-
-
diff -r d9aefe59d544 -r 3075d9b614e6 camerauis/cameraxui/cxui/icons/qgn_indi_cam4_mode_portrait_night.svg
--- a/camerauis/cameraxui/cxui/icons/qgn_indi_cam4_mode_portrait_night.svg Fri Apr 16 14:51:30 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,12 +0,0 @@
-
-
-
diff -r d9aefe59d544 -r 3075d9b614e6 camerauis/cameraxui/cxui/icons/qgn_indi_cam4_mode_sport.svg
--- a/camerauis/cameraxui/cxui/icons/qgn_indi_cam4_mode_sport.svg Fri Apr 16 14:51:30 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,10 +0,0 @@
-
-
-
diff -r d9aefe59d544 -r 3075d9b614e6 camerauis/cameraxui/cxui/icons/qgn_indi_cam4_selftimer.svg
--- a/camerauis/cameraxui/cxui/icons/qgn_indi_cam4_selftimer.svg Fri Apr 16 14:51:30 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,12 +0,0 @@
-
-
-
diff -r d9aefe59d544 -r 3075d9b614e6 camerauis/cameraxui/cxui/icons/qgn_indi_cam4_sequence_burst.svg
--- a/camerauis/cameraxui/cxui/icons/qgn_indi_cam4_sequence_burst.svg Fri Apr 16 14:51:30 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,11 +0,0 @@
-
-
-
diff -r d9aefe59d544 -r 3075d9b614e6 camerauis/cameraxui/cxui/icons/qgn_indi_cam4_sharpness.svg
--- a/camerauis/cameraxui/cxui/icons/qgn_indi_cam4_sharpness.svg Fri Apr 16 14:51:30 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,10 +0,0 @@
-
-
-
diff -r d9aefe59d544 -r 3075d9b614e6 camerauis/cameraxui/cxui/icons/qgn_indi_cam4_tb_capture.svg
--- a/camerauis/cameraxui/cxui/icons/qgn_indi_cam4_tb_capture.svg Fri Apr 16 14:51:30 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,10 +0,0 @@
-
-
-
diff -r d9aefe59d544 -r 3075d9b614e6 camerauis/cameraxui/cxui/icons/qgn_indi_cam4_tb_delete.svg
--- a/camerauis/cameraxui/cxui/icons/qgn_indi_cam4_tb_delete.svg Fri Apr 16 14:51:30 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,10 +0,0 @@
-
-
-
diff -r d9aefe59d544 -r 3075d9b614e6 camerauis/cameraxui/cxui/icons/qgn_indi_cam4_tb_extension.svg
--- a/camerauis/cameraxui/cxui/icons/qgn_indi_cam4_tb_extension.svg Fri Apr 16 14:51:30 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,19 +0,0 @@
-
-
-
diff -r d9aefe59d544 -r 3075d9b614e6 camerauis/cameraxui/cxui/icons/qgn_indi_cam4_tb_flash.svg
--- a/camerauis/cameraxui/cxui/icons/qgn_indi_cam4_tb_flash.svg Fri Apr 16 14:51:30 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,15 +0,0 @@
-
-
-
diff -r d9aefe59d544 -r 3075d9b614e6 camerauis/cameraxui/cxui/icons/qgn_indi_cam4_tb_play.svg
--- a/camerauis/cameraxui/cxui/icons/qgn_indi_cam4_tb_play.svg Fri Apr 16 14:51:30 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,9 +0,0 @@
-
-
-
diff -r d9aefe59d544 -r 3075d9b614e6 camerauis/cameraxui/cxui/icons/qgn_indi_cam4_tb_record.svg
--- a/camerauis/cameraxui/cxui/icons/qgn_indi_cam4_tb_record.svg Fri Apr 16 14:51:30 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,9 +0,0 @@
-
-
-
diff -r d9aefe59d544 -r 3075d9b614e6 camerauis/cameraxui/cxui/icons/qgn_indi_cam4_tb_switch_still.svg
--- a/camerauis/cameraxui/cxui/icons/qgn_indi_cam4_tb_switch_still.svg Fri Apr 16 14:51:30 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,11 +0,0 @@
-
-
-
diff -r d9aefe59d544 -r 3075d9b614e6 camerauis/cameraxui/cxui/icons/qgn_indi_cam4_tb_switch_video.svg
--- a/camerauis/cameraxui/cxui/icons/qgn_indi_cam4_tb_switch_video.svg Fri Apr 16 14:51:30 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,12 +0,0 @@
-
-
-
diff -r d9aefe59d544 -r 3075d9b614e6 camerauis/cameraxui/cxui/icons/qgn_indi_cam4_tb_upload.svg
--- a/camerauis/cameraxui/cxui/icons/qgn_indi_cam4_tb_upload.svg Fri Apr 16 14:51:30 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,7 +0,0 @@
-
-
-
diff -r d9aefe59d544 -r 3075d9b614e6 camerauis/cameraxui/cxui/icons/qgn_indi_cam4_wb.svg
--- a/camerauis/cameraxui/cxui/icons/qgn_indi_cam4_wb.svg Fri Apr 16 14:51:30 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,12 +0,0 @@
-
-
-
diff -r d9aefe59d544 -r 3075d9b614e6 camerauis/cameraxui/cxui/icons/qgn_indi_cam4_wb_auto.svg
--- a/camerauis/cameraxui/cxui/icons/qgn_indi_cam4_wb_auto.svg Fri Apr 16 14:51:30 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,8 +0,0 @@
-
-
-
diff -r d9aefe59d544 -r 3075d9b614e6 camerauis/cameraxui/cxui/icons/qgn_indi_cam4_wb_cloudy.svg
--- a/camerauis/cameraxui/cxui/icons/qgn_indi_cam4_wb_cloudy.svg Fri Apr 16 14:51:30 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,9 +0,0 @@
-
-
-
diff -r d9aefe59d544 -r 3075d9b614e6 camerauis/cameraxui/cxui/icons/qgn_indi_cam4_wb_fluorecent.svg
--- a/camerauis/cameraxui/cxui/icons/qgn_indi_cam4_wb_fluorecent.svg Fri Apr 16 14:51:30 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,16 +0,0 @@
-
-
-
diff -r d9aefe59d544 -r 3075d9b614e6 camerauis/cameraxui/cxui/icons/qgn_indi_cam4_wb_sunny.svg
--- a/camerauis/cameraxui/cxui/icons/qgn_indi_cam4_wb_sunny.svg Fri Apr 16 14:51:30 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,18 +0,0 @@
-
-
-
diff -r d9aefe59d544 -r 3075d9b614e6 camerauis/cameraxui/cxui/icons/qgn_indi_cam4_wb_tungsten.svg
--- a/camerauis/cameraxui/cxui/icons/qgn_indi_cam4_wb_tungsten.svg Fri Apr 16 14:51:30 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,11 +0,0 @@
-
-
-
diff -r d9aefe59d544 -r 3075d9b614e6 camerauis/cameraxui/cxui/icons/qgn_indi_cams_tb_rec_pause.svg
--- a/camerauis/cameraxui/cxui/icons/qgn_indi_cams_tb_rec_pause.svg Fri Apr 16 14:51:30 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,9 +0,0 @@
-
-
-
diff -r d9aefe59d544 -r 3075d9b614e6 camerauis/cameraxui/cxui/icons/qgn_indi_cams_tb_rec_stop.svg
--- a/camerauis/cameraxui/cxui/icons/qgn_indi_cams_tb_rec_stop.svg Fri Apr 16 14:51:30 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,8 +0,0 @@
-
-
-
diff -r d9aefe59d544 -r 3075d9b614e6 camerauis/cameraxui/cxui/icons/qgn_indi_tb_zoom.svg
--- a/camerauis/cameraxui/cxui/icons/qgn_indi_tb_zoom.svg Fri Apr 16 14:51:30 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,9 +0,0 @@
-
-
-
diff -r d9aefe59d544 -r 3075d9b614e6 camerauis/cameraxui/cxui/icons/qgn_indi_vid4_video.svg
--- a/camerauis/cameraxui/cxui/icons/qgn_indi_vid4_video.svg Fri Apr 16 14:51:30 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,11 +0,0 @@
-
-
-
diff -r d9aefe59d544 -r 3075d9b614e6 camerauis/cameraxui/cxui/icons/qgn_prop_vc_media_play.svg
--- a/camerauis/cameraxui/cxui/icons/qgn_prop_vc_media_play.svg Fri Apr 16 14:51:30 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,21 +0,0 @@
-
-
-
diff -r d9aefe59d544 -r 3075d9b614e6 camerauis/cameraxui/cxui/icons/qtg_mono_tick.svg
--- a/camerauis/cameraxui/cxui/icons/qtg_mono_tick.svg Fri Apr 16 14:51:30 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,6 +0,0 @@
-
-
-
diff -r d9aefe59d544 -r 3075d9b614e6 camerauis/cameraxui/cxui/icons/scene_automatic.png
Binary file camerauis/cameraxui/cxui/icons/scene_automatic.png has changed
diff -r d9aefe59d544 -r 3075d9b614e6 camerauis/cameraxui/cxui/icons/scene_close-up.png
Binary file camerauis/cameraxui/cxui/icons/scene_close-up.png has changed
diff -r d9aefe59d544 -r 3075d9b614e6 camerauis/cameraxui/cxui/icons/scene_landscape.png
Binary file camerauis/cameraxui/cxui/icons/scene_landscape.png has changed
diff -r d9aefe59d544 -r 3075d9b614e6 camerauis/cameraxui/cxui/icons/scene_lowlight.png
Binary file camerauis/cameraxui/cxui/icons/scene_lowlight.png has changed
diff -r d9aefe59d544 -r 3075d9b614e6 camerauis/cameraxui/cxui/icons/scene_macro.png
Binary file camerauis/cameraxui/cxui/icons/scene_macro.png has changed
diff -r d9aefe59d544 -r 3075d9b614e6 camerauis/cameraxui/cxui/icons/scene_night.png
Binary file camerauis/cameraxui/cxui/icons/scene_night.png has changed
diff -r d9aefe59d544 -r 3075d9b614e6 camerauis/cameraxui/cxui/icons/scene_nightportrait.png
Binary file camerauis/cameraxui/cxui/icons/scene_nightportrait.png has changed
diff -r d9aefe59d544 -r 3075d9b614e6 camerauis/cameraxui/cxui/icons/scene_portrait.png
Binary file camerauis/cameraxui/cxui/icons/scene_portrait.png has changed
diff -r d9aefe59d544 -r 3075d9b614e6 camerauis/cameraxui/cxui/icons/scene_sport.png
Binary file camerauis/cameraxui/cxui/icons/scene_sport.png has changed
diff -r d9aefe59d544 -r 3075d9b614e6 camerauis/cameraxui/cxui/icons/whitebg.PNG
Binary file camerauis/cameraxui/cxui/icons/whitebg.PNG has changed
diff -r d9aefe59d544 -r 3075d9b614e6 camerauis/cameraxui/cxui/icons/zoomin.png
Binary file camerauis/cameraxui/cxui/icons/zoomin.png has changed
diff -r d9aefe59d544 -r 3075d9b614e6 camerauis/cameraxui/cxui/icons/zoomin.svg
--- a/camerauis/cameraxui/cxui/icons/zoomin.svg Fri Apr 16 14:51:30 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,63 +0,0 @@
-
-
-
diff -r d9aefe59d544 -r 3075d9b614e6 camerauis/cameraxui/cxui/icons/zoomout.png
Binary file camerauis/cameraxui/cxui/icons/zoomout.png has changed
diff -r d9aefe59d544 -r 3075d9b614e6 camerauis/cameraxui/cxui/icons/zoomout.svg
--- a/camerauis/cameraxui/cxui/icons/zoomout.svg Fri Apr 16 14:51:30 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,16 +0,0 @@
-
-
-
diff -r d9aefe59d544 -r 3075d9b614e6 camerauis/cameraxui/cxui/inc/cxuiapplication.h
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/camerauis/cameraxui/cxui/inc/cxuiapplication.h Thu May 13 21:30:19 2010 +0300
@@ -0,0 +1,43 @@
+/*
+* 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 CXUIAPPLICATION_H
+#define CXUIAPPLICATION_H
+
+#include
+#include
+
+class CxuiApplication : public HbApplication
+{
+ Q_OBJECT
+
+public:
+ CxuiApplication(int &argc, char *argv[]);
+ ~CxuiApplication();
+
+public: // from HbApplication
+#if defined(Q_WS_S60)
+ bool symbianEventFilter(const QSymbianEvent *e);
+#endif // Q_WS_S60
+
+signals:
+#if defined(Q_WS_S60)
+ void symbianEvent(const QSymbianEvent *e);
+#endif // Q_WS_S60
+};
+
+#endif // CXUIAPPLICATION_H
diff -r d9aefe59d544 -r 3075d9b614e6 camerauis/cameraxui/cxui/inc/cxuiapplicationframeworkmonitor.h
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/camerauis/cameraxui/cxui/inc/cxuiapplicationframeworkmonitor.h Thu May 13 21:30:19 2010 +0300
@@ -0,0 +1,71 @@
+/*
+* 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 CXUIAPPLICATIONFRAMEWORKMONITOR_H
+#define CXUIAPPLICATIONFRAMEWORKMONITOR_H
+
+#include
+
+class CxeSettings;
+class CxuiApplication;
+class CxuiApplicationFrameworkMonitorPrivate;
+
+/*!
+* Application Framework Monitor.
+*/
+class CxuiApplicationFrameworkMonitor : public QObject
+{
+ Q_OBJECT
+ Q_ENUMS(ForegroundState)
+
+public:
+ /*!
+ * Foreground state enumeration.
+ */
+ enum ForegroundState
+ {
+ /*! Note or dialog partially owns foreground */
+ ForegroundPartiallyLost,
+ /*! Other application owns foreground */
+ ForegroundFullyLost,
+ /*! This application owns foreground */
+ ForegroundOwned
+ };
+
+public:
+ CxuiApplicationFrameworkMonitor(CxuiApplication &application, CxeSettings& settings);
+ virtual ~CxuiApplicationFrameworkMonitor();
+
+public:
+ ForegroundState foregroundState() const;
+
+signals:
+ /*!
+ * Signal that foreground state has changed.
+ * @param t New foreground state.
+ */
+ void foregroundStateChanged(CxuiApplicationFrameworkMonitor::ForegroundState t);
+
+ /*!
+ * Signal battery being empty. Device is ecpected to power down at any moment.
+ */
+ void batteryEmpty();
+
+private:
+ CxuiApplicationFrameworkMonitorPrivate* p;
+};
+
+#endif // CXUIAPPLICATIONFRAMEWORKMONITOR_H
diff -r d9aefe59d544 -r 3075d9b614e6 camerauis/cameraxui/cxui/inc/cxuiapplicationframeworkmonitorprivate.h
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/camerauis/cameraxui/cxui/inc/cxuiapplicationframeworkmonitorprivate.h Thu May 13 21:30:19 2010 +0300
@@ -0,0 +1,77 @@
+/*
+* 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 CXUIAPPLICATIONFRAMEWORKMONITORPRIVATE_H
+#define CXUIAPPLICATIONFRAMEWORKMONITORPRIVATE_H
+
+#include
+#include
+#include "cxuiapplicationframeworkmonitor.h"
+
+class CxeSettings;
+class CxuiApplication;
+#ifdef Q_OS_SYMBIAN
+class RWsSession;
+class RWindowGroup;
+class QString;
+class QSymbianEvent;
+#endif // Q_OS_SYMBIAN
+
+
+class CxuiApplicationFrameworkMonitorPrivate : public QObject
+{
+ Q_OBJECT
+
+public:
+ CxuiApplicationFrameworkMonitorPrivate(CxuiApplication &application, CxeSettings& settings);
+ virtual ~CxuiApplicationFrameworkMonitorPrivate();
+
+public:
+ CxuiApplicationFrameworkMonitor::ForegroundState foregroundState() const;
+
+signals:
+ void foregroundStateChanged(CxuiApplicationFrameworkMonitor::ForegroundState t);
+ void batteryEmpty();
+
+#ifdef Q_OS_SYMBIAN
+private slots:
+ void handleEvent(const QSymbianEvent *event);
+ void handlePropertyEvent(long int uid, unsigned long int key, QVariant value);
+
+private:
+ void init();
+ bool handleWindowServerEvent(const QSymbianEvent *event);
+ void setState(CxuiApplicationFrameworkMonitor::ForegroundState state);
+ CxuiApplicationFrameworkMonitor::ForegroundState getCurrentState();
+ unsigned int focusedApplicationUid();
+#endif // Q_OS_SYMBIAN
+
+
+private:
+ CxuiApplication &mApplication;
+ CxeSettings& mSettings;
+#ifdef Q_OS_SYMBIAN
+ RWsSession &mWsSession;
+ RWindowGroup &mWindowGroup;
+ int mWindowGroupId;
+ QString mWindowGroupName;
+ int mKeyLockState;
+ int mBatteryStatus;
+#endif // Q_OS_SYMBIAN
+ CxuiApplicationFrameworkMonitor::ForegroundState mState;
+};
+
+#endif // CXUIAPPLICATIONFRAMEWORKMONITORPRIVATE_H
diff -r d9aefe59d544 -r 3075d9b614e6 camerauis/cameraxui/cxui/inc/cxuicapturekeyhandler.h
--- a/camerauis/cameraxui/cxui/inc/cxuicapturekeyhandler.h Fri Apr 16 14:51:30 2010 +0300
+++ b/camerauis/cameraxui/cxui/inc/cxuicapturekeyhandler.h Thu May 13 21:30:19 2010 +0300
@@ -33,6 +33,8 @@
virtual ~CxuiCaptureKeyHandler();
public:
+ void listenKeys(bool listen);
+
bool isAutofocusKeyPressed();
bool isCaptureKeyPressed();
@@ -47,6 +49,9 @@
void captureKeyReleased();
private:
+ void listenKey(int key);
+
+private:
bool mAutofocusKeyPressed;
bool mCaptureKeyPressed;
diff -r d9aefe59d544 -r 3075d9b614e6 camerauis/cameraxui/cxui/inc/cxuienums.h
--- a/camerauis/cameraxui/cxui/inc/cxuienums.h Fri Apr 16 14:51:30 2010 +0300
+++ b/camerauis/cameraxui/cxui/inc/cxuienums.h Thu May 13 21:30:19 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"
@@ -35,24 +35,6 @@
//! Preview for captured image
VideoPostCaptureView = 3
};
-
- enum StillSceneModes
- {
- //! Automatic
- StillSceneAuto = 0,
- //! Portrait
- StillScenePortrait = 1,
- //! Landscape
- StillSceneLandscape = 2,
- //! Macro
- StillSceneMacro = 3,
- //! Sports
- StillSceneSports = 4,
- //! Night
- StillSceneNight = 5,
- //! Night portrait
- StillSceneNightPortrait = 6
- };
}
// Application layout strings
@@ -61,13 +43,10 @@
// Application layout xml files
static const char *VIDEO_1ST_XML = ":/xml/view_video_precapture.docml";
- static const char *VIDEO_2ND_XML = ":/xml/view_video_precapture_secondary.docml";
static const char *STILL_1ST_XML = ":/xml/view_still_precapture.docml";
- static const char *STILL_2ND_XML = ":/xml/view_still_precapture_secondary.docml";
static const char *POSTCAPTURE_XML = ":/xml/view_postcapture.docml";
- static const char *SCENEMODE_SETTING_XML = ":/xml/setting_still_scenemode.docml";
- static const char *SCENEMODE_VIDEO_SETTING_XML = ":/xml/setting_video_scenemode.docml";
+ static const char *SCENEMODE_SETTING_XML = ":/xml/setting_scenemode.docml";
static const char *STANDBY_POPUP_XML = ":/xml/standbymode_popup.docml";
static const char *ERROR_POPUP_XML = ":/xml/errornote_popup.docml";
@@ -85,18 +64,22 @@
static const char *VIDEO_PRE_CAPTURE_EMBEDDED_SECTION = "video_embedded_mode";
static const char *VIDEO_PRE_CAPTURE_STANDALONE_SECTION = "video_standalone_mode";
+ static const char *VIDEO_PRE_CAPTURE_IDLE = "video_idle";
+ static const char *VIDEO_PRE_CAPTURE_RECORDING = "video_recording";
+ static const char *VIDEO_PRE_CAPTURE_PAUSED = "video_paused";
+
// Widgets
// In order to be able to refer to a widget, we need to know its object name.
static const char *STILL_PRE_CAPTURE_VIEW = "still_capture_view";
- static const char *STILL_PRE_CAPTURE_VIEW2 = "still_capture_view_2";
+ static const char *STILL_SCENES_VIEW = "settings_scenes_view";
static const char *STILL_PRE_CAPTURE_TOOLBAR = "toolbar";
static const char *STILL_PRE_CAPTURE_FLASH_ACTION = "cxui_action_flash";
+ static const char *STILL_PRE_CAPTURE_SCENE_MODE_ACTION = "cxui_action_scenemodes";
static const char *STILL_PRE_CAPTURE_ROOT_WIDGET = "viewfinder_widget";
static const char *STILL_PRE_CAPTURE_VIEWFINDER = "transparent";
static const char *STILL_PRE_CAPTURE_ZOOM_SLIDER = "zoom";
static const char *STILL_PRE_CAPTURE_IMAGE_QUALITY_ACTION = "cxui_action_image_quality";
static const char *STILL_PRE_CAPTURE_GOTO_VIDEO_ACTION = "cxui_action_goto_video";
- static const char *STILL_PRE_CAPTURE_GOTO_2ND_CAMERA_ACTION = "cxui_action_goto_2_camera";
static const char *STILL_PRE_CAPTURE_IMAGES_LEFT_LABEL = "images_remaining";
static const char *STILL_PRE_CAPTURE_QUALITY_ICON = "quality_indicator";
static const char *STILL_PRE_CAPTURE_POST_CAPTURE_ACTION = "cxui_action_stillpostcapture";
@@ -104,14 +87,14 @@
static const char *STILL_PRE_CAPTURE_IMAGES_LEFT_CONTAINER = "images_left_container";
static const char *STILL_PRE_CAPTURE_SELFTIMER_CONTAINER = "still_precapture_selftimer_container";
- static const char *STILL_PRE_CAPTURE_SELFTIMER_BUTTON_CONTAINER = "selftimer_button_container";
static const char *STILL_PRE_CAPTURE_SELFTIMER_COUNTER = "still_selftimer_counter";
static const char *STILL_PRE_CAPTURE_SELFTIMER_START_BUTTON = "still_selftimer_start_button";
static const char *STILL_PRE_CAPTURE_SELFTIMER_CANCEL_BUTTON = "still_selftimer_cancel_button";
- static const char *VIDEO_PRE_CAPTURE_VIEW = "video_capture_view";
- static const char *VIDEO_PRE_CAPTURE_VIEW2 = "video_capture_view_2";
-
+ static const char *VIDEO_PRE_CAPTURE_VIEW = "video_capture_view";
+
+ static const char *SETTINGS_DIALOG_OK_ACTION = "action_ok";
+
// video
// In order to be able to refer to a widget, we need to know its object name.
static const char *VIDEO_PRE_CAPTURE_TOOLBAR = "video_toolbar";
@@ -123,11 +106,9 @@
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_TOGGLE_LIGHT_ACTION = "cxui_video_action_toggle_light";
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";
- static const char *VIDEO_PRE_CAPTURE_GOTO_2ND_CAMERA_ACTION = "cxui_video_action_goto_2_camera";
static const char *VIDEO_PRE_CAPTURE_POST_CAPTURE_ACTION = "cxui_video_action_showcapturedvideo";
static const char *VIDEO_PRE_CAPTURE_INDICATOR_CONTAINER_TOP = "video_indicator_container_top";
static const char *VIDEO_PRE_CAPTURE_INDICATOR_CONTAINER_BOTTOM = "video_indicator_container_bottom";
@@ -162,8 +143,12 @@
static const char *SETTINGS_SLIDER_DIALOG_CONTENT_WIDGET = "settings_dialog_slider";
// scene setting
- static const char *STILL_SCENE_DIALOG = "still_scenemode_popup";
- static const char *VIDEO_SCENE_DIALOG = "video_scenemode_popup";
+ static const char *SCENE_VIEW_CONTAINER = "scene_view_container";
+ static const char *SCENE_VIEW_BG_IMAGE = "scene_view_bg_icon";
+ static const char *SCENE_VIEW_BG_IMAGE2 = "scene_view_bg_icon2";
+ static const char *SCENE_VIEW_RADIOBUTTONS = "scene_view_radioButtonList";
+ static const char *SCENE_VIEW_OK_BUTTON = "scene_ok_button";
+ static const char *SCENE_VIEW_CANCEL_BUTTON = "scene_cancel_button";
}
namespace CxUiInternal
diff -r d9aefe59d544 -r 3075d9b614e6 camerauis/cameraxui/cxui/inc/cxuierrormanager.h
--- a/camerauis/cameraxui/cxui/inc/cxuierrormanager.h Fri Apr 16 14:51:30 2010 +0300
+++ b/camerauis/cameraxui/cxui/inc/cxuierrormanager.h Thu May 13 21:30:19 2010 +0300
@@ -26,7 +26,7 @@
/*
-* class which handles errors and reports
+* class which handles errors and reports
*/
class CxuiErrorManager : public QObject
{
@@ -38,26 +38,14 @@
~CxuiErrorManager();
signals:
-
+
void aboutToRecoverError();
void errorRecovered();
-
+
private slots:
- /*
- * slot which handles reporting of errors to the client
- */
void analyze(CxeError::Id error);
-
- /*
- * slot which handles cases to be considered when we are about to close
- * the pop-up
- */
void aboutToClosePopup();
-
- /*
- * slot to close camera app
- */
void closeApp();
private:
@@ -65,23 +53,19 @@
// error severity
enum ErrorSeverity
{
- Severe = 0x01, // when error cannot be recovered
- Critical = 0x02, // when error can be recovered, but needs actions e.g. camera in use
- None = 0x08, // we can ignore the error
+ None = 0,
+ Warning, // Low severity, just warning user needed
+ Severe, // when error cannot be recovered
+ Critical // when error can be recovered, but needs actions e.g. camera in use
};
- /*
- * Activates popup which displays the error messages based on the
- * error severity
- */
void launchPopup(QString& errorMsgTxt);
-
- /*
- * check the error severity and get the error msg
- */
+ void showHighSeverityNote(QString& errorMsgTxt);
+ void showLowSeverityNote(QString& errorMsgTxt);
QString getErrorDetails(CxeError::Id error);
private:
+
//data
CxuiCaptureKeyHandler &mKeyHandler;
CxuiDocumentLoader *mDocumentLoader; // not own
diff -r d9aefe59d544 -r 3075d9b614e6 camerauis/cameraxui/cxui/inc/cxuipostcaptureview.h
--- a/camerauis/cameraxui/cxui/inc/cxuipostcaptureview.h Fri Apr 16 14:51:30 2010 +0300
+++ b/camerauis/cameraxui/cxui/inc/cxuipostcaptureview.h Thu May 13 21:30:19 2010 +0300
@@ -21,6 +21,7 @@
#include
#include
#include
+#include
class QGraphicsRectItem;
class HbMainWindow;
@@ -43,6 +44,8 @@
virtual ~CxuiPostcaptureView();
void construct(HbMainWindow *mainwindow, CxeEngine *engine, CxuiDocumentLoader *documentLoader);
+ void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0);
+
signals:
void changeToPrecaptureView();
@@ -52,7 +55,6 @@
protected:
bool eventFilter(QObject *object, QEvent *event);
- bool event(QEvent *event);
void mousePressEvent(QGraphicsSceneMouseEvent *event);
void showEvent(QShowEvent *event);
void hideEvent(QHideEvent *event);
@@ -79,6 +81,8 @@
void showDeleteNote();
void launchVideosApp();
+ void handleDeleteDialogClosed(HbAction *action);
+
private:
void launchNotSupportedNotification();
QString getCurrentFilename();
@@ -124,6 +128,8 @@
bool mControlsVisible;
bool mTimersStarted;
+
+ XQApplicationManager mAppManager;
};
diff -r d9aefe59d544 -r 3075d9b614e6 camerauis/cameraxui/cxui/inc/cxuiprecaptureview.h
--- a/camerauis/cameraxui/cxui/inc/cxuiprecaptureview.h Fri Apr 16 14:51:30 2010 +0300
+++ b/camerauis/cameraxui/cxui/inc/cxuiprecaptureview.h Thu May 13 21:30:19 2010 +0300
@@ -44,6 +44,8 @@
class CxuiSettingRadioButtonList;
class CxuiSettingSlider;
class HbToolBarExtension;
+class HbWidget;
+class CxuiZoomSlider;
/**
* Pre-capture view
@@ -103,7 +105,7 @@
void zoomTo(int value);
// Control visibility of all UI items at the same time: toolbar, zoom and titlepane items
- void hideControls();
+ virtual void hideControls();
virtual void showControls();
void toggleControls();
@@ -117,19 +119,21 @@
// Settings related
void launchNotSupportedNotification();
+ void launchDiskFullNotification();
void showSettingsGrid();
void hideSettingsGrid();
void launchSliderSetting();
void prepareToShowDialog(HbAction *action);
void prepareToCloseDialog(HbAction *action);
-
protected:
virtual void initializeSettingsGrid() = 0;
void hideZoom();
void showZoom();
+ void hideIndicators();
+ void showIndicators();
void showEvent(QShowEvent *event);
void hideEvent(QHideEvent *event);
void mousePressEvent(QGraphicsSceneMouseEvent *event);
@@ -137,7 +141,7 @@
bool eventFilter(QObject *object, QEvent *event);
void launchSettingsDialog(QObject *action);
bool isPostcaptureOn() const;
- void addIncreaseDecreaseButtons(HbSlider *slider);
+ void addIncreaseDecreaseButtons(CxuiZoomSlider *slider);
QString getSettingItemIcon(const QString &key, QVariant value);
void updateQualityIcon();
void createWidgetBackgroundGraphic(HbWidget *widget,
@@ -160,6 +164,7 @@
// signal to report error to ErrorManager for further actions.
void reportError(CxeError::Id errorId);
+ void showScenesView();
protected:
CxeEngine *mEngine; // not own
@@ -169,7 +174,7 @@
CxuiDisplayPropertyHandler *mDisplayHandler;
bool mControlsVisible;
QTimer mHideControlsTimeout;
- HbSlider *mSlider; // zoom slider, not own, owned by the graphics scene
+ CxuiZoomSlider *mSlider; // zoom slider, not own, owned by the graphics scene
HbToolBar *mToolBar; // not own, owned by the graphics scene
HbToolBarExtension *mSettingsGrid;
bool mZoomVisible;
@@ -178,6 +183,7 @@
CxuiSettingRadioButtonList *mSettingsDialogList;
CxuiCaptureKeyHandler *mKeyHandler;
HbLabel *mQualityIcon;
+ HbWidget *mIndicators;
private:
CxuiSettingDialog* createSettingsDialog();
@@ -191,7 +197,9 @@
CxuiSettingSlider *mSettingsSlider;
CxuiSettingsInfo *mSettingsInfo;
-
+
+ HbAction *mSettingsDialogOkAction;
+ HbAction *mSliderSettingsDialogOkAction;
};
#endif // CXUIPRECAPTUREVIEW_H
diff -r d9aefe59d544 -r 3075d9b614e6 camerauis/cameraxui/cxui/inc/cxuiscenemodeview.h
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/camerauis/cameraxui/cxui/inc/cxuiscenemodeview.h Thu May 13 21:30:19 2010 +0300
@@ -0,0 +1,116 @@
+/*
+* 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 CXUISCENEMODEVIEW_H
+#define CXUISCENEMODEVIEW_H
+
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+
+#include "cxeerror.h"
+#include "cxenamespace.h"
+#include "cxuisettingsinfo.h"
+#include "cxuienums.h"
+#include "cxeengine.h"
+
+class CxuiCaptureKeyHandler;
+class CxuiDocumentLoader;
+class HbPushButton;
+class HbLabel;
+class HbView;
+class CxuiSettingsInfo;
+
+
+/**
+ * Scene mode view class for both video and still sides
+ */
+
+
+class CxuiSceneModeView : public HbView
+{
+ Q_OBJECT
+
+public:
+ CxuiSceneModeView(QGraphicsItem *parent = 0);
+
+ virtual ~CxuiSceneModeView();
+
+public:
+
+ void construct(HbMainWindow *mainwindow,
+ CxeEngine *engine,
+ CxuiDocumentLoader *documentLoader,
+ CxuiCaptureKeyHandler *keyHandler = NULL);
+
+ void loadDefaultWidgets();
+ void loadBackgroundImages();
+
+signals:
+ void viewCloseEvent();
+
+public slots:
+ void handleCaptureKeyPressed();
+ void handleAutofocusKeyPressed();
+
+private slots:
+ void handleSceneRadiobuttonPress(int index);
+ void finishScenesTransition();
+ void handleOkButtonPress();
+ void handleCancelButtonPress();
+ void releaseCameraHw();
+
+protected:
+ void showEvent(QShowEvent *event);
+
+private:
+ QString backgroundForScene(const QString& sceneId);
+ void startBackgroundTransition();
+ void createWidgetBackgroundGraphic(HbWidget *widget,
+ const QString &graphicName,
+ HbFrameDrawer::FrameType frameType =
+ HbFrameDrawer::NinePieces);
+
+ void connectSignals();
+ void closeView();
+
+private:
+ HbMainWindow *mMainWindow; //not own
+ CxuiSettingsInfo *mSettingsInfo;
+ CxeEngine *mEngine; //not own
+ CxuiDocumentLoader *mDocumentLoader; //not own
+ CxuiCaptureKeyHandler *mCaptureKeyHandler;
+
+ HbLabel* mScenesBackground;
+ HbLabel* mScenesBackground2;
+ CxuiSettingRadioButtonList* mScenesList;
+ QList mSettingPairList;
+ HbPushButton* mScenesOkButton;
+ HbPushButton* mScenesCancelButton;
+ HbWidget* mScenesContainer;
+
+ QTimer mCameraReleaseTimer;
+
+ QPropertyAnimation* mTransitionAnimation; //for mScenesBackground
+
+};
+
+#endif // CXUISCENEMODEVIEW_H
diff -r d9aefe59d544 -r 3075d9b614e6 camerauis/cameraxui/cxui/inc/cxuiselftimer.h
--- a/camerauis/cameraxui/cxui/inc/cxuiselftimer.h Fri Apr 16 14:51:30 2010 +0300
+++ b/camerauis/cameraxui/cxui/inc/cxuiselftimer.h Thu May 13 21:30:19 2010 +0300
@@ -66,8 +66,7 @@
int mOldPostCaptureTimeOut;
// UI widgets, not own
- HbWidget *mIndicatorContainer;
- HbWidget *mButtonContainer;
+ HbWidget *mWidgetContainer;
HbLabel *mTimerLabel;
HbPushButton *mCancelButton;
HbPushButton *mStartButton;
diff -r d9aefe59d544 -r 3075d9b614e6 camerauis/cameraxui/cxui/inc/cxuisettingbutton.h
--- a/camerauis/cameraxui/cxui/inc/cxuisettingbutton.h Fri Apr 16 14:51:30 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 CXUISETTINGBUTTON_H
-#define CXUISETTINGBUTTON_H
-
-
-#include
-
-class CxeEngine;
-
-class CxuiSettingButton : public HbPushButton
-{
- Q_OBJECT
- Q_PROPERTY(QString settingId READ settingId WRITE setSettingId)
- Q_PROPERTY(int settingValue READ settingValue WRITE setSettingValue)
- Q_PROPERTY(QString settingPopupXml READ settingPopupXml WRITE setSettingPopupXml)
- Q_PROPERTY(QString iconList READ iconList WRITE setIconList)
- Q_PROPERTY(QString scenemodeId READ scenemodeId WRITE setScenemodeId)
-public:
- explicit CxuiSettingButton(QGraphicsItem *parent, CxeEngine *engine);
- virtual ~CxuiSettingButton();
-
- QString settingId() const;
- void setSettingId(const QString &id);
- int settingValue() const;
- QString iconList() const;
- void setIconList(const QString &iconList);
- void setSettingValue(int value);
- QString settingPopupXml() const;
- void setSettingPopupXml(const QString &popupXml);
- QString scenemodeId() const;
- void setScenemodeId(const QString &scenemode);
- void setSetting();
-
-
-signals:
- void clickHandled();
-
-public slots:
- void handleClicked();
-
- void updateIcon(const QString& key, QVariant newValue);
-private:
- Q_DISABLE_COPY(CxuiSettingButton)
-
- QString mSettingId;
- int mSettingValue;
- QString mSettingPopupXml;
- CxeEngine *mEngine;
- QString mIconList;
- QStringList mIcons;
- QString mScenemode;
-};
-
-#endif // CXUISETTINGBUTTON_H
diff -r d9aefe59d544 -r 3075d9b614e6 camerauis/cameraxui/cxui/inc/cxuisettingbuttoncontainer.h
--- a/camerauis/cameraxui/cxui/inc/cxuisettingbuttoncontainer.h Fri Apr 16 14:51:30 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,56 +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 CXUISETTINGBUTTONCONTAINER_H_
-#define CXUISETTINGBUTTONCONTAINER_H_
-#include
-#include
-#include "cxuisettingbutton.h"
-
-class CxuiSettingButtonContainer : public HbWidget
-{
- Q_OBJECT
-
-public:
- explicit CxuiSettingButtonContainer(QGraphicsItem *parent);
-
-
-signals:
- void buttonReleased();
-
-public slots:
-
- void handleButtonPress();
-
-
-protected:
- void mouseMoveEvent(QGraphicsSceneMouseEvent *event);
- void mouseReleaseEvent(QGraphicsSceneMouseEvent *event);
-private:
- Q_DISABLE_COPY(CxuiSettingButtonContainer)
-
- QListmButtons;
- bool mListCreated;
- CxuiSettingButton *mPressedDownButton;
- CxuiSettingButton *mPreviouslyPressedDownButton;
-
-};
-
-
-
-
-#endif /* CXUISETTINGBUTTONCONTAINER_H_ */
diff -r d9aefe59d544 -r 3075d9b614e6 camerauis/cameraxui/cxui/inc/cxuisettingsinfo.h
--- a/camerauis/cameraxui/cxui/inc/cxuisettingsinfo.h Fri Apr 16 14:51:30 2010 +0300
+++ b/camerauis/cameraxui/cxui/inc/cxuisettingsinfo.h Thu May 13 21:30:19 2010 +0300
@@ -76,7 +76,8 @@
QString mHeadingIcon;
QStringList mSettingStrings;
QPair mRange;
- qreal mStep;
+ qreal mMinorStep;
+ qreal mMajorStep;
};
}
diff -r d9aefe59d544 -r 3075d9b614e6 camerauis/cameraxui/cxui/inc/cxuistillprecaptureview2.h
--- a/camerauis/cameraxui/cxui/inc/cxuistillprecaptureview2.h Fri Apr 16 14:51:30 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,52 +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 CXUISTILLPRECAPTUREVIEW2_H
-#define CXUISTILLPRECAPTUREVIEW2_H
-
-#include
-#include "cxuistillprecaptureview.h"
-
-/**
- * CxuiPrecaptureView2
- *
- */
-class CxuiStillPrecaptureView2 : public CxuiStillPrecaptureView
-{
- Q_OBJECT
-
-public:
- CxuiStillPrecaptureView2(QGraphicsItem *parent = 0);
-
- virtual ~CxuiStillPrecaptureView2();
-
-public:
-
- /**
- * Loads default widgets in layouts xml.
- */
- virtual void loadDefaultWidgets();
-
- /**
- * Loads widgets that are not part of the default section in layouts xml.
- * Widgets are created at the time they are first loaded.
- */
- virtual void loadWidgets();
-
-};
-
-#endif /* CXUISTILLPRECAPTUREVIEW2_H */
diff -r d9aefe59d544 -r 3075d9b614e6 camerauis/cameraxui/cxui/inc/cxuivideoprecaptureview.h
--- a/camerauis/cameraxui/cxui/inc/cxuivideoprecaptureview.h Fri Apr 16 14:51:30 2010 +0300
+++ b/camerauis/cameraxui/cxui/inc/cxuivideoprecaptureview.h Thu May 13 21:30:19 2010 +0300
@@ -106,6 +106,9 @@
void updateTimeLabels();
+ // from CxuiPrecaptureView
+ void hideControls();
+
protected:
void setVideoTime(HbLabel* label, int time);
@@ -118,6 +121,8 @@
void initializeSettingsGrid();
void setRecordingItemsVisibility(bool visible);
+ // from QObject
+ bool eventFilter(QObject *object, QEvent *event);
protected:
QTimer mElapsedTimer;
int mTimeElapsed;
@@ -130,13 +135,13 @@
HbToolBar *mToolBarIdle; // not own
HbToolBar *mToolBarRec; // not own
HbToolBar *mToolBarPaused; // not own
- HbAction *mToggleLightAction; // not own
HbDialog *mVideoScenePopup;
CxeVideoCaptureControl *mVideoCaptureControl;
HbMenu *mMenu; // own
QPropertyAnimation* mRecordingAnimation; //For recording indicator
bool mCapturePending;
+ QTimer mPauseTimer;
};
#endif // CXUIVIDEOPRECAPTUREVIEW_H
diff -r d9aefe59d544 -r 3075d9b614e6 camerauis/cameraxui/cxui/inc/cxuivideoprecaptureview2.h
--- a/camerauis/cameraxui/cxui/inc/cxuivideoprecaptureview2.h Fri Apr 16 14:51:30 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,51 +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 CXUIVIDEOPRECAPTUREVIEW2_H
-#define CXUIVIDEOPRECAPTUREVIEW2_H
-
-#include
-#include "cxuivideoprecaptureview.h"
-
-/**
- * CxuiVideoPrecaptureView2
- *
- */
-class CxuiVideoPrecaptureView2 : public CxuiVideoPrecaptureView
-{
- Q_OBJECT
-
-public:
- CxuiVideoPrecaptureView2(QGraphicsItem *parent = 0);
-
- virtual ~CxuiVideoPrecaptureView2();
-
-public:
-
- /**
- * Loads default widgets in layouts xml.
- */
- virtual void loadDefaultWidgets();
-
- /**
- * Loads widgets that are not part of the default section in layouts xml.
- * Widgets are created at the time they are first loaded.
- */
- virtual void loadWidgets();
-
-};
-#endif /* CXUIVIDEOPRECAPTUREVIEW2_H */
diff -r d9aefe59d544 -r 3075d9b614e6 camerauis/cameraxui/cxui/inc/cxuiviewmanager.h
--- a/camerauis/cameraxui/cxui/inc/cxuiviewmanager.h Fri Apr 16 14:51:30 2010 +0300
+++ b/camerauis/cameraxui/cxui/inc/cxuiviewmanager.h Thu May 13 21:30:19 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"
@@ -24,30 +24,29 @@
#include "cxeviewfindercontrol.h"
#include "cxenamespace.h"
#include "cxeerror.h"
+#include "cxuiapplicationframeworkmonitor.h"
+
class QGraphicsSceneMouseEvent;
+class HbMainWindow;
+class CxuiApplication;
class CxuiCaptureKeyHandler;
-class XQSettingsManager;
-class XQSettingsKey;
-class HbMainWindow;
-
class CxuiPrecaptureView;
class CxuiStillPrecaptureView;
-class CxuiStillPrecaptureView2;
class CxuiVideoPrecaptureView;
-class CxuiVideoPrecaptureView2;
class CxuiPostcaptureView;
class CxeEngine;
class CxuiDocumentLoader;
class CxuiErrorManager; // class that handles all errors in ui.
class CxuiStandby;
+class CxuiSceneModeView;
class CxuiViewManager : public QObject
{
Q_OBJECT
public:
- CxuiViewManager(HbMainWindow &mainWindow, CxeEngine &engine, CxuiCaptureKeyHandler &keyHandler);
+ CxuiViewManager(CxuiApplication &application, HbMainWindow &mainWindow, CxeEngine &engine);
~CxuiViewManager();
void prepareWindow();
@@ -60,20 +59,14 @@
public slots:
void changeToPostcaptureView();
void changeToPrecaptureView();
-
- /**
- * Switch camera from primary to secondary or vise versa.
- */
void switchCamera();
-
- /**
- * Event monitor can be used to monitor changes in cenrep and PS values.
- */
- void eventMonitor(const XQSettingsKey& key, const QVariant& value);
-
void createPostcaptureView();
+ void showScenesView();
private slots:
+ void toForeground();
+ void handleForegroundStateChanged(CxuiApplicationFrameworkMonitor::ForegroundState state);
+ void handleBatteryEmpty();
void aboutToLooseFocus();
void aboutToGainFocus();
@@ -81,18 +74,19 @@
void focusGained();
void focusLost();
void batteryEmpty();
+ void disableStandbyTimer();
+ void startStandbyTimer();
protected:
bool eventFilter(QObject *object, QEvent *event);
private:
- void startEventMonitors();
void createStillPrecaptureView();
- void createStillPrecaptureView2();
void createVideoPrecaptureView();
- void createVideoPrecaptureView2();
CxuiPrecaptureView* getPrecaptureView(Cxe::CameraMode mode, Cxe::CameraIndex camera);
+ void createSceneModesView();
+
/*
* connects all necessary signals for precapture view
*/
@@ -117,25 +111,21 @@
private:
//data
+ CxuiApplication &mApplication;
HbMainWindow &mMainWindow;
CxuiStillPrecaptureView *mStillPrecaptureView;
CxuiVideoPrecaptureView *mVideoPrecaptureView;
CxuiPostcaptureView *mPostcaptureView;
- CxuiStillPrecaptureView2 *mStillPrecaptureView2;
- CxuiVideoPrecaptureView2 *mVideoPrecaptureView2;
-
CxeEngine &mEngine;
- CxuiCaptureKeyHandler &mKeyHandler;
+ CxuiCaptureKeyHandler *mKeyHandler;
+ CxuiApplicationFrameworkMonitor *mApplicationMonitor;
private:
- XQSettingsManager *mSettingsManager;
- int mKeyLockState; //! @todo: Needed due to Settings manager error: valueChanged is emmitted with same value repeatedly
- int mBatteryStatus;
- bool mFocused;
CxuiDocumentLoader *mCameraDocumentLoader;
CxuiStandby *mStandbyHandler;
CxuiErrorManager *mErrorManager;
+ CxuiSceneModeView *mSceneModeView;
};
#endif // CXUIVIEWMANAGER_H
diff -r d9aefe59d544 -r 3075d9b614e6 camerauis/cameraxui/cxui/inc/cxuizoomslider.h
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/camerauis/cameraxui/cxui/inc/cxuizoomslider.h Thu May 13 21:30:19 2010 +0300
@@ -0,0 +1,38 @@
+/*
+* 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 CXUIZOOMSLIDER_H
+#define CXUIZOOMSLIDER_H
+
+#include
+#include
+
+class QGraphicsSceneMouseEvent;
+
+class CxuiZoomSlider : public HbSlider
+{
+ Q_OBJECT
+
+public:
+ explicit CxuiZoomSlider(QGraphicsItem *parentItem = NULL);
+ ~CxuiZoomSlider();
+
+protected:
+ void mousePressEvent(QGraphicsSceneMouseEvent *event);
+
+};
+
+#endif // CXUIZOOMSLIDER_H
diff -r d9aefe59d544 -r 3075d9b614e6 camerauis/cameraxui/cxui/layouts/errornote_popup.docml
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/camerauis/cameraxui/cxui/layouts/errornote_popup.docml Thu May 13 21:30:19 2010 +0300
@@ -0,0 +1,37 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff -r d9aefe59d544 -r 3075d9b614e6 camerauis/cameraxui/cxui/layouts/image_setting.xml
--- a/camerauis/cameraxui/cxui/layouts/image_setting.xml Fri Apr 16 14:51:30 2010 +0300
+++ b/camerauis/cameraxui/cxui/layouts/image_setting.xml Thu May 13 21:30:19 2010 +0300
@@ -88,19 +88,33 @@
-
+
-
-
+
-
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff -r d9aefe59d544 -r 3075d9b614e6 camerauis/cameraxui/cxui/layouts/setting.docml
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/camerauis/cameraxui/cxui/layouts/setting.docml Thu May 13 21:30:19 2010 +0300
@@ -0,0 +1,36 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff -r d9aefe59d544 -r 3075d9b614e6 camerauis/cameraxui/cxui/layouts/setting_scenemode.docml
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/camerauis/cameraxui/cxui/layouts/setting_scenemode.docml Thu May 13 21:30:19 2010 +0300
@@ -0,0 +1,79 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff -r d9aefe59d544 -r 3075d9b614e6 camerauis/cameraxui/cxui/layouts/setting_slider.docml
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/camerauis/cameraxui/cxui/layouts/setting_slider.docml Thu May 13 21:30:19 2010 +0300
@@ -0,0 +1,34 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff -r d9aefe59d544 -r 3075d9b614e6 camerauis/cameraxui/cxui/layouts/standbymode_popup.docml
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/camerauis/cameraxui/cxui/layouts/standbymode_popup.docml Thu May 13 21:30:19 2010 +0300
@@ -0,0 +1,18 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff -r d9aefe59d544 -r 3075d9b614e6 camerauis/cameraxui/cxui/layouts/video_setting.xml
--- a/camerauis/cameraxui/cxui/layouts/video_setting.xml Fri Apr 16 14:51:30 2010 +0300
+++ b/camerauis/cameraxui/cxui/layouts/video_setting.xml Thu May 13 21:30:19 2010 +0300
@@ -40,20 +40,20 @@
-
-
+
-
-
-
+ preview="0"
+ type="SingleLineListBox">
+
+
+
+
-
+
-
+
diff -r d9aefe59d544 -r 3075d9b614e6 camerauis/cameraxui/cxui/layouts/view_postcapture.docml
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/camerauis/cameraxui/cxui/layouts/view_postcapture.docml Thu May 13 21:30:19 2010 +0300
@@ -0,0 +1,91 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff -r d9aefe59d544 -r 3075d9b614e6 camerauis/cameraxui/cxui/layouts/view_still_precapture.docml
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/camerauis/cameraxui/cxui/layouts/view_still_precapture.docml Thu May 13 21:30:19 2010 +0300
@@ -0,0 +1,265 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff -r d9aefe59d544 -r 3075d9b614e6 camerauis/cameraxui/cxui/layouts/view_video_precapture.docml
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/camerauis/cameraxui/cxui/layouts/view_video_precapture.docml Thu May 13 21:30:19 2010 +0300
@@ -0,0 +1,316 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff -r d9aefe59d544 -r 3075d9b614e6 camerauis/cameraxui/cxui/src/cxuiapplication.cpp
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/camerauis/cameraxui/cxui/src/cxuiapplication.cpp Thu May 13 21:30:19 2010 +0300
@@ -0,0 +1,63 @@
+/*
+* 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
+#include
+
+#include "cxutils.h"
+#include "cxuiapplication.h"
+
+
+/*!
+ \class CxuiApplication
+ \brief CxuiApplication is a wrapper used for getting platform UI events.
+
+ CxuiApplication is a wrapper used for getting platform UI events.
+
+ Other classes may connect to CxuiApplication::symbianEvent signal, which is
+ emitted whenever a QSymbianEvent is posted to application.
+
+*/
+CxuiApplication::CxuiApplication(int &argc, char *argv[])
+ : HbApplication(argc, argv, Hb::NoSplash)
+{
+ CX_DEBUG_IN_FUNCTION();
+}
+
+/*!
+* Destructor
+*/
+CxuiApplication::~CxuiApplication()
+{
+ CX_DEBUG_IN_FUNCTION();
+}
+
+#if defined(Q_WS_S60)
+/*!
+* Event filter.
+* Reimplemented from HbApplication.
+* Provides a signal with the event for rest of camera ui to use.
+* Event handling is then progressed to HbApplication to process.
+*/
+bool CxuiApplication::symbianEventFilter(const QSymbianEvent *e)
+{
+ emit symbianEvent(e);
+ return HbApplication::symbianEventFilter(e);
+}
+#endif // Q_WS_S60
+
+// end of file
diff -r d9aefe59d544 -r 3075d9b614e6 camerauis/cameraxui/cxui/src/cxuiapplicationframeworkmonitor.cpp
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/camerauis/cameraxui/cxui/src/cxuiapplicationframeworkmonitor.cpp Thu May 13 21:30:19 2010 +0300
@@ -0,0 +1,60 @@
+/*
+* 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 "cxutils.h"
+#include "cxuiapplication.h"
+#include "cxesettings.h"
+#include "cxuiapplicationframeworkmonitor.h"
+#include "cxuiapplicationframeworkmonitorprivate.h"
+
+
+/*!
+* Constructor
+*/
+CxuiApplicationFrameworkMonitor::CxuiApplicationFrameworkMonitor(CxuiApplication &application, CxeSettings &settings)
+{
+ CX_DEBUG_ENTER_FUNCTION();
+ p = new CxuiApplicationFrameworkMonitorPrivate(application, settings);
+
+ connect(p, SIGNAL(foregroundStateChanged(CxuiApplicationFrameworkMonitor::ForegroundState)),
+ this, SIGNAL(foregroundStateChanged(CxuiApplicationFrameworkMonitor::ForegroundState)));
+ connect(p, SIGNAL(batteryEmpty()), this, SIGNAL(batteryEmpty()));
+
+
+ CX_DEBUG_EXIT_FUNCTION();
+}
+
+/*!
+* Destructor
+*/
+CxuiApplicationFrameworkMonitor::~CxuiApplicationFrameworkMonitor()
+{
+ CX_DEBUG_ENTER_FUNCTION();
+ delete p;
+ CX_DEBUG_EXIT_FUNCTION();
+}
+
+/*!
+* Current foreground owning state of this application.
+* @return Foreground owning state.
+*/
+CxuiApplicationFrameworkMonitor::ForegroundState CxuiApplicationFrameworkMonitor::foregroundState() const
+{
+ return p->foregroundState();
+}
+
+// end of file
diff -r d9aefe59d544 -r 3075d9b614e6 camerauis/cameraxui/cxui/src/cxuiapplicationframeworkmonitorprivate.cpp
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/camerauis/cameraxui/cxui/src/cxuiapplicationframeworkmonitorprivate.cpp Thu May 13 21:30:19 2010 +0300
@@ -0,0 +1,390 @@
+/*
+* 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
+
+#ifdef Q_OS_SYMBIAN
+#include
+#include
+#include
+#include
+#include
+#include // keyguard state
+#include // battery status
+
+#include
+#include
+#include
+#include
+#endif // Q_OS_SYMBIAN
+
+#include "cxutils.h"
+#include "cxuiapplication.h"
+#include "cxesettings.h"
+#include "cxuiapplicationframeworkmonitorprivate.h"
+
+
+#ifdef Q_OS_SYMBIAN
+namespace
+{
+ inline QString convertTDesC2QString(const TDesC& aDescriptor)
+ {
+ #ifdef QT_NO_UNICODE
+ return QString::fromLocal8Bit(aDescriptor.Ptr(), aDescriptor.Length());
+ #else
+ return QString::fromUtf16(aDescriptor.Ptr(), aDescriptor.Length());
+ #endif
+ }
+
+ inline QString windowGroupName(RWsSession& ws, int id)
+ {
+ TBuf name;
+ ws.GetWindowGroupNameFromIdentifier(id, name);
+ // Window group name contains "null" characters,
+ // which are considered end-of-string if not replaced.
+ for (int i=0; i < name.Length(); i++) {
+ if (name[i] == NULL) {
+ name[i] = ' ';
+ }
+ }
+ return convertTDesC2QString(name);
+ }
+
+ //!@todo: Avkon UIDs not needed once device dialogs fully implemented in Orbit.
+
+ // AknCapServer
+ static const unsigned int UID_AKNCAPSERVER = 0x10207218;
+
+ // Phone ui
+ static const unsigned int UID_PHONEUI = 0x100058B3;
+ // Task switcher
+ static const unsigned int UID_TASKSWITCHER = 0x2002677D;
+ // Dialog server
+ static const unsigned int UID_DIALOGAPPSERVER = 0x20022FC5;
+}
+#endif // Q_OS_SYMBIAN
+
+
+/*!
+* Constructor
+*/
+CxuiApplicationFrameworkMonitorPrivate::CxuiApplicationFrameworkMonitorPrivate(CxuiApplication &application, CxeSettings& settings)
+ : mApplication(application),
+ mSettings(settings),
+#ifdef Q_OS_SYMBIAN
+ mWsSession(CCoeEnv::Static()->WsSession()),
+ mWindowGroup(CCoeEnv::Static()->RootWin()),
+ mWindowGroupId(mWindowGroup.Identifier()),
+ mWindowGroupName(),
+ mKeyLockState(EKeyguardNotActive),
+ mBatteryStatus(EBatteryStatusUnknown),
+#endif // Q_OS_SYMBIAN
+ mState(CxuiApplicationFrameworkMonitor::ForegroundOwned)
+{
+ CX_DEBUG_ENTER_FUNCTION();
+
+#ifdef Q_OS_SYMBIAN
+ mWindowGroup.EnableFocusChangeEvents();
+ mWindowGroupName = windowGroupName(mWsSession, mWindowGroupId);
+ init();
+#endif // Q_OS_SYMBIAN
+
+ CX_DEBUG_EXIT_FUNCTION();
+}
+
+/*!
+* Destructor
+*/
+CxuiApplicationFrameworkMonitorPrivate::~CxuiApplicationFrameworkMonitorPrivate()
+{
+ CX_DEBUG_IN_FUNCTION();
+}
+
+/*!
+* Current foreground owning state of this application.
+* @return Foreground owning state.
+*/
+CxuiApplicationFrameworkMonitor::ForegroundState CxuiApplicationFrameworkMonitorPrivate::foregroundState() const
+{
+ return mState;
+}
+
+#ifdef Q_OS_SYMBIAN
+/*!
+* Slot to handle Symbian event.
+* @param event Symbian event to be handled. (Ownership not taken.)
+*/
+void CxuiApplicationFrameworkMonitorPrivate::handleEvent(const QSymbianEvent *event)
+{
+ // We receive tons of these events, so function start and end traces
+ // are intentionally left out.
+
+ if (event) {
+ switch (event->type()) {
+ case QSymbianEvent::WindowServerEvent:
+ handleWindowServerEvent(event);
+ break;
+ }
+ }
+}
+
+/*!
+* Handle changes in RProperty values of keylock state and battery status.
+* @param uid Category uid of the changed property.
+* @param key Integer key of the changed property.
+* @param value New value of the changed property.
+*/
+void CxuiApplicationFrameworkMonitorPrivate::handlePropertyEvent(long int uid, unsigned long int key, QVariant value)
+{
+ CX_DEBUG_ENTER_FUNCTION();
+
+ if (uid == KPSUidAvkonDomain.iUid && key == KAknKeyguardStatus) {
+ CX_DEBUG(("CxuiApplicationFrameworkMonitor - keylock status changed: %d -> %d", value.toInt(), mKeyLockState));
+
+ // Check if the keylock value has actually changed
+ const int newKeyLockState = value.toInt();
+ if (newKeyLockState != mKeyLockState) {
+ mKeyLockState = newKeyLockState;
+ // Set foreground state based on keylock status and focused application info.
+ setState(getCurrentState());
+ }
+ } else if (uid == KPSUidHWRMPowerState.iUid && key == KHWRMBatteryStatus ) {
+ CX_DEBUG(("CxuiApplicationFrameworkMonitor - battery status changed: %d -> %d", value.toInt(), mBatteryStatus));
+
+ // If status changed, check if battery is going empty.
+ const int newBatteryStatus = value.toInt();
+ if (newBatteryStatus != mBatteryStatus) {
+ mBatteryStatus = newBatteryStatus;
+
+ // Notify that battery is almost empty,
+ // need to stop any recordings etc.
+ if( mBatteryStatus == EBatteryStatusEmpty ) {
+ emit batteryEmpty();
+ }
+ }
+ }
+
+ CX_DEBUG_EXIT_FUNCTION();
+}
+
+/*!
+* Set initial values.
+*/
+void CxuiApplicationFrameworkMonitorPrivate::init()
+{
+ CX_DEBUG_ENTER_FUNCTION();
+
+ // Connect to application (window server) events.
+ connect(&mApplication, SIGNAL(symbianEvent(const QSymbianEvent *)), this, SLOT(handleEvent(const QSymbianEvent *)));
+
+ QVariant value;
+
+ // Get initial battery status.
+ mSettings.get(KPSUidHWRMPowerState.iUid, KHWRMBatteryStatus, Cxe::PublishAndSubscribe, value);
+ mBatteryStatus = value.toInt();
+
+ // Get initial keylock status.
+ mSettings.get(KPSUidAvkonDomain.iUid, KAknKeyguardStatus, Cxe::PublishAndSubscribe, value);
+ mKeyLockState = value.toInt();
+
+ bool ok = connect(&mSettings, SIGNAL(settingValueChanged(long int, unsigned long int, QVariant)),
+ this, SLOT(handlePropertyEvent(long int, unsigned long int, QVariant)));
+ CX_DEBUG_ASSERT(ok);
+
+ // Get foreground state. Depends on keyguard status, so that needs to be read first.
+ mState = getCurrentState();
+
+ CX_DEBUG_EXIT_FUNCTION();
+}
+
+/*!
+* Helper method to handle Symbian event that specificly is of type QSymbianEvent::WindowServerEvent.
+* @param event Symbian event to be handled. (Ownership not taken.)
+*/
+bool CxuiApplicationFrameworkMonitorPrivate::handleWindowServerEvent(const QSymbianEvent *event)
+ {
+ // We receive tons of these events, so function start and end traces
+ // are intentionally left out.
+
+ const TWsEvent *wsEvent = event->windowServerEvent();
+ if (wsEvent) {
+ switch (wsEvent->Type()) {
+ case EEventFocusGroupChanged: {
+ CX_DEBUG(("CxuiApplicationFrameworkMonitor - EEventFocusGroupChanged event"));
+ setState(getCurrentState());
+ break;
+ }
+ case EEventFocusGained: {
+ CX_DEBUG(("CxuiApplicationFrameworkMonitor - EEventFocusGained event"));
+ setState(getCurrentState());
+ break;
+ }
+ case EEventFocusLost: {
+ CX_DEBUG(("CxuiApplicationFrameworkMonitor - EEventFocusLost event"));
+ setState(getCurrentState());
+ break;
+ }
+ case EEventWindowVisibilityChanged: {
+ const TWsVisibilityChangedEvent *visibilityEvent = wsEvent->VisibilityChanged();
+ if (visibilityEvent) {
+ CX_DEBUG(("CxuiApplicationFrameworkMonitor - EFullyVisible: bits[%s]",
+ QString::number(TWsVisibilityChangedEvent::EFullyVisible, 2).toAscii().constData() ));
+ CX_DEBUG(("CxuiApplicationFrameworkMonitor - EPartiallyVisible: bits[%s]",
+ QString::number(TWsVisibilityChangedEvent::EPartiallyVisible, 2).toAscii().constData() ));
+ CX_DEBUG(("CxuiApplicationFrameworkMonitor - ENotVisible: bits[%s]",
+ QString::number(TWsVisibilityChangedEvent::ENotVisible, 2).toAscii().constData() ));
+ CX_DEBUG(("CxuiApplicationFrameworkMonitor - event: bits[%s]",
+ QString::number(visibilityEvent->iFlags, 2).toAscii().constData() ));
+ }
+ break;
+ }
+ default:
+ break;
+ }
+ }
+
+ return false;
+}
+
+/*!
+* Set state and emit signal if state really changes.
+* @param state New state.
+*/
+void CxuiApplicationFrameworkMonitorPrivate::setState(CxuiApplicationFrameworkMonitor::ForegroundState state)
+{
+ if (mState != state) {
+ const CxuiApplicationFrameworkMonitor::ForegroundState original(mState);
+
+ // Check if state transition is acceptable in current state.
+ switch (mState) {
+ case CxuiApplicationFrameworkMonitor::ForegroundOwned:
+ case CxuiApplicationFrameworkMonitor::ForegroundPartiallyLost:
+ // All changes accepted.
+ mState = state;
+ break;
+ case CxuiApplicationFrameworkMonitor::ForegroundFullyLost:
+ // If foreground application is changed to note when we are already
+ // fully in background, cannot accept state change to "partial foreground".
+ if (state != CxuiApplicationFrameworkMonitor::ForegroundPartiallyLost) {
+ mState = state;
+ } else {
+ CX_DEBUG(("CxuiApplicationFrameworkMonitor - state change full bg -> partial bg ignored"));
+ }
+ }
+
+ if (mState != original) {
+ CX_DEBUG(("CxuiApplicationFrameworkMonitor - state change [%s] -> [%s]",
+ CxuiApplicationFrameworkMonitor::staticMetaObject.enumerator(
+ CxuiApplicationFrameworkMonitor::staticMetaObject.indexOfEnumerator("ForegroundState")).valueToKey(original),
+ CxuiApplicationFrameworkMonitor::staticMetaObject.enumerator(
+ CxuiApplicationFrameworkMonitor::staticMetaObject.indexOfEnumerator("ForegroundState")).valueToKey(mState) ));
+
+ // If state was changed, signal it to listeners.
+ emit foregroundStateChanged(mState);
+ }
+ }
+}
+
+/*!
+* Get the current foreground state.
+* @return Current state for foreground ownership.
+*/
+CxuiApplicationFrameworkMonitor::ForegroundState CxuiApplicationFrameworkMonitorPrivate::getCurrentState()
+{
+ CX_DEBUG_ENTER_FUNCTION();
+
+ CxuiApplicationFrameworkMonitor::ForegroundState state(CxuiApplicationFrameworkMonitor::ForegroundOwned);
+ int focusWindowGroupId(mWsSession.GetFocusWindowGroup());
+
+ if (mKeyLockState != EKeyguardNotActive) {
+ // Keylock enabled is the same as if other application is in foreground.
+ state = CxuiApplicationFrameworkMonitor::ForegroundFullyLost;
+ } else if (focusWindowGroupId == mWindowGroupId) {
+ // If our window group has focus, we clearly are the foreground owning application.
+ CX_DEBUG(("CxuiApplicationFrameworkMonitor - Foreground window group matches ours."));
+ state = CxuiApplicationFrameworkMonitor::ForegroundOwned;
+
+ } else {
+ // Need to check if foreground is owned by known apps.
+ unsigned int uid(focusedApplicationUid());
+
+ // Check the app uid.
+ switch (uid) {
+ case UID_AKNCAPSERVER:
+ case UID_TASKSWITCHER:
+ case UID_DIALOGAPPSERVER:
+ // Note or task switcher in foreground.
+ state = CxuiApplicationFrameworkMonitor::ForegroundPartiallyLost;
+ break;
+ case UID_PHONEUI:
+ default:
+ // Foreground owned by other app.
+ state = CxuiApplicationFrameworkMonitor::ForegroundFullyLost;
+ break;
+ }
+ }
+
+ CX_DEBUG_EXIT_FUNCTION();
+ return state;
+}
+
+/*!
+* Get the uid of application in foreground.
+* @return Application uid for the foreground application.
+*/
+unsigned int CxuiApplicationFrameworkMonitorPrivate::focusedApplicationUid()
+{
+ unsigned int uid(0);
+ int focusWgId(mWsSession.GetFocusWindowGroup());
+
+ TRAP_IGNORE({
+ CApaWindowGroupName* wgn = CApaWindowGroupName::NewLC(mWsSession, focusWgId);
+ uid = wgn->AppUid().iUid;
+ CleanupStack::PopAndDestroy(wgn);
+ });
+
+ // If the window group identifier does not have the application uid set,
+ // get it via thread secure id.
+ if (uid == 0) {
+ TApaTask task(mWsSession);
+ task.SetWgId(focusWgId);
+
+ RThread t;
+ int err = t.Open(task.ThreadId());
+ if (err == KErrNone) {
+ uid = t.SecureId().iId;
+ CX_DEBUG(("CxuiApplicationFrameworkMonitor - uid resolved from thread"));
+ }
+ t.Close();
+ }
+
+#ifdef CX_DEBUG
+ QString name(windowGroupName(mWsSession, focusWgId));
+
+ CX_DEBUG(("CxuiApplicationFrameworkMonitor - Own window group id: 0x%08x", mWindowGroupId));
+ CX_DEBUG(("CxuiApplicationFrameworkMonitor - Focused window group id: 0x%08x", focusWgId));
+ CX_DEBUG(("CxuiApplicationFrameworkMonitor - Own window group name: [%s]", mWindowGroupName.toAscii().constData()));
+ CX_DEBUG(("CxuiApplicationFrameworkMonitor - Focused window group name: [%s]", name.toAscii().constData()));
+ CX_DEBUG(("CxuiApplicationFrameworkMonitor - Focused application uid: 0x%08x", uid));
+#endif
+
+ return uid;
+}
+
+#endif // Q_OS_SYMBIAN
+
+// end of file
diff -r d9aefe59d544 -r 3075d9b614e6 camerauis/cameraxui/cxui/src/cxuicapturekeyhandler.cpp
--- a/camerauis/cameraxui/cxui/src/cxuicapturekeyhandler.cpp Fri Apr 16 14:51:30 2010 +0300
+++ b/camerauis/cameraxui/cxui/src/cxuicapturekeyhandler.cpp Thu May 13 21:30:19 2010 +0300
@@ -44,37 +44,52 @@
mEngine.featureManager().configuredValues(CxeRuntimeKeys::PRIMARY_CAMERA_CAPTURE_KEYS,
mPrimaryCameraCaptureKeys);
- int scanCode = 0;
- int handle = 0;
- foreach (scanCode, mPrimaryCameraAutofocusKeys) {
- handle = mWindowGroup.CaptureKeyUpAndDowns(scanCode, 0, 0, CXUI_KEY_PRIORITY);
- mCapturedKeyUpDownHandles.append(handle);
- }
- foreach (scanCode, mPrimaryCameraCaptureKeys) {
- handle = mWindowGroup.CaptureKeyUpAndDowns(scanCode, 0, 0, CXUI_KEY_PRIORITY);
- mCapturedKeyUpDownHandles.append(handle);
- }
-
- // Capture key press events... this is done only to make sure other
- // applications do not react to camera key events.
- handle = mWindowGroup.CaptureKey(EKeyCamera, 0, 0, CXUI_KEY_PRIORITY);
- mCapturedKeyHandles.append(handle);
-
+ listenKeys(true);
CX_DEBUG_EXIT_FUNCTION();
}
CxuiCaptureKeyHandler::~CxuiCaptureKeyHandler()
{
CX_DEBUG_ENTER_FUNCTION();
+ listenKeys(false);
+ CX_DEBUG_EXIT_FUNCTION();
+}
- int handle = 0;
- foreach (handle, mCapturedKeyUpDownHandles) {
- mWindowGroup.CancelCaptureKeyUpAndDowns(handle);
+/*!
+* 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();
}
- foreach (handle, mCapturedKeyHandles) {
- mWindowGroup.CancelCaptureKey(handle);
- }
-
CX_DEBUG_EXIT_FUNCTION();
}
@@ -95,6 +110,9 @@
if (event->type() == QEvent::KeyPress) {
QKeyEvent *keyEvent = static_cast (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 ) {
@@ -110,6 +128,8 @@
}
} else if (event->type() == QEvent::KeyRelease) {
QKeyEvent *keyEvent = static_cast (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 ) {
@@ -129,3 +149,36 @@
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 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
diff -r d9aefe59d544 -r 3075d9b614e6 camerauis/cameraxui/cxui/src/cxuidocumentloader.cpp
--- a/camerauis/cameraxui/cxui/src/cxuidocumentloader.cpp Fri Apr 16 14:51:30 2010 +0300
+++ b/camerauis/cameraxui/cxui/src/cxuidocumentloader.cpp Thu May 13 21:30:19 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,16 +23,13 @@
#include "cxuidocumentloader.h"
#include "cxuistillprecaptureview.h"
#include "cxuipostcaptureview.h"
-#include "cxuistillprecaptureview2.h"
#include "cxuivideoprecaptureview.h"
-#include "cxuivideoprecaptureview2.h"
+#include "cxuiscenemodeview.h"
#include "cxutils.h" //CX_DEBUG_ASSERT
#include "cxuisettingdialog.h"
-#include "cxuisettingbutton.h"
#include "cxuisettingslider.h"
#include "cxuisettingradiobuttonlist.h"
-#include "cxuiscenelabel.h"
-#include "cxuisettingbuttoncontainer.h"
+#include "cxuizoomslider.h"
#include "cxeengine.h"
#include "cxuienums.h"
@@ -58,33 +55,26 @@
object = new CxuiVideoPrecaptureView();
} else if (name == CxUiLayout::POSTCAPTURE_VIEW) {
object = new CxuiPostcaptureView();
+ } else if (name == CxUiLayout::STILL_SCENES_VIEW) {
+ object = new CxuiSceneModeView(NULL);
}
- } else if (type == "CxuiStillPrecaptureView2") {
- object = new CxuiStillPrecaptureView2();
-
- } else if (type == "CxuiVideoPrecaptureView2") {
- object = new CxuiVideoPrecaptureView2;
-
} else if (type == "HbDialog") {
if (name == CxUiLayout::SETTINGS_DIALOG_WIDGET
|| name == CxUiLayout::SETTINGS_SLIDER_DIALOG_WIDGET) {
object = new CxuiSettingDialog();
}
- } else if (type == "CxuiSettingButton") {
- object = new CxuiSettingButton(NULL, mEngine);
-
- } else if (type == "CxuiSettingSlider") {
- object = new CxuiSettingSlider(NULL, mEngine);
-
- } else if (type == "CxuiSettingRadioButtonList") {
- object = new CxuiSettingRadioButtonList(NULL, mEngine);
-
- } else if (type == "CxuiSceneLabel") {
- object = new CxuiSceneLabel(NULL, mEngine);
-
- } else if (type == "CxuiSettingButtonContainer") {
- object = new CxuiSettingButtonContainer(NULL);
-
+ } else if (type == "HbSlider") {
+ if (name == CxUiLayout::SETTINGS_SLIDER_DIALOG_CONTENT_WIDGET) {
+ object = new CxuiSettingSlider(NULL, mEngine);
+ } else if (name == CxUiLayout::STILL_PRE_CAPTURE_ZOOM_SLIDER
+ || name == CxUiLayout::VIDEO_PRE_CAPTURE_ZOOM_SLIDER) {
+ object = new CxuiZoomSlider();
+ }
+ } else if (type == "HbRadioButtonList") {
+ if (name == CxUiLayout::SETTINGS_DIALOG_CONTENT_WIDGET
+ || name == CxUiLayout::SCENE_VIEW_RADIOBUTTONS) {
+ object = new CxuiSettingRadioButtonList(NULL, mEngine);
+ }
}
if (object) {
diff -r d9aefe59d544 -r 3075d9b614e6 camerauis/cameraxui/cxui/src/cxuierrormanager.cpp
--- a/camerauis/cameraxui/cxui/src/cxuierrormanager.cpp Fri Apr 16 14:51:30 2010 +0300
+++ b/camerauis/cameraxui/cxui/src/cxuierrormanager.cpp Thu May 13 21:30:19 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,10 +15,11 @@
*
*/
-#include
-#include
-#include
#include
+#include
+#include
+#include
+#include
#include "cxutils.h"
#include "cxeerror.h"
@@ -29,8 +30,8 @@
#include "cxecameradevicecontrol.h"
-/*
-* CxuiErrorManager::CxuiErrorManager
+/*!
+* Constructor
*/
CxuiErrorManager::CxuiErrorManager(CxuiCaptureKeyHandler &keyHandler,CxuiDocumentLoader *documentLoader) :
mKeyHandler(keyHandler),
@@ -42,11 +43,9 @@
CX_DEBUG_EXIT_FUNCTION();
}
-// ---------------------------------------------------------------------------
-// CxuiViewManager::~CxuiViewManager
-//
-// ---------------------------------------------------------------------------
-//
+/*!
+* Destructor
+*/
CxuiErrorManager::~CxuiErrorManager()
{
CX_DEBUG_ENTER_FUNCTION();
@@ -54,11 +53,10 @@
}
-// ---------------------------------------------------------------------------
-// CxuiErrorManager::reportError
-//
-// ---------------------------------------------------------------------------
-//
+/*!
+* Analyze the error code and act accordingly.
+* @param error Error code.
+*/
void CxuiErrorManager::analyze(CxeError::Id error)
{
CX_DEBUG_ENTER_FUNCTION();
@@ -66,25 +64,25 @@
mErrorMsgPopup = NULL;
mErrorSeverity = CxuiErrorManager::None;
- // start evaluating the error.
- QString errorMsgTxt = getErrorDetails(error);
+ if (error != CxeError::None) {
+ // start evaluating the error.
+ QString errorMsgTxt = getErrorDetails(error);
- if(mErrorSeverity != CxuiErrorManager::None) {
- // show the error note to the user.
- launchPopup(errorMsgTxt);
- } else {
- // ignore
+ if(mErrorSeverity != CxuiErrorManager::None) {
+ // show the error note to the user.
+ launchPopup(errorMsgTxt);
+ } else {
+ // ignore
+ }
}
CX_DEBUG_EXIT_FUNCTION();
}
-// ---------------------------------------------------------------------------
-// CxuiErrorManager::aboutToClosePopup
-//
-// ---------------------------------------------------------------------------
-//
+/*!
+* Slot that gets called when error note is closed.
+*/
void CxuiErrorManager::aboutToClosePopup()
{
CX_DEBUG_ENTER_FUNCTION();
@@ -94,12 +92,9 @@
}
-
-// ---------------------------------------------------------------------------
-// CxuiErrorManager::closeApp
-//
-// ---------------------------------------------------------------------------
-//
+/*!
+* Helper method for closing the application.
+*/
void CxuiErrorManager::closeApp()
{
CX_DEBUG_ENTER_FUNCTION();
@@ -109,10 +104,11 @@
-// ---------------------------------------------------------------------------
-// CxuiErrorManager::getErrorDetails
-// evaluates error for error severity and error note
-// ---------------------------------------------------------------------------
+/*!
+* Helper method to get the error message to use for showing note to user,
+* and set the severity level, based on given error code.
+* @param error Error code to be analyzed.
+*/
QString CxuiErrorManager::getErrorDetails(CxeError::Id error)
{
CX_DEBUG_ENTER_FUNCTION();
@@ -129,6 +125,9 @@
mErrorSeverity = CxuiErrorManager::Severe;
msg = hbTrId("txt_cam_info_camera_already_in_use");
break;
+ case CxeError::DiskFull:
+ mErrorSeverity = CxuiErrorManager::Warning;
+ msg = hbTrId("txt_cam_info_memory_full");
default:
break;
}
@@ -137,14 +136,33 @@
return msg;
}
-
-// ---------------------------------------------------------------------------
-// CxuiErrorManager::launchPopup
-// ---------------------------------------------------------------------------
+/*!
+*
+*/
void CxuiErrorManager::launchPopup(QString& errorMsgTxt)
{
CX_DEBUG_ENTER_FUNCTION();
+ switch (mErrorSeverity) {
+ case CxuiErrorManager::Warning:
+ showLowSeverityNote(errorMsgTxt);
+ break;
+ case CxuiErrorManager::Severe:
+ case CxuiErrorManager::Critical:
+ showHighSeverityNote(errorMsgTxt);
+ break;
+ default:
+ break;
+ }
+
+ CX_DEBUG_EXIT_FUNCTION();
+}
+
+/*!
+* Show error note for high severity error.
+*/
+void CxuiErrorManager::showHighSeverityNote(QString& errorMsgTxt)
+{
// we always prepare the popup for the new message and hence we load the
// popup everytime from document loader
@@ -156,8 +174,15 @@
CX_DEBUG(("mErrorMsgPopup load ok=%d", ok));
mErrorMsgPopup = qobject_cast(mDocumentLoader->findWidget(CxUiLayout::ERROR_POPUP));
+ CX_ASSERT_ALWAYS(mErrorMsgPopup);
- CX_ASSERT_ALWAYS(mErrorMsgPopup);
+ // HbDialog's default background item is replaced with black rectangle
+ QGraphicsRectItem *backgroundItem = new QGraphicsRectItem();
+ QBrush blackBrush = QBrush(Qt::black);
+ backgroundItem->setBrush(blackBrush);
+ QGraphicsItem *origBgItem = mErrorMsgPopup->backgroundItem();
+ backgroundItem->setRect(origBgItem->boundingRect());
+ mErrorMsgPopup->setBackgroundItem(backgroundItem);
mErrorMsgPopup->setTimeout(HbDialog::NoTimeout);
mErrorMsgPopup->setBackgroundFaded(false);
@@ -182,3 +207,13 @@
CX_DEBUG_EXIT_FUNCTION();
}
+
+/*!
+* Show error note for low severity error.
+*/
+void CxuiErrorManager::showLowSeverityNote(QString& errorMsgTxt)
+{
+ CX_DEBUG_ENTER_FUNCTION();
+ HbMessageBox::warning(errorMsgTxt);
+ CX_DEBUG_EXIT_FUNCTION();
+}
diff -r d9aefe59d544 -r 3075d9b614e6 camerauis/cameraxui/cxui/src/cxuipostcaptureview.cpp
--- a/camerauis/cameraxui/cxui/src/cxuipostcaptureview.cpp Fri Apr 16 14:51:30 2010 +0300
+++ b/camerauis/cameraxui/cxui/src/cxuipostcaptureview.cpp Thu May 13 21:30:19 2010 +0300
@@ -32,7 +32,7 @@
#include
#include
-#include
+#include
#include "cxeviewfindercontrol.h"
#include "cxuienums.h"
@@ -136,14 +136,20 @@
// get toolbar pointers from the documentloader
widget = mDocumentLoader->findWidget(STILL_POST_CAPTURE_TOOLBAR);
+ // This resize is a workaround to get toolbar shown correctly.
+ widget->resize(60, 300);
mStillToolbar = qobject_cast (widget);
CX_DEBUG_ASSERT(mStillToolbar);
widget = mDocumentLoader->findWidget(VIDEO_POST_CAPTURE_TOOLBAR);
+ // This resize is a workaround to get toolbar shown correctly.
+ widget->resize(60, 300);
mVideoToolbar = qobject_cast (widget);
CX_DEBUG_ASSERT(mVideoToolbar);
widget = mDocumentLoader->findWidget(EMBEDDED_POST_CAPTURE_TOOLBAR);
+ // This resize is a workaround to get toolbar shown correctly.
+ widget->resize(60, 300);
mEmbeddedToolbar = qobject_cast (widget);
CX_DEBUG_ASSERT(mEmbeddedToolbar);
@@ -204,9 +210,11 @@
*/
void CxuiPostcaptureView::playVideo()
{
+
launchNotSupportedNotification();
//! @todo needs an implementation
CX_DEBUG_IN_FUNCTION();
+
}
// ---------------------------------------------------------------------------
@@ -218,18 +226,38 @@
{
CX_DEBUG_ENTER_FUNCTION();
- QString filename = getCurrentFilename();
- bool ret = false;
-
hideControls();
if (mEngine->mode() == Cxe::VideoMode) {
- ret = HbMessageBox::question(hbTrId("txt_cam_other_delete_video_clip"));
+ HbMessageBox::question(hbTrId("txt_cam_other_delete_video_clip"),
+ this,
+ SLOT(handleDeleteDialogClosed(HbAction*)));
} else {
- ret = HbMessageBox::question(hbTrId("txt_cam_other_delete_image"));
+ HbMessageBox::question(hbTrId("txt_cam_other_delete_image"),
+ this,
+ SLOT(handleDeleteDialogClosed(HbAction*)));
}
- if (ret) {
+ CX_DEBUG_EXIT_FUNCTION();
+}
+
+// ---------------------------------------------------------------------------
+// CxuiPostcaptureView::handleDeleteDialogClosed
+//
+// ---------------------------------------------------------------------------
+//
+void CxuiPostcaptureView::handleDeleteDialogClosed(HbAction *action)
+{
+ CX_DEBUG_ENTER_FUNCTION();
+
+ hideControls();
+
+ HbMessageBox *dlg = qobject_cast(sender());
+
+ // check that it was "primary action" that closed the dialog
+ if (dlg && dlg->actions().at(0) == action) {
+ // User confirmed delete
+ QString filename = getCurrentFilename();
QFileInfo fileInfo(filename);
if (fileInfo.exists()) {
//! @todo
@@ -246,32 +274,30 @@
}
}
- CX_DEBUG_EXIT_FUNCTION();
+ CX_DEBUG_EXIT_FUNCTION();
}
-
/*!
Slot for handling image/video sharing.
*/
void CxuiPostcaptureView::launchShare()
{
CX_DEBUG_ENTER_FUNCTION();
-
+
stopTimers();
- stopViewfinder();
releaseCamera();
-
+
QString filename = getCurrentFilename();
-
- QVariantList filelist;
- filelist.append(QVariant(filename));
-
+
+ QStringList filelist;
+ filelist.append(filename);
+
ShareUi dialog;
- dialog.init(filelist, true);
-
+ dialog.send(filelist, true);
+
showControls();
-
+
CX_DEBUG_EXIT_FUNCTION();
}
@@ -284,16 +310,16 @@
{
CX_DEBUG_ENTER_FUNCTION();
- // Cannot return to post-capture while stopping in video mode
+ // Cannot return to pre-capture while stopping in video mode
if (mEngine->mode() != Cxe::VideoMode ||
mEngine->videoCaptureControl().state() != CxeVideoCaptureControl::Stopping) {
stopTimers();
+ // Re-enabling starting timers the next time we enter post capture view.
+ mTimersStarted = false;
+
// Make sure engine prepares for new image/video if necessary
mEngine->initMode(mEngine->mode());
- // enables starting of timers in postcaptureview
- mTimersStarted = false;
-
// Switch to pre-capture view
emit changeToPrecaptureView();
}
@@ -414,7 +440,6 @@
bool CxuiPostcaptureView::eventFilter(QObject *object, QEvent *event)
{
Q_UNUSED(object)
-
bool eventWasConsumed = false;
switch (event->type())
@@ -435,16 +460,13 @@
}
/*!
-* Paint event.
-* Used for performance tracing (snapshot latency).
+* Paint method.
+* Used for performance tracing purposes.
*/
-bool CxuiPostcaptureView::event(QEvent *event)
+void CxuiPostcaptureView::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)
{
- bool processed(HbView::event(event));
- if (event && event->type() == QEvent::Paint) {
OstTrace0(camerax_performance, CXUIPOSTCAPTUREVIEW_SNAPSHOT_DRAW, "msg: e_CX_SHOT_TO_SNAPSHOT 0");
- }
- return processed;
+ QGraphicsWidget::paint(painter, option, widget);
}
// ---------------------------------------------------------------------------
@@ -454,8 +476,8 @@
//
void CxuiPostcaptureView::mousePressEvent(QGraphicsSceneMouseEvent *event)
{
-
- if (event->type() == QEvent::GraphicsSceneMousePress) {
+ //! @todo temporary workaround for title bar mouse event handling bug
+ if (event->type() == QEvent::GraphicsSceneMousePress && event->scenePos().y() > 70) {
mPostcaptureTimer.stop();
toggleControls();
event->accept();
@@ -501,6 +523,9 @@
// remove event filter to disable unnecessary actions
QCoreApplication::instance()->removeEventFilter(this);
+ // Clear the snapshot.
+ mImageLabel->setIcon(HbIcon());
+
stopTimers();
// Hide controls to make sure title bar reacts to show()
// when this view is reactivated.
@@ -590,13 +615,7 @@
void CxuiPostcaptureView::launchNotSupportedNotification()
{
CX_DEBUG_ENTER_FUNCTION();
-
- // Instantiate a popup
- HbNotificationDialog note;
- note.setTitle("Notification");
- note.setText("Not supported yet");
- note.exec();
-
+ HbNotificationDialog::launchDialog("Notification", "Not supported yet");
CX_DEBUG_EXIT_FUNCTION();
}
@@ -727,7 +746,13 @@
mPostcaptureTimer.stop();
mStopViewfinderTimer.stop();
- mTimersStarted = false;
+ // Note: mTimersStarted is intentionally not reset here.
+ // Once the timers are stopped, they are not to be started again until
+ // we come from precapture view again.
+ // E.g. returning from background could otherwise restart the timers and
+ // if post-capture timer would be on, user could be confused: camera
+ // shows up with post-capture view, after couple seconds it disappears
+ // and we return to pre-capture view. That's not what we want.
CX_DEBUG_EXIT_FUNCTION();
}
diff -r d9aefe59d544 -r 3075d9b614e6 camerauis/cameraxui/cxui/src/cxuiprecaptureview.cpp
--- a/camerauis/cameraxui/cxui/src/cxuiprecaptureview.cpp Fri Apr 16 14:51:30 2010 +0300
+++ b/camerauis/cameraxui/cxui/src/cxuiprecaptureview.cpp Thu May 13 21:30:19 2010 +0300
@@ -29,9 +29,11 @@
#include
#include
#include
+#include
#include
#include
#include
+#include
#include "cxeengine.h"
#include "cxeviewfindercontrol.h"
@@ -57,6 +59,7 @@
#include "cxuiprecaptureviewTraces.h"
#endif
#include "cxuiserviceprovider.h"
+#include "cxuizoomslider.h"
// CONSTANTS
@@ -93,11 +96,14 @@
mSettingsDialogList(NULL),
mKeyHandler(NULL),
mQualityIcon(NULL),
+ mIndicators(NULL),
mSettingsDialogHeading(NULL),
mSliderSettingsDialog(NULL),
mSliderSettingsDialogHeading(NULL),
mSettingsSlider(NULL),
- mSettingsInfo(NULL)
+ mSettingsInfo(NULL),
+ mSettingsDialogOkAction(NULL),
+ mSliderSettingsDialogOkAction(NULL)
{
CX_DEBUG_ENTER_FUNCTION();
mDisplayHandler = new CxuiDisplayPropertyHandler();
@@ -249,6 +255,10 @@
mHideControlsTimeout.stop();
}
hideToolbar();
+
+ // show indicators when controls are hidden
+ showIndicators();
+
// give the keyboard focus back to the view
// for the view to receive key events
setFocus();
@@ -331,6 +341,30 @@
}
// ---------------------------------------------------------------------------
+// CxuiPrecaptureView::hideIndicators
+//
+// ---------------------------------------------------------------------------
+//
+void CxuiPrecaptureView::hideIndicators()
+{
+ if (mIndicators) {
+ mIndicators->hide();
+ }
+}
+
+// ---------------------------------------------------------------------------
+// CxuiPrecaptureView::showIndicators
+//
+// ---------------------------------------------------------------------------
+//
+void CxuiPrecaptureView::showIndicators()
+{
+ if (mIndicators) {
+ mIndicators->show();
+ }
+}
+
+// ---------------------------------------------------------------------------
// CxuiPrecaptureView::showControls
//
// ---------------------------------------------------------------------------
@@ -348,6 +382,10 @@
showZoom();
// show titlepane
showItems(Hb::AllItems);
+
+ // hide indicators when controls are shown
+ hideIndicators();
+
mHideControlsTimeout.start();
mControlsVisible = true;
}
@@ -430,7 +468,8 @@
//
void CxuiPrecaptureView::mousePressEvent(QGraphicsSceneMouseEvent *event)
{
- if (event->type() == QEvent::GraphicsSceneMousePress) {
+ //! @todo temporary workaround for title bar mouse event handling bug
+ if (event->type() == QEvent::GraphicsSceneMousePress && event->scenePos().y() > 70) {
toggleControls();
event->accept();
}
@@ -684,6 +723,9 @@
documentLoader->findWidget(SETTINGS_DIALOG_CONTENT_WIDGET));
CX_ASSERT_ALWAYS(mSettingsDialogList);
+ QObject *object = documentLoader->findObject(SETTINGS_DIALOG_OK_ACTION);
+ mSettingsDialogOkAction = qobject_cast(object);
+ CX_DEBUG_ASSERT(mSettingsDialogOkAction);
CX_DEBUG_EXIT_FUNCTION();
@@ -737,13 +779,12 @@
// so we can easily decide if we show grid again or not.
mSettingsDialog->setStarterAction(qobject_cast(action));
- HbAction *okAction = mSettingsDialog->primaryAction();
- if (okAction) {
- // disconnect primary action from dialog so that dialog won't be closed
+ if (mSettingsDialogOkAction) {
+ // disconnect ok action from dialog so that dialog won't be closed
// automatically when action is triggered. handleSelectionAccepted
// is called instead
- okAction->disconnect(mSettingsDialog);
- connect(okAction, SIGNAL(triggered()), mSettingsDialogList, SLOT(handleSelectionAccepted()));
+ mSettingsDialogOkAction->disconnect(mSettingsDialog);
+ connect(mSettingsDialogOkAction, SIGNAL(triggered()), mSettingsDialogList, SLOT(handleSelectionAccepted()));
// Close the dialog when new setting value is committed
connect(mSettingsDialogList, SIGNAL(selectionCommitted()), mSettingsDialog, SLOT(close()));
@@ -792,6 +833,9 @@
documentLoader->findWidget(SETTINGS_SLIDER_DIALOG_CONTENT_WIDGET));
CX_ASSERT_ALWAYS(mSettingsSlider);
+ QObject *object = documentLoader->findObject(SETTINGS_DIALOG_OK_ACTION);
+ mSliderSettingsDialogOkAction = qobject_cast(object);
+ CX_DEBUG_ASSERT(mSliderSettingsDialogOkAction);
CX_DEBUG_EXIT_FUNCTION();
@@ -843,13 +887,12 @@
// so we can easily decide if we show grid again or not.
mSliderSettingsDialog->setStarterAction(qobject_cast(action));
- HbAction *okAction = mSliderSettingsDialog->primaryAction();
- if (okAction) {
- // disconnect primary action from dialog so that dialog won't be closed
+ if (mSliderSettingsDialogOkAction) {
+ // disconnect ok action from dialog so that dialog won't be closed
// automatically when action is triggered. handleSelectionAccepted
// is called instead
- okAction->disconnect(mSliderSettingsDialog);
- connect(okAction, SIGNAL(triggered()), mSettingsSlider, SLOT(handleSelectionAccepted()));
+ mSliderSettingsDialogOkAction->disconnect(mSliderSettingsDialog);
+ connect(mSliderSettingsDialogOkAction, SIGNAL(triggered()), mSettingsSlider, SLOT(handleSelectionAccepted()));
// Close the dialog when new setting value is committed
connect(mSettingsSlider, SIGNAL(selectionCommitted()), mSliderSettingsDialog, SLOT(close()));
@@ -891,13 +934,17 @@
void CxuiPrecaptureView::launchNotSupportedNotification()
{
CX_DEBUG_ENTER_FUNCTION();
+ HbNotificationDialog::launchDialog("Notification", "Not supported yet");
+ CX_DEBUG_EXIT_FUNCTION();
+}
- // Instantiate a popup
- HbNotificationDialog note;
- note.setTitle("Notification");
- note.setText("Not supported yet");
- note.exec();
-
+/*!
+* Show "Disk full" notification.
+*/
+void CxuiPrecaptureView::launchDiskFullNotification()
+{
+ CX_DEBUG_ENTER_FUNCTION();
+ HbMessageBox::warning(hbTrId("txt_cam_info_memory_full"));
CX_DEBUG_EXIT_FUNCTION();
}
@@ -967,16 +1014,18 @@
* Adding zoom buttons to the slider
* \param slider Pointer to the slider object, where the buttons will be added
*/
-void CxuiPrecaptureView::addIncreaseDecreaseButtons(HbSlider* slider)
+void CxuiPrecaptureView::addIncreaseDecreaseButtons(CxuiZoomSlider *slider)
{
// get current slider elements
- QList elements = slider->elements();
+ QList elements = slider->sliderElements();
+
// add increase and decrease elements to the slider
elements << HbSlider::IncreaseElement << HbSlider::DecreaseElement;
- slider->setElements(elements);
+ slider->setSliderElements(elements);
+
// set icons for the increase and decrease element
- slider->setIcon(HbSlider::DecreaseElement , HbIcon("qtg_mono_minus"));
- slider->setIcon(HbSlider::IncreaseElement , HbIcon("qtg_mono_plus"));
+ slider->setElementIcon(HbSlider::DecreaseElement , HbIcon("qtg_mono_minus"));
+ slider->setElementIcon(HbSlider::IncreaseElement , HbIcon("qtg_mono_plus"));
}
@@ -990,15 +1039,17 @@
const QString &graphicName,
HbFrameDrawer::FrameType frameType)
{
- HbFrameDrawer *drawer = new HbFrameDrawer(graphicName, frameType);
+ if (widget) {
+ HbFrameDrawer *drawer = new HbFrameDrawer(graphicName, frameType);
- if (drawer && widget) {
- HbFrameItem *backgroundItem = new HbFrameItem(drawer, widget);
- if (backgroundItem) {
- // set item to fill the whole widget
- backgroundItem->setGeometry(QRectF(QPointF(0, 0), widget->size()));
- backgroundItem->setZValue(0);
- widget->setBackgroundItem(backgroundItem);
+ if (drawer) {
+ HbFrameItem *backgroundItem = new HbFrameItem(drawer, widget);
+ if (backgroundItem) {
+ // set item to fill the whole widget
+ backgroundItem->setGeometry(QRectF(QPointF(0, 0), widget->size()));
+ backgroundItem->setZValue(0);
+ widget->setBackgroundItem(backgroundItem);
+ }
}
}
}
@@ -1034,6 +1085,7 @@
*/
QString CxuiPrecaptureView::getSettingItemIcon(const QString &key, QVariant value)
{
+ CX_DEBUG_ENTER_FUNCTION();
CxUiSettings::RadioButtonListParams data;
QString icon = "";
if (mSettingsInfo && mSettingsInfo->getSettingsContent(key, data)) {
@@ -1045,6 +1097,9 @@
}
}
}
+
+ CX_DEBUG((("Setting icon name [%s]"), icon.toAscii().constData()));
+ CX_DEBUG_EXIT_FUNCTION();
return icon;
}
diff -r d9aefe59d544 -r 3075d9b614e6 camerauis/cameraxui/cxui/src/cxuiscenemodeview.cpp
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/camerauis/cameraxui/cxui/src/cxuiscenemodeview.cpp Thu May 13 21:30:19 2010 +0300
@@ -0,0 +1,350 @@
+/*
+* 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
+
+#include "cxenamespace.h"
+#include "cxesettings.h"
+#include "cxuiscenemodeview.h"
+#include "cxuienums.h"
+#include "cxutils.h"
+#include "cxuicapturekeyhandler.h"
+#include "cxuisettingsinfo.h"
+#include "cxeviewfindercontrol.h"
+#include "cxecameradevicecontrol.h"
+#include "cxuidocumentloader.h"
+
+using namespace Cxe;
+using namespace CxUi;
+using namespace CxUiLayout;
+using namespace CxUiSettings;
+using namespace CxeSettingIds;
+
+const int CXUI_SCENES_TRANSITION_TIME = 350; // 350 milliseconds
+const int CXUI_SCENES_CAMERA_TIMEOUT = 60000; // 60 seconds for the camera hw release timeout
+const QString CXUI_SCENES_AUTOMATIC_IMAGE=":/camerax/scene_automatic.png";
+const QString CXUI_SCENES_LANDSCAPE_IMAGE=":/camerax/scene_landscape.png";
+const QString CXUI_SCENES_CLOSEUP_IMAGE=":/camerax/scene_close-up.png";
+const QString CXUI_SCENES_PORTRAIT_IMAGE=":/camerax/scene_portrait.png";
+const QString CXUI_SCENES_SPORT_IMAGE=":/camerax/scene_sport.png";
+const QString CXUI_SCENES_NIGHT_IMAGE=":/camerax/scene_night.png";
+const QString CXUI_SCENES_NIGHT_PORTRAIT_IMAGE=":/camerax/scene_nightportrait.png";
+const QString CXUI_SCENES_LOW_LIGHT_IMAGE=":/camerax/scene_lowlight.png";
+
+
+/*!
+* Constructor
+*/
+CxuiSceneModeView::CxuiSceneModeView(QGraphicsItem *parent) :
+ HbView(parent),
+ mMainWindow(NULL),
+ mSettingsInfo(NULL),
+ mEngine(NULL),
+ mDocumentLoader(NULL),
+ mCaptureKeyHandler(NULL),
+ mScenesBackground(NULL)
+{
+ CX_DEBUG_IN_FUNCTION();
+}
+
+/*!
+* Destructor
+*/
+CxuiSceneModeView::~CxuiSceneModeView()
+{
+ CX_DEBUG_ENTER_FUNCTION();
+ CX_DEBUG_EXIT_FUNCTION();
+}
+
+/*!
+* Construct-method handles initialisation tasks for this class. Needs to be called
+* before the instance of this class is used.
+* @param mainwindow
+* @param engine
+* @param documentLoader
+* @param keyHandler
+*/
+void CxuiSceneModeView::construct(HbMainWindow *mainwindow,
+ CxeEngine *engine,
+ CxuiDocumentLoader *documentLoader,
+ CxuiCaptureKeyHandler *keyHandler)
+{
+ CX_DEBUG_ENTER_FUNCTION();
+
+ mMainWindow = mainwindow;
+ mDocumentLoader = documentLoader;
+ mCaptureKeyHandler = keyHandler;
+ mEngine = engine;
+ mSettingsInfo = new CxuiSettingsInfo(mEngine);
+ setContentFullScreen(true);
+ loadDefaultWidgets();
+
+ mCameraReleaseTimer.setInterval(CXUI_SCENES_CAMERA_TIMEOUT);
+ connect(&mCameraReleaseTimer, SIGNAL(timeout()), this, SLOT(releaseCameraHw()), Qt::UniqueConnection);
+
+ CX_DEBUG_EXIT_FUNCTION();
+}
+
+/*!
+* Load widgets from DocML.
+*/
+void CxuiSceneModeView::loadDefaultWidgets()
+{
+ CX_DEBUG_ENTER_FUNCTION();
+ CX_DEBUG_ASSERT(mDocumentLoader);
+
+ QGraphicsWidget *widget = NULL;
+
+ widget = mDocumentLoader->findWidget(SCENE_VIEW_CONTAINER);
+ mScenesContainer = qobject_cast (widget);
+
+ //Now let's retreive the pointer to icon widget
+ widget = mDocumentLoader->findWidget(SCENE_VIEW_BG_IMAGE);
+ mScenesBackground = qobject_cast (widget);
+
+ widget = mDocumentLoader->findWidget(SCENE_VIEW_BG_IMAGE2);
+ mScenesBackground2 = qobject_cast (widget);
+
+ //Assuming that the automatic scene mode is always the default one
+ CX_DEBUG(("CxuiSceneModeView::loadDefaultWidgets -> Now setting default image"));
+ mScenesBackground->setIcon(HbIcon(CXUI_SCENES_AUTOMATIC_IMAGE));
+
+ widget = mDocumentLoader->findWidget(SCENE_VIEW_RADIOBUTTONS);
+ mScenesList = qobject_cast (widget);
+
+ mTransitionAnimation = new QPropertyAnimation(mScenesBackground2, "opacity");
+ mTransitionAnimation->setDuration(CXUI_SCENES_TRANSITION_TIME);
+
+ createWidgetBackgroundGraphic(mScenesContainer, TRANSPARENT_BACKGROUND_GRAPHIC);
+
+ connectSignals();
+
+ CX_DEBUG_EXIT_FUNCTION();
+}
+
+/*!
+* Helper function to connect signals needed in this class.
+*/
+void CxuiSceneModeView::connectSignals()
+{
+ connect(mScenesList, SIGNAL(itemSelected(int)), this, SLOT(handleSceneRadiobuttonPress(int)));
+ connect(mTransitionAnimation, SIGNAL(finished()), this, SLOT(finishScenesTransition()));
+}
+
+/*!
+* Function can be used to create a graphics item and setting it as a background
+* item for HbWidget. graphicName refers to system wide graphic name. Given graphic
+* can consist of one, three or nine pieces. Nine piece graphics are used by default.
+* See HbFrameDrawer documentation for graphic naming.
+*/
+void CxuiSceneModeView::createWidgetBackgroundGraphic(HbWidget *widget,
+ const QString &graphicName,
+ HbFrameDrawer::FrameType frameType)
+{
+ if (widget) {
+ HbFrameDrawer *drawer = new HbFrameDrawer(graphicName, frameType);
+
+ if (drawer) {
+ HbFrameItem *backgroundItem = new HbFrameItem(drawer, widget);
+ if (backgroundItem) {
+ // set item to fill the whole widget
+ backgroundItem->setGeometry(QRectF(QPointF(0, 0), widget->size()));
+ backgroundItem->setZValue(0);
+ widget->setBackgroundItem(backgroundItem);
+ }
+ }
+ }
+}
+
+/*!
+* This public method assumes that the view is already properly constructed
+*/
+void CxuiSceneModeView::loadBackgroundImages()
+{
+ CX_DEBUG_ENTER_FUNCTION();
+ RadioButtonListParams data;
+ if (mEngine->mode() == Cxe::ImageMode) {
+ mSettingsInfo->getSettingsContent(CxeSettingIds::IMAGE_SCENE, data);
+ } else {
+ mSettingsInfo->getSettingsContent(CxeSettingIds::VIDEO_SCENE, data);
+ }
+ mSettingPairList = data.mSettingPairList;
+ mScenesList->init(&data);
+
+ if (mScenesBackground) {
+ QString sceneId;
+ mEngine->settings().get(data.mSettingId, sceneId);
+ mScenesBackground->setIcon(HbIcon(backgroundForScene(sceneId)));
+ } else {
+ //First time displaying a list
+ //Assuming that the automatic scene mode is always the default one and is on top of the list
+ mScenesList->setSelected(0);
+ }
+ CX_DEBUG_EXIT_FUNCTION();
+}
+
+/*!
+* Handle selecting value in scene list.
+*/
+void CxuiSceneModeView::handleSceneRadiobuttonPress(int index)
+{
+ CX_DEBUG_ENTER_FUNCTION();
+
+ CxUiSettings::SettingItem item = mSettingPairList.at(index);
+ QString sceneId = item.mValue.toString();
+ mScenesBackground2->setIcon(HbIcon(backgroundForScene(sceneId)));
+ startBackgroundTransition();
+ CX_DEBUG_EXIT_FUNCTION();
+}
+
+
+/*!
+* Helper method for getting the background graphic name
+* for each of the scenes.
+*/
+QString CxuiSceneModeView::backgroundForScene(const QString& sceneId)
+{
+ //!@todo: This mapping should be added to the setting xml.
+ if (sceneId == CxeSettingIds::IMAGE_SCENE_AUTO) {
+ return CXUI_SCENES_AUTOMATIC_IMAGE;
+ } else if (sceneId == CxeSettingIds::IMAGE_SCENE_PORTRAIT) {
+ return CXUI_SCENES_PORTRAIT_IMAGE;
+ } else if (sceneId == CxeSettingIds::IMAGE_SCENE_SCENERY) {
+ return CXUI_SCENES_LANDSCAPE_IMAGE;
+ } else if (sceneId == CxeSettingIds::IMAGE_SCENE_MACRO) {
+ return CXUI_SCENES_CLOSEUP_IMAGE;
+ } else if (sceneId == CxeSettingIds::IMAGE_SCENE_SPORTS) {
+ return CXUI_SCENES_SPORT_IMAGE;
+ } else if (sceneId == CxeSettingIds::IMAGE_SCENE_NIGHT) {
+ return CXUI_SCENES_NIGHT_IMAGE;
+ } else if (sceneId == CxeSettingIds::IMAGE_SCENE_NIGHTPORTRAIT) {
+ return CXUI_SCENES_NIGHT_PORTRAIT_IMAGE;
+ } else if (sceneId == CxeSettingIds::VIDEO_SCENE_AUTO) {
+ return CXUI_SCENES_AUTOMATIC_IMAGE;
+ } else if (sceneId == CxeSettingIds::VIDEO_SCENE_LOWLIGHT) {
+ return CXUI_SCENES_LOW_LIGHT_IMAGE;
+ } else if (sceneId == CxeSettingIds::VIDEO_SCENE_NIGHT) {
+ return CXUI_SCENES_NIGHT_IMAGE;
+ } else {
+ return "";
+ }
+
+}
+
+/*!
+* Start animation for changing the scene background graphic.
+*/
+void CxuiSceneModeView::startBackgroundTransition()
+{
+ mTransitionAnimation->setStartValue(0.0);
+ mTransitionAnimation->setEndValue(1.0);
+ mTransitionAnimation->start();
+
+}
+
+/*!
+* Handle scene background graphic animation finishing.
+*/
+void CxuiSceneModeView::finishScenesTransition()
+{
+ mScenesBackground->setIcon(mScenesBackground2->icon());
+ mScenesBackground2->setOpacity(0);
+ mScenesBackground2->setIcon(HbIcon());
+}
+
+/*!
+* Handle press of ok button.
+*/
+void CxuiSceneModeView::handleOkButtonPress()
+{
+ CX_DEBUG_ENTER_FUNCTION();
+ mScenesList->handleSelectionAccepted();
+ closeView();
+ CX_DEBUG_EXIT_FUNCTION();
+}
+
+/*!
+* Handle press of cancel button.
+*/
+void CxuiSceneModeView::handleCancelButtonPress()
+{
+ CX_DEBUG_ENTER_FUNCTION();
+ closeView();
+ CX_DEBUG_EXIT_FUNCTION();
+}
+
+/*!
+* This view is about to be shown.
+* Update the view to match currently selected scene.
+*/
+void CxuiSceneModeView::showEvent(QShowEvent *event)
+{
+ CX_DEBUG_ENTER_FUNCTION();
+ mScenesList->scrollTo(mScenesList->currentIndex(), HbAbstractItemView::PositionAtTop);
+
+ mEngine->viewfinderControl().stop();
+ mCameraReleaseTimer.start();
+ QGraphicsWidget::showEvent(event);
+ CX_DEBUG_EXIT_FUNCTION();
+}
+
+/*!
+* Slot to handle capture key full press.
+*/
+void CxuiSceneModeView::handleCaptureKeyPressed()
+{
+ CX_DEBUG_ENTER_FUNCTION();
+ closeView();
+ CX_DEBUG_EXIT_FUNCTION();
+}
+
+/*!
+* Slot to handle capture key half press / autofocus key press.
+*/
+void CxuiSceneModeView::handleAutofocusKeyPressed()
+{
+ CX_DEBUG_ENTER_FUNCTION();
+ closeView();
+ CX_DEBUG_EXIT_FUNCTION();
+}
+
+/*!
+* Closing the view and reactivating camera hw if needed
+*/
+void CxuiSceneModeView::closeView()
+{
+ CX_DEBUG_ENTER_FUNCTION();
+ mScenesList->handleClose();
+ mScenesBackground->setIcon(HbIcon());
+ // Make sure engine prepares for new image/video if necessary
+ mEngine->initMode(mEngine->mode());
+ emit viewCloseEvent();
+ CX_DEBUG_EXIT_FUNCTION();
+}
+
+/*!
+* Slot to handle camera hw release timeout
+*/
+void CxuiSceneModeView::releaseCameraHw()
+{
+ CX_DEBUG_ENTER_FUNCTION();
+ mCameraReleaseTimer.stop();
+ mEngine->cameraDeviceControl().release();
+ CX_DEBUG_EXIT_FUNCTION();
+}
+
+// end of file
+
diff -r d9aefe59d544 -r 3075d9b614e6 camerauis/cameraxui/cxui/src/cxuiselftimer.cpp
--- a/camerauis/cameraxui/cxui/src/cxuiselftimer.cpp Fri Apr 16 14:51:30 2010 +0300
+++ b/camerauis/cameraxui/cxui/src/cxuiselftimer.cpp Thu May 13 21:30:19 2010 +0300
@@ -45,8 +45,7 @@
mCounter(0),
mTimer(this),
mOldPostCaptureTimeOut(UNKNOWN),
- mIndicatorContainer(NULL),
- mButtonContainer(NULL),
+ mWidgetContainer(NULL),
mTimerLabel(NULL),
mCancelButton(NULL),
mStartButton(NULL),
@@ -78,12 +77,8 @@
QGraphicsWidget *widget = NULL;
widget = documentLoader->findWidget(STILL_PRE_CAPTURE_SELFTIMER_CONTAINER);
- mIndicatorContainer = qobject_cast(widget);
- CX_DEBUG_ASSERT(mIndicatorContainer);
-
- widget = documentLoader->findWidget(STILL_PRE_CAPTURE_SELFTIMER_BUTTON_CONTAINER);
- mButtonContainer = qobject_cast(widget);
- CX_DEBUG_ASSERT(mButtonContainer);
+ mWidgetContainer = qobject_cast(widget);
+ CX_DEBUG_ASSERT(mWidgetContainer);
widget = documentLoader->findWidget(STILL_PRE_CAPTURE_SELFTIMER_COUNTER);
mTimerLabel = qobject_cast(widget);
@@ -309,13 +304,10 @@
*/
void CxuiSelfTimer::showWidgets()
{
- if (mIndicatorContainer){
- mIndicatorContainer->show();
+ if (mWidgetContainer){
+ mWidgetContainer->show();
}
- if (mButtonContainer){
- mButtonContainer->show();
- }
}
@@ -324,12 +316,10 @@
*/
void CxuiSelfTimer::hideWidgets()
{
- if (mIndicatorContainer){
- mIndicatorContainer->hide();
+ if (mWidgetContainer){
+ mWidgetContainer->hide();
}
- if (mButtonContainer){
- mButtonContainer->hide();
- }
+
}
diff -r d9aefe59d544 -r 3075d9b614e6 camerauis/cameraxui/cxui/src/cxuiserviceprovider.cpp
--- a/camerauis/cameraxui/cxui/src/cxuiserviceprovider.cpp Fri Apr 16 14:51:30 2010 +0300
+++ b/camerauis/cameraxui/cxui/src/cxuiserviceprovider.cpp Thu May 13 21:30:19 2010 +0300
@@ -28,14 +28,15 @@
CxuiServiceProvider* CxuiServiceProvider::mInstance = NULL;
-
-const QString CXUI_SERVICE_NAME = "Camera.com.nokia.ICaptureNew";
+// TODO: get these constants from header
+// will be released wk16
+const QString CXUI_SERVICE_NAME = "cxui.com.nokia.symbian.ICameraCapture";
-const QString CAMERA_INDEX = "camera_index";
-const QString QUALITY = "quality";
-const QString ALLOW_MODE_SWITCH = "allow_mode_switch";
-const QString ALLOW_CAMERA_SWITCH = "allow_camera_switch";
-const QString ALLOW_QUALITY_CHANGE = "allow_quality_change";
+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(CxeEngine *engine)
:
diff -r d9aefe59d544 -r 3075d9b614e6 camerauis/cameraxui/cxui/src/cxuisettingbutton.cpp
--- a/camerauis/cameraxui/cxui/src/cxuisettingbutton.cpp Fri Apr 16 14:51:30 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,243 +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
-#include //HbDeviceProfile
-
-#include
-#include
-
-#include "cxuisettingbutton.h"
-#include "cxutils.h"
-#include "cxuidocumentloader.h"
-#include "cxeengine.h"
-#include "cxesettings.h"
-
-
-CxuiSettingButton::CxuiSettingButton(QGraphicsItem *parent, CxeEngine *engine)
-: HbPushButton(parent), mSettingId(), mSettingValue(0), mSettingPopupXml(), mEngine(engine)
-{
- connect(this, SIGNAL(pressed()), this, SLOT(handleClicked()));
-
-}
-
-CxuiSettingButton::~CxuiSettingButton()
-{
- CX_DEBUG_ENTER_FUNCTION();
- CX_DEBUG_EXIT_FUNCTION();
-}
-
-void CxuiSettingButton::updateIcon(const QString& key, QVariant newValue)
-{
- CX_DEBUG_ENTER_FUNCTION();
- // we're only interested in the setting changes that match our id
- if (key == mSettingId){
- int value = newValue.toInt();
- // so we wont overindex
- if (value < mIcons.size()){
- // for this to work the icons need to be in the correct order in the XML
- QString newIcon = mIcons.at(value);
-
- // to make sure that for some reason there isn't an empty string
- if (!newIcon.isEmpty()){
- CX_DEBUG(("setting icon to: %s",newIcon.toAscii().constData()));
- setIcon(HbIcon(newIcon));
- setBackground(HbIcon(newIcon));
- }else{
- CX_DEBUG(("empty string"));
- }
-
- }else{
- CX_DEBUG((("index %d is out of bounds"), value));
- }
-
-
- }
- CX_DEBUG_EXIT_FUNCTION();
-}
-
-QString CxuiSettingButton::settingId() const
-{
- return mSettingId;
-}
-
-void CxuiSettingButton::setSettingId(const QString &id)
-{
- mSettingId = id;
-}
-
-QString CxuiSettingButton::scenemodeId() const
-{
- return mScenemode;
-}
-
-void CxuiSettingButton::setScenemodeId(const QString &scenemode)
-{
- mScenemode = scenemode;
-}
-
-
-int CxuiSettingButton::settingValue() const
-{
- return mSettingValue;
-}
-
-void CxuiSettingButton::setSettingValue(int value)
-{
- mSettingValue = value;
-}
-
-void CxuiSettingButton::setIconList(const QString &iconList)
-{
- CX_DEBUG_ENTER_FUNCTION();
- mIconList = iconList;
- CX_DEBUG(("%s", mIconList.toAscii().data()));
- mIcons = mIconList.split("+");
- CX_DEBUG((("%d"), mIcons.size()));
-
- // we connect the signal to update the button
- // this is done here so that only those buttons that have an iconlist are connected
- // to the signal
- QObject::connect(&(mEngine->settings()), SIGNAL(settingValueChanged(const QString&,QVariant)),
- this, SLOT(updateIcon(const QString&, QVariant)));
-
-
- CX_DEBUG_EXIT_FUNCTION();
-}
-
-QString CxuiSettingButton::iconList() const
-{
- return mIconList;
-}
-
-QString CxuiSettingButton::settingPopupXml() const
-{
- return mSettingPopupXml;
-}
-
-void CxuiSettingButton::setSettingPopupXml(const QString &popupXml)
-{
- mSettingPopupXml = popupXml;
-}
-
-void CxuiSettingButton::handleClicked()
-{
- CX_DEBUG_ENTER_FUNCTION();
-
- if (!mSettingPopupXml.isEmpty()) {
- // If a settings popup XML reference is given, launch popup
-
- CX_DEBUG(("CxuiSettingButton::handleClicked() - launching popup %s", mSettingPopupXml.toAscii().constData()));
-
- CxuiDocumentLoader* documentLoader = new CxuiDocumentLoader(mEngine);
- bool ok = false;
-
- // Use document loader to create popup
- QObjectList objects = documentLoader->load(mSettingPopupXml, &ok);
-
- CX_DEBUG(("load ok=%d", ok));
-
- // Set parameters for all loaded popups (almost always only one match, though)
- foreach(QObject* o, objects) {
- HbDialog* popup = qobject_cast(o);
- if (popup) {
- popup->setTimeout(HbDialog::NoTimeout);
- popup->setBackgroundFaded(false);
- popup->setAttribute(Qt::WA_DeleteOnClose, true);
-
- // set the popup place to be at the bottom of the screen
- QRectF popupRect = popup->boundingRect();
- QSizeF screenSize = HbDeviceProfile::profile(popup).logicalSize();
- QRectF screenRect = QRectF(QPointF(0,0), screenSize);
-
- popupRect.moveBottom(screenRect.bottom());
- popup->setPos(popupRect.topLeft());
-
- popup->show();
-
- }
- }
-
- delete documentLoader;
- documentLoader = NULL;
- TInt trash;
- TInt heapSize;
- User::Heap().Compress();
- heapSize = User::Available( trash );
- RDebug::Print( _L( "showHeapSize <=> heapSize: %d" ),heapSize);
-
- } else {
- // Set the setting value directly to the engine
- CxeSettings *settings = NULL;
- if (mEngine) {
- settings = &mEngine->settings();
- }
-
- CX_DEBUG_ASSERT(settings);
- CX_DEBUG_ASSERT(!mSettingId.isEmpty());
-
- if (settings && !mSettingId.isEmpty()) {
- CX_DEBUG(("CxuiSettingButton::handleClicked() - setting %s to %d", mSettingId.toAscii().constData(), mSettingValue));
- settings->set(mSettingId, mSettingValue);
- }
- }
- emit clickHandled();
-
-
- CX_DEBUG_EXIT_FUNCTION();
-}
-
-void CxuiSettingButton::setSetting()
-{
- CxeSettings *settings = NULL;
- if (mEngine) {
- settings = &mEngine->settings();
- }
-
- CX_DEBUG_ASSERT(settings);
- CX_DEBUG_ASSERT(!mSettingId.isEmpty());
-
- if (settings && !mSettingId.isEmpty()) {
- CX_DEBUG(("CxuiSettingButton::handleClicked() - setting %s to %d", mSettingId.toAscii().constData(), mSettingValue));
- settings->set(mSettingId, mSettingValue);
- }
-
-}
-
-
-
-/*
-void CxuiSettingButton::mouseMoveEvent(QGraphicsSceneMouseEvent *event)
-{
- CX_DEBUG_ENTER_FUNCTION();
- CX_DEBUG(("CxuiSettingButton::mouseMoveEvent() - %s to %d", mSettingId.toAscii().constData(), mSettingValue));
- QPointF pos = event->pos();
- QPoint pos2 = pos.toPoint();
- CX_DEBUG(("itemPos: %d %d", pos2.x(), pos2.y()));
- if (!hitButton(pos)){
- CX_DEBUG(("Left the button area"));
- this->clearFocus();
-
- }
-
-
-
- CX_DEBUG_EXIT_FUNCTION();
-}
-
-
-*/
diff -r d9aefe59d544 -r 3075d9b614e6 camerauis/cameraxui/cxui/src/cxuisettingbuttoncontainer.cpp
--- a/camerauis/cameraxui/cxui/src/cxuisettingbuttoncontainer.cpp Fri Apr 16 14:51:30 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,118 +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
-#include
-
-#include
-#include "cxuisettingbutton.h"
-#include "cxuisettingbuttoncontainer.h"
-#include "cxutils.h"
-
-
-CxuiSettingButtonContainer::CxuiSettingButtonContainer(QGraphicsItem *parent)
-: HbWidget(parent), mListCreated(false), mPressedDownButton(NULL), mPreviouslyPressedDownButton(NULL)
-{
-
-}
-
-void CxuiSettingButtonContainer::handleButtonPress()
-{
- CX_DEBUG_ENTER_FUNCTION();
- grabMouse();
-
- if (!mListCreated){
- QList buttons = this->childItems();
- CxuiSettingButton *button;
- foreach(QGraphicsItem *item, buttons){
- button = static_cast(item);
- mButtons.append(button);
- }
- mListCreated = true;
- }
-
-
- // find the pressed item
- foreach (CxuiSettingButton* button , mButtons) {
-
- if (button->isDown()) {
- mPressedDownButton = button;
- break;
- }
- }
- CX_DEBUG_EXIT_FUNCTION();
-}
-
-void CxuiSettingButtonContainer::mouseMoveEvent(QGraphicsSceneMouseEvent *event)
-{
-
- if (boundingRect().contains(event->pos())) {
- // moving inside the tool bar
- if (!mPressedDownButton || !mPressedDownButton->geometry().contains(event->pos())) {
- if (mPressedDownButton) {
- // lift it up and try to find some other button
- mPressedDownButton->setDown(false);
- mPreviouslyPressedDownButton = mPressedDownButton;
- mPressedDownButton = 0;
- }
-
- // Find the pressed button
- foreach (CxuiSettingButton* button, mButtons) {
- if (button->geometry().contains(event->pos())) {
- mPressedDownButton = button;
- button->setDown(true);
- button->setSetting();
- HbFeedbackManager* feedback = HbFeedbackManager::instance();
- CX_ASSERT_ALWAYS(feedback != NULL);
- feedback->triggered(button, Hb::InstantDraggedOver);
-
- break;
- }
- }
- }
- } else {
- // moving outside the tool bar
-
- // if a button is pressed down, lift it.
- if (mPressedDownButton) {
- mPressedDownButton->setDown(false);
- mPressedDownButton = 0;
- mPreviouslyPressedDownButton = mPressedDownButton;
- }
- }
-}
-
-void CxuiSettingButtonContainer::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
-{
- Q_UNUSED(event);
- ungrabMouse();
-
- if (mPressedDownButton
- && !mPreviouslyPressedDownButton) {
- // Convert event's scene position to item's coordinate system.
- event->setPos(mPressedDownButton->mapFromScene(event->scenePos()));
- QCoreApplication::sendEvent(mPressedDownButton, event);
- mPressedDownButton = 0;
- emit buttonReleased();
- } else if (mPressedDownButton) {
- mPressedDownButton->setDown(false);
- emit buttonReleased();
- } else
- mPreviouslyPressedDownButton = 0;
-}
-
-
diff -r d9aefe59d544 -r 3075d9b614e6 camerauis/cameraxui/cxui/src/cxuisettingdialog.cpp
--- a/camerauis/cameraxui/cxui/src/cxuisettingdialog.cpp Fri Apr 16 14:51:30 2010 +0300
+++ b/camerauis/cameraxui/cxui/src/cxuisettingdialog.cpp Thu May 13 21:30:19 2010 +0300
@@ -17,7 +17,7 @@
#include
#include "cxutils.h"
-#include "CxuiSettingDialog.h"
+#include "cxuisettingdialog.h"
CxuiSettingDialog::CxuiSettingDialog(QGraphicsItem *parent)
: HbDialog(parent),
diff -r d9aefe59d544 -r 3075d9b614e6 camerauis/cameraxui/cxui/src/cxuisettingradiobuttonlist.cpp
--- a/camerauis/cameraxui/cxui/src/cxuisettingradiobuttonlist.cpp Fri Apr 16 14:51:30 2010 +0300
+++ b/camerauis/cameraxui/cxui/src/cxuisettingradiobuttonlist.cpp Thu May 13 21:30:19 2010 +0300
@@ -53,6 +53,7 @@
CxUiSettings::SettingItem setting;
foreach (setting, data->mSettingPairList) {
+ CX_DEBUG(("CxuiSettingRadioButtonList - appending setting value: %s", setting.mValue.toString().toAscii().data()));
settingStrings.append(setting.mItem); // setting string
mSettingValues.append(setting.mValue); // engine value for setting
}
@@ -121,11 +122,13 @@
QString value;
int err = mEngine->settings().get(mSettingId, value);
+ CX_DEBUG(("CxuiSettingRadioButtonList - original value: [%s]", value.toAscii().data()));
int index = 0;
if (err == CxeError::None) {
index = mSettingValues.indexOf(QVariant(value));
+ CX_DEBUG(("CxuiSettingRadioButtonList - got original index of: %d", index));
}
mOriginalIndex = index;
@@ -180,7 +183,7 @@
if (!mSettingId.isEmpty() && !mSettingValues.isEmpty()) {
QVariant value = mSettingValues.at(index);
- if (value.canConvert()) {
+ if (value.type() == QVariant::Int) {
CX_DEBUG(("index:%d value:%d", index, value.toInt()));
// Don't set the value again, if it is the current value.
@@ -193,9 +196,17 @@
}
// inform interested clients about value changed event
emit valueSelected(value.toInt());
- } else if(value.canConvert()) {
+
+ } else if (value.type() == QVariant::String) {
CX_DEBUG(("index:%d value:[%s]", index, value.toString().toAscii().constData()));
- mEngine->settings().set(mSettingId, value.toString());
+
+ QString current;
+ CxeError::Id status(mEngine->settings().get(mSettingId, current));
+ CX_DEBUG(("settings model value:[%s]", current.toAscii().constData()));
+
+ if (status != CxeError::None || current != value.toString()) {
+ mEngine->settings().set(mSettingId, value.toString());
+ }
}
}
diff -r d9aefe59d544 -r 3075d9b614e6 camerauis/cameraxui/cxui/src/cxuisettingsinfo.cpp
--- a/camerauis/cameraxui/cxui/src/cxuisettingsinfo.cpp Fri Apr 16 14:51:30 2010 +0300
+++ b/camerauis/cameraxui/cxui/src/cxuisettingsinfo.cpp Thu May 13 21:30:19 2010 +0300
@@ -71,7 +71,8 @@
mHeadingIcon = other.mHeadingIcon;
mSettingStrings = other.mSettingStrings;
mRange = other.mRange;
- mStep = other.mStep;
+ mMinorStep = other.mMinorStep;
+ mMajorStep = other.mMajorStep;
}
CX_DEBUG_EXIT_FUNCTION();
return *this;
@@ -209,14 +210,12 @@
// get the localized possible strings for each image quality setting
QString vga = hbTrId("txt_cam_dblist_vga");
- QString normal = QString("%L1 Mpix");
- QString imagesLeft = QString("%L1 images left");
- QString widescreen = QString("%L1 Mpix widescreen");
+ QString normal = hbTrId("txt_cam_dblist_ln_mpix");
+ QString imagesLeft = hbTrId("txt_cam_dblist_hd_720p_val_ln_images_left");
+ QString widescreen = hbTrId("txt_cam_dblist_ln_mpix_widescreen");
foreach(CxeImageDetails quality, list) {
// mapping the right value for each quality
- QString index2String;
- index2String.setNum(index);
QString settingString;
QString qualityIcon = "";
@@ -245,12 +244,12 @@
} else if (quality.mMpxCount == "1.2") {
qualityIcon = "qtg_mono_1_3mp";
} else if (quality.mMpxCount == "0.3") {
- qualityIcon = "qtg_mono_qcif"; //correct icon missing
+ qualityIcon = "qtg_mono_0_3mp";
}
SettingItem setting;
setting.mItem = settingString;
- setting.mValue = qVariantFromValue(index2String);
+ setting.mValue = index;
setting.mIcon = qualityIcon;
settings.mSettingPairList.append(setting);
@@ -277,7 +276,7 @@
int index = 0;
// get the localized possible strings for each video quality setting
- QString timeleft = QString("%L1 recording time left");
+ QString timeleft = hbTrId("txt_cam_dblist_hd_720p_val_ln_recording_time_left");
QString hdString = hbTrId("txt_cam_dblist_hd_720p_169_widescreen");
QString vga = hbTrId("txt_cam_dblist_vga_43");
QString wideVga = hbTrId("txt_cam_dblist_vga_169_widescreen"); //VGA 16:9 widescreen
@@ -285,8 +284,6 @@
foreach(CxeVideoDetails quality, list) {
// mapping the right value for each quality
- QString index2String;
- index2String.setNum(index);
QString settingString = "";
QString time = "";
@@ -307,7 +304,7 @@
} else if (quality.mWidth == KResWideVGA.width() &&
quality.mHeight == KResWideVGA.height()) {
settingString.append(wideVga);
- qualityIcon = "qtg_mono_12mp"; //correct icon missing
+ qualityIcon = "qtg_mono_vga_wide";
}
settingString.append(",");
@@ -319,7 +316,7 @@
CX_DEBUG(( "video quality setting string: %s", settingString.toAscii().constData()));
SettingItem setting;
setting.mItem = settingString;
- setting.mValue = qVariantFromValue(index2String);
+ setting.mValue = index;
setting.mIcon = qualityIcon;
settings.mSettingPairList.append(setting);
diff -r d9aefe59d544 -r 3075d9b614e6 camerauis/cameraxui/cxui/src/cxuisettingslider.cpp
--- a/camerauis/cameraxui/cxui/src/cxuisettingslider.cpp Fri Apr 16 14:51:30 2010 +0300
+++ b/camerauis/cameraxui/cxui/src/cxuisettingslider.cpp Thu May 13 21:30:19 2010 +0300
@@ -51,8 +51,8 @@
// labels correctly if step is something else than 1
int step = 1;
mSliderScaleValue = 1;
- if (data->mStep != 0) {
- mSliderScaleValue = step / data->mStep;
+ if (data->mMinorStep != 0) {
+ mSliderScaleValue = step / data->mMinorStep;
}
// scale min and max values as step has been set to 1
@@ -61,17 +61,13 @@
CX_DEBUG(("Setting slider range [%d..%d]", minvalue, maxvalue));
setRange(minvalue,maxvalue);
setSingleStep(step);
-
- setSnappingMode(HbSlider::MajorTickSnapping);
+
+ setSnappingMode(HbSlider::MinorTickSnapping);
- // don't show labels and tickmarks if there are no strings to be shown
- if (!data->mSettingStrings.isEmpty()) {
- setMajorTickLabels(data->mSettingStrings);
- setMajorTickInterval(step);
- setTickPosition(Hb::SliderTicksLeft);
- } else {
- setTickPosition(Hb::NoSliderTicks);
- }
+ setMajorTickLabels(data->mSettingStrings);
+ setMajorTickInterval(mSliderScaleValue * data->mMajorStep);
+ setMinorTickInterval(mSliderScaleValue * data->mMinorStep);
+ setTickPosition(Hb::SliderTicksAbove);
setSettingId(data->mSettingId);
diff -r d9aefe59d544 -r 3075d9b614e6 camerauis/cameraxui/cxui/src/cxuisettingxmlreader.cpp
--- a/camerauis/cameraxui/cxui/src/cxuisettingxmlreader.cpp Fri Apr 16 14:51:30 2010 +0300
+++ b/camerauis/cameraxui/cxui/src/cxuisettingxmlreader.cpp Thu May 13 21:30:19 2010 +0300
@@ -50,7 +50,8 @@
static const char *ATTRIBUTE_SLIDER_MIN = "min";
static const char *ATTRIBUTE_SLIDER_MAX = "max";
- static const char *ATTRIBUTE_SLIDER_STEP = "step";
+ static const char *ATTRIBUTE_SLIDER_MINOR_STEP = "minorStep";
+ static const char *ATTRIBUTE_SLIDER_MAJOR_STEP = "majorStep";
// possible values that can be used in xml for "ATTRIBUTE_LISTBOXTYPE"
static const char *SINGLE_LINE_LISTBOX = "SingleLineListBox";
@@ -290,15 +291,28 @@
// Go through list of items
// XML something like this
//
+ bool ok(false);
+ int intValue(0);
+ QVariant value;
+ QString string;
for (QDomNode n = element.firstChild(); !n.isNull(); n = n.nextSibling()) {
e = n.toElement();
+ CX_DEBUG(("tag name <%s>", e.tagName().toAscii().constData()));
- // get the string text id from the xml
- QString string = e.attribute(ATTRIBUTE_LOCALIZATION_ID);
- // get the equivalent engine value from xml
- QVariant value = e.attribute(ATTRIBUTE_VALUE);
+ // Get the item equivalent engine value from xml.
+ // We need to know later if it is a string or int type, hence the extra effort.
+ // QVariant has auto-conversion even from string to int, so can't use QVariant::canConvert().
+ string = e.attribute(ATTRIBUTE_VALUE);
+ intValue = string.toInt(&ok);
+ if (ok) {
+ value.setValue(intValue);
+ } else {
+ value.setValue(string);
+ }
- CX_DEBUG(("tag name <%s>", e.tagName().toAscii().constData()));
+
+ // get the string text id from the xml, and format based on type.
+ string = e.attribute(ATTRIBUTE_LOCALIZATION_ID);
if (e.tagName() == TAG_ITEM) {
// get the localizable string from the hbtrid
string = hbTrId(string.toAscii().constData());
@@ -307,7 +321,6 @@
// format the setting string
string = hbTrId(string.toAscii().constData(), lnValue.toInt());
}
-
CX_DEBUG(("attribute [%s] value[%s]", ATTRIBUTE_LOCALIZATION_ID, string.toAscii().constData()));
if (!string.isNull()) {
@@ -364,15 +377,18 @@
QString maxString = e.attribute(ATTRIBUTE_SLIDER_MAX);
// get the step text id from the xml
- QVariant stepString = e.attribute(ATTRIBUTE_SLIDER_STEP);
- p->mStep = stepString.toReal();
+ QVariant stepString = e.attribute(ATTRIBUTE_SLIDER_MINOR_STEP);
+ p->mMinorStep = stepString.toReal();
+ stepString = e.attribute(ATTRIBUTE_SLIDER_MAJOR_STEP);
+ p->mMajorStep = stepString.toReal();
// get the ln value from xml to generate strings for slider
QString lnValue = e.attribute(ATTRIBUTE_LOCALIZATION_ID_LN_VALUE);
// Don't create labels for slider if no strings are defined in settinsg xml
+ // Create labels only for major ticks
if (!minString.isEmpty() && !maxString.isEmpty()) {
- qreal step = p->mStep;
+ qreal step = p->mMajorStep;
qreal value = lnValue.toDouble();
// generating all negative valued strings for slider setting
while (value > 0) {
@@ -383,7 +399,7 @@
}
// generating all non-negative valued strings for slider setting
- step = p->mStep;
+ step = p->mMajorStep;
value = 0;
while(value <= lnValue.toInt()) {
// format the setting string
diff -r d9aefe59d544 -r 3075d9b614e6 camerauis/cameraxui/cxui/src/cxuistandby.cpp
--- a/camerauis/cameraxui/cxui/src/cxuistandby.cpp Fri Apr 16 14:51:30 2010 +0300
+++ b/camerauis/cameraxui/cxui/src/cxuistandby.cpp Thu May 13 21:30:19 2010 +0300
@@ -103,12 +103,10 @@
*/
bool CxuiStandby::handleMouseEvent()
{
- CX_DEBUG_ENTER_FUNCTION();
-
bool keyHandled = false;
// close the dialog if it's visible
- if(mStandbyDialogVisible && mStandbyPopup) {
+ if (mStandbyDialogVisible && mStandbyPopup) {
CX_DEBUG(( "closing the popup mStandbyDialogVisible = : %d", mStandbyDialogVisible ));
mStandbyPopup->close();
keyHandled = true;
@@ -117,8 +115,6 @@
startTimer();
}
- CX_DEBUG_EXIT_FUNCTION();
-
return keyHandled;
}
@@ -233,7 +229,6 @@
case QEvent::GraphicsSceneMouseMove:
case QEvent::GraphicsSceneMousePress:
case QEvent::GraphicsSceneMouseRelease:
- CX_DEBUG(("CxuiStandby::eventFilter -> mouse event"));
eventWasConsumed = handleMouseEvent();
break;
default:
diff -r d9aefe59d544 -r 3075d9b614e6 camerauis/cameraxui/cxui/src/cxuistillprecaptureview.cpp
--- a/camerauis/cameraxui/cxui/src/cxuistillprecaptureview.cpp Fri Apr 16 14:51:30 2010 +0300
+++ b/camerauis/cameraxui/cxui/src/cxuistillprecaptureview.cpp Thu May 13 21:30:19 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,6 +30,7 @@
#include
#include // HbDeviceProfile
#include
+#include
#include "cxuiselftimer.h"
#include "cxeengine.h"
@@ -52,6 +53,7 @@
#include "cxuiserviceprovider.h"
#include "cxuisettingdialog.h"
#include "cxuisettingradiobuttonlist.h"
+#include "cxuizoomslider.h"
using namespace Cxe;
using namespace CxUiLayout;
@@ -100,6 +102,8 @@
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()));
loadDefaultWidgets();
hideControls();
@@ -126,13 +130,11 @@
mQualityIcon = qobject_cast(widget);
CX_DEBUG_ASSERT(mQualityIcon);
+ widget = mDocumentLoader->findWidget(STILL_PRE_CAPTURE_INDICATOR_CONTAINER);
+ mIndicators = qobject_cast(widget);
+ CX_DEBUG_ASSERT(mIndicators);
// create background for indicator container
- HbWidget *container = NULL;
- widget = mDocumentLoader->findWidget(STILL_PRE_CAPTURE_INDICATOR_CONTAINER);
- container = qobject_cast(widget);
- CX_DEBUG_ASSERT(container);
- createWidgetBackgroundGraphic(container, TRANSPARENT_BACKGROUND_GRAPHIC);
- container->show();
+ createWidgetBackgroundGraphic(mIndicators, TRANSPARENT_BACKGROUND_GRAPHIC);
CX_DEBUG_EXIT_FUNCTION();
}
@@ -169,7 +171,7 @@
QObject *object = NULL;
widget = mDocumentLoader->findWidget(STILL_PRE_CAPTURE_ZOOM_SLIDER);
- mSlider = qobject_cast(widget);
+ mSlider = qobject_cast(widget);
CX_DEBUG_ASSERT(mSlider);
addIncreaseDecreaseButtons(mSlider);
createWidgetBackgroundGraphic(mSlider, TRANSPARENT_BACKGROUND_GRAPHIC);
@@ -187,12 +189,6 @@
CX_DEBUG_ASSERT(container);
createWidgetBackgroundGraphic(container, TRANSPARENT_BACKGROUND_GRAPHIC);
- widget = mDocumentLoader->findWidget(STILL_PRE_CAPTURE_SELFTIMER_BUTTON_CONTAINER);
- container = qobject_cast(widget);
- CX_DEBUG_ASSERT(container);
- createWidgetBackgroundGraphic(container, TRANSPARENT_BACKGROUND_GRAPHIC);
-
-
// connect selftimer start button to hide controls
widget = mDocumentLoader->findWidget(STILL_PRE_CAPTURE_SELFTIMER_START_BUTTON);
HbPushButton *startButton = qobject_cast(widget);
@@ -239,19 +235,23 @@
}
}
if (!CxuiServiceProvider::instance()->allowCameraSwitching()) {
-
CX_DEBUG(("EMBEDDED: don't allow camera switching"));
-
- HbAction *goto_2nd_cam = qobject_cast (mDocumentLoader->findObject(STILL_PRE_CAPTURE_GOTO_2ND_CAMERA_ACTION));
- if (goto_2nd_cam) {
- CX_DEBUG(("EMBEDDED: setting camera switch to disabled"));
- goto_2nd_cam->setEnabled(false);
-
- }
}
}
+ // update toolbar flash icon
+ int flash;
+ if (mEngine->settings().get(CxeSettingIds::FLASH_MODE, flash) == CxeError::None) {
+ handleSettingValueChanged(CxeSettingIds::FLASH_MODE, flash);
+ }
+
+ // update toolbar scene mode
+ QString scene;
+ if (mEngine->settings().get(CxeSettingIds::IMAGE_SCENE, scene) == CxeError::None) {
+ handleSettingValueChanged(CxeSettingIds::IMAGE_SCENE, scene);
+ }
+
hideControls();
mWidgetsLoaded = true;
@@ -305,31 +305,8 @@
void CxuiStillPrecaptureView::launchSceneModesPopup()
{
CX_DEBUG_ENTER_FUNCTION();
-
- if(mSceneModePopup) {
- CX_DEBUG(("mSceneModePopup exists, showing.."));
- mSceneModePopup->show();
- } else {
- CX_DEBUG(("Loading scene mode popup DocML"));
- CxuiDocumentLoader* documentLoader = new CxuiDocumentLoader(mEngine);
- bool ok = false;
-
- // Use document loader to create popup
- documentLoader->load(SCENEMODE_SETTING_XML, &ok);
-
- CX_DEBUG(("load ok=%d", ok));
-
- mSceneModePopup = qobject_cast(documentLoader->findWidget("still_scenemode_popup"));
- CX_DEBUG_ASSERT(mSceneModePopup);
- mSceneModePopup->setTimeout(HbDialog::NoTimeout);
- mSceneModePopup->setBackgroundFaded(false);
-
- delete documentLoader;
- documentLoader = NULL;
- }
-
- connect(mKeyHandler, SIGNAL(autofocusKeyPressed()), mSceneModePopup, SLOT(close()));
-
+ hideControls();
+ emit showScenesView();
CX_DEBUG_EXIT_FUNCTION();
}
@@ -379,7 +356,10 @@
capture();
} else {
// start focusing
- handleAutofocusKeyPressed();
+ // Auto-focus can only work if viewfinder is running
+ if (mEngine->viewfinderControl().state() == CxeViewfinderControl::Running) {
+ mEngine->autoFocusControl().start(false);
+ }
setCapturePending();
}
@@ -393,7 +373,7 @@
if (mEngine->mode() == Cxe::ImageMode) {
// do not start capturing, if it is already ongoing
- // the user might be repeatly triggering capture key
+ // the user might be repeatedly triggering capture key
if (mEngine->stillCaptureControl().state() == CxeStillCaptureControl::Ready) {
// If focusing in progress, cancel it now.
// Set capture pending and continue once focusing is cancelled.
@@ -401,8 +381,14 @@
mEngine->autoFocusControl().cancel();
setCapturePending();
} else {
- mEngine->stillCaptureControl().reset(); //! @todo: Do not delete snapshots before images are really saved
- mEngine->stillCaptureControl().capture();
+ // Engine uses disk space *estimate* for imagesLeft() so it
+ // should not cause significant delay / additional shutter lag.
+ if (mEngine->stillCaptureControl().imagesLeft()) {
+ mEngine->stillCaptureControl().reset(); //! @todo: Do not delete snapshots before images are really saved
+ mEngine->stillCaptureControl().capture();
+ } else {
+ launchDiskFullNotification();
+ }
}
} else {
setCapturePending();
@@ -411,7 +397,6 @@
// after capturing check what is the new amount for images left
updateImagesLeftLabel();
-
CX_DEBUG_EXIT_FUNCTION();
}
@@ -544,6 +529,13 @@
return;
}
+ // in case of selftimer being enabled, autofocuskey does not start focusing
+ if (mSelfTimer && mSelfTimer->isEnabled()){
+ CX_DEBUG(("Selftimer enabled, ignoring autofocus key press"));
+ CX_DEBUG_EXIT_FUNCTION();
+ return;
+ }
+
// Auto-focus can only work if viewfinder is running
if (mEngine->viewfinderControl().state() == CxeViewfinderControl::Running) {
@@ -557,6 +549,13 @@
{
CX_DEBUG_ENTER_FUNCTION();
+ // in case of selftimer being enabled, autofocuskey should not do anything
+ if (mSelfTimer && mSelfTimer->isEnabled()){
+ CX_DEBUG(("Selftimer enabled, ignoring autofocus key release"));
+ CX_DEBUG_EXIT_FUNCTION();
+ return;
+ }
+
if (mEngine->autoFocusControl().supported()) {
// Check that capture is not in progress, or pending.
// Otherwise wouldn't want to cancel the focus.
@@ -638,7 +637,7 @@
CxeStillCaptureControl::State newState, CxeError::Id /*error*/)
{
if (newState == CxeStillCaptureControl::Ready) {
- OstTrace0(camerax_performance, CXUISTILLPRECAPTUREVIEW_SHOT_TO_SHOT_DUP2, "msg: e_CX_SHOT_TO_SHOT 0");
+ OstTrace0(camerax_performance, DUP1_CXUISTILLPRECAPTUREVIEW_SHOT_TO_SHOT, "msg: e_CX_SHOT_TO_SHOT 0");
if (mCapturePending) {
CX_DEBUG(("mCapturePending is true, starting capture now"));
@@ -665,19 +664,23 @@
}
+/*!
+* Slot to handle application being sent to background.
+*/
void CxuiStillPrecaptureView::handleFocusLost()
{
- CX_DEBUG_IN_FUNCTION();
- bool captureInProgress = mEngine->stillCaptureControl().state() == CxeStillCaptureControl::Capturing;
- if (!captureInProgress) {
- if (mSelfTimer && mSelfTimer->isOngoing()) {
- // If self-timer is running, stop and reset the delay now.
- mSelfTimer->reset();
- }
+ CX_DEBUG_ENTER_FUNCTION();
- // Release camera as we are going to background.
- releaseCamera();
+ if (mSelfTimer && mSelfTimer->isOngoing()) {
+ // If self-timer is running, stop and reset the delay now.
+ mSelfTimer->reset();
}
+
+ // Release camera as we are going to background.
+ // If taking image is just ongoing, it will be cancelled by engine.
+ releaseCamera();
+
+ CX_DEBUG_EXIT_FUNCTION();
}
void CxuiStillPrecaptureView::handleFocusGained()
@@ -687,10 +690,24 @@
CX_DEBUG_EXIT_FUNCTION();
}
+/*
+ Slot for handling scene mode change
+ \param scene QVariantMap containing settings related to the new scene mode
+ */
void CxuiStillPrecaptureView::handleSceneChanged(CxeScene &scene)
{
CX_DEBUG_ENTER_FUNCTION();
if (mEngine->mode() == Cxe::ImageMode) {
+
+ // update toolbar scene mode icon
+ QString icon = getSettingItemIcon(CxeSettingIds::IMAGE_SCENE, scene[CxeSettingIds::SCENE_ID]);
+ CX_DEBUG((("New scene mode icon: %s"), icon.toAscii().constData()));
+ if (mDocumentLoader) {
+ QObject *obj = mDocumentLoader->findObject(STILL_PRE_CAPTURE_SCENE_MODE_ACTION);
+ CX_DEBUG_ASSERT(obj);
+ qobject_cast(obj)->setIcon(HbIcon(icon));
+ }
+
// for now, we are only interested in flashmode change
if (scene.contains(CxeSettingIds::FLASH_MODE)) {
CX_DEBUG(("updating flash to: %d", scene[CxeSettingIds::FLASH_MODE].value()));
@@ -707,25 +724,36 @@
CX_DEBUG_EXIT_FUNCTION();
}
+/*
+ Slot for handling setting value changes. Notice that changing the scene mode
+ does not emit settingValueChanged signal.
+ \param key CxSettingIds key defining the changed setting
+ \param newValue QVariant containing the new setting value
+
+ \sa CxuiStillPrecaptureView::handleSceneChanged(CxeScene &scene)
+ */
void CxuiStillPrecaptureView::handleSettingValueChanged(const QString& key, QVariant newValue)
{
CX_DEBUG_ENTER_FUNCTION();
if (mEngine->mode() == Cxe::ImageMode) {
+
+ // update images left and image quality icons
if (key == CxeSettingIds::IMAGE_QUALITY) {
-
// update the quality indicator on screen
updateQualityIcon();
-
// update images left when quality values are changed
updateImagesLeftLabel();
}
+ // update toolbar flash icon
if (mFlashSetting && key == CxeSettingIds::FLASH_MODE) {
- CX_DEBUG((("flash mode: %d"),newValue.toInt()))
+ CX_DEBUG((("flash mode: %d"), newValue.toInt()));
QString icon = getSettingItemIcon(key, newValue);
+ CX_DEBUG((("flash mode icon: %s"), icon.toAscii().constData()))
mFlashSetting->setIcon(HbIcon(icon));
}
+
}
CX_DEBUG_EXIT_FUNCTION();
@@ -794,7 +822,7 @@
}
CX_DEBUG(("Images left %d", images));
- mImagesLeft->setPlainText(hbTrId("%L1").arg(images));
+ mImagesLeft->setPlainText(hbTrId("txt_cam_fullscreen_imagesleft").arg(images));
}
CX_DEBUG_EXIT_FUNCTION();
diff -r d9aefe59d544 -r 3075d9b614e6 camerauis/cameraxui/cxui/src/cxuistillprecaptureview2.cpp
--- a/camerauis/cameraxui/cxui/src/cxuistillprecaptureview2.cpp Fri Apr 16 14:51:30 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,87 +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
-#include
-#include
-#include
-
-#include "cxutils.h"
-#include "cxenamespace.h"
-#include "cxuienums.h"
-#include "cxuidocumentloader.h"
-#include "cxuistillprecaptureview.h"
-#include "cxuistillprecaptureview2.h"
-
-
-using namespace Cxe;
-using namespace CxUiLayout;
-
-
-CxuiStillPrecaptureView2::CxuiStillPrecaptureView2( QGraphicsItem *parent) :
- CxuiStillPrecaptureView(parent)
-{
- CX_DEBUG_IN_FUNCTION();
-}
-
-CxuiStillPrecaptureView2::~CxuiStillPrecaptureView2()
-{
- CX_DEBUG_IN_FUNCTION();
-}
-
-void CxuiStillPrecaptureView2::loadDefaultWidgets()
-{
- CX_DEBUG_ENTER_FUNCTION();
- CX_DEBUG_ASSERT(mDocumentLoader);
-
- // get pointer to the viewfinder
- QGraphicsWidget *widget = 0;
- widget = mDocumentLoader->findWidget(STILL_PRE_CAPTURE_VIEWFINDER);
- mViewfinder = qobject_cast(widget);
- CX_DEBUG_ASSERT(mViewfinder);
-
-
- widget = mDocumentLoader->findWidget(STILL_PRE_CAPTURE_ZOOM_SLIDER);
- mSlider = qobject_cast(widget);
- CX_DEBUG_ASSERT(mSlider);
- Q_ASSERT_X((mSlider != 0), "camerax ui", "invalid xml file");
-
- widget = mDocumentLoader->findWidget(STILL_PRE_CAPTURE_TOOLBAR);
- mToolBar = qobject_cast(widget);
- CX_DEBUG_ASSERT(mToolBar);
-
- QObject *object = 0;
- object = mDocumentLoader->findObject(STILL_PRE_CAPTURE_FLASH_ACTION);
- mFlashSetting = qobject_cast(object);
- CX_DEBUG_ASSERT(mFlashSetting);
-
- mWidgetsLoaded = true;
-
- hideControls();
-
- CX_DEBUG_EXIT_FUNCTION();
-}
-
-
-void CxuiStillPrecaptureView2::loadWidgets()
-{
- CX_DEBUG_ENTER_FUNCTION();
- CX_DEBUG_EXIT_FUNCTION();
-}
-
-
-// end of file
diff -r d9aefe59d544 -r 3075d9b614e6 camerauis/cameraxui/cxui/src/cxuivideoprecaptureview.cpp
--- a/camerauis/cameraxui/cxui/src/cxuivideoprecaptureview.cpp Fri Apr 16 14:51:30 2010 +0300
+++ b/camerauis/cameraxui/cxui/src/cxuivideoprecaptureview.cpp Thu May 13 21:30:19 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"
@@ -29,7 +29,6 @@
#include
#include
#include
-#include
#include
#include
@@ -42,6 +41,7 @@
#include "cxesettings.h"
#include "cxuienums.h"
#include "cxutils.h"
+#include "cxuizoomslider.h"
#include "cxuicapturekeyhandler.h"
#include "cxuidocumentloader.h"
#include "OstTraceDefinitions.h"
@@ -59,6 +59,7 @@
{
static const int CXUI_ELAPSED_TIME_TIMEOUT = 1000; // 1 second
static const int CXUI_RECORD_ANIMATION_DURATION = 3000; // milliseconds
+ static const int CXUI_PAUSE_TIMEOUT = 60*1000; // 60 seconds
//!@todo Localization?
static const char* VIDEO_TIME_FORMAT = "%02d:%02d";
@@ -77,7 +78,6 @@
mToolBarIdle(NULL),
mToolBarRec(NULL),
mToolBarPaused(NULL),
- mToggleLightAction(NULL),
mVideoScenePopup(NULL),
mVideoCaptureControl(NULL),
mMenu(NULL),
@@ -110,6 +110,12 @@
this, SLOT(handleSnapshot(CxeError::Id)));
connect(mVideoCaptureControl, SIGNAL(stateChanged(CxeVideoCaptureControl::State, CxeError::Id)),
this, SLOT(handleVideoStateChanged(CxeVideoCaptureControl::State,CxeError::Id)));
+ connect(mVideoCaptureControl, SIGNAL(remainingTimeChanged()),
+ this, SLOT(updateTimeLabels()));
+
+ mPauseTimer.setSingleShot(true);
+ connect(&mPauseTimer, SIGNAL(timeout()), this, SLOT(stop()));
+ mPauseTimer.setInterval(CXUI_PAUSE_TIMEOUT);
HbAction *quitAction = new HbAction(Hb::QuitNaviAction, this);
setNavigationAction(quitAction);
@@ -138,13 +144,11 @@
mQualityIcon = qobject_cast (widget);
CX_DEBUG_ASSERT(mQualityIcon);
- // Create background graphics for indicator containers
- HbWidget *indicatorContainer;
widget = mDocumentLoader->findWidget(VIDEO_PRE_CAPTURE_INDICATOR_CONTAINER_TOP);
- indicatorContainer = qobject_cast(widget);
- CX_DEBUG_ASSERT(indicatorContainer);
- createWidgetBackgroundGraphic(indicatorContainer, TRANSPARENT_BACKGROUND_GRAPHIC);
- indicatorContainer->show();
+ mIndicators = qobject_cast(widget);
+ CX_DEBUG_ASSERT(mIndicators);
+ // Create background graphics for indicator container
+ createWidgetBackgroundGraphic(mIndicators, TRANSPARENT_BACKGROUND_GRAPHIC);
CX_DEBUG_EXIT_FUNCTION();
}
@@ -177,7 +181,7 @@
Q_ASSERT_X(ok, "camerax ui", "error in xml file parsing");
// get needed pointers to some of the widgets
widget = mDocumentLoader->findWidget(VIDEO_PRE_CAPTURE_ZOOM_SLIDER);
- mSlider = qobject_cast (widget);
+ mSlider = qobject_cast (widget);
CX_DEBUG_ASSERT(mSlider);
//Let's add a plus and minus buttons to the slider
@@ -197,10 +201,6 @@
CX_DEBUG_ASSERT(mToolBarRec);
CX_DEBUG_ASSERT(mToolBarPaused);
- QObject* object = mDocumentLoader->findObject(VIDEO_PRE_CAPTURE_TOGGLE_LIGHT_ACTION);
- mToggleLightAction = qobject_cast(object);
- CX_DEBUG_ASSERT(mToggleLightAction);
-
hideControls();
if (CxuiServiceProvider::isCameraEmbedded()) {
@@ -227,21 +227,13 @@
if (!CxuiServiceProvider::instance()->allowCameraSwitching()) {
CX_DEBUG(("EMBEDDED: don't allow camera switching"));
- HbAction *goto_2nd_cam = qobject_cast (mDocumentLoader->findObject(VIDEO_PRE_CAPTURE_GOTO_2ND_CAMERA_ACTION));
- if (goto_2nd_cam) {
- CX_DEBUG(("EMBEDDED: setting camera switch to disabled"));
- goto_2nd_cam->setEnabled(false);
-
- }
}
}
- // Create background graphics for indicator containers
+ // Create background graphic for indicator container
HbWidget *indicatorContainer;
-
-
widget = mDocumentLoader->findWidget(VIDEO_PRE_CAPTURE_INDICATOR_CONTAINER_BOTTOM);
indicatorContainer = qobject_cast(widget);
CX_DEBUG_ASSERT(indicatorContainer);
@@ -263,12 +255,12 @@
// Initializing recording indicator animation
mRecordingAnimation = new QPropertyAnimation(mRecordingIcon, "opacity");
- mRecordingAnimation->setStartValue(0.0);
+ mRecordingAnimation->setStartValue(0.2);
mRecordingAnimation->setKeyValueAt(0.5, 1.0);
- mRecordingAnimation->setEndValue(0.0);
+ mRecordingAnimation->setEndValue(0.2);
mRecordingAnimation->setDuration(CXUI_RECORD_ANIMATION_DURATION);
mRecordingAnimation->setLoopCount(-1);
- mRecordingAnimation->setEasingCurve(QEasingCurve::InCubic);
+ mRecordingAnimation->setEasingCurve(QEasingCurve::OutInQuad);
// Initialize the video time counters.
updateTimeLabels();
@@ -313,10 +305,16 @@
{
CX_DEBUG_ENTER_FUNCTION();
- mMenu = takeMenu();
- hideControls();
- mVideoCaptureControl->record();
- //mRecordingAnimation->start();
+ int time(0);
+ mVideoCaptureControl->remainingTime(time);
+
+ if (time) {
+ mMenu = takeMenu();
+ mVideoCaptureControl->record();
+ } else {
+ launchDiskFullNotification();
+ }
+
CX_DEBUG_EXIT_FUNCTION();
}
@@ -326,16 +324,9 @@
CxeVideoCaptureControl::State state = mVideoCaptureControl->state();
if (state == CxeVideoCaptureControl::Recording) {
- if (mRecordingAnimation && mRecordingIcon) {
- mVideoCaptureControl->pause();
- mRecordingAnimation->stop();
- }
-
- // force update of toolbar
- showToolbar();
+ mVideoCaptureControl->pause();
} else if (state == CxeVideoCaptureControl::Paused) {
mVideoCaptureControl->record();
- //mRecordingAnimation->start();
}
CX_DEBUG_EXIT_FUNCTION();
@@ -413,10 +404,10 @@
{
CX_DEBUG_ENTER_FUNCTION();
- HbFeedbackPlayer* feedback = HbFeedbackPlayer::instance();
- if (feedback) {
- feedback->settings().disableFeedback();
- }
+ HbFeedbackSettings settings;
+ settings.disableFeedback();
+
+
CX_DEBUG_EXIT_FUNCTION();
}
@@ -424,10 +415,9 @@
{
CX_DEBUG_ENTER_FUNCTION();
- HbFeedbackPlayer* feedback = HbFeedbackPlayer::instance();
- if (feedback) {
- feedback->settings().disableFeedback();
- }
+ HbFeedbackSettings settings;
+ settings.enableFeedback();
+
CX_DEBUG_EXIT_FUNCTION();
}
@@ -463,31 +453,15 @@
CxeVideoCaptureControl::State state = mVideoCaptureControl->state();
switch (state) {
case CxeVideoCaptureControl::Ready:
- // Update remaining time label
getRemainingTime();
- setVideoTime(mRemainingTimeText, mTimeRemaining);
- // Update elapsed time label
// Not recording => elapsed time is zero
mTimeElapsed = 0;
- setVideoTime(mElapsedTimeText, mTimeElapsed);
-
- // Adjust labels' visibility
- mRemainingTimeText->show();
- mElapsedTimeText->show();
break;
case CxeVideoCaptureControl::Recording:
case CxeVideoCaptureControl::Paused:
- // Update remaining time label
getRemainingTime();
- setVideoTime(mRemainingTimeText, mTimeRemaining);
- // Update elapsed time label
getElapsedTime();
- setVideoTime(mElapsedTimeText, mTimeElapsed);
-
- // Adjust labels' visibility
- mRemainingTimeText->show();
- mElapsedTimeText->show();
break;
case CxeVideoCaptureControl::Idle:
@@ -495,23 +469,35 @@
case CxeVideoCaptureControl::Preparing:
default:
// Minimize processing during initialization phase.
- // Calculating remaining time involves checking disk space,
+ // Calculating remaining time involves checking disk space, avoiding that.
// which
mTimeRemaining = 0;
- setVideoTime(mRemainingTimeText, mTimeRemaining);
mTimeElapsed = 0;
- setVideoTime(mElapsedTimeText, mTimeElapsed);
-
- // Adjust labels' visibility
- mRemainingTimeText->hide();
- mElapsedTimeText->hide();
break;
}
+ setVideoTime(mRemainingTimeText, mTimeRemaining);
+ setVideoTime(mElapsedTimeText, mTimeElapsed);
+
CX_DEBUG_EXIT_FUNCTION();
}
/*!
+ Overridded version of hideControls() that doesn't hide the controls when video recording
+ is paused.
+ */
+void CxuiVideoPrecaptureView::hideControls()
+{
+ if (mVideoCaptureControl && mVideoCaptureControl->state() == CxeVideoCaptureControl::Paused) {
+ // never hide controls in paused state
+ return;
+ }
+
+ CxuiPrecaptureView::hideControls();
+
+}
+
+/*!
* 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.
@@ -559,6 +545,10 @@
}
}
+/*!
+* Slot to handle video capture control state change.
+* Update visible items and stop / start timers.
+*/
void CxuiVideoPrecaptureView::handleVideoStateChanged(CxeVideoCaptureControl::State newState,
CxeError::Id error)
{
@@ -567,31 +557,51 @@
updateTimeLabels();
+ mPauseTimer.stop();
+
switch (newState) {
case CxeVideoCaptureControl::Ready:
- setRecordingItemsVisibility(false);
+ if (mDocumentLoader){
+ mDocumentLoader->load(VIDEO_1ST_XML, VIDEO_PRE_CAPTURE_IDLE);
+ }
if (mCapturePending) {
mCapturePending = false;
record();
}
break;
case CxeVideoCaptureControl::Recording:
- setRecordingItemsVisibility(true);
+ hideControls();
+ if (mDocumentLoader){
+ mDocumentLoader->load(VIDEO_1ST_XML, VIDEO_PRE_CAPTURE_RECORDING);
+ }
mElapsedTimer.start(CXUI_ELAPSED_TIME_TIMEOUT);
disableFeedback();
+ if (mRecordingAnimation && mRecordingIcon) {
+ mRecordingAnimation->start();
+ }
break;
case CxeVideoCaptureControl::Paused:
mElapsedTimer.stop();
- if (mRecordingIcon) {
- mRecordingIcon->hide();
+
+ if (mDocumentLoader){
+ mDocumentLoader->load(VIDEO_1ST_XML, VIDEO_PRE_CAPTURE_PAUSED);
}
- if (mElapsedTimeText) {
- mElapsedTimeText->show();
+
+ if (mRecordingAnimation && mRecordingIcon) {
+ mRecordingAnimation->stop();
}
+ showControls();
enableFeedback();
+ mPauseTimer.start();
break;
case CxeVideoCaptureControl::Stopping:
- setRecordingItemsVisibility(false);
+ if (mDocumentLoader){
+ mDocumentLoader->load(VIDEO_1ST_XML, VIDEO_PRE_CAPTURE_PAUSED);
+ }
+
+ if (mRecordingAnimation && mRecordingIcon) {
+ mRecordingAnimation->stop();
+ }
enableFeedback();
if (isPostcaptureOn()) {
@@ -644,10 +654,10 @@
switch (state) {
case CxeVideoCaptureControl::Ready:
- case CxeVideoCaptureControl::Paused:
record();
break;
case CxeVideoCaptureControl::Recording:
+ case CxeVideoCaptureControl::Paused:
stop();
break;
case CxeVideoCaptureControl::Idle:
@@ -685,7 +695,8 @@
CX_DEBUG_ENTER_FUNCTION();
CxeVideoCaptureControl::State state = mVideoCaptureControl->state();
- if (state == CxeVideoCaptureControl::Recording){
+ if (state == CxeVideoCaptureControl::Recording ||
+ state == CxeVideoCaptureControl::Paused) {
// Disable going to post-capture when video capture control goes to stopping state.
disconnect(mVideoCaptureControl, SIGNAL(stateChanged(CxeVideoCaptureControl::State, CxeError::Id)),
this, SLOT(handleVideoStateChanged(CxeVideoCaptureControl::State,CxeError::Id)));
@@ -701,14 +712,8 @@
void CxuiVideoPrecaptureView::handleFocusLost()
{
CX_DEBUG_IN_FUNCTION();
-
- CxeVideoCaptureControl::State state = mVideoCaptureControl->state();
- if (state == CxeVideoCaptureControl::Recording){
- stop(); // delete recording icon
- } else {
- releaseCamera();
- }
-
+ // Release camera. Stopping possibly ongoing recording is handled by engine.
+ releaseCamera();
}
void CxuiVideoPrecaptureView::handleBatteryEmpty()
@@ -726,31 +731,8 @@
void CxuiVideoPrecaptureView::launchVideoScenePopup()
{
CX_DEBUG_ENTER_FUNCTION();
-
- if (mVideoScenePopup) {
- CX_DEBUG(("mVideoScenePopup already exists, showing..."));
- mVideoScenePopup->show();
- } else {
- CX_DEBUG(("Loading popup DocML"));
- CxuiDocumentLoader* documentLoader = new CxuiDocumentLoader(mEngine);
- bool ok = false;
-
- // Use document loader to create popup
- documentLoader->load(SCENEMODE_VIDEO_SETTING_XML, &ok);
-
- CX_DEBUG(("load ok=%d", ok));
-
- mVideoScenePopup = qobject_cast(documentLoader->findWidget("video_scenemode_popup"));
- CX_DEBUG_ASSERT(mVideoScenePopup);
- mVideoScenePopup->setTimeout(HbDialog::NoTimeout);
- mVideoScenePopup->setBackgroundFaded(false);
-
- delete documentLoader;
- documentLoader = NULL;
- }
-
- connect(mKeyHandler, SIGNAL(autofocusKeyPressed()), mVideoScenePopup, SLOT(close()));
-
+ hideControls();
+ emit showScenesView();
CX_DEBUG_EXIT_FUNCTION();
}
@@ -811,6 +793,29 @@
}
}
+/*!
+ * Overridden eventFilter() to restart the pause timer.
+ */
+bool CxuiVideoPrecaptureView::eventFilter(QObject *object, QEvent *event)
+{
+
+ if (mVideoCaptureControl && mVideoCaptureControl->state() == CxeVideoCaptureControl::Paused) {
+ // restart the timer if the screen is touched and we are in paused state
+ switch (event->type())
+ {
+ case QEvent::GraphicsSceneMouseRelease:
+ mPauseTimer.start();
+ break;
+ case QEvent::GraphicsSceneMousePress:
+ mPauseTimer.stop();
+ break;
+ default:
+ break;
+ }
+ }
+ return CxuiPrecaptureView::eventFilter(object, event);
+}
+
//end of file
diff -r d9aefe59d544 -r 3075d9b614e6 camerauis/cameraxui/cxui/src/cxuivideoprecaptureview2.cpp
--- a/camerauis/cameraxui/cxui/src/cxuivideoprecaptureview2.cpp Fri Apr 16 14:51:30 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,91 +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
-#include
-#include
-#include
-#include
-
-#include "cxutils.h"
-#include "cxenamespace.h"
-#include "cxuienums.h"
-#include "cxuidocumentloader.h"
-#include "cxuivideoprecaptureview.h"
-#include "cxuivideoprecaptureview2.h"
-
-
-using namespace Cxe;
-using namespace CxUiLayout;
-
-
-CxuiVideoPrecaptureView2::CxuiVideoPrecaptureView2( QGraphicsItem *parent) :
- CxuiVideoPrecaptureView(parent)
-{
- CX_DEBUG_IN_FUNCTION();
-}
-
-CxuiVideoPrecaptureView2::~CxuiVideoPrecaptureView2()
-{
- CX_DEBUG_IN_FUNCTION();
-}
-
-void CxuiVideoPrecaptureView2::loadDefaultWidgets()
-{
- CX_DEBUG_ENTER_FUNCTION();
- CX_DEBUG_ASSERT(mDocumentLoader);
-
- // Get pointers to ui components from the layout data
- QGraphicsWidget *widget = NULL;
- widget = mDocumentLoader->findWidget(VIDEO_PRE_CAPTURE_VIEWFINDER);
- mViewfinder = qobject_cast (widget);
- CX_DEBUG_ASSERT(mViewfinder);
-
- widget = mDocumentLoader->findWidget(VIDEO_PRE_CAPTURE_ELAPSED_TIME_LABEL);
- mElapsedTimeText = qobject_cast (widget);
- CX_DEBUG_ASSERT(mElapsedTimeText);
-
- widget = mDocumentLoader->findWidget(VIDEO_PRE_CAPTURE_RECORDING_ICON);
- mRecordingIcon = qobject_cast (widget);
- CX_DEBUG_ASSERT(mRecordingIcon);
-
- // get needed pointers to some of the widgets
- widget = mDocumentLoader->findWidget(VIDEO_PRE_CAPTURE_ZOOM_SLIDER);
- mSlider = qobject_cast (widget);
- CX_DEBUG_ASSERT(mSlider);
-
- widget = mDocumentLoader->findWidget(VIDEO_PRE_CAPTURE_TOOLBAR);
- mToolBar = qobject_cast (widget);
- CX_DEBUG_ASSERT(mToolBar);
-
- mWidgetsLoaded = true;
-
- hideControls();
-
- CX_DEBUG_EXIT_FUNCTION();
-}
-
-
-void CxuiVideoPrecaptureView2::loadWidgets()
-{
- CX_DEBUG_ENTER_FUNCTION();
- // All loaded in loadDefaultWidgets()
- CX_DEBUG_EXIT_FUNCTION();
-}
-
-
-// end of file
diff -r d9aefe59d544 -r 3075d9b614e6 camerauis/cameraxui/cxui/src/cxuiviewmanager.cpp
--- a/camerauis/cameraxui/cxui/src/cxuiviewmanager.cpp Fri Apr 16 14:51:30 2010 +0300
+++ b/camerauis/cameraxui/cxui/src/cxuiviewmanager.cpp Thu May 13 21:30:19 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,16 +18,14 @@
#include
#include
#include
-#include // keyguard
-#include // battery
#include
+#include "cxuiapplication.h"
+#include "cxuiapplicationframeworkmonitor.h"
#include "cxuiviewmanager.h"
#include "cxuivideoprecaptureview.h"
-#include "cxuivideoprecaptureview2.h"
#include "cxuistillprecaptureview.h"
-#include "cxuistillprecaptureview2.h"
#include "cxuipostcaptureview.h"
#include "cxuicapturekeyhandler.h"
#include "cxeengine.h"
@@ -37,16 +35,18 @@
#include "cxenamespace.h"
#include "cxuienums.h"
#include "cxutils.h"
-#include "xqsettingsmanager.h" // Settings Manager API
#include "cxuidocumentloader.h"
#include "cxuistandby.h"
#include "cxuierrormanager.h"
+#include "cxesettings.h"
+#include "cxememorymonitor.h"
+#include "cxuiserviceprovider.h"
+#include "cxuiscenemodeview.h"
+
#include "OstTraceDefinitions.h"
#ifdef OST_TRACE_COMPILER_IN_USE
#include "cxuiviewmanagerTraces.h"
#endif
-#include "cxuiserviceprovider.h"
-
using namespace Cxe;
@@ -58,97 +58,81 @@
//
// ---------------------------------------------------------------------------
//
-CxuiViewManager::CxuiViewManager(HbMainWindow &mainWindow, CxeEngine &engine, CxuiCaptureKeyHandler &keyHandler) :
+CxuiViewManager::CxuiViewManager(CxuiApplication &application, HbMainWindow &mainWindow, CxeEngine &engine) :
+ mApplication(application),
mMainWindow(mainWindow),
mStillPrecaptureView(NULL),
mVideoPrecaptureView(NULL),
mPostcaptureView(NULL),
- mStillPrecaptureView2(NULL),
- mVideoPrecaptureView2(NULL),
mEngine(engine),
- mKeyHandler(keyHandler),
- mSettingsManager(NULL),
- mFocused(true),
- mCameraDocumentLoader(NULL)
+ mKeyHandler(NULL),
+ mApplicationMonitor(NULL),
+ mCameraDocumentLoader(NULL),
+ mSceneModeView(NULL)
{
CX_DEBUG_ENTER_FUNCTION();
+ // Application monitor
+ mApplicationMonitor = new CxuiApplicationFrameworkMonitor(mApplication, mEngine.settings());
+ connect(mApplicationMonitor, SIGNAL(foregroundStateChanged(CxuiApplicationFrameworkMonitor::ForegroundState)),
+ this, SLOT(handleForegroundStateChanged(CxuiApplicationFrameworkMonitor::ForegroundState)));
+ connect(mApplicationMonitor, SIGNAL(batteryEmpty()),
+ this, SLOT(handleBatteryEmpty()));
+
+ // Connect memory monitor start / stop to focused status
+ connect(this, SIGNAL(focusGained()), &mEngine.memoryMonitor(), SLOT(startMonitoring()));
+ connect(this, SIGNAL(focusLost()), &mEngine.memoryMonitor(), SLOT(stopMonitoring()));
+
+ // Key handler
+ mKeyHandler = new CxuiCaptureKeyHandler(mEngine);
+
mMainWindow.installEventFilter(this); // in order to filter capture and AF keys
OstTrace0( camerax_performance, CXUIVIEWMANAGER_CXUIVIEWMANAGER, "msg: e_CX_VIEWMANAGER_CREATE_DOCLOADER 1" );
- mCameraDocumentLoader = new CxuiDocumentLoader;
+ mCameraDocumentLoader = new CxuiDocumentLoader(&engine);
OstTrace0( camerax_performance, DUP1_CXUIVIEWMANAGER_CXUIVIEWMANAGER, "msg: e_CX_VIEWMANAGER_CREATE_DOCLOADER 0" );
// standby functionality and necessary signal connections
- mStandbyHandler = new CxuiStandby(keyHandler, mCameraDocumentLoader, &engine);
+ mStandbyHandler = new CxuiStandby(*mKeyHandler, mCameraDocumentLoader, &mEngine);
connect(mStandbyHandler, SIGNAL(aboutToEnterStandby()),this, SLOT(aboutToLooseFocus()));
connect(mStandbyHandler, SIGNAL(aboutToExitStandby()),this, SLOT(aboutToGainFocus()));
// error manager, handling errors and notifying users based on their severity
- mErrorManager = new CxuiErrorManager(keyHandler, mCameraDocumentLoader);
+ mErrorManager = new CxuiErrorManager(*mKeyHandler, mCameraDocumentLoader);
// connecting necessary signals from error manager to release and init camera.
connect(mErrorManager, SIGNAL(aboutToRecoverError()), this, SLOT(aboutToLooseFocus()));
connect(mErrorManager, SIGNAL(errorRecovered()), this, SLOT(aboutToGainFocus()));
- if (!CxuiServiceProvider::isCameraEmbedded()) {
- // for embedded mode: don't create view yet, create
- // when engine inits to correct mode
-#ifdef FORCE_SECONDARY_CAMERA
- // 2nd camera hack: always use 1st camera view
- if (mEngine.mode() == Cxe::VideoMode) {
- createVideoPrecaptureView();
-
- mMainWindow.blockSignals(true);
- mMainWindow.setCurrentView(mVideoPrecaptureView, false);
- mMainWindow.blockSignals(false);
- } else {
- createStillPrecaptureView();
-
- mMainWindow.blockSignals(true);
- mMainWindow.setCurrentView(mStillPrecaptureView, false);
- mMainWindow.blockSignals(false);
- }
-
-#else
- if (mEngine.cameraDeviceControl().cameraIndex() == Cxe::PrimaryCameraIndex) {
- if (mEngine.mode() == Cxe::VideoMode) {
- createVideoPrecaptureView();
- mMainWindow.blockSignals(true);
- mMainWindow.setCurrentView(mVideoPrecaptureView, false);
- mMainWindow.blockSignals(false);
- } else {
- createStillPrecaptureView();
- mMainWindow.blockSignals(true);
- mMainWindow.setCurrentView(mStillPrecaptureView, false);
- mMainWindow.blockSignals(false);
- }
- } else {
- if (mEngine.mode() == Cxe::VideoMode) {
- createVideoPrecaptureView2();
- mMainWindow.blockSignals(true);
- mMainWindow.setCurrentView(mVideoPrecaptureView2, false);
- mMainWindow.blockSignals(false);
- } else {
- createStillPrecaptureView2();
- mMainWindow.blockSignals(true);
- mMainWindow.setCurrentView(mStillPrecaptureView2, false);
- mMainWindow.blockSignals(false);
- }
- }
-#endif
- connectPreCaptureSignals();
- }
-
- startEventMonitors();
+ if (!CxuiServiceProvider::isCameraEmbedded()) {
+ // For embedded mode: don't create view yet, create
+ // when engine inits to correct mode
+ CX_DEBUG_ASSERT(mEngine.cameraDeviceControl().cameraIndex() == Cxe::PrimaryCameraIndex);
+ if (mEngine.mode() == Cxe::VideoMode) {
+ createVideoPrecaptureView();
+ mMainWindow.blockSignals(true);
+ mMainWindow.setCurrentView(mVideoPrecaptureView, false);
+ mMainWindow.blockSignals(false);
+ } else {
+ createStillPrecaptureView();
+ mMainWindow.blockSignals(true);
+ mMainWindow.setCurrentView(mStillPrecaptureView, false);
+ mMainWindow.blockSignals(false);
+ }
+ connectPreCaptureSignals();
+ }
//connecting initmode signals
connect(&mEngine.cameraDeviceControl(), SIGNAL(initModeComplete(CxeError::Id)),
this, SLOT(createPostcaptureView()));
+
connect(&mEngine.cameraDeviceControl(), SIGNAL(initModeComplete(CxeError::Id)),
mErrorManager, SLOT(analyze(CxeError::Id)));
+ connect(&mEngine.stillCaptureControl(), SIGNAL(imageCaptured(CxeError::Id, int)),
+ mErrorManager, SLOT(analyze(CxeError::Id)));
+
if (CxuiServiceProvider::isCameraEmbedded()) {
// connect signals to set up the view after image/video prepare
connect(&mEngine.stillCaptureControl(), SIGNAL(imagePrepareComplete(CxeError::Id)),
@@ -159,7 +143,7 @@
// start standby timer now because view will not be ready when viewfinder is started
mStandbyHandler->startTimer();
}
-
+
CX_DEBUG_EXIT_FUNCTION();
}
@@ -173,7 +157,8 @@
CX_DEBUG_ENTER_FUNCTION();
delete mCameraDocumentLoader;
- delete mSettingsManager;
+ delete mKeyHandler;
+ delete mApplicationMonitor;
CX_DEBUG_EXIT_FUNCTION();
}
@@ -199,22 +184,20 @@
{
CX_DEBUG_ENTER_FUNCTION();
OstTrace0( camerax_performance, CXUIVIEWMANAGER_CREATESTILLPRECAPTUREVIEW, "msg: e_CX_CREATE_STILLPRECAPTUREVIEW 1" );
- bool ok = false;
- CX_DEBUG_ASSERT(mCameraDocumentLoader);
-
- OstTrace0( camerax_performance, DUP2_CXUIVIEWMANAGER_ADDPRECAPTUREVIEWS, "msg: e_CX_DOCLOADER_LOAD 1" );
// Use document loader to create widgets and layouts
// (non-sectioned parts are parsed and loaded)
+ OstTrace0( camerax_performance, DUP2_CXUIVIEWMANAGER_ADDPRECAPTUREVIEWS, "msg: e_CX_DOCLOADER_LOAD 1" );
+
+ bool ok = false;
+ CX_DEBUG_ASSERT(mCameraDocumentLoader);
mCameraDocumentLoader->load(STILL_1ST_XML, &ok);
Q_ASSERT_X(ok, "createStillPrecaptureView", "error in xml file parsing");
- QGraphicsWidget *widget = NULL;
-
OstTrace0( camerax_performance, DUP2_CXUIVIEWMANAGER_CREATESTILLPRECAPTUREVIEW, "msg: e_CX_DOCLOADER_LOAD 0" );
-
OstTrace0( camerax_performance, DUP4_CXUIVIEWMANAGER_ADDPRECAPTUREVIEWS, "msg: e_CX_DOCLOADER_FINDWIDGET 1" );
+ QGraphicsWidget *widget = NULL;
// ask for the still precapture view widget pointer
widget = mCameraDocumentLoader->findWidget(STILL_PRE_CAPTURE_VIEW);
mStillPrecaptureView = qobject_cast (widget);
@@ -222,9 +205,11 @@
OstTrace0( camerax_performance, DUP5_CXUIVIEWMANAGER_ADDPRECAPTUREVIEWS, "msg: e_CX_DOCLOADER_FINDWIDGET 0" );
// call for needed consturction methods
- mStillPrecaptureView->construct(&mMainWindow, &mEngine, mCameraDocumentLoader, &mKeyHandler);
+ mStillPrecaptureView->construct(&mMainWindow, &mEngine, mCameraDocumentLoader, mKeyHandler);
// .. and add to main window (which also takes ownership)
+ OstTrace0( camerax_performance, DUP1_CXUIVIEWMANAGER_MAINWINDOW_ADDVIEW, "msg: e_CX_MAINWINDOW_ADDVIEW 1" );
mMainWindow.addView(widget);
+ OstTrace0( camerax_performance, DUP2_CXUIVIEWMANAGER_MAINWINDOW_ADDVIEW, "msg: e_CX_MAINWINDOW_ADDVIEW 0" );
OstTrace0( camerax_performance, DUP1_CXUIVIEWMANAGER_CREATESTILLPRECAPTUREVIEW, "msg: e_CX_CREATE_STILLPRECAPTUREVIEW 0" );
@@ -232,11 +217,11 @@
}
// ---------------------------------------------------------------------------
-// CxuiViewManager::createStillPrecaptureView2
+// CxuiViewManager::createStillScenesView
//
// ---------------------------------------------------------------------------
//
-void CxuiViewManager::createStillPrecaptureView2()
+void CxuiViewManager::createSceneModesView()
{
CX_DEBUG_ENTER_FUNCTION();
@@ -245,24 +230,48 @@
// Use document loader to create widgets and layouts
// (non-sectioned parts are parsed and loaded)
- mCameraDocumentLoader->load(STILL_2ND_XML, &ok);
- Q_ASSERT_X(ok, "createStillPrecaptureView2", "error in xml file parsing");
+ mCameraDocumentLoader->load(SCENEMODE_SETTING_XML, &ok);
QGraphicsWidget *widget = NULL;
- // ask for the still precapture view widget pointer
- widget = mCameraDocumentLoader->findWidget(STILL_PRE_CAPTURE_VIEW2);
- mStillPrecaptureView2 = qobject_cast (widget);
- CX_DEBUG_ASSERT(mStillPrecaptureView2);
+ // ask for the scenes mode view widget pointer
+ widget = mCameraDocumentLoader->findWidget(STILL_SCENES_VIEW);
+ Q_ASSERT_X(ok && (widget != 0), "camerax ui", "invalid xml file");
+ mSceneModeView = qobject_cast (widget);
- // call for needed consturction methods
- mStillPrecaptureView2->construct(&mMainWindow, &mEngine, mCameraDocumentLoader, &mKeyHandler);
+ // call for needed construction methods
+ mSceneModeView->construct(&mMainWindow, &mEngine, mCameraDocumentLoader, mKeyHandler);
// .. and add to main window (which also takes ownership)
mMainWindow.addView(widget);
+ mSceneModeView->loadBackgroundImages();
+ connect(mSceneModeView, SIGNAL(viewCloseEvent()), this, SLOT(changeToPrecaptureView()));
CX_DEBUG_EXIT_FUNCTION();
}
+/*!
+* CxuiViewManager::showScenesView
+* A private method for displaying Scene Modes selection view
+*/
+void CxuiViewManager::showScenesView()
+{
+ CX_DEBUG_ENTER_FUNCTION();
+ if (!mSceneModeView) {
+ createSceneModesView();
+ }
+ else {
+ mSceneModeView->loadBackgroundImages();
+ }
+ CX_DEBUG_ASSERT(mSceneModeView);
+ mMainWindow.blockSignals(true);
+ mMainWindow.setCurrentView(mSceneModeView, false);
+ emit disableStandbyTimer();
+ connectCaptureKeySignals();
+ mMainWindow.blockSignals(false);
+ CX_DEBUG_EXIT_FUNCTION();
+}
+
+
// ---------------------------------------------------------------------------
// CxuiViewManager::createVideoPrecaptureView
//
@@ -285,44 +294,18 @@
widget = mCameraDocumentLoader->findWidget(VIDEO_PRE_CAPTURE_VIEW);
mVideoPrecaptureView = qobject_cast (widget);
CX_DEBUG_ASSERT(mVideoPrecaptureView);
- mVideoPrecaptureView->construct(&mMainWindow, &mEngine, mCameraDocumentLoader, &mKeyHandler);
+ mVideoPrecaptureView->construct(&mMainWindow, &mEngine, mCameraDocumentLoader, mKeyHandler);
// add view to main window
+ OstTrace0( camerax_performance, DUP3_CXUIVIEWMANAGER_MAINWINDOW_ADDVIEW, "msg: e_CX_MAINWINDOW_ADDVIEW 1" );
mMainWindow.addView(mVideoPrecaptureView);
+ OstTrace0( camerax_performance, DUP4_CXUIVIEWMANAGER_MAINWINDOW_ADDVIEW, "msg: e_CX_MAINWINDOW_ADDVIEW 0" );
OstTrace0( camerax_performance, DUP1_CXUIVIEWMANAGER_CREATEVIDEOPRECAPTUREVIEW, "msg: e_CX_CREATE_VIDEOPRECAPTUREVIEW 0" );
CX_DEBUG_EXIT_FUNCTION();
}
// ---------------------------------------------------------------------------
-// CxuiViewManager::createVideoPrecaptureView2
-//
-// ---------------------------------------------------------------------------
-//
-void CxuiViewManager::createVideoPrecaptureView2()
-{
- CX_DEBUG_ENTER_FUNCTION();
- CX_DEBUG_ASSERT(mCameraDocumentLoader);
-
- bool ok = false;
- // load and create the default widgets in video xml
- mCameraDocumentLoader->load(VIDEO_2ND_XML, &ok);
- CX_DEBUG_ASSERT(ok);
-
- // get pointer to videoprecaptureview and do some initialisation
- QGraphicsWidget *widget = NULL;
- widget = mCameraDocumentLoader->findWidget(VIDEO_PRE_CAPTURE_VIEW2);
- mVideoPrecaptureView2 = qobject_cast (widget);
- CX_DEBUG_ASSERT(mVideoPrecaptureView2);
- mVideoPrecaptureView2->construct(&mMainWindow, &mEngine, mCameraDocumentLoader);
-
- // add view to main window
- mMainWindow.addView(mVideoPrecaptureView2);
-
- CX_DEBUG_EXIT_FUNCTION();
-}
-
-// ---------------------------------------------------------------------------
// CxuiViewManager::createStillPostcaptureView
//
// ---------------------------------------------------------------------------
@@ -365,44 +348,20 @@
CX_DEBUG_ENTER_FUNCTION();
CX_DEBUG(("CxuiViewManager::getPrecaptureView() mode=%d, camera index=%d", mode, camera));
-#ifdef FORCE_SECONDARY_CAMERA
- // 2nd camera forced: always use 1st camera view
- CX_DEBUG(("CxuiViewManager::getPrecaptureView() forcing primary camera view"));
- camera = Cxe::PrimaryCameraIndex;
-#endif // FORCE_SECONDARY_CAMERA
+ CX_DEBUG_ASSERT(camera == Cxe::PrimaryCameraIndex);
if (mode == ImageMode) {
-
CX_DEBUG(("CxuiViewManager::getPrecaptureView() image mode"));
- if (camera == Cxe::PrimaryCameraIndex) {
- CX_DEBUG(("CxuiViewManager::getPrecaptureView() primary camera"));
- if(!mStillPrecaptureView) {
- createStillPrecaptureView();
- }
- return mStillPrecaptureView;
- } else {
- CX_DEBUG(("CxuiViewManager::getPrecaptureView() secondary camera"));
- if(!mStillPrecaptureView2) {
- createStillPrecaptureView2();
- }
- return mStillPrecaptureView2;
+ if(!mStillPrecaptureView) {
+ createStillPrecaptureView();
}
+ return mStillPrecaptureView;
} else {
-
CX_DEBUG(("CxuiViewManager::getPrecaptureView() video mode"));
- if (camera == Cxe::PrimaryCameraIndex) {
- CX_DEBUG(("CxuiViewManager::getPrecaptureView() primary camera"));
- if(!mVideoPrecaptureView) {
- createVideoPrecaptureView();
- }
- return mVideoPrecaptureView;
- } else {
- CX_DEBUG(("CxuiViewManager::getPrecaptureView() secondary camera"));
- if(!mVideoPrecaptureView2) {
- createVideoPrecaptureView2();
- }
- return mVideoPrecaptureView2;
+ if(!mVideoPrecaptureView) {
+ createVideoPrecaptureView();
}
+ return mVideoPrecaptureView;
}
}
@@ -431,9 +390,6 @@
// connecting all necessary signals for postcapture view
connectPostCaptureSignals();
- //@todo: refactor postcapture view to new focus and state handling as agreed with package owner
- connect(this, SIGNAL(focusGained()), mPostcaptureView, SLOT(startTimers()), Qt::UniqueConnection);
-
CX_DEBUG_EXIT_FUNCTION();
}
@@ -463,6 +419,7 @@
// connecting necessary pre-capture view signals
connectPreCaptureSignals();
+ emit startStandbyTimer();
CX_DEBUG_EXIT_FUNCTION();
}
@@ -509,87 +466,23 @@
//
bool CxuiViewManager::eventFilter(QObject *object, QEvent *event)
{
+ Q_UNUSED(object)
+
bool eventWasConsumed = false;
switch (event->type())
{
case QEvent::KeyPress:
case QEvent::KeyRelease:
- eventWasConsumed = mKeyHandler.handleKeyEvent(event);
- break;
- case QEvent::WindowActivate:
- if (object == &mMainWindow) {
- CX_DEBUG(("CxuiViewManager - window activated"));
- // If we gained focus and keyguard is off.
- if (!mFocused) {
- mFocused = true;
- if (mKeyLockState == EKeyguardNotActive) {
- aboutToGainFocus();
- }
- }
- }
- break;
- case QEvent::WindowDeactivate:
- if (object == &mMainWindow)
- {
- CX_DEBUG(("CxuiViewManager - window de-activated"));
- if (mFocused) {
- mFocused = false;
- aboutToLooseFocus();
- }
- }
+ eventWasConsumed = mKeyHandler->handleKeyEvent(event);
break;
}
-
// No need to call base class implementation, because we derive from QObject directly.
// QObject::eventFilter() implementation always returns false.
return eventWasConsumed;
}
// ---------------------------------------------------------------------------
-// CxuiViewManager::startEventMonitors
-//
-// ---------------------------------------------------------------------------
-//
-void CxuiViewManager::startEventMonitors()
-{
- CX_DEBUG_ENTER_FUNCTION();
- bool ok = false;
-
- mSettingsManager = new XQSettingsManager(this);
- ok = connect(mSettingsManager, SIGNAL(valueChanged(XQSettingsKey, QVariant)),
- this, SLOT(eventMonitor(XQSettingsKey, QVariant)));
- CX_DEBUG_ASSERT(ok);
-
- // Keyguard status (locked / unlocked)
- XQSettingsKey keyguard(XQSettingsKey::TargetPublishAndSubscribe,
- KPSUidAvkonDomain.iUid,
- KAknKeyguardStatus);
-
- QVariant value = mSettingsManager->readItemValue(keyguard);
- if (value == QVariant::Int) {
- mKeyLockState = value.toInt();
- }
- ok = mSettingsManager->startMonitoring(keyguard);
- CX_DEBUG_ASSERT(ok);
-
- // Battery status (ok / low / empty)
- XQSettingsKey battery(XQSettingsKey::TargetPublishAndSubscribe,
- KPSUidHWRMPowerState.iUid,
- KHWRMBatteryStatus);
- value = mSettingsManager->readItemValue(battery);
- if (value == QVariant::Int) {
- mBatteryStatus = value.toInt();
- }
- ok = mSettingsManager->startMonitoring(battery);
- CX_DEBUG_ASSERT(ok);
-
- CX_DEBUG_EXIT_FUNCTION();
-}
-
-
-
-// ---------------------------------------------------------------------------
// CxuiViewManager::connectCaptureKeySignals
//
// ---------------------------------------------------------------------------
@@ -599,17 +492,17 @@
CX_DEBUG_ENTER_FUNCTION();
// Disconnect all existing capture key signals
- mKeyHandler.disconnect();
+ mKeyHandler->disconnect();
QObject *currentView = mMainWindow.currentView();
if (currentView) {
// 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()), currentView, SLOT(handleAutofocusKeyPressed()));
+ connect(mKeyHandler, SIGNAL(autofocusKeyReleased()), currentView, SLOT(handleAutofocusKeyReleased()));
+ connect(mKeyHandler, SIGNAL(captureKeyPressed()), currentView, SLOT(handleCaptureKeyPressed()));
+ connect(mKeyHandler, SIGNAL(captureKeyReleased()), currentView, SLOT(handleCaptureKeyReleased()));
}
CX_DEBUG_EXIT_FUNCTION();
@@ -642,10 +535,12 @@
connect(this, SIGNAL(focusGained()), mStandbyHandler, SLOT(handleMouseEvent()), Qt::UniqueConnection);
// connecting key events to standby.
- connect(&mKeyHandler, SIGNAL(autofocusKeyPressed()), mStandbyHandler, SLOT(stopTimer()), Qt::UniqueConnection);
- connect(&mKeyHandler, SIGNAL(autofocusKeyReleased()), mStandbyHandler, SLOT(startTimer()), Qt::UniqueConnection);
- connect(&mKeyHandler, SIGNAL(captureKeyPressed()), mStandbyHandler, SLOT(startTimer()), Qt::UniqueConnection);
- connect(&mKeyHandler, SIGNAL(captureKeyReleased()), mStandbyHandler, SLOT(startTimer()), Qt::UniqueConnection);
+ connect(mKeyHandler, SIGNAL(autofocusKeyPressed()), mStandbyHandler, SLOT(stopTimer()), Qt::UniqueConnection);
+ connect(mKeyHandler, SIGNAL(autofocusKeyReleased()), mStandbyHandler, SLOT(startTimer()), Qt::UniqueConnection);
+ connect(mKeyHandler, SIGNAL(captureKeyPressed()), mStandbyHandler, SLOT(startTimer()), Qt::UniqueConnection);
+ connect(mKeyHandler, SIGNAL(captureKeyReleased()), mStandbyHandler, SLOT(startTimer()), Qt::UniqueConnection);
+ connect(this, SIGNAL(disableStandbyTimer()), mStandbyHandler, SLOT(stopTimer()), Qt::UniqueConnection);
+ connect(this, SIGNAL(startStandbyTimer()), mStandbyHandler, SLOT(startTimer()), Qt::UniqueConnection);
// connecting pre-capture view signals to standby.
connect(currentView, SIGNAL(startStandbyTimer()), mStandbyHandler, SLOT(startTimer()), Qt::UniqueConnection);
@@ -656,6 +551,10 @@
// connecting precapture view signals to viewmanager slots
connect(currentView, SIGNAL(changeToPostcaptureView()), this, SLOT(changeToPostcaptureView()), Qt::UniqueConnection);
connect(currentView, SIGNAL(changeToPrecaptureView()), this, SLOT(changeToPrecaptureView()), 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 errormanager.
@@ -679,6 +578,7 @@
QObject *currentView = mMainWindow.currentView();
if (currentView == mPostcaptureView) {
// connecting view manager focus events to pre-capture views
+ connect(this, SIGNAL(focusGained()), currentView, SLOT(startTimers()), Qt::UniqueConnection);
connect(this, SIGNAL(focusLost()), currentView, SLOT(handleFocusLost()), Qt::UniqueConnection);
connect(currentView, SIGNAL(changeToPrecaptureView()), mStandbyHandler, SLOT(startTimer()), Qt::UniqueConnection);
@@ -699,7 +599,7 @@
CX_DEBUG_ENTER_FUNCTION();
// Disconnect all existing capture key signals
- mKeyHandler.disconnect();
+ mKeyHandler->disconnect();
disconnect(SIGNAL(focusGained()));
disconnect(SIGNAL(focusLost()));
@@ -708,6 +608,40 @@
CX_DEBUG_EXIT_FUNCTION();
}
+/*!
+* Raise application to foreground if it's currently (fully) in background.
+*/
+void CxuiViewManager::toForeground()
+{
+ CX_DEBUG_ENTER_FUNCTION();
+
+ if (mApplicationMonitor
+ && mApplicationMonitor->foregroundState() == CxuiApplicationFrameworkMonitor::ForegroundFullyLost) {
+ // Bring to foreground and gain focus.
+ CX_DEBUG(("CxuiViewManager - fully in background, bringing to foreground now."));
+ mMainWindow.raise();
+ mMainWindow.activateWindow();
+ }
+
+ CX_DEBUG_EXIT_FUNCTION();
+}
+
+/*!
+* Handle change in foreground state.
+*/
+void CxuiViewManager::handleForegroundStateChanged(CxuiApplicationFrameworkMonitor::ForegroundState state)
+{
+ switch (state) {
+ case CxuiApplicationFrameworkMonitor::ForegroundPartiallyLost:
+ break;
+ case CxuiApplicationFrameworkMonitor::ForegroundFullyLost:
+ aboutToLooseFocus();
+ break;
+ case CxuiApplicationFrameworkMonitor::ForegroundOwned:
+ aboutToGainFocus();
+ break;
+ }
+}
// ---------------------------------------------------------------------------
// CxuiViewManager::aboutToLooseFocus()
@@ -721,6 +655,10 @@
emit focusLost();
disconnectSignals();
+ // We do not stop listening to capture key events even if we go to background,
+ // as capture key brings us back to foreground.
+ connect(mKeyHandler, SIGNAL(captureKeyPressed()), this, SLOT(toForeground()));
+
CX_DEBUG_EXIT_FUNCTION();
}
@@ -734,6 +672,9 @@
{
CX_DEBUG_ENTER_FUNCTION();
+ // Disconnect capture key event and bringing us to foreground connection (if there is one).
+ disconnect(mKeyHandler, SIGNAL(captureKeyPressed()), this, SLOT(toForeground()));
+
// we are getting the focus.
if (mMainWindow.currentView() != mPostcaptureView) {
connectPreCaptureSignals();
@@ -741,68 +682,21 @@
connectPostCaptureSignals();
}
+ if (mKeyHandler) {
+ mKeyHandler->listenKeys(true);
+ }
emit focusGained();
CX_DEBUG_EXIT_FUNCTION();
}
-
-// ---------------------------------------------------------------------------
-// CxuiViewManager::eventMonitor
-//
-// ---------------------------------------------------------------------------
-//
-void CxuiViewManager::eventMonitor( const XQSettingsKey& key, const QVariant& value )
+/*!
+* Handle battery emptying
+*/
+void CxuiViewManager::handleBatteryEmpty()
{
CX_DEBUG_ENTER_FUNCTION();
-
- if (key.uid() == KPSUidAvkonDomain.iUid && key.key() == KAknKeyguardStatus) {
- CX_DEBUG(("new Keyguard value = %d, mKeyLockState = %d", value.toInt(), mKeyLockState));
- if (mSettingsManager->error() == XQSettingsManager::NoError) {
- // New key guard state
- int newKeyLockState = value.toInt();
-
- // Check if the keylock value has actually changed
- bool keylockValueChanged = (newKeyLockState != mKeyLockState);
- mKeyLockState = newKeyLockState;
-
- // Ignore unlock events when on background
- bool unlockedOnBackground = (!mFocused && newKeyLockState == EKeyguardNotActive);
-
- if (keylockValueChanged &&
- !unlockedOnBackground) {
- // Key lock value changed and we need to handle it
- if (mKeyLockState == EKeyguardNotActive) {
- // All other keylock states are handled as a active in S60 code
- aboutToGainFocus();
- } else {
- mFocused = false;
- aboutToLooseFocus();
- }
- }
- } else {
- // Error from settings manager - ignore
- CX_DEBUG(("mSettingsManager indicated error %d for key guard status", mSettingsManager->error()));
- }
- } else if (key.uid() == KPSUidHWRMPowerState.iUid && key.key() == KHWRMBatteryStatus ) {
- CX_DEBUG(("new battery status = %d, mBatteryStatus = %d", value.toInt(), mBatteryStatus));
-
- if (mSettingsManager->error() == XQSettingsManager::NoError) {
-
- // If status changed, check if battery is going empty.
- const int newState = value.toInt();
- if( newState != mBatteryStatus ) {
- mBatteryStatus = newState;
-
- // Notify that battery is almost empty,
- // need to stop any recordings etc.
- if( mBatteryStatus == EBatteryStatusEmpty ) {
- emit batteryEmpty();
- }
- }
- }
- }
-
+ emit batteryEmpty();
CX_DEBUG_EXIT_FUNCTION();
}
diff -r d9aefe59d544 -r 3075d9b614e6 camerauis/cameraxui/cxui/src/cxuizoomslider.cpp
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/camerauis/cameraxui/cxui/src/cxuizoomslider.cpp Thu May 13 21:30:19 2010 +0300
@@ -0,0 +1,57 @@
+/*
+* 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
+#include "cxuizoomslider.h"
+
+/*!
+ \class CxuiZoomSlider
+ \brief CxuiZoomSlider is a camera specific slider that is derived from HbSlider
+
+ CxuiZoomslider has been created so that we are able to control and filter user
+ mouse press events. All mouse press events that happen in slider rect are
+ accepted in this class so that they won't be given any other components.
+ This has to be done to prevent the slider to dismiss when accidentally
+ missing e.g.slider thumb touch area (camera view underneath will get the
+ event and hide the slider).
+
+*/
+
+CxuiZoomSlider::CxuiZoomSlider(QGraphicsItem *parentItem)
+: HbSlider(parentItem)
+{
+
+}
+
+
+CxuiZoomSlider::~CxuiZoomSlider()
+{
+
+}
+
+
+/*
+* CxuiZoomSlider::mousePressEvent()
+*/
+void CxuiZoomSlider::mousePressEvent(QGraphicsSceneMouseEvent *event)
+{
+ HbSlider::mousePressEvent(event);
+
+ // accept event so that it will not be given to the components
+ // underneath this slider
+ event->accept();
+}
diff -r d9aefe59d544 -r 3075d9b614e6 camerauis/cameraxui/cxui/src/main.cpp
--- a/camerauis/cameraxui/cxui/src/main.cpp Fri Apr 16 14:51:30 2010 +0300
+++ b/camerauis/cameraxui/cxui/src/main.cpp Thu May 13 21:30:19 2010 +0300
@@ -14,33 +14,35 @@
* Description:
*
*/
+
+#include
+#include
#include
#include
-#include
+// needed for localization
+#include
+#include
#include
-#include
-#include
+#include
#include "cxeengine.h"
#include "cxecameradevicecontrol.h"
-#include "cxuistillprecaptureview.h"
-#include "cxuivideoprecaptureview.h"
-#include "cxuicapturekeyhandler.h"
+#include "cxuiapplication.h"
#include "cxuiviewmanager.h"
#include "cxutils.h"
+#include "cxuiserviceprovider.h"
+
#include "OstTraceDefinitions.h"
#ifdef OST_TRACE_COMPILER_IN_USE
#include "mainTraces.h"
#endif
-// needed for localization
-#include
-#include
+using namespace Cxe;
-#include "cxuiserviceprovider.h"
-#include
-
-using namespace Cxe;
+// CONSTANTS
+const QString TRANSLATIONS_PATH = "z:/resource/qt/translations/";
+const QString TRANSLATIONS_FILE_NAME = "camera_";
+const QString COMMON_TRANSLATIONS_FILE_NAME = "common_";
int main(int argc, char *argv[])
{
@@ -49,37 +51,16 @@
Q_INIT_RESOURCE(cxui);
- OstTrace0( camerax_performance, DUP7__MAIN, "msg: e_CX_HBAPP_CREATION 1" );
- HbApplication app(argc, argv);
- OstTrace0( camerax_performance, DUP8__MAIN, "msg: e_CX_HBAPP_CREATION 0" );
-
- // Load the language specific localization files: application + common
- QTranslator translator;
- QString lang = QLocale::system().name();
- QString path = "z:/resource/qt/translations/";
-
- CX_DEBUG(("CxUI: loading translation"));
- bool ret = false;
- ret = translator.load(path + "camera_" + lang);
- CX_DEBUG(("load ok=%d", ret));
- app.installTranslator( &translator );
-
- QTranslator commonTranslator;
- commonTranslator.load(path + "common_" + lang);
- app.installTranslator(&commonTranslator);
-
- OstTrace0( camerax_performance, DUP11__MAIN, "msg: e_CX_HBMAINWINDOW_CREATION 1" );
- HbMainWindow mainWindow(0, Hb::WindowFlagTransparent |
- Hb::WindowFlagNoBackground);
- mainWindow.setAttribute(Qt::WA_NoBackground);
- OstTrace0( camerax_performance, DUP12__MAIN, "msg: e_CX_HBMAINWINDOW_CREATION 0" );
+ OstTrace0( camerax_performance, DUP1__MAIN, "msg: e_CX_HBAPP_CREATION 1" );
+ CxuiApplication app(argc, argv);
+ OstTrace0( camerax_performance, DUP2__MAIN, "msg: e_CX_HBAPP_CREATION 0" );
// Creating and initializing engine as early as possible.
// Reserve and power on can then proceed in parallel with
// ui construction.
- OstTrace0( camerax_performance, DUP1__MAIN, "msg: e_CX_CREATE_ENGINE 1" );
+ OstTrace0( camerax_performance, DUP7__MAIN, "msg: e_CX_CREATE_ENGINE 1" );
CxeEngine *eng = CxeEngine::createEngine();
- OstTrace0( camerax_performance, DUP2__MAIN, "msg: e_CX_CREATE_ENGINE 0" );
+ OstTrace0( camerax_performance, DUP8__MAIN, "msg: e_CX_CREATE_ENGINE 0" );
if (XQServiceUtil::isService()) {
// Embedded mode. Engine is inited to correct mode
@@ -89,42 +70,65 @@
CX_DEBUG(("CxUI: done"));
} else {
// Normal mode. Init engine now.
- OstTrace0( camerax_performance, DUP5__MAIN, "msg: e_CX_INIT_ENGINE 1" );
- eng->initMode(Cxe::ImageMode);
- OstTrace0( camerax_performance, DUP6__MAIN, "msg: e_CX_INIT_ENGINE 0" );
+ OstTrace0( camerax_performance, DUP9__MAIN, "msg: e_CX_INIT_ENGINE 1" );
+ //! @todo temporarily commented as part of a hack to change the startup sequence
+ // to avoid GOOM issues
+ //eng->initMode(Cxe::ImageMode);
+ OstTrace0( camerax_performance, DUP10__MAIN, "msg: e_CX_INIT_ENGINE 0" );
}
- // If the parent of the engine is set to be the
- // HbApplication, then for some reason the engine won't be deleted
- // on shutdown (or at least there will be no traces visible of it)
- //eng->setParent(&app); // HbApplication will now own the engine
-
- CxuiCaptureKeyHandler keyHandler(*eng);
+ // Load the language specific localization files: application + common
+ OstTrace0( camerax_performance, DUP3__MAIN, "msg: e_CX_LOAD_TRANSLATIONS 1" );
+ QTranslator translator;
+ QString lang = QLocale::system().name();
- OstTrace0( camerax_performance, DUP3__MAIN, "msg: e_CX_CREATE_VIEW_MANAGER 1" );
- CxuiViewManager viewManager(mainWindow, *eng, keyHandler);
- OstTrace0( camerax_performance, DUP4__MAIN, "msg: e_CX_CREATE_VIEW_MANAGER 0" );
+ CX_DEBUG(("CxUI: loading translation"));
+ bool ret = false;
+ ret = translator.load(TRANSLATIONS_PATH + TRANSLATIONS_FILE_NAME + lang);
+ CX_DEBUG(("load ok=%d", ret));
+ app.installTranslator( &translator );
- // Setting the viewmanager as the parent of the engine fixes the deletion issue
- eng->setParent(&viewManager);
+ QTranslator commonTranslator;
+ CX_DEBUG(("CxUI: loading common translation"));
+ ret = false;
+ ret = commonTranslator.load(TRANSLATIONS_PATH + COMMON_TRANSLATIONS_FILE_NAME + lang);
+ CX_DEBUG(("load ok=%d", ret));
+ app.installTranslator(&commonTranslator);
+ OstTrace0( camerax_performance, DUP4__MAIN, "msg: e_CX_LOAD_TRANSLATIONS 0" );
- OstTrace0( camerax_performance, DUP17__MAIN, "msg: e_CX_HBMAINWINDOWORIENT 1" );
- mainWindow.setOrientation(Qt::Horizontal);
- OstTrace0( camerax_performance, DUP18__MAIN, "msg: e_CX_HBMAINWINDOWORIENT 0" );
+ OstTrace0( camerax_performance, DUP5__MAIN, "msg: e_CX_MAINWINDOW_CREATION 1" );
+ HbMainWindow *mainWindow = new HbMainWindow(0, Hb::WindowFlagTransparent |
+ Hb::WindowFlagNoBackground);
+ mainWindow->setAttribute(Qt::WA_NoBackground);
+ OstTrace0( camerax_performance, DUP6__MAIN, "msg: e_CX_MAINWINDOW_CREATION 0" );
+
+ OstTrace0( camerax_performance, DUP11__MAIN, "msg: e_CX_CREATE_VIEW_MANAGER 1" );
+ CxuiViewManager *viewManager = new CxuiViewManager(app, *mainWindow, *eng);
+ OstTrace0( camerax_performance, DUP12__MAIN, "msg: e_CX_CREATE_VIEW_MANAGER 0" );
- OstTrace0( camerax_performance, DUP13__MAIN, "msg: e_CX_MAINWINDOW_FULLSCREEN 1" );
- mainWindow.showFullScreen();
- OstTrace0( camerax_performance, DUP14__MAIN, "msg: e_CX_MAINWINDOW_FULLSCREEN 0" );
+ OstTrace0( camerax_performance, DUP13__MAIN, "msg: e_CX_MAINWINDOW_SETORIENTATION 1" );
+ mainWindow->setOrientation(Qt::Horizontal);
+ OstTrace0( camerax_performance, DUP14__MAIN, "msg: e_CX_MAINWINDOW_SETORIENTATION 0" );
+
+ OstTrace0( camerax_performance, DUP15__MAIN, "msg: e_CX_MAINWINDOW_FULLSCREEN 1" );
+ mainWindow->showFullScreen();
+ OstTrace0( camerax_performance, DUP16__MAIN, "msg: e_CX_MAINWINDOW_FULLSCREEN 0" );
- OstTrace0( camerax_performance, DUP15__MAIN, "msg: e_CX_PREPAREWINDOW 1" );
- viewManager.prepareWindow();
-
- OstTrace0( camerax_performance, DUP16__MAIN, "msg: e_CX_PREPAREWINDOW 0" );
-
+ OstTrace0( camerax_performance, DUP17__MAIN, "msg: e_CX_PREPAREWINDOW 1" );
+ viewManager->prepareWindow();
+ OstTrace0( camerax_performance, DUP18__MAIN, "msg: e_CX_PREPAREWINDOW 0" );
+ //! @todo initMode call added here as a temporary hack to change the startup sequence
+ // in order to avoid GOOM issues
+ User::After(2000000);
+ eng->initMode(Cxe::ImageMode);
int returnValue = app.exec();
// delete service provider instance
CxuiServiceProvider::destroy();
+ delete viewManager;
+ delete mainWindow;
+ delete eng;
+
return returnValue;
}
diff -r d9aefe59d544 -r 3075d9b614e6 camerauis/cameraxui/cxui/traces/OstTraceDefinitions.h
--- a/camerauis/cameraxui/cxui/traces/OstTraceDefinitions.h Fri Apr 16 14:51:30 2010 +0300
+++ b/camerauis/cameraxui/cxui/traces/OstTraceDefinitions.h Thu May 13 21:30:19 2010 +0300
@@ -1,5 +1,5 @@
/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* 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"
@@ -11,7 +11,7 @@
*
* Contributors:
*
-* Description:
+* Description:
*
*/
#ifndef __OSTTRACEDEFINITIONS_H__
diff -r d9aefe59d544 -r 3075d9b614e6 camerauis/cameraxui/cxui/tsrc/cxuitest.pro
--- a/camerauis/cameraxui/cxui/tsrc/cxuitest.pro Fri Apr 16 14:51:30 2010 +0300
+++ b/camerauis/cameraxui/cxui/tsrc/cxuitest.pro Thu May 13 21:30:19 2010 +0300
@@ -30,7 +30,7 @@
./cxui \
../traces
QT += testlib
-HB += hbcore hbwidgets hbtools hbfeedback hbutils
+HB += hbcore hbwidgets hbutils hbfeedback
CONFIG += qtestlib hb symbian_test
LIBS += -lcxengine \
-lcommonui \
diff -r d9aefe59d544 -r 3075d9b614e6 camerauis/cameraxui/cxui/tsrc/cxuitestbat.pro
--- a/camerauis/cameraxui/cxui/tsrc/cxuitestbat.pro Fri Apr 16 14:51:30 2010 +0300
+++ b/camerauis/cameraxui/cxui/tsrc/cxuitestbat.pro Thu May 13 21:30:19 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"
@@ -35,7 +35,7 @@
QT += testlib
CONFIG += qtestlib hb symbian_test
-HB += hbcore hbwidgets hbtools hbfeedback hbutils
+HB += hbcore hbwidgets hbfeedback hbutils
LIBS += -lcxengine \
-lcommonui \
@@ -53,9 +53,7 @@
cxuiautofocusreticule.cpp \
cxuiprecaptureview.cpp \
cxuivideoprecaptureview.cpp \
- cxuivideoprecaptureview2.cpp \
cxuistillprecaptureview.cpp \
- cxuistillprecaptureview2.cpp \
cxuipostcaptureview.cpp \
cxuicapturekeyhandler.cpp \
cxuiviewmanager.cpp \
@@ -65,8 +63,6 @@
cxuisettingradiobuttonlist.cpp \
cxuisettingscenemoderadiobuttonlist.cpp \
cxuiscenelabel.cpp \
- cxuisettingbutton.cpp \
- cxuisettingbuttoncontainer.cpp \
cxuiselftimer.cpp \
cxuierrormanager.cpp \
cxuistandby.cpp
@@ -75,21 +71,17 @@
cxuiautofocusreticule.h \
cxuiprecaptureview.h \
cxuistillprecaptureview.h \
- cxuistillprecaptureview2.h \
cxuivideoprecaptureview.h \
- cxuivideoprecaptureview2.h \
cxuipostcaptureview.h \
cxuicapturekeyhandler.h \
cxuiviewmanager.h \
cxuienums.h \
cxuidocumentloader.h \
cxuidisplaypropertyhandler.h \
- cxuisettingbutton.h \
cxuisettingslider.h \
cxuisettingradiobuttonlist.h \
cxuisettingscenemoderadiobuttonlist.h \
cxuiscenelabel.h \
- cxuisettingbuttoncontainer.h \
cxuiselftimer.h \
cxuierrormanager.h \
cxuistandby.h \