tools: CameraToolBarTools {
VideoTorchButton {
camera: cam
+ visible: !overlay.cam.quirks.hasQuirk(Quirks.NoVideoTorch)
}
VideoSceneButton {
- visible: !overlay.recording
+ property bool hide: (overlay.recording && overlay.cam.quirks.hasQuirk(Quirks.NoSceneModeChangeDuringRecording)) || overlay.cam.quirks.hasQuirk(Quirks.NoNightSceneMode)
+ visible: !hide
onClicked: toolBar.push(tools)
}
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);
- if (toolBar.depth() > 1) {
- toolBar.pop()
- }
+ 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()
+ }
}