diff options
author | Yoann Lopes <yoann.lopes@qt.io> | 2016-07-08 15:22:16 +0200 |
---|---|---|
committer | Yoann Lopes <yoann.lopes@qt.io> | 2016-08-22 09:50:06 +0000 |
commit | cc12446728d00161116d6e1823e161440415d2d5 (patch) | |
tree | 81998ddb81bdb602be6faf76878e849fe675a75a /src/imports | |
parent | d47e412b7b196e37196fa7c7469ae3b54eecf6d4 (diff) |
Improve audio volume documentation
Added information about volume scales.
Change-Id: Ica8367396147e3e1c814b3575faa5cf0503be031
Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
Reviewed-by: Christian Stromme <christian.stromme@qt.io>
Diffstat (limited to 'src/imports')
-rw-r--r-- | src/imports/multimedia/Video.qml | 12 | ||||
-rw-r--r-- | src/imports/multimedia/qdeclarativeaudio.cpp | 24 |
2 files changed, 31 insertions, 5 deletions
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. */ /*! |