camerauis/cameraxui/cxui/src/cxuivideoprecaptureview.cpp
changeset 43 0e652f8f1fbd
parent 28 3075d9b614e6
child 45 24fd82631616
equal deleted inserted replaced
28:3075d9b614e6 43:0e652f8f1fbd
    16 */
    16 */
    17 
    17 
    18 #include <e32keys.h>
    18 #include <e32keys.h>
    19 
    19 
    20 #include <QApplication>
    20 #include <QApplication>
       
    21 #include <QGraphicsLayout>
    21 
    22 
    22 #include <hbmainwindow.h>
    23 #include <hbmainwindow.h>
    23 #include <hbaction.h>
    24 #include <hbaction.h>
    24 #include <hbtoolbar.h>
    25 #include <hbtoolbar.h>
    25 #include <hbtoolbarextension.h>
    26 #include <hbtoolbarextension.h>
    29 #include <hbmenu.h>
    30 #include <hbmenu.h>
    30 #include <hbdialog.h>
    31 #include <hbdialog.h>
    31 #include <hbnotificationdialog.h>
    32 #include <hbnotificationdialog.h>
    32 #include <hbfeedbacksettings.h>
    33 #include <hbfeedbacksettings.h>
    33 #include <hbfeedbacknamespace.h>
    34 #include <hbfeedbacknamespace.h>
       
    35 #include <hbactivitymanager.h>
    34 
    36 
    35 #include "cxuivideoprecaptureview.h"
    37 #include "cxuivideoprecaptureview.h"
    36 #include "cxeengine.h"
    38 #include "cxeengine.h"
    37 #include "cxeviewfindercontrol.h"
    39 #include "cxeviewfindercontrol.h"
    38 #include "cxevideocapturecontrol.h"
    40 #include "cxevideocapturecontrol.h"
    42 #include "cxuienums.h"
    44 #include "cxuienums.h"
    43 #include "cxutils.h"
    45 #include "cxutils.h"
    44 #include "cxuizoomslider.h"
    46 #include "cxuizoomslider.h"
    45 #include "cxuicapturekeyhandler.h"
    47 #include "cxuicapturekeyhandler.h"
    46 #include "cxuidocumentloader.h"
    48 #include "cxuidocumentloader.h"
       
    49 #include "cxuiserviceprovider.h"
       
    50 
    47 #include "OstTraceDefinitions.h"
    51 #include "OstTraceDefinitions.h"
    48 #ifdef OST_TRACE_COMPILER_IN_USE
    52 #ifdef OST_TRACE_COMPILER_IN_USE
    49 #include "cxuivideoprecaptureviewTraces.h"
    53 #include "cxuivideoprecaptureviewTraces.h"
    50 #endif
    54 #endif
    51 #include "cxuiserviceprovider.h"
       
    52 
    55 
    53 
    56 
    54 using namespace Cxe;
    57 using namespace Cxe;
    55 using namespace CxUiLayout;
    58 using namespace CxUiLayout;
    56 using namespace CxUiInternal;
    59 using namespace CxUiInternal;
    73     mTimeRemaining(0),
    76     mTimeRemaining(0),
    74     mElapsedTimeText(NULL),
    77     mElapsedTimeText(NULL),
    75     mRemainingTimeText(NULL),
    78     mRemainingTimeText(NULL),
    76     mRecordingIcon(NULL),
    79     mRecordingIcon(NULL),
    77     mGoToStillAction(NULL),
    80     mGoToStillAction(NULL),
    78     mToolBarIdle(NULL),
    81     mToolbarIdle(NULL),
    79     mToolBarRec(NULL),
    82     mToolbarRec(NULL),
    80     mToolBarPaused(NULL),
    83     mToolbarPaused(NULL),
    81     mVideoScenePopup(NULL),
    84     mVideoScenePopup(NULL),
    82     mVideoCaptureControl(NULL),
    85     mVideoCaptureControl(NULL),
    83     mMenu(NULL),
    86     mMenu(NULL),
    84     mCapturePending(false)
    87     mCapturePending(false)
    85 {
    88 {
    92     mElapsedTimer.stop();
    95     mElapsedTimer.stop();
    93     delete mMenu;
    96     delete mMenu;
    94     CX_DEBUG_EXIT_FUNCTION();
    97     CX_DEBUG_EXIT_FUNCTION();
    95 }
    98 }
    96 
    99 
       
   100 /*!
       
   101  * Construct-method handles initialisation tasks for this class.
       
   102  * @param mainwindow
       
   103  * @param engine
       
   104  * @param documentLoader
       
   105  * @param keyHandler
       
   106  */
    97 void CxuiVideoPrecaptureView::construct(HbMainWindow *mainwindow, CxeEngine *engine,
   107 void CxuiVideoPrecaptureView::construct(HbMainWindow *mainwindow, CxeEngine *engine,
    98                                         CxuiDocumentLoader *documentLoader,
   108                                         CxuiDocumentLoader *documentLoader,
    99                                         CxuiCaptureKeyHandler *keyHandler)
   109                                         CxuiCaptureKeyHandler *keyHandler,
   100 {
   110                                         HbActivityManager *activityManager)
   101     CX_DEBUG_ENTER_FUNCTION();
   111 {
   102 
   112     CX_DEBUG_ENTER_FUNCTION();
   103     CxuiPrecaptureView::construct(mainwindow, engine, documentLoader, keyHandler);
   113 
   104     mKeyHandler = keyHandler;
   114     CxuiPrecaptureView::construct(mainwindow, engine, documentLoader, keyHandler, activityManager);
       
   115     mCaptureKeyHandler = keyHandler;
   105 
   116 
   106     mVideoCaptureControl = &(engine->videoCaptureControl());
   117     mVideoCaptureControl = &(engine->videoCaptureControl());
   107 
   118 
   108     connect(&mElapsedTimer, SIGNAL(timeout()), this, SLOT(updateTimeLabels()));
   119     connect(&mElapsedTimer, SIGNAL(timeout()), this, SLOT(updateTimeLabels()));
   109     connect(mVideoCaptureControl, SIGNAL(snapshotReady(CxeError::Id, const QPixmap&, const QString&)),
   120     connect(mVideoCaptureControl, SIGNAL(snapshotReady(CxeError::Id, const QImage&, const QString&)),
   110             this, SLOT(handleSnapshot(CxeError::Id)));
   121             this, SLOT(handleSnapshot(CxeError::Id)));
   111     connect(mVideoCaptureControl, SIGNAL(stateChanged(CxeVideoCaptureControl::State, CxeError::Id)),
   122     connect(mVideoCaptureControl, SIGNAL(stateChanged(CxeVideoCaptureControl::State, CxeError::Id)),
   112             this, SLOT(handleVideoStateChanged(CxeVideoCaptureControl::State,CxeError::Id)));
   123             this, SLOT(handleVideoStateChanged(CxeVideoCaptureControl::State,CxeError::Id)));
       
   124     connect(&(mEngine->settings()), SIGNAL(sceneChanged(CxeScene&)),
       
   125             this, SLOT(handleSceneChanged(CxeScene&)));
   113     connect(mVideoCaptureControl, SIGNAL(remainingTimeChanged()),
   126     connect(mVideoCaptureControl, SIGNAL(remainingTimeChanged()),
   114             this, SLOT(updateTimeLabels()));
   127             this, SLOT(updateTimeLabels()));
   115 
   128 
   116     mPauseTimer.setSingleShot(true);
   129     mPauseTimer.setSingleShot(true);
   117     connect(&mPauseTimer, SIGNAL(timeout()), this, SLOT(stop()));
   130     connect(&mPauseTimer, SIGNAL(timeout()), this, SLOT(stop()));
   127 
   140 
   128     CX_DEBUG_EXIT_FUNCTION();
   141     CX_DEBUG_EXIT_FUNCTION();
   129 
   142 
   130 }
   143 }
   131 
   144 
       
   145 /*!
       
   146  * Loads widgets that are needed right from the start.
       
   147  */
   132 void CxuiVideoPrecaptureView::loadDefaultWidgets()
   148 void CxuiVideoPrecaptureView::loadDefaultWidgets()
   133 {
   149 {
   134     CX_DEBUG_ENTER_FUNCTION();
   150     CX_DEBUG_ENTER_FUNCTION();
   135     CX_DEBUG_ASSERT(mDocumentLoader);
   151     CX_ASSERT_ALWAYS(mDocumentLoader);
   136 
   152 
   137     // get pointers to ui components from the layout data
   153     // get pointers to ui components from the layout data
   138     QGraphicsWidget *widget = NULL;
   154     QGraphicsWidget *widget = NULL;
   139     widget = mDocumentLoader->findWidget(VIDEO_PRE_CAPTURE_VIEWFINDER);
   155     widget = mDocumentLoader->findWidget(VIDEO_PRE_CAPTURE_VIEWFINDER);
   140     mViewfinder = qobject_cast<HbTransparentWindow *> (widget);
   156     mViewfinder = qobject_cast<HbTransparentWindow *> (widget);
   141     CX_DEBUG_ASSERT(mViewfinder);
   157     CX_ASSERT_ALWAYS(mViewfinder);
   142 
   158 
       
   159     reloadIndicatorWidgets();
       
   160 
       
   161     CX_DEBUG_EXIT_FUNCTION();
       
   162 }
       
   163 
       
   164 /*!
       
   165  * Loads default indicators from docml and modifies the visibility 
       
   166  * according to current settings.
       
   167  */
       
   168 void CxuiVideoPrecaptureView::reloadIndicatorWidgets()
       
   169 {
       
   170     CX_DEBUG_ENTER_FUNCTION();
       
   171     CX_ASSERT_ALWAYS(mDocumentLoader);
       
   172 
       
   173     bool ok = false;
       
   174     mDocumentLoader->load(VIDEO_1ST_XML, VIDEO_PRE_CAPTURE_INDICATORS_SECTION, &ok);
       
   175     CX_ASSERT_ALWAYS(ok);
       
   176 
       
   177     QGraphicsWidget *widget = NULL;
   143     widget = mDocumentLoader->findWidget(VIDEO_PRE_CAPTURE_QUALITY_ICON);
   178     widget = mDocumentLoader->findWidget(VIDEO_PRE_CAPTURE_QUALITY_ICON);
   144     mQualityIcon = qobject_cast<HbLabel *> (widget);
   179     mQualityIcon = qobject_cast<HbLabel *> (widget);
   145     CX_DEBUG_ASSERT(mQualityIcon);
   180     CX_ASSERT_ALWAYS(mQualityIcon);
       
   181 
       
   182     widget = mDocumentLoader->findWidget(VIDEO_PRE_CAPTURE_VIDEOAUDIOMUTE_INDICATOR_ICON);
       
   183     HbLabel *videoaudiomuteIndicatorIcon = qobject_cast<HbLabel *>(widget);
       
   184     CX_ASSERT_ALWAYS(videoaudiomuteIndicatorIcon);
       
   185 
       
   186     widget = mDocumentLoader->findWidget(VIDEO_PRE_CAPTURE_STABILITY_INDICATOR_ICON);
       
   187     HbLabel *videoStabilityIndicatorIcon = qobject_cast<HbLabel *>(widget);
       
   188     CX_ASSERT_ALWAYS(videoStabilityIndicatorIcon);
   146 
   189 
   147     widget = mDocumentLoader->findWidget(VIDEO_PRE_CAPTURE_INDICATOR_CONTAINER_TOP);
   190     widget = mDocumentLoader->findWidget(VIDEO_PRE_CAPTURE_INDICATOR_CONTAINER_TOP);
   148     mIndicators = qobject_cast<HbWidget *>(widget);
   191     mIndicators = qobject_cast<HbWidget *>(widget);
   149     CX_DEBUG_ASSERT(mIndicators);
   192     CX_ASSERT_ALWAYS(mIndicators);
       
   193 
       
   194     QGraphicsLayout *layout = mIndicators->layout();
       
   195     QGraphicsLayoutItem *graphicsLayoutItem = NULL;
       
   196     QGraphicsItem *graphicsItem = NULL;
       
   197     QString key = "";
       
   198     int currentSettingValue = -1;
       
   199     bool isSettingOff = false;
       
   200     // Go through the items in the layout to check whether they should be
       
   201     // shown or not in the indicator pane. Start from the last towards
       
   202     // the first, so that removing items from between works correctly.
       
   203     for (int i = layout->count() - 1; i >= 0; i--) {
       
   204         graphicsLayoutItem = layout->itemAt(i);
       
   205         isSettingOff = false;
       
   206         if (graphicsLayoutItem) {
       
   207             graphicsItem = graphicsLayoutItem->graphicsItem();
       
   208             currentSettingValue = -1;
       
   209             if (graphicsItem == videoaudiomuteIndicatorIcon) {
       
   210                 key = CxeSettingIds::VIDEO_MUTE_SETTING;
       
   211                 mEngine->settings().get(key, currentSettingValue);
       
   212                 // video mute implementation does not use 
       
   213                 // enum for on/off values but instead 
       
   214                 // 0 for off and 1 for on.
       
   215                 if (currentSettingValue == 0) {
       
   216                     isSettingOff = true;
       
   217                 }
       
   218             } else if (graphicsItem == videoStabilityIndicatorIcon) {
       
   219                 // remove video stability indicator.
       
   220                 isSettingOff = true;
       
   221             }
       
   222             if (isSettingOff) {
       
   223                 layout->removeAt(i);
       
   224             }
       
   225         }
       
   226     }
       
   227 
   150     // Create background graphics for indicator container
   228     // Create background graphics for indicator container
   151     createWidgetBackgroundGraphic(mIndicators, TRANSPARENT_BACKGROUND_GRAPHIC);
   229     createWidgetBackgroundGraphic(mIndicators, TRANSPARENT_BACKGROUND_GRAPHIC);
   152 
   230 
   153     CX_DEBUG_EXIT_FUNCTION();
   231     mIndicators->setVisible(true);
   154 }
   232 
   155 
   233     CX_DEBUG_EXIT_FUNCTION();
       
   234 }
       
   235 
       
   236 /*!
       
   237  * Loads widgets that are not part of the default section in layouts xml.
       
   238  * Widgets are created at the time they are first loaded.
       
   239  */
   156 void CxuiVideoPrecaptureView::loadWidgets()
   240 void CxuiVideoPrecaptureView::loadWidgets()
   157 {
   241 {
   158     CX_DEBUG_ENTER_FUNCTION();
   242     CX_DEBUG_ENTER_FUNCTION();
   159     CX_DEBUG_ASSERT(mDocumentLoader);
   243     CX_ASSERT_ALWAYS(mDocumentLoader);
   160 
   244 
   161     if (mWidgetsLoaded) {
   245     if (mWidgetsLoaded) {
   162         CX_DEBUG(("Widgets already loaded"));
   246         CX_DEBUG(("Widgets already loaded"));
   163         CX_DEBUG_EXIT_FUNCTION();
   247         CX_DEBUG_EXIT_FUNCTION();
   164         return;
   248         return;
   170     // load the "secondary" widgets
   254     // load the "secondary" widgets
   171     bool ok = false;
   255     bool ok = false;
   172 
   256 
   173     // load widgets section (creates the widgets)
   257     // load widgets section (creates the widgets)
   174     mDocumentLoader->load(VIDEO_1ST_XML, VIDEO_PRE_CAPTURE_WIDGETS_SECTION, &ok);
   258     mDocumentLoader->load(VIDEO_1ST_XML, VIDEO_PRE_CAPTURE_WIDGETS_SECTION, &ok);
   175     Q_ASSERT_X(ok, "camerax ui", "error in xml file parsing");
   259     CX_ASSERT_ALWAYS(ok);
   176     if (CxuiServiceProvider::isCameraEmbedded()) {
   260     if (CxuiServiceProvider::isCameraEmbedded()) {
   177         mDocumentLoader->load(VIDEO_1ST_XML, VIDEO_PRE_CAPTURE_EMBEDDED_SECTION, &ok);
   261         mDocumentLoader->load(VIDEO_1ST_XML, VIDEO_PRE_CAPTURE_EMBEDDED_SECTION, &ok);
   178     } else {
   262     } else {
   179         mDocumentLoader->load(VIDEO_1ST_XML, VIDEO_PRE_CAPTURE_STANDALONE_SECTION, &ok);
   263         mDocumentLoader->load(VIDEO_1ST_XML, VIDEO_PRE_CAPTURE_STANDALONE_SECTION, &ok);
   180     }
   264     }
   181     Q_ASSERT_X(ok, "camerax ui", "error in xml file parsing");
   265     CX_ASSERT_ALWAYS(ok);
   182     // get needed pointers to some of the widgets
   266     // get needed pointers to some of the widgets
   183     widget = mDocumentLoader->findWidget(VIDEO_PRE_CAPTURE_ZOOM_SLIDER);
   267     widget = mDocumentLoader->findWidget(VIDEO_PRE_CAPTURE_ZOOM_SLIDER);
   184     mSlider = qobject_cast<CxuiZoomSlider *> (widget);
   268     mSlider = qobject_cast<CxuiZoomSlider *> (widget);
   185     CX_DEBUG_ASSERT(mSlider);
   269     CX_ASSERT_ALWAYS(mSlider);
   186 
   270 
   187     //Let's add a plus and minus buttons to the slider
   271     //Let's add a plus and minus buttons to the slider
   188     addIncreaseDecreaseButtons(mSlider);
   272     mSlider->addZoomButtons();
   189     createWidgetBackgroundGraphic(mSlider, TRANSPARENT_BACKGROUND_GRAPHIC);
   273     createWidgetBackgroundGraphic(mSlider, TRANSPARENT_BACKGROUND_GRAPHIC);
   190 
   274 
   191     widget = mDocumentLoader->findWidget(VIDEO_PRE_CAPTURE_TOOLBAR);
   275     widget = mDocumentLoader->findWidget(VIDEO_PRE_CAPTURE_TOOLBAR);
   192     mToolBarIdle = qobject_cast<HbToolBar *> (widget);
   276     mToolbarIdle = qobject_cast<HbToolBar *> (widget);
   193     widget = mDocumentLoader->findWidget(VIDEO_PRE_CAPTURE_TOOLBAR_REC);
   277     widget = mDocumentLoader->findWidget(VIDEO_PRE_CAPTURE_TOOLBAR_REC);
   194     mToolBarRec = qobject_cast<HbToolBar *> (widget);
   278     mToolbarRec = qobject_cast<HbToolBar *> (widget);
   195     widget = mDocumentLoader->findWidget(VIDEO_PRE_CAPTURE_TOOLBAR_PAUSED);
   279     widget = mDocumentLoader->findWidget(VIDEO_PRE_CAPTURE_TOOLBAR_PAUSED);
   196     mToolBarPaused = qobject_cast<HbToolBar *> (widget);
   280     mToolbarPaused = qobject_cast<HbToolBar *> (widget);
   197 
   281 
   198     mToolBar = mToolBarIdle;
   282     mToolbar = mToolbarIdle;
   199 
   283 
   200     CX_DEBUG_ASSERT(mToolBarIdle);
   284     CX_ASSERT_ALWAYS(mToolbarIdle);
   201     CX_DEBUG_ASSERT(mToolBarRec);
   285     CX_ASSERT_ALWAYS(mToolbarRec);
   202     CX_DEBUG_ASSERT(mToolBarPaused);
   286     CX_ASSERT_ALWAYS(mToolbarPaused);
   203 
   287 
   204     hideControls();
   288     hideControls();
   205 
   289 
   206     if (CxuiServiceProvider::isCameraEmbedded()) {
   290     if (CxuiServiceProvider::isCameraEmbedded()) {
   207         CX_DEBUG(("EMBEDDED: camera in embedded mode"));
   291         CX_DEBUG(("EMBEDDED: camera in embedded mode"));
   234 
   318 
   235     // Create background graphic for indicator container
   319     // Create background graphic for indicator container
   236     HbWidget *indicatorContainer;
   320     HbWidget *indicatorContainer;
   237     widget = mDocumentLoader->findWidget(VIDEO_PRE_CAPTURE_INDICATOR_CONTAINER_BOTTOM);
   321     widget = mDocumentLoader->findWidget(VIDEO_PRE_CAPTURE_INDICATOR_CONTAINER_BOTTOM);
   238     indicatorContainer = qobject_cast<HbWidget *>(widget);
   322     indicatorContainer = qobject_cast<HbWidget *>(widget);
   239     CX_DEBUG_ASSERT(indicatorContainer);
   323     CX_ASSERT_ALWAYS(indicatorContainer);
   240     createWidgetBackgroundGraphic(indicatorContainer, TRANSPARENT_BACKGROUND_GRAPHIC);
   324     createWidgetBackgroundGraphic(indicatorContainer, TRANSPARENT_BACKGROUND_GRAPHIC);
   241 
   325 
   242     widget = mDocumentLoader->findWidget(VIDEO_PRE_CAPTURE_ELAPSED_TIME_LABEL);
   326     widget = mDocumentLoader->findWidget(VIDEO_PRE_CAPTURE_ELAPSED_TIME_LABEL);
   243     mElapsedTimeText = qobject_cast<HbLabel *> (widget);
   327     mElapsedTimeText = qobject_cast<HbLabel *> (widget);
   244     CX_DEBUG_ASSERT(mElapsedTimeText);
   328     CX_ASSERT_ALWAYS(mElapsedTimeText);
   245 
   329 
   246     widget = mDocumentLoader->findWidget(VIDEO_PRE_CAPTURE_REMAINING_TIME_LABEL);
   330     widget = mDocumentLoader->findWidget(VIDEO_PRE_CAPTURE_REMAINING_TIME_LABEL);
   247     mRemainingTimeText = qobject_cast<HbLabel *> (widget);
   331     mRemainingTimeText = qobject_cast<HbLabel *> (widget);
   248     CX_DEBUG_ASSERT(mRemainingTimeText);
   332     CX_ASSERT_ALWAYS(mRemainingTimeText);
   249 
   333 
   250     widget = mDocumentLoader->findWidget(VIDEO_PRE_CAPTURE_RECORDING_ICON);
   334     widget = mDocumentLoader->findWidget(VIDEO_PRE_CAPTURE_RECORDING_ICON);
   251     mRecordingIcon = qobject_cast<HbLabel *> (widget);
   335     mRecordingIcon = qobject_cast<HbLabel *> (widget);
   252     CX_DEBUG_ASSERT(mRecordingIcon);
   336     CX_ASSERT_ALWAYS(mRecordingIcon);
   253 
   337 
   254     mWidgetsLoaded = true;
   338     mWidgetsLoaded = true;
   255 
   339 
   256     // Initializing recording indicator animation
   340     // Initializing recording indicator animation
   257     mRecordingAnimation = new QPropertyAnimation(mRecordingIcon, "opacity");
   341     mRecordingAnimation = new QPropertyAnimation(mRecordingIcon, "opacity");
   260     mRecordingAnimation->setEndValue(0.2);
   344     mRecordingAnimation->setEndValue(0.2);
   261     mRecordingAnimation->setDuration(CXUI_RECORD_ANIMATION_DURATION);
   345     mRecordingAnimation->setDuration(CXUI_RECORD_ANIMATION_DURATION);
   262     mRecordingAnimation->setLoopCount(-1);
   346     mRecordingAnimation->setLoopCount(-1);
   263     mRecordingAnimation->setEasingCurve(QEasingCurve::OutInQuad);
   347     mRecordingAnimation->setEasingCurve(QEasingCurve::OutInQuad);
   264 
   348 
       
   349 
       
   350     // Update toolbar scene mode icon.
       
   351     QString sceneId;
       
   352     if (mEngine->settings().get(CxeSettingIds::SCENE_ID, sceneId) == CxeError::None) {
       
   353         updateSceneIcon(sceneId);
       
   354     }
       
   355 
   265     // Initialize the video time counters.
   356     // Initialize the video time counters.
   266     updateTimeLabels();
   357     updateTimeLabels();
   267 
   358 
       
   359     // View is ready. Needed for startup performance automated testing.
       
   360     emit viewReady();
       
   361 
       
   362     CX_DEBUG_EXIT_FUNCTION();
       
   363 }
       
   364 
       
   365 /*!
       
   366  * Restore view state from activity.
       
   367  */
       
   368 void CxuiVideoPrecaptureView::restoreActivity(const QString &activityId, const QVariant &data)
       
   369 {
       
   370     Q_UNUSED(activityId);
       
   371     Q_UNUSED(data);
       
   372 
       
   373     CX_DEBUG_ENTER_FUNCTION();
       
   374     // no need to restore any state
       
   375     CX_DEBUG_EXIT_FUNCTION();
       
   376 }
       
   377 
       
   378 /*!
       
   379  * Save view state to activity.
       
   380  */
       
   381 void CxuiVideoPrecaptureView::saveActivity()
       
   382 {
       
   383     CX_DEBUG_ENTER_FUNCTION();
       
   384     QVariantMap data;
       
   385     QVariantHash params;
       
   386     //@todo: add pre-capture icon as screenshot
       
   387     mActivityManager->removeActivity(CxuiActivityIds::VIDEO_PRECAPTURE_ACTIVITY);
       
   388     mActivityManager->addActivity(CxuiActivityIds::VIDEO_PRECAPTURE_ACTIVITY, data, params);
       
   389     CX_DEBUG_EXIT_FUNCTION();
       
   390 }
       
   391 
       
   392 /*!
       
   393  * Clear activity from activity manager.
       
   394  */
       
   395 void CxuiVideoPrecaptureView::clearActivity()
       
   396 {
       
   397     CX_DEBUG_ENTER_FUNCTION();
       
   398     mActivityManager->removeActivity(CxuiActivityIds::VIDEO_PRECAPTURE_ACTIVITY);
   268     CX_DEBUG_EXIT_FUNCTION();
   399     CX_DEBUG_EXIT_FUNCTION();
   269 }
   400 }
   270 
   401 
   271 /*!
   402 /*!
   272 * Initialize settings grid.
   403 * Initialize settings grid.
   276     if(!mSettingsGrid) {
   407     if(!mSettingsGrid) {
   277         HbAction* action(NULL);
   408         HbAction* action(NULL);
   278 
   409 
   279         mSettingsGrid = new HbToolBarExtension;
   410         mSettingsGrid = new HbToolBarExtension;
   280 
   411 
   281         action = mSettingsGrid->addAction(HbIcon("qtg_mono_exposure.svg"), hbTrId("txt_cam_button_exposure_compensation"), this, SLOT(launchSliderSetting()));
   412         action = mSettingsGrid->addAction(HbIcon("qtg_mono_exposure"), hbTrId("txt_cam_button_exposure_compensation"), this, SLOT(launchSliderSetting()));
   282         action->setProperty(PROPERTY_KEY_SETTING_ID, CxeSettingIds::EV_COMPENSATION_VALUE);
   413         action->setProperty(PROPERTY_KEY_SETTING_ID, CxeSettingIds::EV_COMPENSATION_VALUE);
   283         action->setProperty(PROPERTY_KEY_SETTING_GRID, PROPERTY_KEY_TRUE);
   414         action->setProperty(PROPERTY_KEY_SETTING_GRID, PROPERTY_KEY_TRUE);
   284 
   415 
   285         action = mSettingsGrid->addAction(HbIcon("qtg_small_rgb.svg"), hbTrId("txt_cam_button_color_tone"), this, SLOT(launchSetting()));
   416         action = mSettingsGrid->addAction(HbIcon("qtg_small_rgb"), hbTrId("txt_cam_button_color_tone"), this, SLOT(launchSetting()));
   286         action->setProperty(PROPERTY_KEY_SETTING_ID, CxeSettingIds::COLOR_TONE);
   417         action->setProperty(PROPERTY_KEY_SETTING_ID, CxeSettingIds::COLOR_TONE);
   287         action->setProperty(PROPERTY_KEY_SETTING_GRID, PROPERTY_KEY_TRUE);
   418         action->setProperty(PROPERTY_KEY_SETTING_GRID, PROPERTY_KEY_TRUE);
   288 
   419 
   289         action = mSettingsGrid->addAction(HbIcon("qtg_mono_white_balance.svg"), hbTrId("txt_cam_button_white_balance"), this, SLOT(launchSetting()));
   420         action = mSettingsGrid->addAction(HbIcon("qtg_mono_white_balance"), hbTrId("txt_cam_button_white_balance"), this, SLOT(launchSetting()));
   290         action->setProperty(PROPERTY_KEY_SETTING_ID, CxeSettingIds::WHITE_BALANCE);
   421         action->setProperty(PROPERTY_KEY_SETTING_ID, CxeSettingIds::WHITE_BALANCE);
   291         action->setProperty(PROPERTY_KEY_SETTING_GRID, PROPERTY_KEY_TRUE);
   422         action->setProperty(PROPERTY_KEY_SETTING_GRID, PROPERTY_KEY_TRUE);
   292 
   423 
   293         connect(mKeyHandler, SIGNAL(autofocusKeyPressed()), mSettingsGrid, SLOT(close()));
   424         connect(mCaptureKeyHandler, SIGNAL(autofocusKeyPressed()), mSettingsGrid, SLOT(close()));
   294     }
   425     }
       
   426 }
       
   427 
       
   428 /**
       
   429 * Get if postcapture view should be shown or not.
       
   430 * Postcapture view may be shown for a predefined time or
       
   431 * until user dismisses it, or it may be completely disabled.
       
   432 */
       
   433 bool CxuiVideoPrecaptureView::isPostcaptureOn() const
       
   434 {
       
   435     CX_DEBUG_ENTER_FUNCTION();
       
   436     if (CxuiServiceProvider::isCameraEmbedded()) {
       
   437         // always show post capture in embedded mode
       
   438         CX_DEBUG_EXIT_FUNCTION();
       
   439         return true;
       
   440     }
       
   441 
       
   442     // Read the value from settings. Ignoring reading error.
       
   443     // On error (missing settings) default to "postcapture on".
       
   444     int showPostcapture(-1);
       
   445     if(mEngine) {
       
   446         mEngine->settings().get(CxeSettingIds::VIDEO_SHOWCAPTURED, showPostcapture);
       
   447     }
       
   448 
       
   449     CX_DEBUG_EXIT_FUNCTION();
       
   450     return showPostcapture != 0; // 0 == no postcapture
       
   451 }
       
   452 
       
   453 /*!
       
   454 * Update the scene mode icon.
       
   455 * @param sceneId The new scene id.
       
   456 */
       
   457 void CxuiVideoPrecaptureView::updateSceneIcon(const QString& sceneId)
       
   458 {
       
   459     CX_DEBUG_ENTER_FUNCTION();
       
   460 
       
   461     if (mEngine->mode() == Cxe::VideoMode) {
       
   462         CX_DEBUG(("CxuiPrecaptureView - scene: %s", sceneId.toAscii().constData()));
       
   463 
       
   464         // No need to update icon, if widgets are not even loaded yet.
       
   465         // We'll update the icon once the widgets are loaded.
       
   466         if (mWidgetsLoaded) {
       
   467             QString iconObjectName = VIDEO_PRE_CAPTURE_SCENE_MODE_ACTION;
       
   468             QString icon = getSettingItemIcon(CxeSettingIds::VIDEO_SCENE, sceneId);
       
   469 
       
   470             CX_DEBUG(("CxuiVideoPrecaptureView - icon: %s", icon.toAscii().constData()));
       
   471 
       
   472             if (mDocumentLoader) {
       
   473                 QObject *obj = mDocumentLoader->findObject(iconObjectName);
       
   474                 CX_ASSERT_ALWAYS(obj);
       
   475                 qobject_cast<HbAction *>(obj)->setIcon(HbIcon(icon));
       
   476             }
       
   477         } else {
       
   478             CX_DEBUG(("CxuiVideoPrecaptureView - widgets not loaded yet, ignored!"));
       
   479         }
       
   480     }
       
   481     CX_DEBUG_EXIT_FUNCTION();
       
   482 }
       
   483 
       
   484 /*!
       
   485     Update the quality indicator
       
   486 */
       
   487 void CxuiVideoPrecaptureView::updateQualityIcon()
       
   488 {
       
   489     CX_DEBUG_ENTER_FUNCTION();
       
   490 
       
   491     if (mQualityIcon && mEngine) {
       
   492         QString icon = "";
       
   493         int currentValue = -1;
       
   494 
       
   495         mEngine->settings().get(CxeSettingIds::VIDEO_QUALITY, currentValue);
       
   496         icon = getSettingItemIcon(CxeSettingIds::VIDEO_QUALITY, currentValue);
       
   497 
       
   498         mQualityIcon->setIcon(HbIcon(icon));
       
   499     }
       
   500 
       
   501     CX_DEBUG_EXIT_FUNCTION();
   295 }
   502 }
   296 
   503 
   297 void CxuiVideoPrecaptureView::handleSnapshot(CxeError::Id /*error*/)
   504 void CxuiVideoPrecaptureView::handleSnapshot(CxeError::Id /*error*/)
   298 {
   505 {
   299     CX_DEBUG_ENTER_FUNCTION();
   506     CX_DEBUG_ENTER_FUNCTION();
   310 
   517 
   311     if (time) {
   518     if (time) {
   312         mMenu = takeMenu();
   519         mMenu = takeMenu();
   313         mVideoCaptureControl->record();
   520         mVideoCaptureControl->record();
   314     } else {
   521     } else {
   315         launchDiskFullNotification();
   522         emit errorEncountered(CxeError::DiskFull);
   316     }
   523     }
   317 
   524 
   318     CX_DEBUG_EXIT_FUNCTION();
   525     CX_DEBUG_EXIT_FUNCTION();
   319 }
   526 }
   320 
   527 
   333 }
   540 }
   334 
   541 
   335 void CxuiVideoPrecaptureView::stop()
   542 void CxuiVideoPrecaptureView::stop()
   336 {
   543 {
   337     CX_DEBUG_ENTER_FUNCTION();
   544     CX_DEBUG_ENTER_FUNCTION();
   338     if (isPostcaptureOn()) {
   545 
   339         CxeVideoCaptureControl::State state = mVideoCaptureControl->state();
   546     CxeVideoCaptureControl::State state = mVideoCaptureControl->state();
   340         if (state == CxeVideoCaptureControl::Recording ||
   547     if (state == CxeVideoCaptureControl::Recording ||
   341             state == CxeVideoCaptureControl::Paused) {
   548         state == CxeVideoCaptureControl::Paused) {
   342             mVideoCaptureControl->stop();
   549         mVideoCaptureControl->stop();
   343             // Continue in handleVideoStateChanged().
   550         // Continue in handleVideoStateChanged().
   344         }
   551     }
       
   552 
       
   553     CX_DEBUG_EXIT_FUNCTION();
       
   554 }
       
   555 
       
   556 
       
   557 /*!
       
   558 * Allow showing UI controls?
       
   559 */
       
   560 bool CxuiVideoPrecaptureView::allowShowControls() const
       
   561 {
       
   562     bool show(false);
       
   563     if (mEngine) {
       
   564         CxeVideoCaptureControl::State state(mEngine->videoCaptureControl().state());
       
   565 
       
   566         show = (mEngine->isEngineReady()
       
   567              || state == CxeVideoCaptureControl::Recording
       
   568              || state == CxeVideoCaptureControl::Paused);
       
   569     }
       
   570     return show;
       
   571 }
       
   572 
       
   573 /*!
       
   574  * Play feedback when touching view outside of any widget?
       
   575  * If video is paused feedback is off.  Otherwise on.
       
   576  */
       
   577 bool CxuiVideoPrecaptureView::isFeedbackEnabled() const
       
   578 {
       
   579     CxeVideoCaptureControl::State state(mEngine->videoCaptureControl().state());
       
   580     if (state == CxeVideoCaptureControl::Paused) {
       
   581         return false;
   345     } else {
   582     } else {
   346         // no postcapture
   583         return true;
   347         stopAndPrepareNewVideo();
   584     }
   348     }
   585 }
   349 
       
   350 
       
   351     CX_DEBUG_EXIT_FUNCTION();
       
   352 }
       
   353 
       
   354 // CxuiVideoPrecaptureView::stopAndPrepareNewVideo()
       
   355 // A version of stop that doesn't go to post-capture. When
       
   356 // not going to post-capture, we need to prepare new video
       
   357 void CxuiVideoPrecaptureView::stopAndPrepareNewVideo()
       
   358 {
       
   359     CX_DEBUG_ENTER_FUNCTION();
       
   360     mVideoCaptureControl->stop();
       
   361     mElapsedTimer.stop();
       
   362     hideControls();
       
   363 
       
   364     if (mMenu) {
       
   365         setMenu(mMenu);
       
   366         mMenu = NULL;
       
   367     }
       
   368 
       
   369     // prepare new video when old one is ready
       
   370     connect(mVideoCaptureControl, SIGNAL(videoComposed(CxeError::Id, const QString&)),
       
   371             this, SLOT(prepareNewVideo(CxeError::Id)));
       
   372 
       
   373     CX_DEBUG_EXIT_FUNCTION();
       
   374 }
       
   375 
       
   376 
   586 
   377 // CxuiPrecaptureView::showToolbar()
   587 // CxuiPrecaptureView::showToolbar()
   378 // Shows toolbar. Calls the base class implementation if not recording
   588 // Shows toolbar. Calls the base class implementation if not recording
   379 // since toolbar is not shown during recording
   589 // since toolbar is not shown during recording
   380 void CxuiVideoPrecaptureView::showToolbar()
   590 void CxuiVideoPrecaptureView::showToolbar()
   381 {
   591 {
   382     CxeVideoCaptureControl::State state = mVideoCaptureControl->state();
   592     CxeVideoCaptureControl::State state = mVideoCaptureControl->state();
   383     if (state == CxeVideoCaptureControl::Recording) {
   593     if (state == CxeVideoCaptureControl::Recording) {
   384         if (mToolBar != mToolBarRec) {
   594         if (mToolbar != mToolbarRec) {
   385             mToolBar->hide();
   595             mToolbar->hide();
   386             mToolBar = mToolBarRec;
   596             mToolbar = mToolbarRec;
   387         }
   597         }
   388     } else if (state ==CxeVideoCaptureControl::Ready) {
   598     } else if (state ==CxeVideoCaptureControl::Ready) {
   389         if (mToolBar != mToolBarIdle) {
   599         if (mToolbar != mToolbarIdle) {
   390             mToolBar->hide();
   600             mToolbar->hide();
   391             mToolBar = mToolBarIdle;
   601             mToolbar = mToolbarIdle;
   392         }
   602         }
   393     } else if (state == CxeVideoCaptureControl::Paused) {
   603     } else if (state == CxeVideoCaptureControl::Paused) {
   394         if (mToolBar != mToolBarPaused) {
   604         if (mToolbar != mToolbarPaused) {
   395             mToolBar->hide();
   605             mToolbar->hide();
   396             mToolBar = mToolBarPaused;
   606             mToolbar = mToolbarPaused;
   397         }
   607         }
   398     }
   608     }
   399 
   609 
   400     CxuiPrecaptureView::showToolbar();
   610     CxuiPrecaptureView::showToolbar();
   401 }
   611 }
   424 
   634 
   425 
   635 
   426 void CxuiVideoPrecaptureView::goToStill()
   636 void CxuiVideoPrecaptureView::goToStill()
   427 {
   637 {
   428     CX_DEBUG_ENTER_FUNCTION();
   638     CX_DEBUG_ENTER_FUNCTION();
   429     OstTrace0( camerax_performance, DUP1_CXUIVIDEOPRECAPTUREVIEW_GOTOSTILL, "msg: e_CX_GO_TO_STILL_MODE 1" );
   639     OstTrace0( camerax_performance, CXUIVIDEOPRECAPTUREVIEW_GOTOSTILL, "msg: e_CX_GO_TO_STILL_MODE 1" );
   430 
   640 
   431     hideControls();
   641     hideControls();
   432     mEngine->initMode(ImageMode);
   642     mEngine->initMode(ImageMode);
   433     emit changeToPrecaptureView();
   643     emit changeToPrecaptureView();
   434 
   644 
   435     OstTrace0( camerax_performance, DUP2_CXUIVIDEOPRECAPTUREVIEW_GOTOSTILL, "msg: e_CX_GO_TO_STILL_MODE 0" );
       
   436     CX_DEBUG_EXIT_FUNCTION();
   645     CX_DEBUG_EXIT_FUNCTION();
   437 }
   646 }
   438 
   647 
   439 /*!
   648 /*!
   440 * Update the remaining and elapsed time labels.
   649 * Update the remaining and elapsed time labels.
   514 
   723 
   515 bool CxuiVideoPrecaptureView::getElapsedTime()
   724 bool CxuiVideoPrecaptureView::getElapsedTime()
   516 {
   725 {
   517     CX_DEBUG_ENTER_FUNCTION();
   726     CX_DEBUG_ENTER_FUNCTION();
   518 
   727 
   519     TBool status = mVideoCaptureControl->elapsedTime(mTimeElapsed);
   728     bool status = mVideoCaptureControl->elapsedTime(mTimeElapsed);
   520     CX_DEBUG(("Elapsed time: %d", mTimeElapsed));
   729     CX_DEBUG(("Elapsed time: %d", mTimeElapsed));
   521     CX_DEBUG(("status: %d", status));
   730     CX_DEBUG(("status: %d", status));
   522 
   731 
   523     CX_DEBUG_EXIT_FUNCTION();
   732     CX_DEBUG_EXIT_FUNCTION();
   524     return status;
   733     return status;
   569             record();
   778             record();
   570         }
   779         }
   571         break;
   780         break;
   572     case CxeVideoCaptureControl::Recording:
   781     case CxeVideoCaptureControl::Recording:
   573         hideControls();
   782         hideControls();
       
   783         emit stopStandbyTimer();
   574         if (mDocumentLoader){
   784         if (mDocumentLoader){
   575             mDocumentLoader->load(VIDEO_1ST_XML, VIDEO_PRE_CAPTURE_RECORDING);
   785             mDocumentLoader->load(VIDEO_1ST_XML, VIDEO_PRE_CAPTURE_RECORDING);
   576         }
   786         }
   577         mElapsedTimer.start(CXUI_ELAPSED_TIME_TIMEOUT);
   787         mElapsedTimer.start(CXUI_ELAPSED_TIME_TIMEOUT);
   578         disableFeedback();
   788         disableFeedback();
   579         if (mRecordingAnimation && mRecordingIcon) {
   789 
   580             mRecordingAnimation->start();
   790         // commented out the activation of the recording animation because
   581         }
   791         // it is causing issues when using SW rendering
       
   792         //if (mRecordingAnimation && mRecordingIcon) {
       
   793         //  mRecordingAnimation->start();
       
   794         //}
       
   795 
   582         break;
   796         break;
   583     case CxeVideoCaptureControl::Paused:
   797     case CxeVideoCaptureControl::Paused:
   584         mElapsedTimer.stop();
   798         mElapsedTimer.stop();
   585 
       
   586         if (mDocumentLoader){
   799         if (mDocumentLoader){
   587             mDocumentLoader->load(VIDEO_1ST_XML, VIDEO_PRE_CAPTURE_PAUSED);
   800             mDocumentLoader->load(VIDEO_1ST_XML, VIDEO_PRE_CAPTURE_PAUSED);
   588         }
       
   589 
       
   590         if (mRecordingAnimation && mRecordingIcon) {
       
   591             mRecordingAnimation->stop();
       
   592         }
   801         }
   593         showControls();
   802         showControls();
   594         enableFeedback();
   803         enableFeedback();
   595         mPauseTimer.start();
   804         mPauseTimer.start();
   596         break;
   805         break;
   597     case CxeVideoCaptureControl::Stopping:
   806     case CxeVideoCaptureControl::Stopping:
   598         if (mDocumentLoader){
   807         if (mDocumentLoader){
   599             mDocumentLoader->load(VIDEO_1ST_XML, VIDEO_PRE_CAPTURE_PAUSED);
   808             mDocumentLoader->load(VIDEO_1ST_XML, VIDEO_PRE_CAPTURE_PAUSED);
   600         }
   809         }
   601 
   810 
   602         if (mRecordingAnimation && mRecordingIcon) {
   811         // commented out the stopping of the recording animation since the activation
   603             mRecordingAnimation->stop();
   812         // is commented out also couple lines earlier
   604         }
   813         //if (mRecordingAnimation && mRecordingIcon) {
       
   814         //    mRecordingAnimation->stop();
       
   815         //}
       
   816 
   605         enableFeedback();
   817         enableFeedback();
       
   818         emit startStandbyTimer();
       
   819         mElapsedTimer.stop();
       
   820         hideControls();
       
   821 
       
   822         if (mMenu) {
       
   823             setMenu(mMenu);
       
   824             mMenu = NULL;
       
   825         }
   606 
   826 
   607         if (isPostcaptureOn()) {
   827         if (isPostcaptureOn()) {
   608             mElapsedTimer.stop();
       
   609             hideControls();
       
   610 
       
   611             if (mRecordingAnimation && mRecordingIcon) {
       
   612                 mRecordingAnimation->stop();
       
   613                 mRecordingIcon->setOpacity(0);
       
   614             }
       
   615             if (mMenu) {
       
   616                 setMenu(mMenu);
       
   617                 mMenu = NULL;
       
   618             }
       
   619 
       
   620             emit changeToPostcaptureView();
   828             emit changeToPostcaptureView();
   621         }
   829         } else {
       
   830             // post capture off, we need prepare new video
       
   831             // do the prepare when the previous video is ready
       
   832             connect(mVideoCaptureControl, SIGNAL(videoComposed(CxeError::Id, const QString&)),
       
   833                     this, SLOT(prepareNewVideo(CxeError::Id)));
       
   834         }
       
   835         break;
       
   836     case CxeVideoCaptureControl::PlayingStartSound:
       
   837         // don't change anything
   622         break;
   838         break;
   623     default:
   839     default:
   624         // in any other state, just hide the controls
   840         // in any other state, just hide the controls
   625         setRecordingItemsVisibility(false);
   841         setRecordingItemsVisibility(false);
   626         break;
   842         break;
   627     }
       
   628 
       
   629     CX_DEBUG_EXIT_FUNCTION();
       
   630 }
       
   631 
       
   632 void CxuiVideoPrecaptureView::updateOrientation(Qt::Orientation orientation)
       
   633 {
       
   634     CX_DEBUG_ENTER_FUNCTION();
       
   635 
       
   636     hideControls();
       
   637     mMainWindow->setOrientation(orientation);
       
   638 
       
   639     if (mToolBar) {
       
   640         if (orientation == Qt::Horizontal) {
       
   641             mToolBar->setOrientation(Qt::Vertical);
       
   642         } else {
       
   643             mToolBar->setOrientation(Qt::Horizontal);
       
   644         }
       
   645     }
   843     }
   646 
   844 
   647     CX_DEBUG_EXIT_FUNCTION();
   845     CX_DEBUG_EXIT_FUNCTION();
   648 }
   846 }
   649 
   847 
   675     if (!error) {
   873     if (!error) {
   676         mEngine->initMode(Cxe::VideoMode);
   874         mEngine->initMode(Cxe::VideoMode);
   677         disconnect(mVideoCaptureControl, SIGNAL(videoComposed(CxeError::Id, const QString&)),
   875         disconnect(mVideoCaptureControl, SIGNAL(videoComposed(CxeError::Id, const QString&)),
   678                    this, SLOT(prepareNewVideo(CxeError::Id)));
   876                    this, SLOT(prepareNewVideo(CxeError::Id)));
   679     } else {
   877     } else {
   680         emit reportError(error);
   878         emit errorEncountered(error);
   681     }
   879     }
   682 
   880 
   683 }
       
   684 
       
   685 /**
       
   686 * Toggle video light on / off.
       
   687 */
       
   688 void CxuiVideoPrecaptureView::toggleLight()
       
   689 {
       
   690     launchNotSupportedNotification();
       
   691 }
   881 }
   692 
   882 
   693 void CxuiVideoPrecaptureView::handleQuitClicked()
   883 void CxuiVideoPrecaptureView::handleQuitClicked()
   694 {
   884 {
   695     CX_DEBUG_ENTER_FUNCTION();
   885     CX_DEBUG_ENTER_FUNCTION();
   707     QCoreApplication::exit();
   897     QCoreApplication::exit();
   708 
   898 
   709     CX_DEBUG_EXIT_FUNCTION();
   899     CX_DEBUG_EXIT_FUNCTION();
   710 }
   900 }
   711 
   901 
   712 void CxuiVideoPrecaptureView::handleFocusLost()
       
   713 {
       
   714     CX_DEBUG_IN_FUNCTION();
       
   715     // Release camera. Stopping possibly ongoing recording is handled by engine.
       
   716     releaseCamera();
       
   717 }
       
   718 
       
   719 void CxuiVideoPrecaptureView::handleBatteryEmpty()
       
   720 {
       
   721     CX_DEBUG_ENTER_FUNCTION();
       
   722 
       
   723     CxeVideoCaptureControl::State state = mVideoCaptureControl->state();
       
   724     if (state == CxeVideoCaptureControl::Recording){
       
   725         stop(); // delete recording icon
       
   726     }
       
   727     CX_DEBUG_EXIT_FUNCTION();
       
   728 }
       
   729 
       
   730 
       
   731 void CxuiVideoPrecaptureView::launchVideoScenePopup()
   902 void CxuiVideoPrecaptureView::launchVideoScenePopup()
   732 {
   903 {
   733     CX_DEBUG_ENTER_FUNCTION();
   904     CX_DEBUG_ENTER_FUNCTION();
   734     hideControls();
   905     hideControls();
   735     emit showScenesView();
   906     emit showScenesView();
   769             // update the quality indicator on screen
   940             // update the quality indicator on screen
   770             updateQualityIcon();
   941             updateQualityIcon();
   771 
   942 
   772             // update video remaining time counter when video quality is changed
   943             // update video remaining time counter when video quality is changed
   773             updateTimeLabels();
   944             updateTimeLabels();
   774         }
   945         } else if (key == CxeSettingIds::GEOTAGGING) {
   775     }
   946             reloadIndicatorWidgets();
   776 
   947         } else if (key == CxeSettingIds::VIDEO_MUTE_SETTING) {
   777     CX_DEBUG_EXIT_FUNCTION();
   948             reloadIndicatorWidgets();
   778 }
   949         }
       
   950     }
       
   951 
       
   952     CX_DEBUG_EXIT_FUNCTION();
       
   953 }
       
   954 
       
   955 /*!
       
   956 * Handle scene mode change.
       
   957 * @param scene The new active scene mode.
       
   958 */
       
   959 void CxuiVideoPrecaptureView::handleSceneChanged(CxeScene &scene)
       
   960 {
       
   961     CX_DEBUG_ENTER_FUNCTION();
       
   962     // Ignore if not in video mode.
       
   963     if (mEngine->mode() == Cxe::VideoMode) {
       
   964         // Update toolbar scene mode icon.
       
   965         updateSceneIcon(scene[CxeSettingIds::SCENE_ID].toString());
       
   966     }
       
   967 
       
   968     CX_DEBUG_EXIT_FUNCTION();
       
   969 }
       
   970 
       
   971 
   779 
   972 
   780 /*!
   973 /*!
   781     Sets the visibility of recording icon and elapsed time text.
   974     Sets the visibility of recording icon and elapsed time text.
   782     \param visible True if widgets are to be shown, false if not.
   975     \param visible True if widgets are to be shown, false if not.
   783 */
   976 */
   814         }
  1007         }
   815     }
  1008     }
   816     return CxuiPrecaptureView::eventFilter(object, event);
  1009     return CxuiPrecaptureView::eventFilter(object, event);
   817 }
  1010 }
   818 
  1011 
   819 
       
   820 
       
   821 //end of file
  1012 //end of file
       
  1013