Expose the audio category information for streams.

QAudioOutput and QSoundEffect now have a category property so that
system volume mixing or processing can be applied.

Initially just pulseaudio supports this but Windows Vista etc should also
work.

Change-Id: I6855b08367e5a055ac7dfcffd644c98bfd7c5a4e
Reviewed-by: Ling Hu <ling.hu@nokia.com>
This commit is contained in:
Michael Goddard
2012-04-13 13:51:09 +10:00
committed by Qt by Nokia
parent 8441d2e32e
commit 5f7b64346d
11 changed files with 198 additions and 4 deletions

View File

@@ -218,6 +218,7 @@ QSoundEffect::QSoundEffect(QObject *parent) :
connect(d, SIGNAL(loadedChanged()), SIGNAL(loadedChanged()));
connect(d, SIGNAL(playingChanged()), SIGNAL(playingChanged()));
connect(d, SIGNAL(statusChanged()), SIGNAL(statusChanged()));
connect(d, SIGNAL(categoryChanged()), SIGNAL(categoryChanged()));
}
/*!
@@ -366,6 +367,57 @@ QSoundEffect::Status QSoundEffect::status() const
return d->status();
}
/*!
\qmlproperty string QtMultimedia5::SoundEffect::category
\property QSoundEffect::category
This property contains the \e category of this sound effect.
Some platforms can perform different audio routing
for different categories, or may allow the user to
set different volume levels for different categories.
This setting will be ignored on platforms that do not
support audio categories.
*/
/*!
Returns the current \e category for this sound effect.
Some platforms can perform different audio routing
for different categories, or may allow the user to
set different volume levels for different categories.
This setting will be ignored on platforms that do not
support audio categories.
\sa setCategory()
*/
QString QSoundEffect::category() const
{
return d->category();
}
/*!
Sets the \e category of this sound effect to \a category.
Some platforms can perform different audio routing
for different categories, or may allow the user to
set different volume levels for different categories.
This setting will be ignored on platforms that do not
support audio categories.
If this setting is changed while a sound effect is playing
it will only take effect when the sound effect has stopped
playing.
\sa category()
*/
void QSoundEffect::setCategory(const QString &category)
{
d->setCategory(category);
}
/*!
\qmlmethod QtMultimedia5::SoundEffect::stop()