diff options
author | Lars Knoll <lars.knoll@qt.io> | 2021-05-06 16:55:54 +0200 |
---|---|---|
committer | Lars Knoll <lars.knoll@qt.io> | 2021-05-07 13:04:35 +0000 |
commit | 96543d75ef8d2935b36a19d2601a761cf5ac6396 (patch) | |
tree | c1775778bb44048bf8913beec228af1979f26dc3 /src/multimedia/audio/qaudiooutput.cpp | |
parent | a0cae0211a9b3f8db7ea8807f02b0d47380e480c (diff) |
Replace category in QAudioOutput with an audio role
This makes the API consistent with QMediaPlayer and removes a
place where we accepted random strings without knowing what
the backend might do with them.
Change-Id: Icdd699bc547eacb9250f4e860e23e5f645dc45d8
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Diffstat (limited to 'src/multimedia/audio/qaudiooutput.cpp')
-rw-r--r-- | src/multimedia/audio/qaudiooutput.cpp | 35 |
1 files changed, 10 insertions, 25 deletions
diff --git a/src/multimedia/audio/qaudiooutput.cpp b/src/multimedia/audio/qaudiooutput.cpp index 0d404cb81..2d3639904 100644 --- a/src/multimedia/audio/qaudiooutput.cpp +++ b/src/multimedia/audio/qaudiooutput.cpp @@ -346,38 +346,23 @@ qreal QAudioOutput::volume() const } /*! - Returns the audio category of this audio stream. + \property QMediaPlayer::audioRole + \brief the role of the audio stream played by the media player. - Some platforms can group audio streams into categories - and manage their volumes independently, or display them - in a system mixer control. You can set this property to - allow the platform to distinguish the purpose of your streams. + It can be set to specify the type of audio being played, allowing the system to make + appropriate decisions when it comes to volume, routing or post-processing. - \sa setCategory() + The audio role must be set before calling setMedia(). */ -QString QAudioOutput::category() const + +QAudio::Role QAudioOutput::audioRole() const { - return d->category(); + return d->role(); } -/*! - Sets the audio category of this audio stream to \a category. - - Some platforms can group audio streams into categories - and manage their volumes independently, or display them - in a system mixer control. You can set this property to - allow the platform to distinguish the purpose of your streams. - - Not all platforms support audio stream categorization. In this - case, the function call will be ignored. - - Changing an audio output stream's category while it is opened - will not take effect until it is reopened. - \sa category() -*/ -void QAudioOutput::setCategory(const QString &category) +void QAudioOutput::setAudioRole(QAudio::Role role) { - d->setCategory(category); + d->setRole(role); } /*! |