Warning, /maui/booth/src/widgets/VideoCaptureControls.qml is written in an unsupported language. File is not indexed.

0001 /****************************************************************************
0002 **
0003 ** Copyright (C) 2017 The Qt Company Ltd.
0004 ** Contact: https://www.qt.io/licensing/
0005 **
0006 ** This file is part of the examples of the Qt Toolkit.
0007 **
0008 ** $QT_BEGIN_LICENSE:BSD$
0009 ** Commercial License Usage
0010 ** Licensees holding valid commercial Qt licenses may use this file in
0011 ** accordance with the commercial license agreement provided with the
0012 ** Software or, alternatively, in accordance with the terms contained in
0013 ** a written agreement between you and The Qt Company. For licensing terms
0014 ** and conditions see https://www.qt.io/terms-conditions. For further
0015 ** information use the contact form at https://www.qt.io/contact-us.
0016 **
0017 ** BSD License Usage
0018 ** Alternatively, you may use this file under the terms of the BSD license
0019 ** as follows:
0020 **
0021 ** "Redistribution and use in source and binary forms, with or without
0022 ** modification, are permitted provided that the following conditions are
0023 ** met:
0024 **   * Redistributions of source code must retain the above copyright
0025 **     notice, this list of conditions and the following disclaimer.
0026 **   * Redistributions in binary form must reproduce the above copyright
0027 **     notice, this list of conditions and the following disclaimer in
0028 **     the documentation and/or other materials provided with the
0029 **     distribution.
0030 **   * Neither the name of The Qt Company Ltd nor the names of its
0031 **     contributors may be used to endorse or promote products derived
0032 **     from this software without specific prior written permission.
0033 **
0034 **
0035 ** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
0036 ** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
0037 ** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
0038 ** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
0039 ** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
0040 ** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
0041 ** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
0042 ** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
0043 ** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
0044 ** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
0045 ** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
0046 **
0047 ** $QT_END_LICENSE$
0048 **
0049 ****************************************************************************/
0050 
0051 import QtQuick 2.0
0052 import QtMultimedia 5.4
0053 
0054 FocusScope {
0055     property Camera camera
0056     property bool previewAvailable : false
0057 
0058     property int buttonsPanelWidth: buttonPaneShadow.width
0059 
0060     signal previewSelected
0061     signal photoModeSelected
0062     id : captureControls
0063 
0064     Rectangle {
0065         id: buttonPaneShadow
0066         width: bottomColumn.width + 16
0067         height: parent.height
0068         anchors.top: parent.top
0069         anchors.right: parent.right
0070         color: Qt.rgba(0.08, 0.08, 0.08, 1)
0071 
0072         Column {
0073             anchors {
0074                 right: parent.right
0075                 top: parent.top
0076                 margins: 8
0077             }
0078 
0079             id: buttonsColumn
0080             spacing: 8
0081 
0082             FocusButton {
0083                 camera: captureControls.camera
0084                 visible: camera.cameraStatus == Camera.ActiveStatus && camera.focus.isFocusModeSupported(Camera.FocusAuto)
0085             }
0086 
0087             CameraButton {
0088                 id: stopButton
0089                 text: i18n("Stop")
0090                 visible: camera.videoRecorder.recorderStatus == CameraRecorder.RecordingStatus
0091                 onClicked: camera.videoRecorder.stop()
0092             }
0093 
0094             CameraButton {
0095                 text: i18n("View")
0096                 onClicked: captureControls.previewSelected()
0097                 //don't show View button during recording
0098                 visible: camera.videoRecorder.actualLocation && !stopButton.visible
0099             }
0100         }
0101 
0102         Column {
0103             anchors {
0104                 bottom: parent.bottom
0105                 right: parent.right
0106                 margins: 8
0107             }
0108 
0109             id: bottomColumn
0110             spacing: 8
0111 
0112             CameraListButton {
0113                 model: QtMultimedia.availableCameras
0114                 onValueChanged: captureControls.camera.deviceId = value
0115             }
0116 
0117             CameraButton {
0118                 text: i18n("Switch to Photo")
0119                 onClicked: captureControls.photoModeSelected()
0120             }
0121 
0122             CameraButton {
0123                 id: quitButton
0124                 text: i18n("Quit")
0125                 onClicked: Qt.quit()
0126             }
0127         }
0128     }
0129 
0130 
0131     ZoomControl {
0132         x : 0
0133         y : 0
0134         width : 100
0135         height: parent.height
0136 
0137         currentZoom: camera.digitalZoom
0138         maximumZoom: Math.min(4.0, camera.maximumDigitalZoom)
0139         onZoomTo: camera.setDigitalZoom(value)
0140     }
0141 }