- onVideoResolutionChanged: {
- videoSettings.setVideoResolution();
- }
- }
-
- Camera {
- id: cam
- anchors.fill: parent
-
- onRoiChanged: roi.normalize = false;
-
- GridLines {
- x: cam.renderArea.x
- y: cam.renderArea.y
- width: cam.renderArea.width
- height: cam.renderArea.height
- visible: settings.gridEnabled
- }
-
- FocusReticle {
- id: focusReticle
- cam: cam
- 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
- }
-
- onError: {
- if (pipelineManager.error) {
- // Ignore any subsequent errors.
- // Killing pulseaudio while recording will lead to an
- // infinite supply of errors which will break the UI
- // if we show a banner for each.
- return;
- }
-
- pipelineManager.error = true;
- pageStack.currentPage.cameraError();
- console.log("Camera error (" + code + "): " + message + " " + debug);
- showError(qsTr("Camera error. Please restart the application."));
-
- // We cannot stop camera here. Seems there is a race condition somewhere
- // which leads to a freeze if we do so.
- }
-
- onRunningChanged: {
- if (!cam.running) {
- mountProtector.unlock();
- }
- }
-
- Component.onDestruction: cam.stop();
-
- // We need to show viewfinder below pages.
- z: -1
-
- Rectangle {
- property bool dimmed: false
- id: camDimmer
- z: 1
- anchors.fill: parent
- opacity: dimmed ? 1.0 : 0.0
- color: "black"
- Behavior on opacity {
- PropertyAnimation { duration: 150 }
- }
- }
-
- notifications: Sounds {
- id: sounds
- mute: !settings.soundEnabled
- }
-
- }
-
- Binding {
- target: cam.flash
- property: "value"
- when: cam.mode == Camera.ImageMode
- value: settings.imageFlashMode
- }
-
- Binding {
- target: settings
- property: "imageFlashMode"
- when: cam.mode == Camera.ImageMode
- value: cam.flash.value
- }
-
- Binding {
- target: cam.scene
- property: "value"
- when: cam.mode == Camera.VideoMode
- value: settings.videoSceneMode
- }
-
- Binding {
- target: cam.scene
- property: "value"
- when: cam.mode == Camera.ImageMode
- value: settings.imageSceneMode
- }
-
- Binding {
- target: cam.evComp
- property: "value"
- when: cam.mode == Camera.ImageMode
- value: settings.imageEvComp
- }
-
- Binding {
- target: cam.evComp
- property: "value"
- when: cam.mode == Camera.VideoMode
- value: settings.videoEvComp
- }
-
- Binding {
- target: settings
- property: "imageEvComp"
- when: cam.mode == Camera.ImageMode
- value: cam.evComp.value
- }
-
- Binding {
- target: settings
- property: "videoEvComp"
- when: cam.mode == Camera.VideoMode
- value: cam.evComp.value
- }
-
- Binding {
- target: cam.whiteBalance
- property: "value"
- when: cam.mode == Camera.ImageMode
- value: settings.imageWhiteBalance
- }
-
- Binding {
- target: cam.whiteBalance
- property: "value"
- when: cam.mode == Camera.VideoMode
- value: settings.videoWhiteBalance
- }
-
- Binding {
- target: cam.colorTone
- property: "value"
- when: cam.mode == Camera.ImageMode
- value: settings.imageColorFilter
- }
-
- Binding {
- target: cam.colorTone
- property: "value"
- when: cam.mode == Camera.VideoMode
- value: settings.videoColorFilter
- }
-
- Binding {
- target: cam.iso
- property: "value"
- when: cam.mode == Camera.ImageMode
- value: settings.imageIso
- }
-
- Binding {
- target: settings
- property: "imageIso"
- when: cam.mode == Camera.ImageMode
- value: cam.iso.value
- }
-
- Binding {
- target: cam.videoMute
- property: "enabled"
- value: settings.videoMuted
- }
-
- Binding {
- target: cam.roi
- property: "enabled"
- value: settings.faceDetectionEnabled && !focusReticle.pressed && !focusReticle.touchMode && cam.mode == Camera.ImageMode
- }
-
-
- TrackerStore {
- id: trackerStore
- active: cam.running
- manufacturer: deviceInfo.manufacturer
- model: deviceInfo.model