* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-@IMPORT_QT_QUICK@
+import QtQuick 2.0
import QtCamera 1.0
import CameraPlus 1.0
-import "data.js" as Data
Item {
id: overlay
onReleased: overlay.toggleRecording()
}
- ZoomCaptureCancel {
+ CaptureCancel {
anchors.fill: parent
- zoomCapture: zoomCapture
+ enabled: zoomCapture.zoomPressed
+ onPressed: zoomCapture.zoomPressed = false
}
CaptureButton {
anchors.right: parent.right
anchors.rightMargin: 20
anchors.verticalCenter: parent.verticalCenter
- iconSource: overlay.recording ? "image://theme/icon-m-camera-video-record" : "image://theme/icon-m-camera-video-record"
+ iconSource: overlay.recording ? cameraTheme.captureButtonRecordingIconId : cameraTheme.captureButtonVideoIconId
width: 75
height: 75
opacity: 0.5
expanded: settings.showToolBar
onExpandedChanged: settings.showToolBar = expanded;
- items: [
+ tools: CameraToolBarTools {
VideoTorchButton {
camera: cam
- },
+ visible: !overlay.cam.quirks.hasQuirk(Quirks.NoVideoTorch)
+ }
+
VideoSceneButton {
-// TODO: hide when recording
- onClicked: toolBar.push(items)
- },
+ property bool hide: (overlay.recording && overlay.cam.quirks.hasQuirk(Quirks.NoSceneModeChangeDuringRecording)) || overlay.cam.quirks.hasQuirk(Quirks.NoNightSceneMode)
+ visible: !hide
+ onClicked: toolBar.push(tools)
+ }
+
VideoEvCompButton {
- onClicked: toolBar.push(items)
- },
+ onClicked: toolBar.push(tools)
+ }
+
VideoWhiteBalanceButton {
- onClicked: toolBar.push(items)
- },
+ onClicked: toolBar.push(tools)
+ }
+
VideoColorFilterButton {
- onClicked: toolBar.push(items)
- },
+ onClicked: toolBar.push(tools)
+ }
+
VideoMuteButton {
}
- ]
+ }
}
Rectangle {
Indicator {
id: resolutionIndicator
- source: "image://theme/" + Data.videoIcon(settings.videoResolution)
+ source: cameraTheme.videoIcon(settings.videoAspectRatio,
+ settings.videoResolution, settings.device)
}
Indicator {
id: wbIndicator
- source: visible ? "image://theme/" + Data.wbIcon(settings.videoWhiteBalance) + "-screen" : ""
- visible: settings.videoWhiteBalance != WhiteBalance.Auto
+ source: visible ? cameraTheme.whiteBalanceIcon(settings.videoWhiteBalance) : ""
+ visible: settings.videoWhiteBalance != WhiteBalance.Auto && !toolBar.expanded
}
Indicator {
id: cfIndicator
- source: "image://theme/" + Data.cfIcon(settings.videoColorFilter) + "-screen"
- visible: settings.videoColorFilter != ColorTone.Normal
+ source: visible ? cameraTheme.colorFilterIcon(settings.videoColorFilter) : ""
+ visible: settings.videoColorFilter != ColorTone.Normal && !toolBar.expanded
+ }
+
+ Indicator {
+ id: sceneIndicator
+ visible: settings.videoSceneMode != Scene.Auto && (!toolBar.expanded || overlay.recording)
+ source: visible ? cameraTheme.videoSceneModeIcon(settings.videoSceneMode) : ""
}
Indicator {
id: gpsIndicator
visible: settings.useGps
- source: "image://theme/icon-m-camera-location"
+ source: cameraTheme.gpsIndicatorIcon
PropertyAnimation on opacity {
easing.type: Easing.OutSine
if (duration == 3600) {
overlay.stopRecording()
showError(qsTr("Maximum recording time reached."))
- } else if (!checkDiskSpace()) {
+ } else if (!fileSystem.hasFreeSpace(fileNaming.temporaryVideoPath)) {
page.stopRecording()
showError(qsTr("Not enough space to continue recording."))
}
duration: recordingDuration.duration
}
+ function resetToolBar() {
+ if (toolBar.depth() > 1) {
+ toolBar.pop()
+ }
+ }
+
function doStartRecording() {
if (!overlay.recording) {
return
metaData.setMetaData()
- if (!mountProtector.lock()) {
- showError(qsTr("Failed to lock images directory."))
+ if (!mountProtector.lock(fileNaming.temporaryVideoPath)) {
+ showError(qsTr("Failed to lock temporary videos directory."))
overlay.recording = false
return
}
+ if (!mountProtector.lock(fileNaming.videoPath)) {
+ showError(qsTr("Failed to lock videos directory."))
+ overlay.recording = false
+ mountProtector.unlockAll()
+ return
+ }
+
var file = fileNaming.videoFileName()
var tmpFile = fileNaming.temporaryVideoFileName()
if (!videoMode.startRecording(file, tmpFile)) {
showError(qsTr("Failed to record video. Please restart the camera."))
- mountProtector.unlock()
+ mountProtector.unlockAll()
overlay.recording = false
return
}
trackerStore.storeVideo(file);
+
+ resetToolBar()
}
function startRecording() {
showError(qsTr("Camera cannot record videos in mass storage mode."))
} else if (!checkBattery()) {
showError(qsTr("Not enough battery to record video."))
- } else if (!checkDiskSpace()) {
+ } else if (!fileSystem.hasFreeSpace(fileNaming.videoPath) || !fileSystem.hasFreeSpace(fileNaming.temporaryVideoPath)) {
showError(qsTr("Not enough space to record video."))
} else {
recordingDuration.duration = 0
function stopRecording() {
videoMode.stopRecording(true)
- mountProtector.unlock()
+ mountProtector.unlockAll()
overlay.recording = false
}
}
}
+ function cameraDeviceChanged() {
+ resetToolBar()
+ }
}