Make sure we don't play camera sounds in silent profile
[harmattan/cameraplus] / qml / VideoOverlay.qml
index 382410e..24d44aa 100644 (file)
@@ -104,11 +104,12 @@ Item {
         tools: CameraToolBarTools {
             VideoTorchButton {
                 camera: cam
-                visible: cam.device == 0
+                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)
             }
 
@@ -149,9 +150,8 @@ Item {
 
             Indicator {
                 id: resolutionIndicator
-                property string videoResolution: settings.device == 1 ? settings.secondaryVideoResolution : settings.primaryVideoResolution
-                property string videoRatio: settings.device == 1 ? settings.secondaryVideoAspectRatio : settings.primaryVideoAspectRatio
-                source: cameraTheme.videoIcon(videoRatio, videoResolution, settings.device)
+                source: cameraTheme.videoIcon(settings.videoAspectRatio,
+                    settings.videoResolution, settings.device)
             }
 
             Indicator {
@@ -229,6 +229,12 @@ Item {
         duration: recordingDuration.duration
     }
 
+    function resetToolBar() {
+        if (toolBar.depth() > 1) {
+            toolBar.pop()
+        }
+    }
+
     function doStartRecording() {
         if (!overlay.recording) {
             return
@@ -267,9 +273,7 @@ Item {
 
         trackerStore.storeVideo(file);
 
-        if (toolBar.depth() > 1) {
-            toolBar.pop()
-        }
+        resetToolBar()
     }
 
     function startRecording() {
@@ -319,4 +323,7 @@ Item {
         }
     }
 
+    function cameraDeviceChanged() {
+        resetToolBar()
+    }
 }