diff options
author | Gareth Stockwell <ext-gareth.stockwell@nokia.com> | 2010-01-11 15:38:07 (GMT) |
---|---|---|
committer | Gareth Stockwell <ext-gareth.stockwell@nokia.com> | 2010-01-11 15:38:07 (GMT) |
commit | 894bb6e1742b75312feb7a18d043a67a3dba4cb9 (patch) | |
tree | 84ed946121bbae72b0933b8f5bc785a6b34aec18 /src/3rdparty/phonon/mmf/effectfactory.cpp | |
parent | e53306725e52407146304df9d8d3a65920fc3e8d (diff) | |
download | Qt-894bb6e1742b75312feb7a18d043a67a3dba4cb9.zip Qt-894bb6e1742b75312feb7a18d043a67a3dba4cb9.tar.gz Qt-894bb6e1742b75312feb7a18d043a67a3dba4cb9.tar.bz2 |
Removed dependency of EffectFactory on native effect headers
By refactoring the static capabilities / parameters interface
exposed by AbstractAudioEffect-derived classes to the EffectFactory,
the latter's implementation no longer needs access to the headers
for native effect classes.
Previously, during the initialization phase, the EffectFactory
tried to create an instance of each native effect class, in order to
determine whether that effect is supported. This is now done inside
the backend class for each effect, thereby improving encapsulation.
Task-number: QTBUG-4659
Reviewed-by: Espen Riskedal
Diffstat (limited to 'src/3rdparty/phonon/mmf/effectfactory.cpp')
-rw-r--r-- | src/3rdparty/phonon/mmf/effectfactory.cpp | 21 |
1 files changed, 2 insertions, 19 deletions
diff --git a/src/3rdparty/phonon/mmf/effectfactory.cpp b/src/3rdparty/phonon/mmf/effectfactory.cpp index a8cbf24..19c6d90 100644 --- a/src/3rdparty/phonon/mmf/effectfactory.cpp +++ b/src/3rdparty/phonon/mmf/effectfactory.cpp @@ -19,17 +19,6 @@ along with this library. If not, see <http://www.gnu.org/licenses/>. #include <QObject> #include <QCoreApplication> -#include <AudioEqualizerBase.h> -#include <BassBoostBase.h> -#include <DistanceAttenuationBase.h> -#include <DopplerBase.h> -#include <EnvironmentalReverbBase.h> -#include <ListenerOrientationBase.h> -#include <LocationBase.h> -#include <LoudnessBase.h> -#include <SourceOrientationBase.h> -#include <StereoWideningBase.h> - #include <mdaaudiooutputstream.h> #include "audioequalizer.h" @@ -171,19 +160,13 @@ EffectFactory::EffectData EffectFactory::getData() OutputStreamFactory streamFactory; QScopedPointer<CMdaAudioOutputStream> stream(streamFactory.create()); - typedef typename BackendNode::NativeEffect NativeEffect; - QScopedPointer<NativeEffect> effect; - TRAPD(err, effect.reset(NativeEffect::NewL(*stream))); - data.m_supported = (KErrNone == err); - - if (KErrNone == err) { + if (data.m_supported = BackendNode::getParameters + (stream.data(), data.m_parameters)) { const QString description = QCoreApplication::translate ("Phonon::MMF::EffectFactory", BackendNode::description()); data.m_descriptions.insert("name", description); data.m_descriptions.insert("description", description); data.m_descriptions.insert("available", true); - - BackendNode::getParameters(effect.data(), data.m_parameters); } return data; |