4 * This file is part of CameraPlus.
6 * Copyright (C) 2012 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
29 // TODO: video recording indicators.
30 // TODO: stop recording when battery low
31 // TODO: stop recording when disk is low
35 policyMode: CameraResources.Video
37 controlsVisible: videoControlsVisible && !videoMode.recording
38 property bool videoControlsVisible: recording.visible && cam.running && !standbyWidget.visible
40 orientationLock: PageOrientation.LockLandscape
43 inhibitDim: videoMode.recording
48 anchors.right: parent.right
49 anchors.rightMargin: 20
50 anchors.verticalCenter: parent.verticalCenter
51 iconSource: "image://theme/icon-m-camera-video-record"
57 if (!fileSystem.available) {
58 showError(qsTr("Camera cannot record videos in mass storage mode."));
62 // We only toggle the mode to video recording so
63 // policy can acquire the needed resources
65 if (policyMode == CameraResources.Video) {
66 policyMode = CameraResources.Recording;
68 else if (videoMode.recording) {
69 // We just ask to stop video.
70 videoMode.stopRecording();
77 if (!videoMode.recording) {
78 policyMode = CameraResources.Video;
84 target: resourcePolicy
86 if (resourcePolicy.acquired && policyMode == CameraResources.Recording) {
87 metaData.setMetaData();
88 if (!videoMode.startRecording(fileNaming.videoFileName())) {
89 showError(qsTr("Failed to record video. Please restart the camera."));
90 policyMode = CameraResources.Video
96 visible: (videoMode.recording || videoMode.canCapture) && !cameraMode.animationRunning && !previewAnimationRunning && !standbyWidget.visible
100 target: Qt.application
102 if (!Qt.application.active && videoMode.recording) {
103 videoMode.stopRecording();
111 onPreviewAvailable: {
112 if (!standbyWidget.visible) {
113 page.setPreview(preview);
120 visible: videoControlsVisible
121 anchors.top: parent.top
122 anchors.left: parent.left
123 anchors.topMargin: 20
124 anchors.leftMargin: 20
130 visible: controlsVisible
131 anchors.top: torch.bottom
132 anchors.left: parent.left
133 anchors.topMargin: 10
134 anchors.leftMargin: 20
139 visible: videoControlsVisible
140 anchors.top: scene.bottom
141 anchors.left: parent.left
142 anchors.topMargin: 10
143 anchors.leftMargin: 20
148 anchors.bottom: parent.bottom
149 anchors.bottomMargin: 20
150 anchors.left: parent.left
151 anchors.leftMargin: 20
154 onClicked: openFile("VideoSettingsPage.qml");
155 visible: controlsVisible
161 source: indicators.pressed ? "image://theme/meegotouch-camera-settings-indicators-background-pressed" : "image://theme/meegotouch-camera-settings-indicators-background"
170 id: resolutionIndicator
176 source: "image://theme/" + Data.wbIcon(settings.videoWhiteBalance) + "-screen"
177 visible: settings.videoWhiteBalance != WhiteBalance.Auto
182 source: "image://theme/" + Data.cfIcon(settings.videoColorFilter) + "-screen"
183 visible: settings.videoColorFilter != ColorTone.Normal
188 visible: settings.useGps
189 source: "image://theme/icon-m-camera-location"
191 PropertyAnimation on opacity {
192 easing.type: Easing.OutSine
193 loops: Animation.Infinite
197 running: settings.useGps && !positionSource.position.longitudeValid
206 anchors.top: parent.top
207 anchors.right: parent.right
208 anchors.topMargin: 20
209 anchors.rightMargin: 20
214 iconSource: "image://theme/icon-m-camera-roll"
215 onClicked: openFile("PostCapturePage.qml");
216 visible: controlsVisible && !videoMode.recording