import com.nokia.extras 1.1
import QtCamera 1.0
import CameraPlus 1.0
-import QtMobility.systeminfo 1.2
+import QtMobility.systeminfo 1.2 as Qtm
import QtMobility.location 1.2
-// TODO: postcapture
// TODO: flash not ready (battery low or flash not ready message)
// TODO: portrait/landscape
-// TODO: stop viewfinder in settings pages ?
// TODO: grid lines, face tracking
// TODO: select primary/secondary camera.
// TODO: disable debug builds.
// TODO: a way to get buffers to the application
// TODO: fcam like functionality (precise control over capture parameters).
-// TODO: mute video sound
PageStackWindow {
id: root
camera: cam
}
- DeviceInfo {
+ Qtm.DeviceInfo {
id: deviceInfo
}
path: fileNaming.path
}
+ BatteryInfo {
+ id: batteryMonitor
+ active: cam.running
+
+ function check() {
+ if (!checkBattery()) {
+ pageStack.currentPage.batteryLow();
+ }
+ }
+
+ onChargingChanged: {
+ batteryMonitor.check();
+ }
+
+ onCriticalChanged: {
+ batteryMonitor.check();
+ }
+ }
+
function replacePage(file) {
- pageStack.replace(Qt.resolvedUrl(file), {cam: cam}, true);
+ pageStack.replace(Qt.resolvedUrl(file), {cam: cam, dimmer: root.dimmer}, true);
}
function openFile(file) {
- pageStack.push(Qt.resolvedUrl(file), {cam: cam});
+ pageStack.push(Qt.resolvedUrl(file), {cam: cam, dimmer: root.dimmer});
}
function openFileNow(file) {
- pageStack.push(Qt.resolvedUrl(file), {cam: cam}, true);
+ pageStack.push(Qt.resolvedUrl(file), {cam: cam, dimmer: root.dimmer}, true);
+ }
+
+ function checkBattery() {
+ // We are fine if we are connected to the charger:
+ if (batteryMonitor.charging) {
+ return true;
+ }
+
+ // If we have enough battery then we are fine:
+ if (!batteryMonitor.critical) {
+ return true;
+ }
+
+ return false;
}
platformStyle: PageStackWindowStyle {
visible: pageStack.currentPage && pageStack.currentPage.controlsVisible && pageStack.currentPage.focusReticleVisible && cam && cam.autoFocus.canFocus(cam.scene.value);
cafStatus: cam ? cam.autoFocus.cafStatus : -1
status: cam ? cam.autoFocus.status : -1
- }
+ }
/*
onDeviceIdChanged: {
z: -1
Rectangle {
+ property bool dimmed: false
id: camDimmer
z: 1
anchors.fill: parent
- opacity: 0
+ opacity: dimmed ? 1.0 : 0.0
color: "black"
+ Behavior on opacity {
+ PropertyAnimation { duration: 150 }
+ }
}
notifications: Sounds {
value: cam.iso.value
}
+ Binding {
+ target: cam.videoMute
+ property: "enabled"
+ value: settings.videoMuted
+ }
+
TrackerStore {
id: trackerStore
active: cam.running
}
}
}
+
+ Standby {
+ policyLost: pipelineManager.state == "policyLost"
+ show: !pageStack.currentPage || (pageStack.currentPage.standbyVisible && pageStack.currentPage.status == PageStatus.Active && pipelineManager.showStandBy)
+ }
}