Added a button to enable/disable video torch
[harmattan/cameraplus] / qml / VideoPage.qml
1 // -*- qml -*-
2 import QtQuick 1.1
3 import com.nokia.meego 1.1
4 import QtCamera 1.0
5
6 CameraPage {
7         id: page
8
9         controlsVisible: recording.visible
10
11         orientationLock: PageOrientation.LockLandscape
12
13         Button {
14                 id: recording
15                 anchors.right: parent.right
16                 anchors.rightMargin: 20
17                 anchors.verticalCenter: parent.verticalCenter
18                 iconSource: "/usr/share/themes/blanco/meegotouch/icons/icon-m-camera-video-record.png"
19                 width: 75
20                 height: 75
21                 opacity: 0.5
22                 onClicked: {
23                         if (!videoMode.recording) {
24                                 videoMode.startRecording("/home/developer/foo.mp4");
25                         }
26                         else {
27                                 videoMode.stopRecording();
28                         }
29                 }
30
31                 visible: (videoMode.recording || videoMode.canCapture) && !cameraMode.animationRunning && !previewAnimationRunning
32         }
33
34         VideoMode {
35                 id: videoMode
36                 camera: cam
37                 onPreviewAvailable: page.setPreview(preview);
38         }
39
40         VideoTorchButton {
41                 id: torch
42                 visible: controlsVisible
43                 anchors.top: parent.top
44                 anchors.left: parent.left
45                 anchors.topMargin: 20
46                 anchors.leftMargin: 20
47         }
48
49 }