From cc12446728d00161116d6e1823e161440415d2d5 Mon Sep 17 00:00:00 2001 From: Yoann Lopes Date: Fri, 8 Jul 2016 15:22:16 +0200 Subject: Improve audio volume documentation Added information about volume scales. Change-Id: Ica8367396147e3e1c814b3575faa5cf0503be031 Reviewed-by: Venugopal Shivashankar Reviewed-by: Christian Stromme --- src/imports/multimedia/Video.qml | 12 +++++++++++- src/imports/multimedia/qdeclarativeaudio.cpp | 24 ++++++++++++++++++++---- 2 files changed, 31 insertions(+), 5 deletions(-) (limited to 'src/imports/multimedia') diff --git a/src/imports/multimedia/Video.qml b/src/imports/multimedia/Video.qml index 2188d17b9..b3fee7495 100644 --- a/src/imports/multimedia/Video.qml +++ b/src/imports/multimedia/Video.qml @@ -360,7 +360,17 @@ Item { /*! \qmlproperty real Video::volume - This property holds the volume of the audio output, from 0.0 (silent) to 1.0 (maximum volume). + This property holds the audio volume. + + The volume is scaled linearly from \c 0.0 (silence) to \c 1.0 (full volume). Values outside + this range will be clamped. + + The default volume is \c 1.0. + + UI volume controls should usually be scaled nonlinearly. For example, using a logarithmic + scale will produce linear changes in perceived loudness, which is what a user would normally + expect from a volume control. See \l {QtMultimedia::QtMultimedia::convertVolume()}{QtMultimedia.convertVolume()} + for more details. */ property alias volume: player.volume diff --git a/src/imports/multimedia/qdeclarativeaudio.cpp b/src/imports/multimedia/qdeclarativeaudio.cpp index 86f8f30ba..5a065072c 100644 --- a/src/imports/multimedia/qdeclarativeaudio.cpp +++ b/src/imports/multimedia/qdeclarativeaudio.cpp @@ -689,9 +689,17 @@ QDeclarativeAudio::PlaybackState QDeclarativeAudio::playbackState() const /*! \qmlproperty real QtMultimedia::Audio::volume - This property holds the volume of the audio output, from 0.0 (silent) to 1.0 (maximum volume). + This property holds the audio volume. - Defaults to 1.0. + The volume is scaled linearly from \c 0.0 (silence) to \c 1.0 (full volume). Values outside this + range will be clamped. + + The default volume is \c 1.0. + + UI volume controls should usually be scaled nonlinearly. For example, using a logarithmic scale + will produce linear changes in perceived loudness, which is what a user would normally expect + from a volume control. See \l {QtMultimedia::QtMultimedia::convertVolume()}{QtMultimedia.convertVolume()} + for more details. */ /*! @@ -1310,9 +1318,17 @@ void QDeclarativeAudio::_q_mediaChanged(const QMediaContent &media) /*! \qmlproperty real QtMultimedia::MediaPlayer::volume - This property holds the volume of the audio output, from 0.0 (silent) to 1.0 (maximum volume). + This property holds the audio volume of the media player. - Defaults to 1.0. + The volume is scaled linearly from \c 0.0 (silence) to \c 1.0 (full volume). Values outside this + range will be clamped. + + The default volume is \c 1.0. + + UI volume controls should usually be scaled nonlinearly. For example, using a logarithmic scale + will produce linear changes in perceived loudness, which is what a user would normally expect + from a volume control. See \l {QtMultimedia::QtMultimedia::convertVolume()}{QtMultimedia.convertVolume()} + for more details. */ /*! -- cgit v1.2.3 From 29232a2bc207fb7dc44532f64bbe35d9181340c6 Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Fri, 26 Aug 2016 11:58:48 +0200 Subject: Improve robustness of QML plugin loading Use a variable that expands to the latest plugin version instead of hard-coding the string. Change-Id: I3bdbee161e4a3b59127dc4f00a0c9ce9386b67c2 Reviewed-by: Yoann Lopes --- src/imports/multimedia/multimedia.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/imports/multimedia') diff --git a/src/imports/multimedia/multimedia.cpp b/src/imports/multimedia/multimedia.cpp index 872b2ae61..2a5e8cd2c 100644 --- a/src/imports/multimedia/multimedia.cpp +++ b/src/imports/multimedia/multimedia.cpp @@ -81,7 +81,7 @@ static QObject *multimedia_global_object(QQmlEngine *qmlEngine, QJSEngine *jsEng class QMultimediaDeclarativeModule : public QQmlExtensionPlugin { Q_OBJECT - Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface/1.0") + Q_PLUGIN_METADATA(IID QQmlExtensionInterface_iid) public: QMultimediaDeclarativeModule(QObject *parent = 0) : QQmlExtensionPlugin(parent) { initResources(); } -- cgit v1.2.3 From a8fe4b989b2002d3fcb4e33afe16bd6fd2ff192b Mon Sep 17 00:00:00 2001 From: Jochen Seemann Date: Wed, 31 Aug 2016 21:15:50 +0200 Subject: fix documentation for QML Playlist Some signals for QDeclarativePlaylist were wrongly tagged to QDeclarativeAudio. Task-number: QTBUG-55007 Change-Id: I16185f74768b45115f19c049ec1261d1d3dadf5c Reviewed-by: Yoann Lopes --- src/imports/multimedia/qdeclarativeplaylist.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src/imports/multimedia') diff --git a/src/imports/multimedia/qdeclarativeplaylist.cpp b/src/imports/multimedia/qdeclarativeplaylist.cpp index bb785aa98..19413dec8 100644 --- a/src/imports/multimedia/qdeclarativeplaylist.cpp +++ b/src/imports/multimedia/qdeclarativeplaylist.cpp @@ -517,7 +517,7 @@ void QDeclarativePlaylist::componentComplete() } /*! - \qmlsignal QtMultimedia::Audio::itemAboutToBeInserted(start, end) + \qmlsignal QtMultimedia::Playlist::itemAboutToBeInserted(start, end) This signal is emitted when items are to be inserted into the playlist at \a start and ending at \a end. @@ -526,7 +526,7 @@ void QDeclarativePlaylist::componentComplete() */ /*! - \qmlsignal QtMultimedia::Audio::itemInserted(start, end) + \qmlsignal QtMultimedia::Playlist::itemInserted(start, end) This signal is emitted after items have been inserted into the playlist. The new items are those between \a start and \a end inclusive. @@ -535,7 +535,7 @@ void QDeclarativePlaylist::componentComplete() */ /*! - \qmlsignal QtMultimedia::Audio::itemAboutToBeRemoved(start, end) + \qmlsignal QtMultimedia::Playlist::itemAboutToBeRemoved(start, end) This signal emitted when items are to be deleted from the playlist at \a start and ending at \a end. @@ -544,7 +544,7 @@ void QDeclarativePlaylist::componentComplete() */ /*! - \qmlsignal QtMultimedia::Audio::itemRemoved(start, end) + \qmlsignal QtMultimedia::Playlist::itemRemoved(start, end) This signal is emitted after items have been removed from the playlist. The removed items are those between \a start and \a end inclusive. @@ -553,7 +553,7 @@ void QDeclarativePlaylist::componentComplete() */ /*! - \qmlsignal QtMultimedia::Audio::itemChanged(start, end) + \qmlsignal QtMultimedia::Playlist::itemChanged(start, end) This signal is emitted after items have been changed in the playlist between \a start and \a end positions inclusive. @@ -562,7 +562,7 @@ void QDeclarativePlaylist::componentComplete() */ /*! - \qmlsignal QtMultimedia::Audio::loaded() + \qmlsignal QtMultimedia::Playlist::loaded() This signal is emitted when the playlist loading succeeded. @@ -570,7 +570,7 @@ void QDeclarativePlaylist::componentComplete() */ /*! - \qmlsignal QtMultimedia::Audio::loadFailed() + \qmlsignal QtMultimedia::Playlist::loadFailed() This signal is emitted when the playlist loading failed. \l error and \l errorString can be checked for more information on the failure. -- cgit v1.2.3 From 6e8f05f016726e078374f92092f643b5154855cf Mon Sep 17 00:00:00 2001 From: Yoann Lopes Date: Wed, 7 Sep 2016 15:37:03 +0200 Subject: Update plugins.qmltypes for 5.8 Change-Id: Iade5ceb5f791abaa2ec7649ff4752d1b59d96aad Reviewed-by: Christian Stromme --- src/imports/multimedia/plugins.qmltypes | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) (limited to 'src/imports/multimedia') diff --git a/src/imports/multimedia/plugins.qmltypes b/src/imports/multimedia/plugins.qmltypes index 91fff02eb..20bbf7d3e 100644 --- a/src/imports/multimedia/plugins.qmltypes +++ b/src/imports/multimedia/plugins.qmltypes @@ -4,7 +4,7 @@ import QtQuick.tooling 1.2 // It is used for QML tooling purposes only. // // This file was auto-generated by: -// 'qmlplugindump -nonrelocatable QtMultimedia 5.7' +// 'qmlplugindump -nonrelocatable QtMultimedia 5.8' Module { dependencies: ["QtQuick 2.0"] @@ -1248,8 +1248,24 @@ Module { isCreatable: false isSingleton: true exportMetaObjectRevisions: [0] + Enum { + name: "VolumeScale" + values: { + "LinearVolumeScale": 0, + "CubicVolumeScale": 1, + "LogarithmicVolumeScale": 2, + "DecibelVolumeScale": 3 + } + } Property { name: "defaultCamera"; type: "QJSValue"; isReadonly: true } Property { name: "availableCameras"; type: "QJSValue"; isReadonly: true } + Method { + name: "convertVolume" + type: "double" + Parameter { name: "volume"; type: "double" } + Parameter { name: "from"; type: "VolumeScale" } + Parameter { name: "to"; type: "VolumeScale" } + } } Component { name: "QDeclarativePlaylist" @@ -1794,9 +1810,10 @@ Module { prototype: "QObject" exports: [ "QtMultimedia/SoundEffect 5.0", - "QtMultimedia/SoundEffect 5.3" + "QtMultimedia/SoundEffect 5.3", + "QtMultimedia/SoundEffect 5.8" ] - exportMetaObjectRevisions: [0, 0] + exportMetaObjectRevisions: [0, 0, 0] Enum { name: "Loop" values: { -- cgit v1.2.3 From f5a264d1f6dd5c6470c66573a3faeae58aac360f Mon Sep 17 00:00:00 2001 From: Yoann Lopes Date: Wed, 7 Sep 2016 15:10:55 +0200 Subject: Register 5.8 version for the multimedia QML module There isn't any new API in 5.8, we need to re-register an existing type to make that version number available. Change-Id: I061dc53e9570eefc1cbdcb9d15f557904b5d275f Reviewed-by: Christian Stromme --- src/imports/multimedia/multimedia.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/imports/multimedia') diff --git a/src/imports/multimedia/multimedia.cpp b/src/imports/multimedia/multimedia.cpp index 2a5e8cd2c..b7ab473c7 100644 --- a/src/imports/multimedia/multimedia.cpp +++ b/src/imports/multimedia/multimedia.cpp @@ -140,6 +140,9 @@ public: qmlRegisterUncreatableType(uri, 5, 7, "CameraImageProcessing", trUtf8("CameraImageProcessing is provided by Camera")); + // 5.8 types (nothing new, re-register one of the types) + qmlRegisterType(uri, 5, 8, "SoundEffect"); + qmlRegisterType(); qmlRegisterType(); } -- cgit v1.2.3