3 import com.nokia.meego 1.1
4 import com.nokia.extras 1.1
7 import QtMobility.systeminfo 1.2
8 import QtMobility.location 1.2
10 // TODO: resolutions and aspect ratios
12 // TODO: battery low state
14 // TODO: flash not ready
15 // TODO: focus, caf, ...
17 // TODO: portrait/landscape
18 // TODO: record video in a hidden directory and then copy the video to avoid tracker indexing it.
19 // TODO: stop viewfinder in settings pages ?
20 // TODO: prevent going to mass storage while recording and capturing
22 // TODO: grid lines, face tracking, ambr
23 // TODO: complete settings pages
24 // TODO: stop camera properly when we get closed.
25 // TODO: select primary/secondary camera.
26 // TODO: disable debug builds.
27 // TODO: a way to get buffers to the application
28 // TODO: fcam like functionality (precise control over capture parameters).
33 property alias dimmer: camDimmer
37 Component.onCompleted: {
38 theme.inverted = true;
39 if (settings.mode == 0) {
40 openFile("ImagePage.qml");
43 openFile("VideoPage.qml");
47 function showError(msg) {
54 active: cam.running && settings.useGps
55 onPositionChanged: geocode.search(position.coordinate.longitude, position.coordinate.latitude);
61 manufacturer: deviceInfo.manufacturer
62 model: deviceInfo.model
63 country: geocode.country
65 suburb: geocode.suburb
66 longitude: positionSource.position.coordinate.longitude
67 longitudeValid: positionSource.position.longitudeValid && settings.useGps
68 latitude: positionSource.position.coordinate.latitude
69 latitudeValid: positionSource.position.latitudeValid && settings.useGps
70 elevation: positionSource.position.coordinate.altitude
71 elevationValid: positionSource.position.altitudeValid && settings.useGps
72 orientation: orientation.orientation
73 artist: settings.creatorName
74 captureDirection: compass.direction
75 captureDirectionValid: compass.directionValid
76 horizontalError: positionSource.position.horizontalAccuracy
77 horizontalErrorValid: positionSource.position.horizontalAccuracyValid && settings.useGps
93 active: cam.running && settings.useGps && settings.useGeotags
99 if (resourcePolicy.acquired) {
103 // TODO: We need a way to force a stop.
126 imageSuffix: cam.imageSuffix
127 videoSuffix: cam.videoSuffix
130 // Stolen from https://qt.gitorious.org/qt-components/qt-components/blobs/master/examples/meego/QmlComponentGallery/qml/ListPage.qml
131 function replacePage(file) {
132 var component = Qt.createComponent(file)
134 if (component.status == Component.Ready) {
135 pageStack.replace(component, {cam: cam}, true);
138 console.log("Error loading component:", component.errorString());
142 function openFile(file) {
143 var component = Qt.createComponent(file)
145 if (component.status == Component.Ready) {
146 pageStack.push(component, {cam: cam});
149 console.log("Error loading component:", component.errorString());
153 platformStyle: PageStackWindowStyle {
161 // TODO: is this needed ?
162 if (platformWindow.active) {
171 console.log("Camera error (" + code + "): " + message + " " + debug);
172 showError(qsTr("Camera error. Please restart the application."));
176 // TODO: hardcoding device id
177 Component.onCompleted: { cam.deviceId = 0; mode = settings.mode; }
194 value: ready ? camera.mode == Camera.VideoMode ? settings.videoSceneMode : settings.imageSceneMode : 0
198 id: colorToneController
200 value: ready ? camera.mode == Camera.VideoMode ? settings.videoColorFilter : settings.imageColorFilter : 0
204 id: whiteBalanceController
206 value: ready ? camera.mode == Camera.VideoMode ? settings.videoWhiteBalance : settings.imageWhiteBalance : 0
218 if (cam.mode == Camera.VideoMode) {
219 replacePage("VideoPage.qml");
222 replacePage("ImagePage.qml");