4 * This file is part of CameraPlus.
6 * Copyright (C) 2012-2013 Mohammed Sameer <msameer@foolab.org>
8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public
10 * License as published by the Free Software Foundation; either
11 * version 2.1 of the License, or (at your option) any later version.
13 * This library is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Lesser General Public License for more details.
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with this library; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
24 import com.nokia.meego 1.1
27 import "data.js" as Data
32 policyMode: CameraResources.Video
34 controlsVisible: cam.running && !videoMode.recording && videoMode.canCapture && !cameraMode.busy && dimmer.opacity == 0.0 && !previewAnimationRunning
35 orientationLock: PageOrientation.LockLandscape
37 property Item settingsDialog: null
39 function startRecording() {
40 if (!fileSystem.available) {
41 showError(qsTr("Camera cannot record videos in mass storage mode."));
45 if (!checkBattery()) {
46 showError(qsTr("Not enough battery to record video."));
50 if (!checkDiskSpace()) {
51 showError(qsTr("Not enough space to record video."));
55 openFileNow("RecordingPage.qml");
61 onReleased: page.startRecording();
67 zoomCapture: zoomCapture
72 anchors.right: parent.right
73 anchors.rightMargin: 20
74 anchors.verticalCenter: parent.verticalCenter
75 iconSource: "image://theme/icon-m-camera-video-record"
80 onClicked: startRecording();
82 visible: controlsVisible && (!settings.zoomAsShutter && keys.active)
89 page.setPreview(preview);
94 anchors.top: parent.top
96 anchors.left: parent.left
97 anchors.leftMargin: 20
104 visible: controlsVisible
112 id: resolutionIndicator
113 source: "image://theme/" + Data.videoIcon(settings.videoResolution);
118 source: visible ? "image://theme/" + Data.wbIcon(settings.videoWhiteBalance) + "-screen" : ""
119 visible: settings.videoWhiteBalance != WhiteBalance.Auto
124 source: "image://theme/" + Data.cfIcon(settings.videoColorFilter) + "-screen"
125 visible: settings.videoColorFilter != ColorTone.Normal
130 visible: settings.useGps
131 source: "image://theme/icon-m-camera-location"
133 PropertyAnimation on opacity {
134 easing.type: Easing.OutSine
135 loops: Animation.Infinite
139 running: settings.useGps && !positionSource.position.longitudeValid
148 anchors.top: parent.top
149 anchors.right: parent.right
150 anchors.topMargin: 20
151 anchors.rightMargin: 20
156 iconSource: "image://theme/icon-m-camera-roll"
157 onClicked: openFile("PostCapturePage.qml");
158 visible: controlsVisible
163 anchors.bottom: parent.bottom
164 anchors.bottomMargin: 20
165 anchors.left: parent.left
166 anchors.leftMargin: 20
168 targetWidth: parent.width - (anchors.leftMargin * 2) - (66 * 1.5)
169 visible: controlsVisible
170 expanded: settings.showToolBar
171 onExpandedChanged: settings.showToolBar = expanded;
178 onClicked: toolBar.push(items);
181 onClicked: toolBar.push(items);
183 VideoWhiteBalanceButton {
184 onClicked: toolBar.push(items);
186 VideoColorFilterButton {
187 onClicked: toolBar.push(items);
192 iconSource: "image://theme/icon-m-toolbar-view-menu-white"
193 onClicked: openSettings();
198 function openSettings() {
199 if (!settingsDialog) {
200 settingsDialog = videoSettingsDialog.createObject(page);
203 settingsDialog.open();
207 id: videoSettingsDialog
209 VideoSettingsDialog { }