diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtMultimedia/AudioOutputSpecifics.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtMultimedia/AudioOutputSpecifics.qml new file mode 100644 index 00000000000..ab5860ec02a --- /dev/null +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtMultimedia/AudioOutputSpecifics.qml @@ -0,0 +1,37 @@ +/**************************************************************************** +** +** Copyright (C) 2021 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of Qt Creator. +** +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. +** +****************************************************************************/ + +import QtQuick 2.15 +import QtQuick.Layouts 1.15 +import HelperWidgets 2.0 +import StudioControls 1.0 as StudioControls +import StudioTheme 1.0 as StudioTheme + +Column { + anchors.left: parent.left + anchors.right: parent.right + + AudioSection {} +} diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtMultimedia/AudioSection.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtMultimedia/AudioSection.qml new file mode 100644 index 00000000000..db226e755a9 --- /dev/null +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtMultimedia/AudioSection.qml @@ -0,0 +1,67 @@ +/**************************************************************************** +** +** Copyright (C) 2021 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of Qt Creator. +** +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. +** +****************************************************************************/ + +import QtQuick 2.15 +import QtQuick.Layouts 1.15 +import HelperWidgets 2.0 +import StudioControls 1.0 as StudioControls +import StudioTheme 1.0 as StudioTheme + +Section { + caption: qsTr("Audio") + + anchors.left: parent.left + anchors.right: parent.right + + SectionLayout { + PropertyLabel { text: qsTr("Volume") } + + SecondColumnLayout { + SpinBox { + implicitWidth: StudioTheme.Values.twoControlColumnWidth + + StudioTheme.Values.actionIndicatorWidth + backendValue: backendValues.volume + decimals: 1 + minimumValue: 0.0 + maximumValue: 1.0 + } + + ExpandingSpacer {} + } + + PropertyLabel { text: qsTr("Muted") } + + SecondColumnLayout { + CheckBox { + implicitWidth: StudioTheme.Values.twoControlColumnWidth + + StudioTheme.Values.actionIndicatorWidth + backendValue: backendValues.muted + text: backendValues.muted.valueToString + } + + ExpandingSpacer {} + } + } +} diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtMultimedia/MediaPlayerSection.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtMultimedia/MediaPlayerSection.qml new file mode 100644 index 00000000000..b76a1bd0fb5 --- /dev/null +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtMultimedia/MediaPlayerSection.qml @@ -0,0 +1,56 @@ +/**************************************************************************** +** +** Copyright (C) 2021 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of Qt Creator. +** +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. +** +****************************************************************************/ + +import QtQuick 2.15 +import QtQuick.Layouts 1.15 +import HelperWidgets 2.0 +import StudioControls 1.0 as StudioControls +import StudioTheme 1.0 as StudioTheme + +Section { + caption: qsTr("Media Player") + + anchors.left: parent.left + anchors.right: parent.right + + // TODO position property, what should be the range?! + + SectionLayout { + PropertyLabel { text: qsTr("Playback rate") } + + SecondColumnLayout { + SpinBox { + implicitWidth: StudioTheme.Values.twoControlColumnWidth + + StudioTheme.Values.actionIndicatorWidth + backendValue: backendValues.playbackRate + decimals: 1 + minimumValue: -1000 // TODO correct range + maximumValue: 1000 + } + + ExpandingSpacer {} + } + } +} diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtMultimedia/MediaPlayerSpecifics.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtMultimedia/MediaPlayerSpecifics.qml new file mode 100644 index 00000000000..1a6c41ecf88 --- /dev/null +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtMultimedia/MediaPlayerSpecifics.qml @@ -0,0 +1,37 @@ +/**************************************************************************** +** +** Copyright (C) 2021 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of Qt Creator. +** +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. +** +****************************************************************************/ + +import QtQuick 2.15 +import QtQuick.Layouts 1.15 +import HelperWidgets 2.0 +import StudioControls 1.0 as StudioControls +import StudioTheme 1.0 as StudioTheme + +Column { + anchors.left: parent.left + anchors.right: parent.right + + MediaPlayerSection {} +} diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtMultimedia/VideoSection.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtMultimedia/VideoSection.qml new file mode 100644 index 00000000000..d5a87af559a --- /dev/null +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtMultimedia/VideoSection.qml @@ -0,0 +1,105 @@ +/**************************************************************************** +** +** Copyright (C) 2021 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of Qt Creator. +** +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. +** +****************************************************************************/ + +import QtQuick 2.15 +import QtQuick.Layouts 1.15 +import HelperWidgets 2.0 +import StudioControls 1.0 as StudioControls +import StudioTheme 1.0 as StudioTheme + +Section { + caption: qsTr("Video") + + anchors.left: parent.left + anchors.right: parent.right + + SectionLayout { + PropertyLabel { text: qsTr("Source") } + + SecondColumnLayout { + UrlChooser { + backendValue: backendValues.source + filter: "*.mp4" + } + + ExpandingSpacer {} + } + + PropertyLabel { text: qsTr("Fill mode") } + + SecondColumnLayout { + ComboBox { + implicitWidth: StudioTheme.Values.singleControlColumnWidth + + StudioTheme.Values.actionIndicatorWidth + width: implicitWidth + scope: "VideoOutput" + model: ["Stretch", "PreserveAspectFit", "PreserveAspectCrop"] + backendValue: backendValues.fillMode + } + + ExpandingSpacer {} + } + + PropertyLabel { text: qsTr("Orientation") } + + SecondColumnLayout { + ComboBox { + id: orientationComboBox + implicitWidth: StudioTheme.Values.singleControlColumnWidth + + StudioTheme.Values.actionIndicatorWidth + width: implicitWidth + model: [0, 90, 180, 270, 360] + backendValue: backendValues.orientation + manualMapping: true + + onValueFromBackendChanged: { + if (!orientationComboBox.__isCompleted) + return + + orientationComboBox.syncIndexToBackendValue() + } + onCompressedActivated: { + if (!orientationComboBox.__isCompleted) + return + + if (orientationComboBox.block) + return + + backendValues.orientation.value = orientationComboBox.model[orientationComboBox.currentIndex] + } + Component.onCompleted: orientationComboBox.syncIndexToBackendValue() + + function syncIndexToBackendValue() { + orientationComboBox.block = true + orientationComboBox.currentIndex = orientationComboBox.model.indexOf(backendValues.orientation.value) + orientationComboBox.block = false + } + } + + ExpandingSpacer {} + } + } +} + diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtMultimedia/VideoSpecifics.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtMultimedia/VideoSpecifics.qml new file mode 100644 index 00000000000..45c8cce6290 --- /dev/null +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtMultimedia/VideoSpecifics.qml @@ -0,0 +1,41 @@ +/**************************************************************************** +** +** Copyright (C) 2021 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of Qt Creator. +** +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. +** +****************************************************************************/ + +import QtQuick 2.15 +import QtQuick.Layouts 1.15 +import HelperWidgets 2.0 +import StudioControls 1.0 as StudioControls +import StudioTheme 1.0 as StudioTheme + +Column { + anchors.left: parent.left + anchors.right: parent.right + + MediaPlayerSection {} + + VideoSection {} + + AudioSection {} +} diff --git a/src/plugins/qmldesigner/qtquickplugin/images/audio-16px.png b/src/plugins/qmldesigner/qtquickplugin/images/audio-16px.png new file mode 100644 index 00000000000..d9fd2f57bf4 Binary files /dev/null and b/src/plugins/qmldesigner/qtquickplugin/images/audio-16px.png differ diff --git a/src/plugins/qmldesigner/qtquickplugin/images/audio-24px.png b/src/plugins/qmldesigner/qtquickplugin/images/audio-24px.png new file mode 100644 index 00000000000..9e477c806db Binary files /dev/null and b/src/plugins/qmldesigner/qtquickplugin/images/audio-24px.png differ diff --git a/src/plugins/qmldesigner/qtquickplugin/images/audio-24px@2x.png b/src/plugins/qmldesigner/qtquickplugin/images/audio-24px@2x.png new file mode 100644 index 00000000000..41948718fd1 Binary files /dev/null and b/src/plugins/qmldesigner/qtquickplugin/images/audio-24px@2x.png differ diff --git a/src/plugins/qmldesigner/qtquickplugin/images/audio-output-16px.png b/src/plugins/qmldesigner/qtquickplugin/images/audio-output-16px.png new file mode 100644 index 00000000000..6ae703de646 Binary files /dev/null and b/src/plugins/qmldesigner/qtquickplugin/images/audio-output-16px.png differ diff --git a/src/plugins/qmldesigner/qtquickplugin/images/audio-output-24px.png b/src/plugins/qmldesigner/qtquickplugin/images/audio-output-24px.png new file mode 100644 index 00000000000..f2133ca7167 Binary files /dev/null and b/src/plugins/qmldesigner/qtquickplugin/images/audio-output-24px.png differ diff --git a/src/plugins/qmldesigner/qtquickplugin/images/audio-output-24px@2x.png b/src/plugins/qmldesigner/qtquickplugin/images/audio-output-24px@2x.png new file mode 100644 index 00000000000..9336b81b6e8 Binary files /dev/null and b/src/plugins/qmldesigner/qtquickplugin/images/audio-output-24px@2x.png differ diff --git a/src/plugins/qmldesigner/qtquickplugin/images/media-player-16px.png b/src/plugins/qmldesigner/qtquickplugin/images/media-player-16px.png new file mode 100644 index 00000000000..515287a8462 Binary files /dev/null and b/src/plugins/qmldesigner/qtquickplugin/images/media-player-16px.png differ diff --git a/src/plugins/qmldesigner/qtquickplugin/images/media-player-24px.png b/src/plugins/qmldesigner/qtquickplugin/images/media-player-24px.png new file mode 100644 index 00000000000..1b31ddc8260 Binary files /dev/null and b/src/plugins/qmldesigner/qtquickplugin/images/media-player-24px.png differ diff --git a/src/plugins/qmldesigner/qtquickplugin/images/media-player-24px@2x.png b/src/plugins/qmldesigner/qtquickplugin/images/media-player-24px@2x.png new file mode 100644 index 00000000000..86ae5914aca Binary files /dev/null and b/src/plugins/qmldesigner/qtquickplugin/images/media-player-24px@2x.png differ diff --git a/src/plugins/qmldesigner/qtquickplugin/images/video-16px.png b/src/plugins/qmldesigner/qtquickplugin/images/video-16px.png new file mode 100644 index 00000000000..caf9c16a61d Binary files /dev/null and b/src/plugins/qmldesigner/qtquickplugin/images/video-16px.png differ diff --git a/src/plugins/qmldesigner/qtquickplugin/images/video-24px.png b/src/plugins/qmldesigner/qtquickplugin/images/video-24px.png new file mode 100644 index 00000000000..df1b84e5c99 Binary files /dev/null and b/src/plugins/qmldesigner/qtquickplugin/images/video-24px.png differ diff --git a/src/plugins/qmldesigner/qtquickplugin/images/video-24px@2x.png b/src/plugins/qmldesigner/qtquickplugin/images/video-24px@2x.png new file mode 100644 index 00000000000..4b9f31faf39 Binary files /dev/null and b/src/plugins/qmldesigner/qtquickplugin/images/video-24px@2x.png differ diff --git a/src/plugins/qmldesigner/qtquickplugin/images/video-output-16px.png b/src/plugins/qmldesigner/qtquickplugin/images/video-output-16px.png new file mode 100644 index 00000000000..f00afc52e97 Binary files /dev/null and b/src/plugins/qmldesigner/qtquickplugin/images/video-output-16px.png differ diff --git a/src/plugins/qmldesigner/qtquickplugin/images/video-output-24px.png b/src/plugins/qmldesigner/qtquickplugin/images/video-output-24px.png new file mode 100644 index 00000000000..fd3c89c0817 Binary files /dev/null and b/src/plugins/qmldesigner/qtquickplugin/images/video-output-24px.png differ diff --git a/src/plugins/qmldesigner/qtquickplugin/images/video-output-24px@2x.png b/src/plugins/qmldesigner/qtquickplugin/images/video-output-24px@2x.png new file mode 100644 index 00000000000..0f651a1013f Binary files /dev/null and b/src/plugins/qmldesigner/qtquickplugin/images/video-output-24px@2x.png differ diff --git a/src/plugins/qmldesigner/qtquickplugin/qtquickplugin.qrc b/src/plugins/qmldesigner/qtquickplugin/qtquickplugin.qrc index 21189d1dce3..af2ff0ff415 100644 --- a/src/plugins/qmldesigner/qtquickplugin/qtquickplugin.qrc +++ b/src/plugins/qmldesigner/qtquickplugin/qtquickplugin.qrc @@ -31,6 +31,7 @@ images/text-edit-icon16.png images/text-input-icon16.png images/webview-icon16.png + source/audio.qml source/listview.qml source/listviewv2.qml source/gridview.qml @@ -83,5 +84,20 @@ images/loader-icon.png images/loader-icon@2x.png images/loader-icon16.png + images/audio-16px.png + images/audio-24px.png + images/audio-24px@2x.png + images/audio-output-16px.png + images/audio-output-24px.png + images/audio-output-24px@2x.png + images/media-player-16px.png + images/media-player-24px.png + images/media-player-24px@2x.png + images/video-16px.png + images/video-24px.png + images/video-24px@2x.png + images/video-output-16px.png + images/video-output-24px.png + images/video-output-24px@2x.png diff --git a/src/plugins/qmldesigner/qtquickplugin/quick.metainfo b/src/plugins/qmldesigner/qtquickplugin/quick.metainfo index 5ad17c372e2..7858ca08ea1 100644 --- a/src/plugins/qmldesigner/qtquickplugin/quick.metainfo +++ b/src/plugins/qmldesigner/qtquickplugin/quick.metainfo @@ -501,4 +501,89 @@ MetaInfo { version: "2.0" } } + + Type { + name: "QtMultimedia.MediaPlayer" + icon: ":/qtquickplugin/images/media-player-16px.png" + + Hints { + visibleInNavigator: true + canBeDroppedInNavigator: true + canBeDroppedInFormEditor: false + canBeContainer: false + } + + ItemLibraryEntry { + name: "Media Player" + category: "f.Qt Quick - Multimedia" + libraryIcon: ":/qtquickplugin/images/media-player-24px.png" + version: "6.0" + requiredImport: "QtMultimedia" + } + } + + Type { + name: "QtMultimedia.MediaPlayer" + icon: ":/qtquickplugin/images/audio-16px.png" + + Hints { + visibleInNavigator: true + canBeDroppedInNavigator: true + canBeDroppedInFormEditor: false + canBeContainer: false + } + + ItemLibraryEntry { + name: "Audio" + category: "f.Qt Quick - Multimedia" + libraryIcon: ":/qtquickplugin/images/audio-24px.png" + version: "6.0" + requiredImport: "QtMultimedia" + + QmlSource { source: ":/qtquickplugin/source/audio.qml" } + } + } + + Type { + name: "QtMultimedia.AudioOutput" + icon: ":/qtquickplugin/images/audio-output-16px.png" + + Hints { + visibleInNavigator: true + canBeDroppedInNavigator: true + canBeDroppedInFormEditor: false + canBeContainer: false + } + + ItemLibraryEntry { + name: "Audio Output" + category: "f.Qt Quick - Multimedia" + libraryIcon: ":/qtquickplugin/images/audio-output-24px.png" + version: "6.0" + requiredImport: "QtMultimedia" + } + } + + Type { + name: "QtMultimedia.Video" + icon: ":/qtquickplugin/images/video-16px.png" + + Hints { + visibleInNavigator: true + canBeDroppedInNavigator: true + canBeDroppedInFormEditor: true + canBeContainer: false + } + + ItemLibraryEntry { + name: "Video" + category: "f.Qt Quick - Multimedia" + libraryIcon: ":/qtquickplugin/images/video-24px.png" + version: "6.0" + requiredImport: "QtMultimedia" + + Property { name: "width"; type: "int"; value: 200; } + Property { name: "height"; type: "int"; value: 200; } + } + } } diff --git a/src/plugins/qmldesigner/qtquickplugin/source/audio.qml b/src/plugins/qmldesigner/qtquickplugin/source/audio.qml new file mode 100644 index 00000000000..b3d1347e85e --- /dev/null +++ b/src/plugins/qmldesigner/qtquickplugin/source/audio.qml @@ -0,0 +1,35 @@ +/**************************************************************************** +** +** Copyright (C) 2021 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of Qt Creator. +** +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. +** +****************************************************************************/ + +import QtQuick 2.0 +import QtMultimedia 6.0 + +MediaPlayer { + audioOutput: output + + AudioOutput { + id: output + } +}