summaryrefslogtreecommitdiff
path: root/src/3rdparty/phonon/mmf/audioequalizer.cpp
diff options
context:
space:
mode:
authorGareth Stockwell <ext-gareth.stockwell@nokia.com>2010-01-11 15:30:15 +0000
committerGareth Stockwell <ext-gareth.stockwell@nokia.com>2010-01-11 15:30:15 +0000
commite53306725e52407146304df9d8d3a65920fc3e8d (patch)
treeb3b8f4d25616ac8171af60f86ad1c060d26ac33c /src/3rdparty/phonon/mmf/audioequalizer.cpp
parent483893142dcec15c646ef997309dcede76466766 (diff)
downloadqt4-tools-e53306725e52407146304df9d8d3a65920fc3e8d.tar.gz
Delayed creation of audio effect object until audio is initialized
When applying effects to an audio stream, we must ensure that the MMF utility API (CMdaAudioPlayerUtility or CVideoPlayerUtility) instance has loaded a controller before calling attempting to create a CAudioEffect- derived object. If the controller has not been loaded, construction of the effect object will fail. Even if we mitigate against this, calling CAudioEffect::ApplyL() will only have an effect if there is a controller object - or more precisely, a DevSound instance - on which to apply the effect. This patch delays construction of the effect object until the MediaObject has transitioned out of the LoadingState, indicating that an underlying DevSound instance will have been created. Task-number: QTBUG-4659 Reviewed-by: Espen Riskedal
Diffstat (limited to 'src/3rdparty/phonon/mmf/audioequalizer.cpp')
-rw-r--r--src/3rdparty/phonon/mmf/audioequalizer.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/3rdparty/phonon/mmf/audioequalizer.cpp b/src/3rdparty/phonon/mmf/audioequalizer.cpp
index adbe6c83e9..b41eda4cb7 100644
--- a/src/3rdparty/phonon/mmf/audioequalizer.cpp
+++ b/src/3rdparty/phonon/mmf/audioequalizer.cpp
@@ -44,7 +44,7 @@ void AudioEqualizer::parameterChanged(const int pid,
}
}
-void AudioEqualizer::connectAudioPlayer(AudioPlayer::NativePlayer *player)
+void AudioEqualizer::createEffect(AudioPlayer::NativePlayer *player)
{
CAudioEqualizer *ptr = 0;
QT_TRAP_THROWING(ptr = CAudioEqualizer::NewL(*player));
@@ -57,7 +57,7 @@ void AudioEqualizer::applyParameters()
Phonon::EffectParameter param;
foreach (param, parameters()) {
const int band = param.id();
- const int level = parameterValue(param).toInt();
+ const qreal level = parameterValue(param).toReal();
setBandLevel(band, level);
}
}
@@ -65,7 +65,7 @@ void AudioEqualizer::applyParameters()
void AudioEqualizer::setBandLevel(int band, qreal externalLevel)
{
- const EffectParameter &param = m_params[band];
+ const EffectParameter &param = m_params[band-1]; // Band IDs are 1-based
const int internalLevel = param.toInternalValue(externalLevel);
CAudioEqualizer *const effect = static_cast<CAudioEqualizer *>(m_effect.data());