# HG changeset patch # User Dremov Kirill (Nokia-D-MSW/Tampere) # Date 1273840846 -10800 # Node ID 2094593137f59d43ef2d61b535c098a76080b7ec # Parent fa6d9f75d6a631ec6c5df7020b34713b02b6a528 Revision: 201017 Kit: 201019 diff -r fa6d9f75d6a6 -r 2094593137f5 camerauis/cameraxui/cxengine/inc/api/cxeautofocuscontrol.h --- a/camerauis/cameraxui/cxengine/inc/api/cxeautofocuscontrol.h Mon May 03 12:22:55 2010 +0300 +++ b/camerauis/cameraxui/cxengine/inc/api/cxeautofocuscontrol.h Fri May 14 15:40:46 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 fa6d9f75d6a6 -r 2094593137f5 camerauis/cameraxui/cxengine/inc/api/cxenamespace.h --- a/camerauis/cameraxui/cxengine/inc/api/cxenamespace.h Mon May 03 12:22:55 2010 +0300 +++ b/camerauis/cameraxui/cxengine/inc/api/cxenamespace.h Fri May 14 15:40:46 2010 +0300 @@ -84,9 +84,9 @@ enum Sharpness { - SharpnessHard = 100, + SharpnessHard = 2, SharpnessNormal = 0, - SharpnessSoft = -100 + SharpnessSoft = -2 }; enum LightSensitivity diff -r fa6d9f75d6a6 -r 2094593137f5 camerauis/cameraxui/cxengine/inc/cxeautofocuscontrolsymbian.h --- a/camerauis/cameraxui/cxengine/inc/cxeautofocuscontrolsymbian.h Mon May 03 12:22:55 2010 +0300 +++ b/camerauis/cameraxui/cxengine/inc/cxeautofocuscontrolsymbian.h Fri May 14 15:40:46 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 fa6d9f75d6a6 -r 2094593137f5 camerauis/cameraxui/cxengine/inc/cxevideocapturecontrolsymbian.h --- a/camerauis/cameraxui/cxengine/inc/cxevideocapturecontrolsymbian.h Mon May 03 12:22:55 2010 +0300 +++ b/camerauis/cameraxui/cxengine/inc/cxevideocapturecontrolsymbian.h Fri May 14 15:40:46 2010 +0300 @@ -108,6 +108,8 @@ 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(); diff -r fa6d9f75d6a6 -r 2094593137f5 camerauis/cameraxui/cxengine/src/cxeautofocuscontrolsymbian.cpp --- a/camerauis/cameraxui/cxengine/src/cxeautofocuscontrolsymbian.cpp Mon May 03 12:22:55 2010 +0300 +++ b/camerauis/cameraxui/cxengine/src/cxeautofocuscontrolsymbian.cpp Fri May 14 15:40:46 2010 +0300 @@ -86,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); @@ -106,7 +109,6 @@ } CX_DEBUG( ("CxeAutoFocusControlSymbian::start() <= err : %d", err ) ); - return CxeErrorHandlingSymbian::map(err); } @@ -446,4 +448,13 @@ 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 fa6d9f75d6a6 -r 2094593137f5 camerauis/cameraxui/cxengine/src/cxeenginesymbian.cpp --- a/camerauis/cameraxui/cxengine/src/cxeenginesymbian.cpp Mon May 03 12:22:55 2010 +0300 +++ b/camerauis/cameraxui/cxengine/src/cxeenginesymbian.cpp Fri May 14 15:40:46 2010 +0300 @@ -67,7 +67,9 @@ CX_DEBUG_ENTER_FUNCTION(); // Do secondary construction during reserve call. - connect(this, SIGNAL(reserveStarted()), this, SLOT(construct())); + //! @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; @@ -76,7 +78,10 @@ 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(); } @@ -119,6 +124,11 @@ 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))); diff -r fa6d9f75d6a6 -r 2094593137f5 camerauis/cameraxui/cxengine/src/cxesettingsmodelimp.cpp --- a/camerauis/cameraxui/cxengine/src/cxesettingsmodelimp.cpp Mon May 03 12:22:55 2010 +0300 +++ b/camerauis/cameraxui/cxengine/src/cxesettingsmodelimp.cpp Fri May 14 15:40:46 2010 +0300 @@ -464,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 fa6d9f75d6a6 -r 2094593137f5 camerauis/cameraxui/cxengine/src/cxestillcapturecontrolsymbian.cpp --- a/camerauis/cameraxui/cxengine/src/cxestillcapturecontrolsymbian.cpp Mon May 03 12:22:55 2010 +0300 +++ b/camerauis/cameraxui/cxengine/src/cxestillcapturecontrolsymbian.cpp Fri May 14 15:40:46 2010 +0300 @@ -907,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(); diff -r fa6d9f75d6a6 -r 2094593137f5 camerauis/cameraxui/cxengine/src/cxevideocapturecontrolsymbian.cpp --- a/camerauis/cameraxui/cxengine/src/cxevideocapturecontrolsymbian.cpp Mon May 03 12:22:55 2010 +0300 +++ b/camerauis/cameraxui/cxengine/src/cxevideocapturecontrolsymbian.cpp Fri May 14 15:40:46 2010 +0300 @@ -126,6 +126,8 @@ 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"); @@ -372,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; @@ -381,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. @@ -665,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 @@ -1078,7 +1091,8 @@ { 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; @@ -1175,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; @@ -1232,6 +1247,13 @@ // 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 } @@ -1241,6 +1263,26 @@ } /*! + * 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. */ diff -r fa6d9f75d6a6 -r 2094593137f5 camerauis/cameraxui/cxengine/tsrc/unit/cxeunitrunner/cxetestrunner.cpp --- a/camerauis/cameraxui/cxengine/tsrc/unit/cxeunitrunner/cxetestrunner.cpp Mon May 03 12:22:55 2010 +0300 +++ b/camerauis/cameraxui/cxengine/tsrc/unit/cxeunitrunner/cxetestrunner.cpp Fri May 14 15:40:46 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 fa6d9f75d6a6 -r 2094593137f5 camerauis/cameraxui/cxengine/tsrc/unit/unittest_cxeenginesymbian/unittest_cxeenginesymbian.cpp --- a/camerauis/cameraxui/cxengine/tsrc/unit/unittest_cxeenginesymbian/unittest_cxeenginesymbian.cpp Mon May 03 12:22:55 2010 +0300 +++ b/camerauis/cameraxui/cxengine/tsrc/unit/unittest_cxeenginesymbian/unittest_cxeenginesymbian.cpp Fri May 14 15:40:46 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 fa6d9f75d6a6 -r 2094593137f5 camerauis/cameraxui/cxengine/tsrc/unit/unittest_cxeenginesymbian/unittest_cxeenginesymbian.pro --- a/camerauis/cameraxui/cxengine/tsrc/unit/unittest_cxeenginesymbian/unittest_cxeenginesymbian.pro Mon May 03 12:22:55 2010 +0300 +++ b/camerauis/cameraxui/cxengine/tsrc/unit/unittest_cxeenginesymbian/unittest_cxeenginesymbian.pro Fri May 14 15:40:46 2010 +0300 @@ -44,6 +44,7 @@ LIBS *= -lalfclient LIBS *= -lalfdecoderserverclient LIBS *= -lxqserviceutil +LIBS *= -loommonitor SOURCES *= unittest_cxeenginesymbian.cpp \ @@ -98,6 +99,10 @@ sensor/xqaccsensor_p.cpp \ cxefakequalitypresets.cpp \ cxequalitypresetssymbian.cpp \ + cxediskmonitor.cpp \ + cxediskmonitorprivate.cpp \ + cxememorymonitor.cpp \ + cxememorymonitorprivate.cpp @@ -165,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 fa6d9f75d6a6 -r 2094593137f5 camerauis/cameraxui/cxengine/tsrc/unit/unittest_cxesettingscenrepstore/unittest_cxesettingscenrepstore.cpp --- a/camerauis/cameraxui/cxengine/tsrc/unit/unittest_cxesettingscenrepstore/unittest_cxesettingscenrepstore.cpp Mon May 03 12:22:55 2010 +0300 +++ b/camerauis/cameraxui/cxengine/tsrc/unit/unittest_cxesettingscenrepstore/unittest_cxesettingscenrepstore.cpp Fri May 14 15:40:46 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 fa6d9f75d6a6 -r 2094593137f5 camerauis/cameraxui/cxengine/tsrc/unit/unittest_cxestillcapturecontrolsymbian/unittest_cxestillcapturecontrolsymbian.cpp --- a/camerauis/cameraxui/cxengine/tsrc/unit/unittest_cxestillcapturecontrolsymbian/unittest_cxestillcapturecontrolsymbian.cpp Mon May 03 12:22:55 2010 +0300 +++ b/camerauis/cameraxui/cxengine/tsrc/unit/unittest_cxestillcapturecontrolsymbian/unittest_cxestillcapturecontrolsymbian.cpp Fri May 14 15:40:46 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 fa6d9f75d6a6 -r 2094593137f5 camerauis/cameraxui/cxengine/tsrc/unit/unittest_cxestillcapturecontrolsymbian/unittest_cxestillcapturecontrolsymbian.h --- a/camerauis/cameraxui/cxengine/tsrc/unit/unittest_cxestillcapturecontrolsymbian/unittest_cxestillcapturecontrolsymbian.h Mon May 03 12:22:55 2010 +0300 +++ b/camerauis/cameraxui/cxengine/tsrc/unit/unittest_cxestillcapturecontrolsymbian/unittest_cxestillcapturecontrolsymbian.h Fri May 14 15:40:46 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 fa6d9f75d6a6 -r 2094593137f5 camerauis/cameraxui/cxengine/tsrc/unit/unittest_cxestillcapturecontrolsymbian/unittest_cxestillcapturecontrolsymbian.pro --- a/camerauis/cameraxui/cxengine/tsrc/unit/unittest_cxestillcapturecontrolsymbian/unittest_cxestillcapturecontrolsymbian.pro Mon May 03 12:22:55 2010 +0300 +++ b/camerauis/cameraxui/cxengine/tsrc/unit/unittest_cxestillcapturecontrolsymbian/unittest_cxestillcapturecontrolsymbian.pro Fri May 14 15:40:46 2010 +0300 @@ -66,6 +66,8 @@ cxefakeautofocuscontrol.cpp \ cxefakesettings.cpp \ cxefilesavethread.cpp \ + cxediskmonitor.cpp \ + cxediskmonitorprivate.cpp \ cxefakefilesavethread.cpp HEADERS *= unittest_cxestillcapturecontrolsymbian.h \ @@ -112,4 +114,6 @@ cxefakequalitypresets.h \ cxefakefilesavethread.h \ cxefilesavethread.h \ + cxediskmonitor.h \ + cxediskmonitorprivate.h \ cxequalitypresets.h diff -r fa6d9f75d6a6 -r 2094593137f5 camerauis/cameraxui/cxengine/tsrc/unit/unittest_cxevideocapturecontrolsymbian/cxevideocapturecontrolsymbianunit.cpp --- a/camerauis/cameraxui/cxengine/tsrc/unit/unittest_cxevideocapturecontrolsymbian/cxevideocapturecontrolsymbianunit.cpp Mon May 03 12:22:55 2010 +0300 +++ b/camerauis/cameraxui/cxengine/tsrc/unit/unittest_cxevideocapturecontrolsymbian/cxevideocapturecontrolsymbianunit.cpp Fri May 14 15:40:46 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 fa6d9f75d6a6 -r 2094593137f5 camerauis/cameraxui/cxengine/tsrc/unit/unittest_cxevideocapturecontrolsymbian/cxevideocapturecontrolsymbianunit.h --- a/camerauis/cameraxui/cxengine/tsrc/unit/unittest_cxevideocapturecontrolsymbian/cxevideocapturecontrolsymbianunit.h Mon May 03 12:22:55 2010 +0300 +++ b/camerauis/cameraxui/cxengine/tsrc/unit/unittest_cxevideocapturecontrolsymbian/cxevideocapturecontrolsymbianunit.h Fri May 14 15:40:46 2010 +0300 @@ -37,7 +37,8 @@ CxeCameraDeviceControl &cameraDeviceControl, CxeFilenameGenerator &nameGenerator, CxeSettings &settings, - CxeQualityPresets &qualityPresets); + CxeQualityPresets &qualityPresets, + CxeDiskMonitor &diskMonitor); virtual ~CxeVideoCaptureControlSymbianUnit(); void createVideoRecorder(); diff -r fa6d9f75d6a6 -r 2094593137f5 camerauis/cameraxui/cxengine/tsrc/unit/unittest_cxevideocapturecontrolsymbian/unittest_cxevideocapturecontrolsymbian.cpp --- a/camerauis/cameraxui/cxengine/tsrc/unit/unittest_cxevideocapturecontrolsymbian/unittest_cxevideocapturecontrolsymbian.cpp Mon May 03 12:22:55 2010 +0300 +++ b/camerauis/cameraxui/cxengine/tsrc/unit/unittest_cxevideocapturecontrolsymbian/unittest_cxevideocapturecontrolsymbian.cpp Fri May 14 15:40:46 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 fa6d9f75d6a6 -r 2094593137f5 camerauis/cameraxui/cxengine/tsrc/unit/unittest_cxevideocapturecontrolsymbian/unittest_cxevideocapturecontrolsymbian.h --- a/camerauis/cameraxui/cxengine/tsrc/unit/unittest_cxevideocapturecontrolsymbian/unittest_cxevideocapturecontrolsymbian.h Mon May 03 12:22:55 2010 +0300 +++ b/camerauis/cameraxui/cxengine/tsrc/unit/unittest_cxevideocapturecontrolsymbian/unittest_cxevideocapturecontrolsymbian.h Fri May 14 15:40:46 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 fa6d9f75d6a6 -r 2094593137f5 camerauis/cameraxui/cxengine/tsrc/unit/unittest_cxevideocapturecontrolsymbian/unittest_cxevideocapturecontrolsymbian.pro --- a/camerauis/cameraxui/cxengine/tsrc/unit/unittest_cxevideocapturecontrolsymbian/unittest_cxevideocapturecontrolsymbian.pro Mon May 03 12:22:55 2010 +0300 +++ b/camerauis/cameraxui/cxengine/tsrc/unit/unittest_cxevideocapturecontrolsymbian/unittest_cxevideocapturecontrolsymbian.pro Fri May 14 15:40:46 2010 +0300 @@ -50,6 +50,8 @@ cxesoundplayersymbian.cpp \ cxeerrormappingsymbian.cpp \ cxefakequalitypresets.cpp \ + cxediskmonitor.cpp \ + cxediskmonitorprivate.cpp \ cxesysutil.cpp HEADERS *= unittest_cxevideocapturecontrolsymbian.h \ @@ -79,4 +81,6 @@ cxesoundplayersymbian.h \ cxefakequalitypresets.h \ cxutils.h \ + cxediskmonitor.h \ + cxediskmonitorprivate.h \ cxesysutil.h diff -r fa6d9f75d6a6 -r 2094593137f5 camerauis/cameraxui/cxui/inc/cxuienums.h --- a/camerauis/cameraxui/cxui/inc/cxuienums.h Mon May 03 12:22:55 2010 +0300 +++ b/camerauis/cameraxui/cxui/inc/cxuienums.h Fri May 14 15:40:46 2010 +0300 @@ -91,8 +91,10 @@ 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_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"; diff -r fa6d9f75d6a6 -r 2094593137f5 camerauis/cameraxui/cxui/inc/cxuipostcaptureview.h --- a/camerauis/cameraxui/cxui/inc/cxuipostcaptureview.h Mon May 03 12:22:55 2010 +0300 +++ b/camerauis/cameraxui/cxui/inc/cxuipostcaptureview.h Fri May 14 15:40:46 2010 +0300 @@ -21,6 +21,7 @@ #include #include #include +#include class QGraphicsRectItem; class HbMainWindow; @@ -127,6 +128,8 @@ bool mControlsVisible; bool mTimersStarted; + + XQApplicationManager mAppManager; }; diff -r fa6d9f75d6a6 -r 2094593137f5 camerauis/cameraxui/cxui/inc/cxuiprecaptureview.h --- a/camerauis/cameraxui/cxui/inc/cxuiprecaptureview.h Mon May 03 12:22:55 2010 +0300 +++ b/camerauis/cameraxui/cxui/inc/cxuiprecaptureview.h Fri May 14 15:40:46 2010 +0300 @@ -105,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(); @@ -197,7 +197,9 @@ CxuiSettingSlider *mSettingsSlider; CxuiSettingsInfo *mSettingsInfo; - + + HbAction *mSettingsDialogOkAction; + HbAction *mSliderSettingsDialogOkAction; }; #endif // CXUIPRECAPTUREVIEW_H diff -r fa6d9f75d6a6 -r 2094593137f5 camerauis/cameraxui/cxui/inc/cxuivideoprecaptureview.h --- a/camerauis/cameraxui/cxui/inc/cxuivideoprecaptureview.h Mon May 03 12:22:55 2010 +0300 +++ b/camerauis/cameraxui/cxui/inc/cxuivideoprecaptureview.h Fri May 14 15:40:46 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; @@ -136,6 +141,7 @@ QPropertyAnimation* mRecordingAnimation; //For recording indicator bool mCapturePending; + QTimer mPauseTimer; }; #endif // CXUIVIDEOPRECAPTUREVIEW_H diff -r fa6d9f75d6a6 -r 2094593137f5 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 Fri May 14 15:40:46 2010 +0300 @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r fa6d9f75d6a6 -r 2094593137f5 camerauis/cameraxui/cxui/layouts/setting.docml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraxui/cxui/layouts/setting.docml Fri May 14 15:40:46 2010 +0300 @@ -0,0 +1,36 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r fa6d9f75d6a6 -r 2094593137f5 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 Fri May 14 15:40:46 2010 +0300 @@ -0,0 +1,79 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r fa6d9f75d6a6 -r 2094593137f5 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 Fri May 14 15:40:46 2010 +0300 @@ -0,0 +1,34 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r fa6d9f75d6a6 -r 2094593137f5 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 Fri May 14 15:40:46 2010 +0300 @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + diff -r fa6d9f75d6a6 -r 2094593137f5 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 Fri May 14 15:40:46 2010 +0300 @@ -0,0 +1,91 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r fa6d9f75d6a6 -r 2094593137f5 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 Fri May 14 15:40:46 2010 +0300 @@ -0,0 +1,265 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + + + + + + + + + + +
+
+ + + + + + + + + + + +
+ + + + + + +
diff -r fa6d9f75d6a6 -r 2094593137f5 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 Fri May 14 15:40:46 2010 +0300 @@ -0,0 +1,316 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + + + + + + + +
+
+ + + + + + + + + + +
+
+ + + + + + + + + + + + + +
+
+ + + + + + + + + + + + + + + + + + +
+
+ + + + + + + + + + + + + + + +
+ + + + + + + + + +
diff -r fa6d9f75d6a6 -r 2094593137f5 camerauis/cameraxui/cxui/src/cxuipostcaptureview.cpp --- a/camerauis/cameraxui/cxui/src/cxuipostcaptureview.cpp Mon May 03 12:22:55 2010 +0300 +++ b/camerauis/cameraxui/cxui/src/cxuipostcaptureview.cpp Fri May 14 15:40:46 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(); + } // --------------------------------------------------------------------------- @@ -245,7 +253,9 @@ hideControls(); HbMessageBox *dlg = qobject_cast(sender()); - if(dlg && action == dlg->primaryAction()) { + + // 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); @@ -276,16 +286,15 @@ 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(); @@ -467,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(); @@ -606,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(); } diff -r fa6d9f75d6a6 -r 2094593137f5 camerauis/cameraxui/cxui/src/cxuiprecaptureview.cpp --- a/camerauis/cameraxui/cxui/src/cxuiprecaptureview.cpp Mon May 03 12:22:55 2010 +0300 +++ b/camerauis/cameraxui/cxui/src/cxuiprecaptureview.cpp Fri May 14 15:40:46 2010 +0300 @@ -101,7 +101,9 @@ mSliderSettingsDialog(NULL), mSliderSettingsDialogHeading(NULL), mSettingsSlider(NULL), - mSettingsInfo(NULL) + mSettingsInfo(NULL), + mSettingsDialogOkAction(NULL), + mSliderSettingsDialogOkAction(NULL) { CX_DEBUG_ENTER_FUNCTION(); mDisplayHandler = new CxuiDisplayPropertyHandler(); @@ -466,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(); } @@ -720,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(); @@ -773,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())); @@ -828,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(); @@ -879,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())); @@ -927,13 +934,7 @@ void CxuiPrecaptureView::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(); } @@ -1016,13 +1017,15 @@ 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")); } @@ -1038,7 +1041,7 @@ { if (widget) { HbFrameDrawer *drawer = new HbFrameDrawer(graphicName, frameType); - + if (drawer) { HbFrameItem *backgroundItem = new HbFrameItem(drawer, widget); if (backgroundItem) { diff -r fa6d9f75d6a6 -r 2094593137f5 camerauis/cameraxui/cxui/src/cxuiscenemodeview.cpp --- a/camerauis/cameraxui/cxui/src/cxuiscenemodeview.cpp Mon May 03 12:22:55 2010 +0300 +++ b/camerauis/cameraxui/cxui/src/cxuiscenemodeview.cpp Fri May 14 15:40:46 2010 +0300 @@ -271,6 +271,7 @@ void CxuiSceneModeView::handleOkButtonPress() { CX_DEBUG_ENTER_FUNCTION(); + mScenesList->handleSelectionAccepted(); closeView(); CX_DEBUG_EXIT_FUNCTION(); } @@ -326,7 +327,6 @@ void CxuiSceneModeView::closeView() { CX_DEBUG_ENTER_FUNCTION(); - mScenesList->handleSelectionAccepted(); mScenesList->handleClose(); mScenesBackground->setIcon(HbIcon()); // Make sure engine prepares for new image/video if necessary diff -r fa6d9f75d6a6 -r 2094593137f5 camerauis/cameraxui/cxui/src/cxuistillprecaptureview.cpp --- a/camerauis/cameraxui/cxui/src/cxuistillprecaptureview.cpp Mon May 03 12:22:55 2010 +0300 +++ b/camerauis/cameraxui/cxui/src/cxuistillprecaptureview.cpp Fri May 14 15:40:46 2010 +0300 @@ -356,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(); } @@ -370,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. @@ -394,7 +397,6 @@ // after capturing check what is the new amount for images left updateImagesLeftLabel(); - CX_DEBUG_EXIT_FUNCTION(); } diff -r fa6d9f75d6a6 -r 2094593137f5 camerauis/cameraxui/cxui/src/cxuivideoprecaptureview.cpp --- a/camerauis/cameraxui/cxui/src/cxuivideoprecaptureview.cpp Mon May 03 12:22:55 2010 +0300 +++ b/camerauis/cameraxui/cxui/src/cxuivideoprecaptureview.cpp Fri May 14 15:40:46 2010 +0300 @@ -29,7 +29,6 @@ #include #include #include -#include #include #include @@ -60,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"; @@ -113,6 +113,10 @@ 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); connect(quitAction, SIGNAL(triggered()), this, SLOT(handleQuitClicked())); @@ -251,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(); @@ -306,7 +310,6 @@ if (time) { mMenu = takeMenu(); - hideControls(); mVideoCaptureControl->record(); } else { launchDiskFullNotification(); @@ -321,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(); @@ -408,10 +404,10 @@ { CX_DEBUG_ENTER_FUNCTION(); - HbFeedbackPlayer* feedback = HbFeedbackPlayer::instance(); - if (feedback) { - feedback->settings().disableFeedback(); - } + HbFeedbackSettings settings; + settings.disableFeedback(); + + CX_DEBUG_EXIT_FUNCTION(); } @@ -419,10 +415,9 @@ { CX_DEBUG_ENTER_FUNCTION(); - HbFeedbackPlayer* feedback = HbFeedbackPlayer::instance(); - if (feedback) { - feedback->settings().disableFeedback(); - } + HbFeedbackSettings settings; + settings.enableFeedback(); + CX_DEBUG_EXIT_FUNCTION(); } @@ -488,6 +483,21 @@ } /*! + 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. @@ -547,6 +557,8 @@ updateTimeLabels(); + mPauseTimer.stop(); + switch (newState) { case CxeVideoCaptureControl::Ready: if (mDocumentLoader){ @@ -558,11 +570,15 @@ } break; case CxeVideoCaptureControl::Recording: + 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(); @@ -571,13 +587,21 @@ mDocumentLoader->load(VIDEO_1ST_XML, VIDEO_PRE_CAPTURE_PAUSED); } + if (mRecordingAnimation && mRecordingIcon) { + mRecordingAnimation->stop(); + } + showControls(); enableFeedback(); + mPauseTimer.start(); break; case CxeVideoCaptureControl::Stopping: if (mDocumentLoader){ mDocumentLoader->load(VIDEO_1ST_XML, VIDEO_PRE_CAPTURE_PAUSED); } + if (mRecordingAnimation && mRecordingIcon) { + mRecordingAnimation->stop(); + } enableFeedback(); if (isPostcaptureOn()) { @@ -630,10 +654,10 @@ switch (state) { case CxeVideoCaptureControl::Ready: - case CxeVideoCaptureControl::Paused: record(); break; case CxeVideoCaptureControl::Recording: + case CxeVideoCaptureControl::Paused: stop(); break; case CxeVideoCaptureControl::Idle: @@ -671,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))); @@ -768,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 fa6d9f75d6a6 -r 2094593137f5 camerauis/cameraxui/cxui/src/main.cpp --- a/camerauis/cameraxui/cxui/src/main.cpp Mon May 03 12:22:55 2010 +0300 +++ b/camerauis/cameraxui/cxui/src/main.cpp Fri May 14 15:40:46 2010 +0300 @@ -71,7 +71,9 @@ } else { // Normal mode. Init engine now. OstTrace0( camerax_performance, DUP9__MAIN, "msg: e_CX_INIT_ENGINE 1" ); - eng->initMode(Cxe::ImageMode); + //! @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" ); } @@ -94,40 +96,39 @@ app.installTranslator(&commonTranslator); OstTrace0( camerax_performance, DUP4__MAIN, "msg: e_CX_LOAD_TRANSLATIONS 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 - OstTrace0( camerax_performance, DUP5__MAIN, "msg: e_CX_MAINWINDOW_CREATION 1" ); - HbMainWindow mainWindow(0, Hb::WindowFlagTransparent | - Hb::WindowFlagNoBackground); - mainWindow.setAttribute(Qt::WA_NoBackground); + 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(app, mainWindow, *eng); + CxuiViewManager *viewManager = new CxuiViewManager(app, *mainWindow, *eng); OstTrace0( camerax_performance, DUP12__MAIN, "msg: e_CX_CREATE_VIEW_MANAGER 0" ); - // Setting the viewmanager as the parent of the engine fixes the deletion issue - eng->setParent(&viewManager); - OstTrace0( camerax_performance, DUP13__MAIN, "msg: e_CX_MAINWINDOW_SETORIENTATION 1" ); - mainWindow.setOrientation(Qt::Horizontal); + 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(); + mainWindow->showFullScreen(); OstTrace0( camerax_performance, DUP16__MAIN, "msg: e_CX_MAINWINDOW_FULLSCREEN 0" ); OstTrace0( camerax_performance, DUP17__MAIN, "msg: e_CX_PREPAREWINDOW 1" ); - viewManager.prepareWindow(); + 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; }