From 7d3cdcb63c4030926ef5224d7e986de6d67da31b Mon Sep 17 00:00:00 2001 From: Gareth Stockwell Date: Tue, 8 Dec 2009 14:44:31 +0000 Subject: Fixed typo in Phonon::EffectWidget implementation Task-number: QTBUG-4659 Reviewed-by: trustme --- src/3rdparty/phonon/phonon/effectwidget.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/3rdparty/phonon/phonon/effectwidget.cpp b/src/3rdparty/phonon/phonon/effectwidget.cpp index 2334d7f..b39299a 100644 --- a/src/3rdparty/phonon/phonon/effectwidget.cpp +++ b/src/3rdparty/phonon/phonon/effectwidget.cpp @@ -151,7 +151,7 @@ void EffectWidgetPrivate::autogenerateUi() bool minValueOk = false; bool maxValueOk = false; const int minValue = para.minimumValue().toInt(&minValueOk); - const int maxValue = para.minimumValue().toInt(&maxValueOk); + const int maxValue = para.maximumValue().toInt(&maxValueOk); sb->setRange(minValueOk ? minValue : DEFAULT_MIN_INT, maxValueOk ? maxValue : DEFAULT_MAX_INT); sb->setValue(value.toInt()); -- cgit v0.12 From d44c661d75ff6edcabf70b188b18bc991611628b Mon Sep 17 00:00:00 2001 From: Gareth Stockwell Date: Tue, 8 Dec 2009 17:18:17 +0000 Subject: Corrected parameter name ordering in internal Phonon MMF function signatures Some instances of the changeState signal declaration had the newState and oldState parameters in the wrong order. While this has no effect on the behaviour of the code, it can be confusing to developers reading it. Reviewed-by: trustme --- src/3rdparty/phonon/mmf/abstractplayer.h | 4 ++-- src/3rdparty/phonon/mmf/mediaobject.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/3rdparty/phonon/mmf/abstractplayer.h b/src/3rdparty/phonon/mmf/abstractplayer.h index 40ad7f8..dbcbe63 100644 --- a/src/3rdparty/phonon/mmf/abstractplayer.h +++ b/src/3rdparty/phonon/mmf/abstractplayer.h @@ -106,8 +106,8 @@ Q_SIGNALS: void finished(); void tick(qint64 time); void bufferStatus(int percentFilled); - void stateChanged(Phonon::State oldState, - Phonon::State newState); + void stateChanged(Phonon::State newState, + Phonon::State oldState); void metaDataChanged(const QMultiMap& metaData); void aboutToFinish(); void prefinishMarkReached(qint32 remaining); diff --git a/src/3rdparty/phonon/mmf/mediaobject.h b/src/3rdparty/phonon/mmf/mediaobject.h index 668b953..7d330e7 100644 --- a/src/3rdparty/phonon/mmf/mediaobject.h +++ b/src/3rdparty/phonon/mmf/mediaobject.h @@ -101,8 +101,8 @@ Q_SIGNALS: // TODO: emit metaDataChanged from MediaObject void metaDataChanged(const QMultiMap& metaData); void currentSourceChanged(const MediaSource& source); - void stateChanged(Phonon::State oldState, - Phonon::State newState); + void stateChanged(Phonon::State newState, + Phonon::State oldState); void finished(); void tick(qint64 time); -- cgit v0.12 From 4c95ec342c62183ecc3dffe50497b4858bc27c8d Mon Sep 17 00:00:00 2001 From: Gareth Stockwell Date: Fri, 8 Jan 2010 18:09:27 +0000 Subject: Implemented audio effects capability querying in Phonon MMF backend This patch addresses the following deficiencies in the existing implementation of audio effects: 1. Native effect objects (e.g. CAudioEqualizer, CBassBoost etc) were created frequently, just in order to check whether a given effect is supported, or retrieve the list of parameters which it requires. Although this is in part due to a deficiency in the S60 audio effects API (it doesn't have a 'capability query' concept), it can be improved by using caching. This patch introduces a singleton EffectFactory object, which lazily initializes a data structure containing information about support and parameters. 2. In order to either query effect support, the native effect object ultimately needs to access a DevSound instance. Previously, the effect object was provided with a CMdaAudioPlayerUtility object. If this player utility has not loaded an MMF controller plugin *before* the effects object makes any calls to the player utility, incorrect results will be returned. This was observed in the previous code. For querying, we don't actually need to load an MMF controller; instead, we would like to directly provide a CMMFDevSound instance to the effect object. Unfortunately, this API is not available in public S60 SDKs, so we must use the next lowest interface available, namely CMdaAudioOutputStream. By making this change, this patch ensures that support and parameter queries made via the EffectFactory will return the correct result. At this point, however, effect settings made via the Phonon API are not actually applied to the audio output. Fixing this will require notifying the audio effects backend nodes of state changes in the MediaObject. Task-number: QTBUG-4659 Reviewed-by: Espen Riskedal --- src/3rdparty/phonon/mmf/abstractaudioeffect.cpp | 9 +- src/3rdparty/phonon/mmf/abstractaudioeffect.h | 12 -- src/3rdparty/phonon/mmf/audioequalizer.cpp | 40 ++--- src/3rdparty/phonon/mmf/audioequalizer.h | 13 +- src/3rdparty/phonon/mmf/backend.cpp | 11 +- src/3rdparty/phonon/mmf/backend.h | 2 + src/3rdparty/phonon/mmf/bassboost.cpp | 21 ++- src/3rdparty/phonon/mmf/bassboost.h | 10 +- src/3rdparty/phonon/mmf/effectfactory.cpp | 189 +++++++++++++++--------- src/3rdparty/phonon/mmf/effectfactory.h | 50 +++++-- src/plugins/phonon/mmf/mmf.pro | 1 + 11 files changed, 226 insertions(+), 132 deletions(-) diff --git a/src/3rdparty/phonon/mmf/abstractaudioeffect.cpp b/src/3rdparty/phonon/mmf/abstractaudioeffect.cpp index e7ef9b2..c75c08e 100644 --- a/src/3rdparty/phonon/mmf/abstractaudioeffect.cpp +++ b/src/3rdparty/phonon/mmf/abstractaudioeffect.cpp @@ -37,10 +37,11 @@ using namespace Phonon::MMF; AbstractAudioEffect::AbstractAudioEffect(QObject *parent, const QList ¶ms) - : MediaNode::MediaNode(parent) + : MediaNode(parent) , m_player(0) , m_params(params) { + } QList AbstractAudioEffect::parameters() const @@ -63,8 +64,10 @@ void AbstractAudioEffect::setParameterValue(const EffectParameter ¶m, { m_values.insert(param.id(), newValue); parameterChanged(param.id(), newValue); - // TODO: handle audio effect errors - TRAP_IGNORE(m_effect->ApplyL()); + + if (m_effect.data()) + // TODO: handle audio effect errors + TRAP_IGNORE(m_effect->ApplyL()); } void AbstractAudioEffect::connectMediaObject(MediaObject *mediaObject) diff --git a/src/3rdparty/phonon/mmf/abstractaudioeffect.h b/src/3rdparty/phonon/mmf/abstractaudioeffect.h index 6f74a73..df1d08a 100644 --- a/src/3rdparty/phonon/mmf/abstractaudioeffect.h +++ b/src/3rdparty/phonon/mmf/abstractaudioeffect.h @@ -68,18 +68,6 @@ public: virtual void setParameterValue(const EffectParameter &, const QVariant &newValue); - enum Type - { - EffectAudioEqualizer = 1, - EffectBassBoost, - EffectDistanceAttenuation, - EffectEnvironmentalReverb, - EffectListenerOrientation, - EffectLoudness, - EffectSourceOrientation, - EffectStereoWidening - }; - protected: // MediaNode void connectMediaObject(MediaObject *mediaObject); diff --git a/src/3rdparty/phonon/mmf/audioequalizer.cpp b/src/3rdparty/phonon/mmf/audioequalizer.cpp index c2936c5..5aa659a 100644 --- a/src/3rdparty/phonon/mmf/audioequalizer.cpp +++ b/src/3rdparty/phonon/mmf/audioequalizer.cpp @@ -28,8 +28,10 @@ using namespace Phonon::MMF; \internal */ -AudioEqualizer::AudioEqualizer(QObject *parent) : AbstractAudioEffect::AbstractAudioEffect(parent, createParams()) +AudioEqualizer::AudioEqualizer(QObject *parent, const QList ¶meters) + : AbstractAudioEffect::AbstractAudioEffect(parent, parameters) { + } void AudioEqualizer::parameterChanged(const int pid, @@ -68,30 +70,32 @@ void AudioEqualizer::setBandLevel(int band, int level) TRAP_IGNORE(effect->SetBandLevelL(band, level)); } -QList AudioEqualizer::createParams() -{ - QList retval; - - // We temporarily create an AudioPlayer, and run the effect on it, so - // we can extract the readonly data we need. - AudioPlayer dummyPlayer; +//----------------------------------------------------------------------------- +// Static functions +//----------------------------------------------------------------------------- - CAudioEqualizer *eqPtr = 0; - QT_TRAP_THROWING(eqPtr = CAudioEqualizer::NewL(*dummyPlayer.nativePlayer())); - QScopedPointer e(eqPtr); +const char* AudioEqualizer::description() +{ + return "Audio equalizer"; +} +void AudioEqualizer::getParameters(NativeEffect *effect, + QList ¶meters) +{ TInt32 dbMin; TInt32 dbMax; - e->DbLevelLimits(dbMin, dbMax); + effect->DbLevelLimits(dbMin, dbMax); - const int bandCount = e->NumberOfBands(); + const int bandCount = effect->NumberOfBands(); - for (int i = 0; i < bandCount; ++i) { - const qint32 hz = e->CenterFrequency(i); + // For some reason, band IDs are 1-based, as opposed to the + // 0-based indices used in just about other Symbian API...! + for (int i = 1; i <= bandCount; ++i) { + const qint32 hz = effect->CenterFrequency(i); - const qint32 defVol = e->BandLevel(i); + const qint32 defVol = effect->BandLevel(i); - retval.append(EffectParameter(i, + parameters.append(EffectParameter(i, tr("Frequency band, %1 Hz").arg(hz), EffectParameter::LogarithmicHint, QVariant(qint32(defVol)), @@ -100,8 +104,6 @@ QList AudioEqualizer::createParams() QVariantList(), QString())); } - - return retval; } QT_END_NAMESPACE diff --git a/src/3rdparty/phonon/mmf/audioequalizer.h b/src/3rdparty/phonon/mmf/audioequalizer.h index 10fe9ad..ee3d297 100644 --- a/src/3rdparty/phonon/mmf/audioequalizer.h +++ b/src/3rdparty/phonon/mmf/audioequalizer.h @@ -21,6 +21,8 @@ along with this library. If not, see . #include "abstractaudioeffect.h" +class CAudioEqualizer; + QT_BEGIN_NAMESPACE namespace Phonon @@ -39,7 +41,13 @@ class AudioEqualizer : public AbstractAudioEffect { Q_OBJECT public: - AudioEqualizer(QObject *parent); + AudioEqualizer(QObject *parent, const QList ¶meters); + + // Static interface required by EffectFactory + static const char* description(); + typedef CAudioEqualizer NativeEffect; + static void getParameters(NativeEffect *effect, + QList ¶meters); protected: // AbstractAudioEffect @@ -50,9 +58,6 @@ protected: private: void setBandLevel(int band, int level); -private: - static QList createParams(); - }; } } diff --git a/src/3rdparty/phonon/mmf/backend.cpp b/src/3rdparty/phonon/mmf/backend.cpp index 0c07f66..3568a49 100644 --- a/src/3rdparty/phonon/mmf/backend.cpp +++ b/src/3rdparty/phonon/mmf/backend.cpp @@ -45,6 +45,7 @@ using namespace Phonon::MMF; Backend::Backend(QObject *parent) : QObject(parent) , m_ancestorMoveMonitor(new AncestorMoveMonitor(this)) + , m_effectFactory(new EffectFactory(this)) { TRACE_CONTEXT(Backend::Backend, EBackend); TRACE_ENTRY_0(); @@ -81,9 +82,9 @@ QObject *Backend::createObject(BackendInterface::Class c, QObject *parent, const { Q_ASSERT(args.count() == 1); Q_ASSERT(args.first().type() == QVariant::Int); - const AbstractAudioEffect::Type effect = AbstractAudioEffect::Type(args.first().toInt()); - - return EffectFactory::createAudioEffect(effect, parent); + const EffectFactory::Type type = + static_cast(args.first().toInt()); + return m_effectFactory->createAudioEffect(type, parent); } case VideoWidgetClass: result = new VideoWidget(m_ancestorMoveMonitor.data(), qobject_cast(parent)); @@ -105,7 +106,7 @@ QList Backend::objectDescriptionIndexes(ObjectDescriptionType type) const switch(type) { case EffectType: - retval.append(EffectFactory::effectIndexes()); + retval.append(m_effectFactory->effectIndexes()); break; case AudioOutputDeviceType: // We only have one possible output device, but we need at least @@ -126,7 +127,7 @@ QHash Backend::objectDescriptionProperties(ObjectDescripti switch (type) { case EffectType: - return EffectFactory::audioEffectDescriptions(AbstractAudioEffect::Type(index)); + return m_effectFactory->audioEffectDescriptions(EffectFactory::Type(index)); case AudioOutputDeviceType: return AudioOutput::audioOutputDescription(index); default: diff --git a/src/3rdparty/phonon/mmf/backend.h b/src/3rdparty/phonon/mmf/backend.h index 9e3d3b3..6b85625 100644 --- a/src/3rdparty/phonon/mmf/backend.h +++ b/src/3rdparty/phonon/mmf/backend.h @@ -20,6 +20,7 @@ along with this library. If not, see . #define PHONON_MMF_BACKEND_H #include "ancestormovemonitor.h" +#include "effectfactory.h" #include #include @@ -53,6 +54,7 @@ Q_SIGNALS: private: QScopedPointer m_ancestorMoveMonitor; + QScopedPointer m_effectFactory; }; } diff --git a/src/3rdparty/phonon/mmf/bassboost.cpp b/src/3rdparty/phonon/mmf/bassboost.cpp index ae96b45..4edd102 100644 --- a/src/3rdparty/phonon/mmf/bassboost.cpp +++ b/src/3rdparty/phonon/mmf/bassboost.cpp @@ -28,15 +28,16 @@ using namespace Phonon::MMF; \internal */ -BassBoost::BassBoost(QObject *parent) : AbstractAudioEffect::AbstractAudioEffect(parent, - QList()) +BassBoost::BassBoost(QObject *parent, const QList ¶meters) + : AbstractAudioEffect::AbstractAudioEffect(parent, parameters) { + } void BassBoost::parameterChanged(const int, const QVariant &) { - Q_ASSERT_X(false, Q_FUNC_INFO, "BassBoost has not parameters"); + Q_ASSERT_X(false, Q_FUNC_INFO, "BassBoost has no parameters"); } void BassBoost::connectAudioPlayer(AudioPlayer::NativePlayer *player) @@ -51,5 +52,19 @@ void BassBoost::applyParameters() // No parameters to apply } +//----------------------------------------------------------------------------- +// Static functions +//----------------------------------------------------------------------------- + +const char* BassBoost::description() +{ + return "Bass boost"; +} + +void BassBoost::getParameters(NativeEffect*, QList&) +{ + +} + QT_END_NAMESPACE diff --git a/src/3rdparty/phonon/mmf/bassboost.h b/src/3rdparty/phonon/mmf/bassboost.h index 4ad0a6c..c3c48d0 100644 --- a/src/3rdparty/phonon/mmf/bassboost.h +++ b/src/3rdparty/phonon/mmf/bassboost.h @@ -21,6 +21,8 @@ along with this library. If not, see . #include "abstractaudioeffect.h" +class CBassBoost; + QT_BEGIN_NAMESPACE namespace Phonon @@ -37,7 +39,13 @@ class BassBoost : public AbstractAudioEffect { Q_OBJECT public: - BassBoost(QObject *parent); + BassBoost(QObject *parent, const QList ¶meters); + + // Static interface required by EffectFactory + static const char* description(); + typedef CBassBoost NativeEffect; + static void getParameters(NativeEffect *effect, + QList ¶meters); protected: // AbstractAudioEffect diff --git a/src/3rdparty/phonon/mmf/effectfactory.cpp b/src/3rdparty/phonon/mmf/effectfactory.cpp index cc94367..a8cbf24 100644 --- a/src/3rdparty/phonon/mmf/effectfactory.cpp +++ b/src/3rdparty/phonon/mmf/effectfactory.cpp @@ -30,6 +30,8 @@ along with this library. If not, see . #include #include +#include + #include "audioequalizer.h" #include "bassboost.h" @@ -44,111 +46,154 @@ using namespace Phonon::MMF; \internal */ -QHash EffectFactory::constructEffectDescription(const QString &name, - const QString &description) +EffectFactory::EffectFactory(QObject *parent) + : QObject(parent) + , m_initialized(false) { - QHash retval; - - retval.insert("name", name); - retval.insert("description", description); - retval.insert("available", true); - return retval; } - -QHash EffectFactory::audioEffectDescriptions(AbstractAudioEffect::Type type) +EffectFactory::~EffectFactory() { - switch (type) - { - case AbstractAudioEffect::EffectAudioEqualizer: - return constructEffectDescription(QCoreApplication::translate("Phonon::MMF::EffectFactory", "Audio Equalizer"), "Audio equalizer."); - case AbstractAudioEffect::EffectBassBoost: - return constructEffectDescription(QCoreApplication::translate("Phonon::MMF::EffectFactory", "Bass Boost"), "Bass boost."); - case AbstractAudioEffect::EffectDistanceAttenuation: - return constructEffectDescription(QCoreApplication::translate("Phonon::MMF::EffectFactory", "Distance Attenuation"), "Distance Attenuation."); - case AbstractAudioEffect::EffectEnvironmentalReverb: - return constructEffectDescription(QCoreApplication::translate("Phonon::MMF::EffectFactory", "Environmental Reverb"), "Environmental Reverb."); - case AbstractAudioEffect::EffectListenerOrientation: - return constructEffectDescription(QCoreApplication::translate("Phonon::MMF::EffectFactory", "Environmental Reverb"), "Environmental Reverb."); - case AbstractAudioEffect::EffectLoudness: - return constructEffectDescription(QCoreApplication::translate("Phonon::MMF::EffectFactory", "Loudness"), "Loudness."); - case AbstractAudioEffect::EffectSourceOrientation: - return constructEffectDescription(QCoreApplication::translate("Phonon::MMF::EffectFactory", "Source Orientation"), "Source Orientation."); - case AbstractAudioEffect::EffectStereoWidening: - return constructEffectDescription(QCoreApplication::translate("Phonon::MMF::EffectFactory", "Stereo Widening"), "Stereo Widening."); - } - Q_ASSERT_X(false, Q_FUNC_INFO, "Unknown effect type."); - return QHash(); } -AbstractAudioEffect *EffectFactory::createAudioEffect(AbstractAudioEffect::Type type, +//----------------------------------------------------------------------------- +// Public functions +//----------------------------------------------------------------------------- + +AbstractAudioEffect *EffectFactory::createAudioEffect(Type type, QObject *parent) { + // Lazily initialize + if (!m_initialized) + initialize(); + Q_ASSERT(parent); + const QList& parameters = data(type).m_parameters; + + AbstractAudioEffect *effect = 0; + switch (type) { - case AbstractAudioEffect::EffectBassBoost: - return new BassBoost(parent); - case AbstractAudioEffect::EffectAudioEqualizer: - return new AudioEqualizer(parent); - case AbstractAudioEffect::EffectDistanceAttenuation: - case AbstractAudioEffect::EffectEnvironmentalReverb: - case AbstractAudioEffect::EffectListenerOrientation: - case AbstractAudioEffect::EffectLoudness: - case AbstractAudioEffect::EffectSourceOrientation: - case AbstractAudioEffect::EffectStereoWidening: - ; + case TypeBassBoost: + effect = new BassBoost(parent, parameters); + case TypeAudioEqualizer: + effect = new AudioEqualizer(parent, parameters); + case TypeDistanceAttenuation: + case TypeEnvironmentalReverb: + case TypeListenerOrientation: + case TypeLoudness: + case TypeSourceOrientation: + case TypeStereoWidening: + break; + default: + Q_ASSERT_X(false, Q_FUNC_INFO, "Unknown effect"); } - Q_ASSERT_X(false, Q_FUNC_INFO, "Unknown effect."); - return 0; + return effect; } -template -bool isEffectSupported() +QHash EffectFactory::audioEffectDescriptions(Type type) { - AudioPlayer audioPlayer; - - QScopedPointer eff; - TRAPD(errorCode, eff.reset(TEffect::NewL(*audioPlayer.nativePlayer()))); + // Lazily initialize + if (!m_initialized) + initialize(); - return errorCode != KErrNone; + return data(type).m_descriptions; } QList EffectFactory::effectIndexes() { - QList retval; + // Lazily initialize + if (!m_initialized) + initialize(); + + QList result; - if (isEffectSupported()) - retval.append(AbstractAudioEffect::EffectAudioEqualizer); + QHash::const_iterator i = m_effectData.begin(); + for ( ; i != m_effectData.end(); ++i) + if (i.value().m_supported) + result.append(i.key()); - if (isEffectSupported()) - retval.append(AbstractAudioEffect::EffectBassBoost); + return result; +} + +//----------------------------------------------------------------------------- +// Private functions +//----------------------------------------------------------------------------- - /* We haven't implemented these yet. - if (isEffectSupported()) - retval.append(AbstractAudioEffect::EffectDistanceAttenuation); +#define INITIALIZE_EFFECT(Effect) \ + { \ + EffectData data = getData(); \ + m_effectData.insert(Type##Effect, data); \ + } - if (isEffectSupported()) - retval.append(AbstractAudioEffect::EffectEnvironmentalReverb); +void EffectFactory::initialize() +{ + Q_ASSERT_X(!m_initialized, Q_FUNC_INFO, "Already initialized"); - if (isEffectSupported()) - retval.append(AbstractAudioEffect::EffectLoudness); + INITIALIZE_EFFECT(AudioEqualizer) + //INITIALIZE_EFFECT(BassBoost) - if (isEffectSupported()) - retval.append(AbstractAudioEffect::EffectListenerOrientation); + m_initialized = true; +} - if (isEffectSupported()) - retval.append(AbstractAudioEffect::EffectSourceOrientation); +// This class is just a wrapper which allows us to instantiate a +// CMdaAudioOutputStream object. This is done in order to allow the +// effects API to query the DevSound implementation, to discover +// which effects are supported and what parameters they take. +// Ideally, we would use CMMFDevSound directly, but this class is not +// available in the public S60 SDK. +class OutputStreamFactory : public MMdaAudioOutputStreamCallback +{ +public: + CMdaAudioOutputStream* create() + { + CMdaAudioOutputStream* stream = 0; + QT_TRAP_THROWING(stream = CMdaAudioOutputStream::NewL(*this)); + return stream; + } +private: + void MaoscOpenComplete(TInt /*aError*/) { } + void MaoscBufferCopied(TInt /*aError*/, const TDesC8& /*aBuffer*/) { } + void MaoscPlayComplete(TInt /*aError*/) { } +}; + +template +EffectFactory::EffectData EffectFactory::getData() +{ + EffectData data; + + // Create a temporary CMdaAudioOutputStream object, so that the effects + // API can query DevSound to discover which effects are supported. + OutputStreamFactory streamFactory; + QScopedPointer stream(streamFactory.create()); + + typedef typename BackendNode::NativeEffect NativeEffect; + QScopedPointer effect; + TRAPD(err, effect.reset(NativeEffect::NewL(*stream))); + data.m_supported = (KErrNone == err); + + if (KErrNone == err) { + 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); + } - if (isEffectSupported()) - retval.append(AbstractAudioEffect::EffectStereoWidening); - */ + return data; +} - return retval; +const EffectFactory::EffectData& EffectFactory::data(Type type) const +{ + QHash::const_iterator i = m_effectData.find(type); + Q_ASSERT_X(i != m_effectData.end(), Q_FUNC_INFO, "Effect data not found"); + return i.value(); } QT_END_NAMESPACE diff --git a/src/3rdparty/phonon/mmf/effectfactory.h b/src/3rdparty/phonon/mmf/effectfactory.h index e83ad15..45bd0f0 100644 --- a/src/3rdparty/phonon/mmf/effectfactory.h +++ b/src/3rdparty/phonon/mmf/effectfactory.h @@ -31,14 +31,30 @@ namespace MMF /** * @short Contains utility functions related to effects. */ -class EffectFactory +class EffectFactory : public QObject { + Q_OBJECT + public: + EffectFactory(QObject *parent); + ~EffectFactory(); + + enum Type + { + TypeAudioEqualizer = 0 + , TypeBassBoost + , TypeDistanceAttenuation + , TypeEnvironmentalReverb + , TypeListenerOrientation + , TypeLoudness + , TypeSourceOrientation + , TypeStereoWidening + }; + /** * @short Creates an audio effect of type @p type. */ - static AbstractAudioEffect *createAudioEffect(AbstractAudioEffect::Type type, - QObject *parent); + AbstractAudioEffect *createAudioEffect(Type type, QObject *parent); /** * @short Return the properties for effect @p type. @@ -46,7 +62,7 @@ public: * This handles the effects for * BackendInterface::objectDescriptionProperties(). */ - static QHash audioEffectDescriptions(AbstractAudioEffect::Type type); + QHash audioEffectDescriptions(Type type); /** * @short Returns the indexes for the supported effects. @@ -54,19 +70,27 @@ public: * This handles the effects for * BackendInterface::objectDescriptionIndexes(). */ - static QList effectIndexes(); + QList effectIndexes(); private: - static inline QHash constructEffectDescription(const QString &name, - const QString &description); + void initialize(); + + struct EffectData + { + bool m_supported; + QHash m_descriptions; + QList m_parameters; + }; + + template EffectData getData(); + const EffectData& data(Type type) const; + +private: + bool m_initialized; + QHash m_effectData; - /** - * This class is not supposed to be instantiated, so disable - * the default constructor. - */ - inline EffectFactory(); - Q_DISABLE_COPY(EffectFactory) }; + } } diff --git a/src/plugins/phonon/mmf/mmf.pro b/src/plugins/phonon/mmf/mmf.pro index 854f893..65a7a29 100644 --- a/src/plugins/phonon/mmf/mmf.pro +++ b/src/plugins/phonon/mmf/mmf.pro @@ -81,6 +81,7 @@ LIBS += -lws32 # For RWindow LIBS += -lefsrv # For file server LIBS += -lapgrfx -lapmime # For recognizer LIBS += -lmmfcontrollerframework # For CMMFMetaDataEntry +LIBS += -lmediaclientaudiostream # For CMdaAudioOutputStream # These are for effects. LIBS += -lAudioEqualizerEffect -lBassBoostEffect -lDistanceAttenuationEffect -lDopplerBase -lEffectBase -lEnvironmentalReverbEffect -lListenerDopplerEffect -lListenerLocationEffect -lListenerOrientationEffect -lLocationBase -lLoudnessEffect -lOrientationBase -lSourceDopplerEffect -lSourceLocationEffect -lSourceOrientationEffect -lStereoWideningEffect -- cgit v0.12 From af7a0cbe4d6dcbae5d16e91d488df5a5dc8919c2 Mon Sep 17 00:00:00 2001 From: Gareth Stockwell Date: Tue, 8 Dec 2009 14:39:51 +0000 Subject: Shortened description of audio equalizer bands This improves the small-screen layout of the equalizer configuration dialog. Task-number: QTBUG-4659 Reviewed-by: trustme --- src/3rdparty/phonon/mmf/audioequalizer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/3rdparty/phonon/mmf/audioequalizer.cpp b/src/3rdparty/phonon/mmf/audioequalizer.cpp index 5aa659a..37ba328 100644 --- a/src/3rdparty/phonon/mmf/audioequalizer.cpp +++ b/src/3rdparty/phonon/mmf/audioequalizer.cpp @@ -96,7 +96,7 @@ void AudioEqualizer::getParameters(NativeEffect *effect, const qint32 defVol = effect->BandLevel(i); parameters.append(EffectParameter(i, - tr("Frequency band, %1 Hz").arg(hz), + tr("%1 Hz").arg(hz), EffectParameter::LogarithmicHint, QVariant(qint32(defVol)), QVariant(qint32(dbMin)), -- cgit v0.12 From e4f2a7f7aae733df87a60f0e9b32dd4d4f6ddcd0 Mon Sep 17 00:00:00 2001 From: Gareth Stockwell Date: Tue, 8 Dec 2009 14:41:31 +0000 Subject: Added comments to clarify usage of Phonon::EffectParameter API Task-number: QTBUG-4659 Reviewed-by: trustme --- src/3rdparty/phonon/mmf/audioequalizer.cpp | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/src/3rdparty/phonon/mmf/audioequalizer.cpp b/src/3rdparty/phonon/mmf/audioequalizer.cpp index 37ba328..5a1ce19 100644 --- a/src/3rdparty/phonon/mmf/audioequalizer.cpp +++ b/src/3rdparty/phonon/mmf/audioequalizer.cpp @@ -95,14 +95,15 @@ void AudioEqualizer::getParameters(NativeEffect *effect, const qint32 defVol = effect->BandLevel(i); - parameters.append(EffectParameter(i, - tr("%1 Hz").arg(hz), - EffectParameter::LogarithmicHint, - QVariant(qint32(defVol)), - QVariant(qint32(dbMin)), - QVariant(qint32(dbMax)), - QVariantList(), - QString())); + parameters.append(EffectParameter( + /* parameterId */ i, + /* name */ tr("%1 Hz").arg(hz), + /* hints */ EffectParameter::LogarithmicHint, + /* defaultValue */ QVariant(qint32(defVol)), + /* minimumValue */ QVariant(qint32(dbMin)), + /* maximumValue */ QVariant(qint32(dbMax)), + /* values */ QVariantList(), + /* description */ QString())); } } -- cgit v0.12 From 483893142dcec15c646ef997309dcede76466766 Mon Sep 17 00:00:00 2001 From: Gareth Stockwell Date: Mon, 11 Jan 2010 15:03:29 +0000 Subject: Modified effect parameter handling to improve user experience This change is to work around a limitation in the Phonon::EffectWidget class. This widget only displays sliders for parameters with numeric values if the variant type of the parameter is QReal and the range is exactly -1.0 to +1.0; otherwise, a spinbox is displayed. This is rather inconvenient for many effects, such as the audio equalizer, for which a slider is a much more natural UI control. The MMF backend therefore reports the type of numeric parameters to be QReal, and the range to be -1.0 to +1.0. Internally, the integer range for the parameter is stored. Changes to the parameter value are converted from the client-side, floating point representation to the internal, integer representation. Task-number: QTBUG-4659 Reviewed-by: Espen Riskedal --- src/3rdparty/phonon/mmf/abstractaudioeffect.cpp | 15 ++++-- src/3rdparty/phonon/mmf/abstractaudioeffect.h | 11 ++-- src/3rdparty/phonon/mmf/audioequalizer.cpp | 30 +++++++---- src/3rdparty/phonon/mmf/audioequalizer.h | 2 +- src/3rdparty/phonon/mmf/effectfactory.h | 1 + src/3rdparty/phonon/mmf/effectparameter.cpp | 63 ++++++++++++++++++++++ src/3rdparty/phonon/mmf/effectparameter.h | 72 +++++++++++++++++++++++++ src/3rdparty/phonon/phonon/effectwidget.cpp | 2 +- src/plugins/phonon/mmf/mmf.pro | 2 + 9 files changed, 175 insertions(+), 23 deletions(-) create mode 100644 src/3rdparty/phonon/mmf/effectparameter.cpp create mode 100644 src/3rdparty/phonon/mmf/effectparameter.h diff --git a/src/3rdparty/phonon/mmf/abstractaudioeffect.cpp b/src/3rdparty/phonon/mmf/abstractaudioeffect.cpp index c75c08e..1939e04 100644 --- a/src/3rdparty/phonon/mmf/abstractaudioeffect.cpp +++ b/src/3rdparty/phonon/mmf/abstractaudioeffect.cpp @@ -38,18 +38,23 @@ using namespace Phonon::MMF; AbstractAudioEffect::AbstractAudioEffect(QObject *parent, const QList ¶ms) : MediaNode(parent) - , m_player(0) , m_params(params) + , m_player(0) { } -QList AbstractAudioEffect::parameters() const +QList AbstractAudioEffect::parameters() const { - return m_params; + // Convert from QList to QList + QList result; + EffectParameter param; + foreach (param, m_params) + result += param; + return result; } -QVariant AbstractAudioEffect::parameterValue(const EffectParameter &queriedParam) const +QVariant AbstractAudioEffect::parameterValue(const Phonon::EffectParameter &queriedParam) const { const QVariant &val = m_values.value(queriedParam.id()); @@ -59,7 +64,7 @@ QVariant AbstractAudioEffect::parameterValue(const EffectParameter &queriedParam return val; } -void AbstractAudioEffect::setParameterValue(const EffectParameter ¶m, +void AbstractAudioEffect::setParameterValue(const Phonon::EffectParameter ¶m, const QVariant &newValue) { m_values.insert(param.id(), newValue); diff --git a/src/3rdparty/phonon/mmf/abstractaudioeffect.h b/src/3rdparty/phonon/mmf/abstractaudioeffect.h index df1d08a..4772eb8 100644 --- a/src/3rdparty/phonon/mmf/abstractaudioeffect.h +++ b/src/3rdparty/phonon/mmf/abstractaudioeffect.h @@ -24,9 +24,9 @@ along with this library. If not, see . #include #include -#include #include "audioplayer.h" +#include "effectparameter.h" #include "mmf_medianode.h" #include "mmf_videoplayer.h" @@ -63,9 +63,10 @@ public: AbstractAudioEffect(QObject *parent, const QList ¶ms); - virtual QList parameters() const; - virtual QVariant parameterValue(const EffectParameter ¶m) const; - virtual void setParameterValue(const EffectParameter &, + // Phonon::EffectInterface + virtual QList parameters() const; + virtual QVariant parameterValue(const Phonon::EffectParameter ¶m) const; + virtual void setParameterValue(const Phonon::EffectParameter &, const QVariant &newValue); protected: @@ -81,10 +82,10 @@ protected: protected: QScopedPointer m_effect; + const QList m_params; private: AbstractMediaPlayer * m_player; - const QList m_params; QHash m_values; }; diff --git a/src/3rdparty/phonon/mmf/audioequalizer.cpp b/src/3rdparty/phonon/mmf/audioequalizer.cpp index 5a1ce19..adbe6c8 100644 --- a/src/3rdparty/phonon/mmf/audioequalizer.cpp +++ b/src/3rdparty/phonon/mmf/audioequalizer.cpp @@ -39,7 +39,7 @@ void AudioEqualizer::parameterChanged(const int pid, { if (m_effect.data()) { const int band = pid; - const int level = value.toInt(); + const qreal level = value.toReal(); setBandLevel(band, level); } } @@ -54,7 +54,7 @@ void AudioEqualizer::connectAudioPlayer(AudioPlayer::NativePlayer *player) void AudioEqualizer::applyParameters() { if (m_effect.data()) { - EffectParameter param; + Phonon::EffectParameter param; foreach (param, parameters()) { const int band = param.id(); const int level = parameterValue(param).toInt(); @@ -63,11 +63,14 @@ void AudioEqualizer::applyParameters() } } -void AudioEqualizer::setBandLevel(int band, int level) +void AudioEqualizer::setBandLevel(int band, qreal externalLevel) { + const EffectParameter ¶m = m_params[band]; + const int internalLevel = param.toInternalValue(externalLevel); + CAudioEqualizer *const effect = static_cast(m_effect.data()); // TODO: handle audio effect errors - TRAP_IGNORE(effect->SetBandLevelL(band, level)); + TRAP_IGNORE(effect->SetBandLevelL(band, internalLevel)); } //----------------------------------------------------------------------------- @@ -93,17 +96,22 @@ void AudioEqualizer::getParameters(NativeEffect *effect, for (int i = 1; i <= bandCount; ++i) { const qint32 hz = effect->CenterFrequency(i); - const qint32 defVol = effect->BandLevel(i); - - parameters.append(EffectParameter( + // We pass a floating-point parameter range of -1.0 to +1.0 for + // each band in order to work around a limitation in + // Phonon::EffectWidget. See documentation of EffectParameter + // for more details. + EffectParameter param( /* parameterId */ i, /* name */ tr("%1 Hz").arg(hz), /* hints */ EffectParameter::LogarithmicHint, - /* defaultValue */ QVariant(qint32(defVol)), - /* minimumValue */ QVariant(qint32(dbMin)), - /* maximumValue */ QVariant(qint32(dbMax)), + /* defaultValue */ QVariant(qreal(0.0)), + /* minimumValue */ QVariant(qreal(-1.0)), + /* maximumValue */ QVariant(qreal(+1.0)), /* values */ QVariantList(), - /* description */ QString())); + /* description */ QString()); + + param.setInternalRange(dbMin, dbMax); + parameters.append(param); } } diff --git a/src/3rdparty/phonon/mmf/audioequalizer.h b/src/3rdparty/phonon/mmf/audioequalizer.h index ee3d297..d10cbf3 100644 --- a/src/3rdparty/phonon/mmf/audioequalizer.h +++ b/src/3rdparty/phonon/mmf/audioequalizer.h @@ -56,7 +56,7 @@ protected: virtual void parameterChanged(const int id, const QVariant &value); private: - void setBandLevel(int band, int level); + void setBandLevel(int band, qreal externalLevel); }; } diff --git a/src/3rdparty/phonon/mmf/effectfactory.h b/src/3rdparty/phonon/mmf/effectfactory.h index 45bd0f0..dd4b58d 100644 --- a/src/3rdparty/phonon/mmf/effectfactory.h +++ b/src/3rdparty/phonon/mmf/effectfactory.h @@ -20,6 +20,7 @@ along with this library. If not, see . #define PHONON_MMF_EFFECTFACTORY_H #include "abstractaudioeffect.h" +#include "effectparameter.h" QT_BEGIN_NAMESPACE diff --git a/src/3rdparty/phonon/mmf/effectparameter.cpp b/src/3rdparty/phonon/mmf/effectparameter.cpp new file mode 100644 index 0000000..f4287b8 --- /dev/null +++ b/src/3rdparty/phonon/mmf/effectparameter.cpp @@ -0,0 +1,63 @@ +/* This file is part of the KDE project. + +Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). + +This library is free software: you can redistribute it and/or modify +it under the terms of the GNU Lesser General Public License as published by +the Free Software Foundation, either version 2.1 or 3 of the License. + +This library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU Lesser General Public License for more details. + +You should have received a copy of the GNU Lesser General Public License +along with this library. If not, see . + +*/ + +#include "effectparameter.h" + +QT_BEGIN_NAMESPACE + +using namespace Phonon; +using namespace Phonon::MMF; + +/*! \class MMF::EffectParameter + \internal +*/ + +MMF::EffectParameter::EffectParameter() + : m_hasInternalRange(false) +{ + +} + +MMF::EffectParameter::EffectParameter( + int parameterId, const QString &name, Hints hints, + const QVariant &defaultValue, const QVariant &min, + const QVariant &max, const QVariantList &values, + const QString &description) + : Phonon::EffectParameter(parameterId, name, hints, defaultValue, + min, max, values, description) + , m_hasInternalRange(false) +{ + +} + +void MMF::EffectParameter::setInternalRange(qint32 min, qint32 max) +{ + Q_ASSERT_X(max >= min, Q_FUNC_INFO, "Invalid range"); + m_internalRange = QPair(min, max); + m_hasInternalRange = true; +} + +qint32 MMF::EffectParameter::toInternalValue(qreal external) const +{ + Q_ASSERT_X(m_hasInternalRange, Q_FUNC_INFO, "Does not have internal range"); + const qint32 range = m_internalRange.second - m_internalRange.first; + return m_internalRange.first + ((1.0 + external) / 2) * range; +} + +QT_END_NAMESPACE + diff --git a/src/3rdparty/phonon/mmf/effectparameter.h b/src/3rdparty/phonon/mmf/effectparameter.h new file mode 100644 index 0000000..3008159 --- /dev/null +++ b/src/3rdparty/phonon/mmf/effectparameter.h @@ -0,0 +1,72 @@ +/* This file is part of the KDE project. + +Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). + +This library is free software: you can redistribute it and/or modify +it under the terms of the GNU Lesser General Public License as published by +the Free Software Foundation, either version 2.1 or 3 of the License. + +This library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU Lesser General Public License for more details. + +You should have received a copy of the GNU Lesser General Public License +along with this library. If not, see . + +*/ + +#ifndef PHONON_MMF_EFFECTPARAMETER_H +#define PHONON_MMF_EFFECTPARAMETER_H + +#include + +QT_BEGIN_NAMESPACE + +namespace Phonon +{ +namespace MMF +{ + +/** + * @short Parameter value for an audio effect + * + * The base class is extended in order to work around a shortcoming + * in Phonon::EffectWidget. This widget only displays sliders for + * parameters with numeric values if the variant type of the parameter + * is QReal and the range is exactly -1.0 to +1.0; otherwise, a + * spinbox is used to set numeric parameters. This is rather + * inconvenient for many effects, such as the audio equalizer, for + * which a slider is a much more natural UI control. + * + * For many such parameters, we therefore report the type to be QReal + * and the range to be -1.0 to +1.0. This class stores the actual + * integer range for the parameter, and provides the toInternalValue + * function for converting between the client-side floating point + * value and the internal integer value. + */ +class EffectParameter : public Phonon::EffectParameter +{ +public: + EffectParameter(); + EffectParameter(int parameterId, const QString &name, Hints hints, + const QVariant &defaultValue, const QVariant &min = QVariant(), + const QVariant &max = QVariant(), const QVariantList &values = QVariantList(), + const QString &description = QString()); + + void setInternalRange(qint32 min, qint32 max); + qint32 toInternalValue(qreal external) const; + +private: + bool m_hasInternalRange; + QPair m_internalRange; + +}; + +} +} + +QT_END_NAMESPACE + +#endif + diff --git a/src/3rdparty/phonon/phonon/effectwidget.cpp b/src/3rdparty/phonon/phonon/effectwidget.cpp index b39299a..a2fe50f 100644 --- a/src/3rdparty/phonon/phonon/effectwidget.cpp +++ b/src/3rdparty/phonon/phonon/effectwidget.cpp @@ -15,7 +15,7 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. - You should have received a copy of the GNU Lesser General Public + You should have received a copy of the GNU Lesser General Public License along with this library. If not, see . */ diff --git a/src/plugins/phonon/mmf/mmf.pro b/src/plugins/phonon/mmf/mmf.pro index 65a7a29..f72a657 100644 --- a/src/plugins/phonon/mmf/mmf.pro +++ b/src/plugins/phonon/mmf/mmf.pro @@ -35,6 +35,7 @@ HEADERS += \ $$PHONON_MMF_DIR/defs.h \ $$PHONON_MMF_DIR/dummyplayer.h \ $$PHONON_MMF_DIR/effectfactory.h \ + $$PHONON_MMF_DIR/effectparameter.h \ $$PHONON_MMF_DIR/mediaobject.h \ $$PHONON_MMF_DIR/mmf_medianode.h \ $$PHONON_MMF_DIR/mmf_videoplayer.h \ @@ -57,6 +58,7 @@ SOURCES += \ $$PHONON_MMF_DIR/bassboost.cpp \ $$PHONON_MMF_DIR/dummyplayer.cpp \ $$PHONON_MMF_DIR/effectfactory.cpp \ + $$PHONON_MMF_DIR/effectparameter.cpp \ $$PHONON_MMF_DIR/mediaobject.cpp \ $$PHONON_MMF_DIR/mmf_medianode.cpp \ $$PHONON_MMF_DIR/mmf_videoplayer.cpp \ -- cgit v0.12 From e53306725e52407146304df9d8d3a65920fc3e8d Mon Sep 17 00:00:00 2001 From: Gareth Stockwell Date: Mon, 11 Jan 2010 15:30:15 +0000 Subject: 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 --- src/3rdparty/phonon/mmf/abstractaudioeffect.cpp | 59 ++++++++++++++++++------- src/3rdparty/phonon/mmf/abstractaudioeffect.h | 11 ++++- src/3rdparty/phonon/mmf/audioequalizer.cpp | 6 +-- src/3rdparty/phonon/mmf/audioequalizer.h | 2 +- src/3rdparty/phonon/mmf/bassboost.cpp | 2 +- src/3rdparty/phonon/mmf/bassboost.h | 2 +- src/3rdparty/phonon/mmf/mediaobject.cpp | 3 ++ src/3rdparty/phonon/mmf/mediaobject.h | 1 + 8 files changed, 63 insertions(+), 23 deletions(-) diff --git a/src/3rdparty/phonon/mmf/abstractaudioeffect.cpp b/src/3rdparty/phonon/mmf/abstractaudioeffect.cpp index 1939e04..cdddf02 100644 --- a/src/3rdparty/phonon/mmf/abstractaudioeffect.cpp +++ b/src/3rdparty/phonon/mmf/abstractaudioeffect.cpp @@ -68,11 +68,26 @@ void AbstractAudioEffect::setParameterValue(const Phonon::EffectParameter ¶m const QVariant &newValue) { m_values.insert(param.id(), newValue); - parameterChanged(param.id(), newValue); - if (m_effect.data()) + if (m_effect.data()) { + parameterChanged(param.id(), newValue); // TODO: handle audio effect errors TRAP_IGNORE(m_effect->ApplyL()); + } +} + +void AbstractAudioEffect::abstractPlayerChanged(AbstractPlayer *player) +{ + m_player = qobject_cast(player); + m_effect.reset(); +} + +void AbstractAudioEffect::stateChanged(Phonon::State newState, + Phonon::State oldState) +{ + if (Phonon::LoadingState == oldState + && Phonon::LoadingState != newState) + createEffect(); } void AbstractAudioEffect::connectMediaObject(MediaObject *mediaObject) @@ -80,25 +95,37 @@ void AbstractAudioEffect::connectMediaObject(MediaObject *mediaObject) Q_ASSERT_X(!m_player, Q_FUNC_INFO, "Player already connected"); Q_ASSERT_X(!m_effect.data(), Q_FUNC_INFO, "Effect already created"); - AbstractMediaPlayer *const player = - qobject_cast(mediaObject->abstractPlayer()); + abstractPlayerChanged(mediaObject->abstractPlayer()); - if (player) { - m_player = player; + connect(mediaObject, SIGNAL(stateChanged(Phonon::State, Phonon::State)), + SLOT(stateChanged(Phonon::State, Phonon::State))); - if (AudioPlayer *audioPlayer = qobject_cast(player)) { - connectAudioPlayer(audioPlayer->nativePlayer()); - applyParameters(); - // TODO: handle audio effect errors - TRAP_IGNORE(m_effect->EnableL()); - } - } + connect(mediaObject, SIGNAL(abstractPlayerChanged(AbstractPlayer *)), + SLOT(abstractPlayerChanged(AbstractPlayer *))); + + if (mediaObject->state() != Phonon::LoadingState) + createEffect(); } -void AbstractAudioEffect::disconnectMediaObject(MediaObject * /*mediaObject*/) +void AbstractAudioEffect::disconnectMediaObject(MediaObject *mediaObject) { - m_player = 0; - m_effect.reset(); + mediaObject->disconnect(this); + abstractPlayerChanged(0); +} + +void AbstractAudioEffect::createEffect() +{ + Q_ASSERT_X(m_player, Q_FUNC_INFO, "Invalid media player pointer"); + + if (AudioPlayer *audioPlayer = qobject_cast(m_player)) { + createEffect(audioPlayer->nativePlayer()); + } + + if (m_effect.data()) { + applyParameters(); + // TODO: handle audio effect errors + TRAP_IGNORE(m_effect->EnableL()); + } } QT_END_NAMESPACE diff --git a/src/3rdparty/phonon/mmf/abstractaudioeffect.h b/src/3rdparty/phonon/mmf/abstractaudioeffect.h index 4772eb8..7d44bf0 100644 --- a/src/3rdparty/phonon/mmf/abstractaudioeffect.h +++ b/src/3rdparty/phonon/mmf/abstractaudioeffect.h @@ -36,6 +36,7 @@ namespace Phonon { namespace MMF { +class AbstractPlayer; class AbstractMediaPlayer; /** @@ -69,17 +70,25 @@ public: virtual void setParameterValue(const Phonon::EffectParameter &, const QVariant &newValue); +public Q_SLOTS: + void abstractPlayerChanged(AbstractPlayer *player); + void stateChanged(Phonon::State newState, + Phonon::State oldState); + protected: // MediaNode void connectMediaObject(MediaObject *mediaObject); void disconnectMediaObject(MediaObject *mediaObject); - virtual void connectAudioPlayer(AudioPlayer::NativePlayer *player) = 0; + virtual void createEffect(AudioPlayer::NativePlayer *player) = 0; virtual void applyParameters() = 0; virtual void parameterChanged(const int id, const QVariant &value) = 0; +private: + void createEffect(); + protected: QScopedPointer m_effect; const QList m_params; diff --git a/src/3rdparty/phonon/mmf/audioequalizer.cpp b/src/3rdparty/phonon/mmf/audioequalizer.cpp index adbe6c8..b41eda4 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 ¶m = m_params[band]; + const EffectParameter ¶m = m_params[band-1]; // Band IDs are 1-based const int internalLevel = param.toInternalValue(externalLevel); CAudioEqualizer *const effect = static_cast(m_effect.data()); diff --git a/src/3rdparty/phonon/mmf/audioequalizer.h b/src/3rdparty/phonon/mmf/audioequalizer.h index d10cbf3..22fa1e8 100644 --- a/src/3rdparty/phonon/mmf/audioequalizer.h +++ b/src/3rdparty/phonon/mmf/audioequalizer.h @@ -51,7 +51,7 @@ public: protected: // AbstractAudioEffect - virtual void connectAudioPlayer(AudioPlayer::NativePlayer *player); + virtual void createEffect(AudioPlayer::NativePlayer *player); virtual void applyParameters(); virtual void parameterChanged(const int id, const QVariant &value); diff --git a/src/3rdparty/phonon/mmf/bassboost.cpp b/src/3rdparty/phonon/mmf/bassboost.cpp index 4edd102..9f62ecc 100644 --- a/src/3rdparty/phonon/mmf/bassboost.cpp +++ b/src/3rdparty/phonon/mmf/bassboost.cpp @@ -40,7 +40,7 @@ void BassBoost::parameterChanged(const int, Q_ASSERT_X(false, Q_FUNC_INFO, "BassBoost has no parameters"); } -void BassBoost::connectAudioPlayer(AudioPlayer::NativePlayer *player) +void BassBoost::createEffect(AudioPlayer::NativePlayer *player) { CBassBoost *ptr = 0; QT_TRAP_THROWING(ptr = CBassBoost::NewL(*player)); diff --git a/src/3rdparty/phonon/mmf/bassboost.h b/src/3rdparty/phonon/mmf/bassboost.h index c3c48d0..9f3d764 100644 --- a/src/3rdparty/phonon/mmf/bassboost.h +++ b/src/3rdparty/phonon/mmf/bassboost.h @@ -49,7 +49,7 @@ public: protected: // AbstractAudioEffect - virtual void connectAudioPlayer(AudioPlayer::NativePlayer *player); + virtual void createEffect(AudioPlayer::NativePlayer *player); virtual void applyParameters(); virtual void parameterChanged(const int id, const QVariant &value); diff --git a/src/3rdparty/phonon/mmf/mediaobject.cpp b/src/3rdparty/phonon/mmf/mediaobject.cpp index 4653fee..9744774 100644 --- a/src/3rdparty/phonon/mmf/mediaobject.cpp +++ b/src/3rdparty/phonon/mmf/mediaobject.cpp @@ -297,7 +297,10 @@ void MMF::MediaObject::createPlayer(const MediaSource &source) break; } + if (oldPlayer) + emit abstractPlayerChanged(0); m_player.reset(newPlayer); + emit abstractPlayerChanged(newPlayer); if (oldPlayerHasVideo != hasVideo()) { emit hasVideoChanged(hasVideo()); diff --git a/src/3rdparty/phonon/mmf/mediaobject.h b/src/3rdparty/phonon/mmf/mediaobject.h index 7d330e7..c87d755 100644 --- a/src/3rdparty/phonon/mmf/mediaobject.h +++ b/src/3rdparty/phonon/mmf/mediaobject.h @@ -92,6 +92,7 @@ public Q_SLOTS: void switchToNextSource(); Q_SIGNALS: + void abstractPlayerChanged(AbstractPlayer *player); void totalTimeChanged(qint64 length); void hasVideoChanged(bool hasVideo); void seekableChanged(bool seekable); -- cgit v0.12 From 894bb6e1742b75312feb7a18d043a67a3dba4cb9 Mon Sep 17 00:00:00 2001 From: Gareth Stockwell Date: Mon, 11 Jan 2010 15:38:07 +0000 Subject: 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 --- src/3rdparty/phonon/mmf/abstractaudioeffect.h | 2 + src/3rdparty/phonon/mmf/audioequalizer.cpp | 67 +++++++++++++++------------ src/3rdparty/phonon/mmf/audioequalizer.h | 7 +-- src/3rdparty/phonon/mmf/bassboost.cpp | 4 +- src/3rdparty/phonon/mmf/bassboost.h | 7 +-- src/3rdparty/phonon/mmf/effectfactory.cpp | 21 +-------- 6 files changed, 48 insertions(+), 60 deletions(-) diff --git a/src/3rdparty/phonon/mmf/abstractaudioeffect.h b/src/3rdparty/phonon/mmf/abstractaudioeffect.h index 7d44bf0..9e5a6eb 100644 --- a/src/3rdparty/phonon/mmf/abstractaudioeffect.h +++ b/src/3rdparty/phonon/mmf/abstractaudioeffect.h @@ -30,6 +30,8 @@ along with this library. If not, see . #include "mmf_medianode.h" #include "mmf_videoplayer.h" +class CMdaAudioOutputStream; + QT_BEGIN_NAMESPACE namespace Phonon diff --git a/src/3rdparty/phonon/mmf/audioequalizer.cpp b/src/3rdparty/phonon/mmf/audioequalizer.cpp index b41eda4..a4127c4 100644 --- a/src/3rdparty/phonon/mmf/audioequalizer.cpp +++ b/src/3rdparty/phonon/mmf/audioequalizer.cpp @@ -82,37 +82,46 @@ const char* AudioEqualizer::description() return "Audio equalizer"; } -void AudioEqualizer::getParameters(NativeEffect *effect, - QList ¶meters) +bool AudioEqualizer::getParameters(CMdaAudioOutputStream *stream, + QList& parameters) { - TInt32 dbMin; - TInt32 dbMax; - effect->DbLevelLimits(dbMin, dbMax); - - const int bandCount = effect->NumberOfBands(); - - // For some reason, band IDs are 1-based, as opposed to the - // 0-based indices used in just about other Symbian API...! - for (int i = 1; i <= bandCount; ++i) { - const qint32 hz = effect->CenterFrequency(i); - - // We pass a floating-point parameter range of -1.0 to +1.0 for - // each band in order to work around a limitation in - // Phonon::EffectWidget. See documentation of EffectParameter - // for more details. - EffectParameter param( - /* parameterId */ i, - /* name */ tr("%1 Hz").arg(hz), - /* hints */ EffectParameter::LogarithmicHint, - /* defaultValue */ QVariant(qreal(0.0)), - /* minimumValue */ QVariant(qreal(-1.0)), - /* maximumValue */ QVariant(qreal(+1.0)), - /* values */ QVariantList(), - /* description */ QString()); - - param.setInternalRange(dbMin, dbMax); - parameters.append(param); + bool supported = false; + + QScopedPointer effect; + TRAPD(err, effect.reset(CAudioEqualizer::NewL(*stream))); + + if (KErrNone == err) { + supported = true; + + TInt32 dbMin; + TInt32 dbMax; + effect->DbLevelLimits(dbMin, dbMax); + + const int bandCount = effect->NumberOfBands(); + + // For some reason, band IDs are 1-based, as opposed to the + // 0-based indices used in just about other Symbian API...! + for (int i = 1; i <= bandCount; ++i) { + const qint32 hz = effect->CenterFrequency(i); + + // We pass a floating-point parameter range of -1.0 to +1.0 for + // each band in order to work around a limitation in + // Phonon::EffectWidget. See documentation of EffectParameter + // for more details. + EffectParameter param( + /* parameterId */ i, + /* name */ tr("%1 Hz").arg(hz), + /* hints */ EffectParameter::LogarithmicHint, + /* defaultValue */ QVariant(qreal(0.0)), + /* minimumValue */ QVariant(qreal(-1.0)), + /* maximumValue */ QVariant(qreal(+1.0))); + + param.setInternalRange(dbMin, dbMax); + parameters.append(param); + } } + + return supported; } QT_END_NAMESPACE diff --git a/src/3rdparty/phonon/mmf/audioequalizer.h b/src/3rdparty/phonon/mmf/audioequalizer.h index 22fa1e8..35592f4 100644 --- a/src/3rdparty/phonon/mmf/audioequalizer.h +++ b/src/3rdparty/phonon/mmf/audioequalizer.h @@ -21,8 +21,6 @@ along with this library. If not, see . #include "abstractaudioeffect.h" -class CAudioEqualizer; - QT_BEGIN_NAMESPACE namespace Phonon @@ -45,9 +43,8 @@ public: // Static interface required by EffectFactory static const char* description(); - typedef CAudioEqualizer NativeEffect; - static void getParameters(NativeEffect *effect, - QList ¶meters); + static bool getParameters(CMdaAudioOutputStream *stream, + QList& parameters); protected: // AbstractAudioEffect diff --git a/src/3rdparty/phonon/mmf/bassboost.cpp b/src/3rdparty/phonon/mmf/bassboost.cpp index 9f62ecc..642d782 100644 --- a/src/3rdparty/phonon/mmf/bassboost.cpp +++ b/src/3rdparty/phonon/mmf/bassboost.cpp @@ -61,9 +61,9 @@ const char* BassBoost::description() return "Bass boost"; } -void BassBoost::getParameters(NativeEffect*, QList&) +bool BassBoost::getParameters(CMdaAudioOutputStream *, QList&) { - + return true; } QT_END_NAMESPACE diff --git a/src/3rdparty/phonon/mmf/bassboost.h b/src/3rdparty/phonon/mmf/bassboost.h index 9f3d764..241cda9 100644 --- a/src/3rdparty/phonon/mmf/bassboost.h +++ b/src/3rdparty/phonon/mmf/bassboost.h @@ -21,8 +21,6 @@ along with this library. If not, see . #include "abstractaudioeffect.h" -class CBassBoost; - QT_BEGIN_NAMESPACE namespace Phonon @@ -43,9 +41,8 @@ public: // Static interface required by EffectFactory static const char* description(); - typedef CBassBoost NativeEffect; - static void getParameters(NativeEffect *effect, - QList ¶meters); + static bool getParameters(CMdaAudioOutputStream *stream, + QList& parameters); protected: // AbstractAudioEffect 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 . #include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - #include #include "audioequalizer.h" @@ -171,19 +160,13 @@ EffectFactory::EffectData EffectFactory::getData() OutputStreamFactory streamFactory; QScopedPointer stream(streamFactory.create()); - typedef typename BackendNode::NativeEffect NativeEffect; - QScopedPointer 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; -- cgit v0.12 From 1a7234e3a27b592565241e9044919f7842fc5f08 Mon Sep 17 00:00:00 2001 From: Gareth Stockwell Date: Mon, 11 Jan 2010 15:50:19 +0000 Subject: Added a macro to reduce boilerplate code in Phonon MMF backend Task-number: QTBUG-4659 Reviewed-by: Espen Riskedal --- src/3rdparty/phonon/mmf/abstractaudioeffect.h | 19 +++++++++++++++++++ src/3rdparty/phonon/mmf/audioequalizer.cpp | 15 +++++---------- src/3rdparty/phonon/mmf/audioequalizer.h | 3 +++ src/3rdparty/phonon/mmf/bassboost.cpp | 10 +++------- src/3rdparty/phonon/mmf/bassboost.h | 5 +++++ 5 files changed, 35 insertions(+), 17 deletions(-) diff --git a/src/3rdparty/phonon/mmf/abstractaudioeffect.h b/src/3rdparty/phonon/mmf/abstractaudioeffect.h index 9e5a6eb..b34ad0d 100644 --- a/src/3rdparty/phonon/mmf/abstractaudioeffect.h +++ b/src/3rdparty/phonon/mmf/abstractaudioeffect.h @@ -103,6 +103,25 @@ private: } } + +// Macro for defining functions which depend on the native class name +// for each of the effects. Using this reduces repetition of boilerplate +// in the implementations of the backend effect nodes. + +#define PHONON_MMF_DEFINE_EFFECT_FUNCTIONS(Effect) \ + \ +void Effect##::createEffect(AudioPlayer::NativePlayer *player) \ +{ \ + C##Effect *ptr = 0; \ + QT_TRAP_THROWING(ptr = C##Effect::NewL(*player)); \ + m_effect.reset(ptr); \ +} \ + \ +C##Effect* Effect::concreteEffect() \ +{ \ + return static_cast(m_effect.data()); \ +} + QT_END_NAMESPACE #endif diff --git a/src/3rdparty/phonon/mmf/audioequalizer.cpp b/src/3rdparty/phonon/mmf/audioequalizer.cpp index a4127c4..ab95f30 100644 --- a/src/3rdparty/phonon/mmf/audioequalizer.cpp +++ b/src/3rdparty/phonon/mmf/audioequalizer.cpp @@ -28,7 +28,10 @@ using namespace Phonon::MMF; \internal */ -AudioEqualizer::AudioEqualizer(QObject *parent, const QList ¶meters) +// Define functions which depend on concrete native effect class name +PHONON_MMF_DEFINE_EFFECT_FUNCTIONS(AudioEqualizer) + +AudioEqualizer::AudioEqualizer(QObject *parent, const QList& parameters) : AbstractAudioEffect::AbstractAudioEffect(parent, parameters) { @@ -44,13 +47,6 @@ void AudioEqualizer::parameterChanged(const int pid, } } -void AudioEqualizer::createEffect(AudioPlayer::NativePlayer *player) -{ - CAudioEqualizer *ptr = 0; - QT_TRAP_THROWING(ptr = CAudioEqualizer::NewL(*player)); - m_effect.reset(ptr); -} - void AudioEqualizer::applyParameters() { if (m_effect.data()) { @@ -68,9 +64,8 @@ void AudioEqualizer::setBandLevel(int band, qreal externalLevel) const EffectParameter ¶m = m_params[band-1]; // Band IDs are 1-based const int internalLevel = param.toInternalValue(externalLevel); - CAudioEqualizer *const effect = static_cast(m_effect.data()); // TODO: handle audio effect errors - TRAP_IGNORE(effect->SetBandLevelL(band, internalLevel)); + TRAP_IGNORE(concreteEffect()->SetBandLevelL(band, internalLevel)); } //----------------------------------------------------------------------------- diff --git a/src/3rdparty/phonon/mmf/audioequalizer.h b/src/3rdparty/phonon/mmf/audioequalizer.h index 35592f4..9eda994 100644 --- a/src/3rdparty/phonon/mmf/audioequalizer.h +++ b/src/3rdparty/phonon/mmf/audioequalizer.h @@ -21,6 +21,8 @@ along with this library. If not, see . #include "abstractaudioeffect.h" +class CAudioEqualizer; + QT_BEGIN_NAMESPACE namespace Phonon @@ -54,6 +56,7 @@ protected: private: void setBandLevel(int band, qreal externalLevel); + CAudioEqualizer *concreteEffect(); }; } diff --git a/src/3rdparty/phonon/mmf/bassboost.cpp b/src/3rdparty/phonon/mmf/bassboost.cpp index 642d782..c8c4831 100644 --- a/src/3rdparty/phonon/mmf/bassboost.cpp +++ b/src/3rdparty/phonon/mmf/bassboost.cpp @@ -24,6 +24,9 @@ QT_BEGIN_NAMESPACE using namespace Phonon; using namespace Phonon::MMF; +// Define functions which depend on concrete native effect class name +PHONON_MMF_DEFINE_EFFECT_FUNCTIONS(BassBoost) + /*! \class MMF::BassBoost \internal */ @@ -40,13 +43,6 @@ void BassBoost::parameterChanged(const int, Q_ASSERT_X(false, Q_FUNC_INFO, "BassBoost has no parameters"); } -void BassBoost::createEffect(AudioPlayer::NativePlayer *player) -{ - CBassBoost *ptr = 0; - QT_TRAP_THROWING(ptr = CBassBoost::NewL(*player)); - m_effect.reset(ptr); -} - void BassBoost::applyParameters() { // No parameters to apply diff --git a/src/3rdparty/phonon/mmf/bassboost.h b/src/3rdparty/phonon/mmf/bassboost.h index 241cda9..d3cda34 100644 --- a/src/3rdparty/phonon/mmf/bassboost.h +++ b/src/3rdparty/phonon/mmf/bassboost.h @@ -21,6 +21,8 @@ along with this library. If not, see . #include "abstractaudioeffect.h" +class CBassBoost; + QT_BEGIN_NAMESPACE namespace Phonon @@ -50,6 +52,9 @@ protected: virtual void applyParameters(); virtual void parameterChanged(const int id, const QVariant &value); +private: + CBassBoost *concreteEffect(); + }; } } -- cgit v0.12 From aefcf35b4e4dd62771b9fe531c84d35e13f2c660 Mon Sep 17 00:00:00 2001 From: Gareth Stockwell Date: Tue, 8 Dec 2009 18:26:17 +0000 Subject: Removed unnecessary check in Phonon MMF backend This pointer is guaranteed not to be null by the check in AbstractAudioEffect::setParameterValue. Task-number: QTBUG-4659 Reviewed-by: trustme --- src/3rdparty/phonon/mmf/audioequalizer.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/3rdparty/phonon/mmf/audioequalizer.cpp b/src/3rdparty/phonon/mmf/audioequalizer.cpp index ab95f30..e3b1ab3 100644 --- a/src/3rdparty/phonon/mmf/audioequalizer.cpp +++ b/src/3rdparty/phonon/mmf/audioequalizer.cpp @@ -40,11 +40,9 @@ AudioEqualizer::AudioEqualizer(QObject *parent, const QList& pa void AudioEqualizer::parameterChanged(const int pid, const QVariant &value) { - if (m_effect.data()) { - const int band = pid; - const qreal level = value.toReal(); - setBandLevel(band, level); - } + const int band = pid; + const qreal level = value.toReal(); + setBandLevel(band, level); } void AudioEqualizer::applyParameters() -- cgit v0.12 From 99acb8f8e53767e59a5634609b0d3582ae5b0d7c Mon Sep 17 00:00:00 2001 From: Gareth Stockwell Date: Mon, 11 Jan 2010 16:05:17 +0000 Subject: Refactored AbstractAudioEffect to reduce redundancy in derived classes Task-number: QTBUG-4659 Reviewed-by: Espen Riskedal --- src/3rdparty/phonon/mmf/abstractaudioeffect.cpp | 21 +++++++++++++-- src/3rdparty/phonon/mmf/abstractaudioeffect.h | 6 ++--- src/3rdparty/phonon/mmf/audioequalizer.cpp | 35 +++++++------------------ src/3rdparty/phonon/mmf/audioequalizer.h | 5 ++-- src/3rdparty/phonon/mmf/bassboost.cpp | 7 +---- src/3rdparty/phonon/mmf/bassboost.h | 4 +-- 6 files changed, 37 insertions(+), 41 deletions(-) diff --git a/src/3rdparty/phonon/mmf/abstractaudioeffect.cpp b/src/3rdparty/phonon/mmf/abstractaudioeffect.cpp index cdddf02..3bce86b 100644 --- a/src/3rdparty/phonon/mmf/abstractaudioeffect.cpp +++ b/src/3rdparty/phonon/mmf/abstractaudioeffect.cpp @@ -70,7 +70,8 @@ void AbstractAudioEffect::setParameterValue(const Phonon::EffectParameter ¶m m_values.insert(param.id(), newValue); if (m_effect.data()) { - parameterChanged(param.id(), newValue); + const EffectParameter& internalParam = internalParameter(param.id()); + parameterChanged(internalParam, newValue); // TODO: handle audio effect errors TRAP_IGNORE(m_effect->ApplyL()); } @@ -122,11 +123,27 @@ void AbstractAudioEffect::createEffect() } if (m_effect.data()) { - applyParameters(); + EffectParameter param; + foreach (param, m_params) { + const QVariant value = parameterValue(param); + parameterChanged(param, value); + } + // TODO: handle audio effect errors TRAP_IGNORE(m_effect->EnableL()); } } +const MMF::EffectParameter& AbstractAudioEffect::internalParameter(int id) const +{ + const EffectParameter *result = 0; + for (int i=0; i m_effect; - const QList m_params; private: + const QList m_params; AbstractMediaPlayer * m_player; QHash m_values; }; diff --git a/src/3rdparty/phonon/mmf/audioequalizer.cpp b/src/3rdparty/phonon/mmf/audioequalizer.cpp index e3b1ab3..1584cf7 100644 --- a/src/3rdparty/phonon/mmf/audioequalizer.cpp +++ b/src/3rdparty/phonon/mmf/audioequalizer.cpp @@ -37,35 +37,18 @@ AudioEqualizer::AudioEqualizer(QObject *parent, const QList& pa } -void AudioEqualizer::parameterChanged(const int pid, +void AudioEqualizer::parameterChanged(const EffectParameter ¶m, const QVariant &value) { - const int band = pid; - const qreal level = value.toReal(); - setBandLevel(band, level); -} - -void AudioEqualizer::applyParameters() -{ - if (m_effect.data()) { - Phonon::EffectParameter param; - foreach (param, parameters()) { - const int band = param.id(); - const qreal level = parameterValue(param).toReal(); - setBandLevel(band, level); - } - } -} - -void AudioEqualizer::setBandLevel(int band, qreal externalLevel) -{ - const EffectParameter ¶m = m_params[band-1]; // Band IDs are 1-based + const int band = param.id() + 1; + const qreal externalLevel = value.toReal(); const int internalLevel = param.toInternalValue(externalLevel); // TODO: handle audio effect errors TRAP_IGNORE(concreteEffect()->SetBandLevelL(band, internalLevel)); } + //----------------------------------------------------------------------------- // Static functions //----------------------------------------------------------------------------- @@ -92,10 +75,12 @@ bool AudioEqualizer::getParameters(CMdaAudioOutputStream *stream, const int bandCount = effect->NumberOfBands(); - // For some reason, band IDs are 1-based, as opposed to the - // 0-based indices used in just about other Symbian API...! - for (int i = 1; i <= bandCount; ++i) { - const qint32 hz = effect->CenterFrequency(i); + for (int i = 0; i < bandCount; ++i) { + // For some reason, band IDs are 1-based, as opposed to the + // 0-based indices used in just about other Symbian API...! + const int band = i + 1; + + const qint32 hz = effect->CenterFrequency(band); // We pass a floating-point parameter range of -1.0 to +1.0 for // each band in order to work around a limitation in diff --git a/src/3rdparty/phonon/mmf/audioequalizer.h b/src/3rdparty/phonon/mmf/audioequalizer.h index 9eda994..3a9a5ca 100644 --- a/src/3rdparty/phonon/mmf/audioequalizer.h +++ b/src/3rdparty/phonon/mmf/audioequalizer.h @@ -51,11 +51,10 @@ public: protected: // AbstractAudioEffect virtual void createEffect(AudioPlayer::NativePlayer *player); - virtual void applyParameters(); - virtual void parameterChanged(const int id, const QVariant &value); + virtual void parameterChanged(const EffectParameter ¶m, + const QVariant &value); private: - void setBandLevel(int band, qreal externalLevel); CAudioEqualizer *concreteEffect(); }; diff --git a/src/3rdparty/phonon/mmf/bassboost.cpp b/src/3rdparty/phonon/mmf/bassboost.cpp index c8c4831..997bae4 100644 --- a/src/3rdparty/phonon/mmf/bassboost.cpp +++ b/src/3rdparty/phonon/mmf/bassboost.cpp @@ -37,17 +37,12 @@ BassBoost::BassBoost(QObject *parent, const QList ¶meters) } -void BassBoost::parameterChanged(const int, +void BassBoost::parameterChanged(const EffectParameter &, const QVariant &) { Q_ASSERT_X(false, Q_FUNC_INFO, "BassBoost has no parameters"); } -void BassBoost::applyParameters() -{ - // No parameters to apply -} - //----------------------------------------------------------------------------- // Static functions //----------------------------------------------------------------------------- diff --git a/src/3rdparty/phonon/mmf/bassboost.h b/src/3rdparty/phonon/mmf/bassboost.h index d3cda34..b2bc854 100644 --- a/src/3rdparty/phonon/mmf/bassboost.h +++ b/src/3rdparty/phonon/mmf/bassboost.h @@ -49,8 +49,8 @@ public: protected: // AbstractAudioEffect virtual void createEffect(AudioPlayer::NativePlayer *player); - virtual void applyParameters(); - virtual void parameterChanged(const int id, const QVariant &value); + virtual void parameterChanged(const EffectParameter ¶m, + const QVariant &value); private: CBassBoost *concreteEffect(); -- cgit v0.12 From edbbbe81675e1b9792f43232963c399ff2fffbd6 Mon Sep 17 00:00:00 2001 From: Gareth Stockwell Date: Mon, 11 Jan 2010 16:13:10 +0000 Subject: Implemented bass boost in Phonon MMF backend Task-number: QTBUG-4659 Reviewed-by: Espen Riskedal --- src/3rdparty/phonon/mmf/abstractaudioeffect.cpp | 12 ++++++++++ src/3rdparty/phonon/mmf/abstractaudioeffect.h | 2 ++ src/3rdparty/phonon/mmf/bassboost.cpp | 29 ++++++++++++++++++++----- src/3rdparty/phonon/mmf/bassboost.h | 5 +---- src/3rdparty/phonon/mmf/effectfactory.cpp | 5 +++-- 5 files changed, 42 insertions(+), 11 deletions(-) diff --git a/src/3rdparty/phonon/mmf/abstractaudioeffect.cpp b/src/3rdparty/phonon/mmf/abstractaudioeffect.cpp index 3bce86b..593e00f 100644 --- a/src/3rdparty/phonon/mmf/abstractaudioeffect.cpp +++ b/src/3rdparty/phonon/mmf/abstractaudioeffect.cpp @@ -114,6 +114,16 @@ void AbstractAudioEffect::disconnectMediaObject(MediaObject *mediaObject) abstractPlayerChanged(0); } +void AbstractAudioEffect::setEnabled(bool enabled) +{ + if (enabled) + // TODO: handle audio effect errors + TRAP_IGNORE(m_effect->EnableL()) + else + // TODO: handle audio effect errors + TRAP_IGNORE(m_effect->DisableL()) +} + void AbstractAudioEffect::createEffect() { Q_ASSERT_X(m_player, Q_FUNC_INFO, "Invalid media player pointer"); @@ -131,6 +141,8 @@ void AbstractAudioEffect::createEffect() // TODO: handle audio effect errors TRAP_IGNORE(m_effect->EnableL()); + + setEnabled(true); } } diff --git a/src/3rdparty/phonon/mmf/abstractaudioeffect.h b/src/3rdparty/phonon/mmf/abstractaudioeffect.h index 9b9c47d..57427e7 100644 --- a/src/3rdparty/phonon/mmf/abstractaudioeffect.h +++ b/src/3rdparty/phonon/mmf/abstractaudioeffect.h @@ -82,6 +82,8 @@ protected: void connectMediaObject(MediaObject *mediaObject); void disconnectMediaObject(MediaObject *mediaObject); + void setEnabled(bool enabled); + virtual void createEffect(AudioPlayer::NativePlayer *player) = 0; virtual void parameterChanged(const EffectParameter ¶m, diff --git a/src/3rdparty/phonon/mmf/bassboost.cpp b/src/3rdparty/phonon/mmf/bassboost.cpp index 997bae4..a8631e0 100644 --- a/src/3rdparty/phonon/mmf/bassboost.cpp +++ b/src/3rdparty/phonon/mmf/bassboost.cpp @@ -37,10 +37,11 @@ BassBoost::BassBoost(QObject *parent, const QList ¶meters) } -void BassBoost::parameterChanged(const EffectParameter &, - const QVariant &) +void BassBoost::parameterChanged(const EffectParameter ¶m, + const QVariant &value) { - Q_ASSERT_X(false, Q_FUNC_INFO, "BassBoost has no parameters"); + Q_ASSERT_X(param.id() == 0, Q_FUNC_INFO, "Invalid parameter ID"); + setEnabled(value.toBool()); } //----------------------------------------------------------------------------- @@ -52,9 +53,27 @@ const char* BassBoost::description() return "Bass boost"; } -bool BassBoost::getParameters(CMdaAudioOutputStream *, QList&) +bool BassBoost::getParameters(CMdaAudioOutputStream *stream, + QList ¶meters) { - return true; + bool supported = false; + + QScopedPointer effect; + TRAPD(err, effect.reset(CBassBoost::NewL(*stream))); + + if(KErrNone == err) { + supported = true; + + EffectParameter param( + /* parameterId */ 0, + /* name */ tr("Enabled"), + /* hints */ EffectParameter::ToggledHint, + /* defaultValue */ QVariant(bool(true))); + + parameters.append(param); + } + + return supported; } QT_END_NAMESPACE diff --git a/src/3rdparty/phonon/mmf/bassboost.h b/src/3rdparty/phonon/mmf/bassboost.h index b2bc854..82a3bab 100644 --- a/src/3rdparty/phonon/mmf/bassboost.h +++ b/src/3rdparty/phonon/mmf/bassboost.h @@ -30,10 +30,7 @@ namespace Phonon namespace MMF { /** - * @short An "bass boost" effect. - * - * The documentation does not say what "bass boost" is, neither has it anykind - * of setting. It's an on or off thing. + * @short A "bass boost" effect. */ class BassBoost : public AbstractAudioEffect { diff --git a/src/3rdparty/phonon/mmf/effectfactory.cpp b/src/3rdparty/phonon/mmf/effectfactory.cpp index 19c6d90..c6593bb 100644 --- a/src/3rdparty/phonon/mmf/effectfactory.cpp +++ b/src/3rdparty/phonon/mmf/effectfactory.cpp @@ -68,15 +68,16 @@ AbstractAudioEffect *EffectFactory::createAudioEffect(Type type, { case TypeBassBoost: effect = new BassBoost(parent, parameters); + break; case TypeAudioEqualizer: effect = new AudioEqualizer(parent, parameters); + break; case TypeDistanceAttenuation: case TypeEnvironmentalReverb: case TypeListenerOrientation: case TypeLoudness: case TypeSourceOrientation: case TypeStereoWidening: - break; default: Q_ASSERT_X(false, Q_FUNC_INFO, "Unknown effect"); } @@ -124,7 +125,7 @@ void EffectFactory::initialize() Q_ASSERT_X(!m_initialized, Q_FUNC_INFO, "Already initialized"); INITIALIZE_EFFECT(AudioEqualizer) - //INITIALIZE_EFFECT(BassBoost) + INITIALIZE_EFFECT(BassBoost) m_initialized = true; } -- cgit v0.12 From d993351832c34f51056af06eb83d18f71fa9fd9d Mon Sep 17 00:00:00 2001 From: Gareth Stockwell Date: Thu, 10 Dec 2009 15:43:37 +0000 Subject: Implemented loudness effect in Phonon MMF backend Task-number: QTBUG-4659 Reviewed-by: Espen Riskedal --- src/3rdparty/phonon/mmf/effectfactory.cpp | 4 ++ src/3rdparty/phonon/mmf/loudness.cpp | 80 +++++++++++++++++++++++++++++++ src/3rdparty/phonon/mmf/loudness.h | 62 ++++++++++++++++++++++++ src/plugins/phonon/mmf/mmf.pro | 2 + 4 files changed, 148 insertions(+) create mode 100644 src/3rdparty/phonon/mmf/loudness.cpp create mode 100644 src/3rdparty/phonon/mmf/loudness.h diff --git a/src/3rdparty/phonon/mmf/effectfactory.cpp b/src/3rdparty/phonon/mmf/effectfactory.cpp index c6593bb..50d08e7 100644 --- a/src/3rdparty/phonon/mmf/effectfactory.cpp +++ b/src/3rdparty/phonon/mmf/effectfactory.cpp @@ -23,6 +23,7 @@ along with this library. If not, see . #include "audioequalizer.h" #include "bassboost.h" +#include "loudness.h" #include "effectfactory.h" @@ -76,6 +77,8 @@ AbstractAudioEffect *EffectFactory::createAudioEffect(Type type, case TypeEnvironmentalReverb: case TypeListenerOrientation: case TypeLoudness: + effect = new Loudness(parent, parameters); + break; case TypeSourceOrientation: case TypeStereoWidening: default: @@ -126,6 +129,7 @@ void EffectFactory::initialize() INITIALIZE_EFFECT(AudioEqualizer) INITIALIZE_EFFECT(BassBoost) + INITIALIZE_EFFECT(Loudness) m_initialized = true; } diff --git a/src/3rdparty/phonon/mmf/loudness.cpp b/src/3rdparty/phonon/mmf/loudness.cpp new file mode 100644 index 0000000..7a033fa --- /dev/null +++ b/src/3rdparty/phonon/mmf/loudness.cpp @@ -0,0 +1,80 @@ +/* This file is part of the KDE project. + +Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). + +This library is free software: you can redistribute it and/or modify +it under the terms of the GNU Lesser General Public License as published by +the Free Software Foundation, either version 2.1 or 3 of the License. + +This library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU Lesser General Public License for more details. + +You should have received a copy of the GNU Lesser General Public License +along with this library. If not, see . + +*/ + +#include +#include "loudness.h" + +QT_BEGIN_NAMESPACE + +using namespace Phonon; +using namespace Phonon::MMF; + +// Define functions which depend on concrete native effect class name +PHONON_MMF_DEFINE_EFFECT_FUNCTIONS(Loudness) + +/*! \class MMF::Loudness + \internal +*/ + +Loudness::Loudness(QObject *parent, const QList& parameters) + : AbstractAudioEffect::AbstractAudioEffect(parent, parameters) +{ + +} + +void Loudness::parameterChanged(const EffectParameter ¶m, + const QVariant &value) +{ + Q_ASSERT_X(param.id() == 0, Q_FUNC_INFO, "Invalid parameter ID"); + setEnabled(value.toBool()); +} + +//----------------------------------------------------------------------------- +// Static functions +//----------------------------------------------------------------------------- + +const char* Loudness::description() +{ + return "Loudness"; +} + +bool Loudness::getParameters(CMdaAudioOutputStream *stream, + QList ¶meters) +{ + bool supported = false; + + QScopedPointer effect; + TRAPD(err, effect.reset(CLoudness::NewL(*stream))); + + if(KErrNone == err) { + supported = true; + + EffectParameter param( + /* parameterId */ 0, + /* name */ tr("Enabled"), + /* hints */ EffectParameter::ToggledHint, + /* defaultValue */ QVariant(bool(true))); + + parameters.append(param); + } + + return supported; +} + +QT_END_NAMESPACE + diff --git a/src/3rdparty/phonon/mmf/loudness.h b/src/3rdparty/phonon/mmf/loudness.h new file mode 100644 index 0000000..f772d7f --- /dev/null +++ b/src/3rdparty/phonon/mmf/loudness.h @@ -0,0 +1,62 @@ +/* This file is part of the KDE project. + +Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). + +This library is free software: you can redistribute it and/or modify +it under the terms of the GNU Lesser General Public License as published by +the Free Software Foundation, either version 2.1 or 3 of the License. + +This library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU Lesser General Public License for more details. + +You should have received a copy of the GNU Lesser General Public License +along with this library. If not, see . + +*/ + +#ifndef PHONON_MMF_LOUDNESS_H +#define PHONON_MMF_LOUDNESS_H + +#include "abstractaudioeffect.h" + +class CLoudness; + +QT_BEGIN_NAMESPACE + +namespace Phonon +{ +namespace MMF +{ +/** + * @short A "loudness" effect. + */ +class Loudness : public AbstractAudioEffect +{ + Q_OBJECT +public: + Loudness(QObject *parent, const QList& parameters); + + // Static interface required by EffectFactory + static const char* description(); + static bool getParameters(CMdaAudioOutputStream *stream, + QList& parameters); + +protected: + // AbstractAudioEffect + virtual void createEffect(AudioPlayer::NativePlayer *player); + virtual void parameterChanged(const EffectParameter ¶m, + const QVariant &value); + +private: + CLoudness *concreteEffect(); + +}; +} +} + +QT_END_NAMESPACE + +#endif + diff --git a/src/plugins/phonon/mmf/mmf.pro b/src/plugins/phonon/mmf/mmf.pro index f72a657..37c613c 100644 --- a/src/plugins/phonon/mmf/mmf.pro +++ b/src/plugins/phonon/mmf/mmf.pro @@ -36,6 +36,7 @@ HEADERS += \ $$PHONON_MMF_DIR/dummyplayer.h \ $$PHONON_MMF_DIR/effectfactory.h \ $$PHONON_MMF_DIR/effectparameter.h \ + $$PHONON_MMF_DIR/loudness.h \ $$PHONON_MMF_DIR/mediaobject.h \ $$PHONON_MMF_DIR/mmf_medianode.h \ $$PHONON_MMF_DIR/mmf_videoplayer.h \ @@ -59,6 +60,7 @@ SOURCES += \ $$PHONON_MMF_DIR/dummyplayer.cpp \ $$PHONON_MMF_DIR/effectfactory.cpp \ $$PHONON_MMF_DIR/effectparameter.cpp \ + $$PHONON_MMF_DIR/loudness.cpp \ $$PHONON_MMF_DIR/mediaobject.cpp \ $$PHONON_MMF_DIR/mmf_medianode.cpp \ $$PHONON_MMF_DIR/mmf_videoplayer.cpp \ -- cgit v0.12 From bc0e4aa8aec231b43a6033f3f4f12037b02ee64e Mon Sep 17 00:00:00 2001 From: Gareth Stockwell Date: Thu, 10 Dec 2009 17:24:03 +0000 Subject: Implemented reverb effect in Phonon MMF backend Task-number: QTBUG-4659 Reviewed-by: Espen Riskedal --- src/3rdparty/phonon/mmf/effectfactory.cpp | 11 +- src/3rdparty/phonon/mmf/effectparameter.cpp | 8 + src/3rdparty/phonon/mmf/effectparameter.h | 2 + src/3rdparty/phonon/mmf/environmentalreverb.cpp | 202 ++++++++++++++++++++++++ src/3rdparty/phonon/mmf/environmentalreverb.h | 62 ++++++++ src/plugins/phonon/mmf/mmf.pro | 2 + 6 files changed, 285 insertions(+), 2 deletions(-) create mode 100644 src/3rdparty/phonon/mmf/environmentalreverb.cpp create mode 100644 src/3rdparty/phonon/mmf/environmentalreverb.h diff --git a/src/3rdparty/phonon/mmf/effectfactory.cpp b/src/3rdparty/phonon/mmf/effectfactory.cpp index 50d08e7..ef2ddf7 100644 --- a/src/3rdparty/phonon/mmf/effectfactory.cpp +++ b/src/3rdparty/phonon/mmf/effectfactory.cpp @@ -23,6 +23,7 @@ along with this library. If not, see . #include "audioequalizer.h" #include "bassboost.h" +#include "environmentalreverb.h" #include "loudness.h" #include "effectfactory.h" @@ -73,14 +74,19 @@ AbstractAudioEffect *EffectFactory::createAudioEffect(Type type, case TypeAudioEqualizer: effect = new AudioEqualizer(parent, parameters); break; - case TypeDistanceAttenuation: case TypeEnvironmentalReverb: - case TypeListenerOrientation: + effect = new EnvironmentalReverb(parent, parameters); + break; case TypeLoudness: effect = new Loudness(parent, parameters); break; + + // Not implemented + case TypeDistanceAttenuation: + case TypeListenerOrientation: case TypeSourceOrientation: case TypeStereoWidening: + // Fall through default: Q_ASSERT_X(false, Q_FUNC_INFO, "Unknown effect"); } @@ -129,6 +135,7 @@ void EffectFactory::initialize() INITIALIZE_EFFECT(AudioEqualizer) INITIALIZE_EFFECT(BassBoost) + INITIALIZE_EFFECT(EnvironmentalReverb) INITIALIZE_EFFECT(Loudness) m_initialized = true; diff --git a/src/3rdparty/phonon/mmf/effectparameter.cpp b/src/3rdparty/phonon/mmf/effectparameter.cpp index f4287b8..17c1315 100644 --- a/src/3rdparty/phonon/mmf/effectparameter.cpp +++ b/src/3rdparty/phonon/mmf/effectparameter.cpp @@ -59,5 +59,13 @@ qint32 MMF::EffectParameter::toInternalValue(qreal external) const return m_internalRange.first + ((1.0 + external) / 2) * range; } +qreal MMF::EffectParameter::toExternalValue + (qint32 value, qint32 min, qint32 max) +{ + Q_ASSERT_X(max >= min, Q_FUNC_INFO, "Invalid range"); + const qint32 range = max - min; + return range == 0 ? 0.0 : ((2.0 * value - min) / range) - 1.0; +} + QT_END_NAMESPACE diff --git a/src/3rdparty/phonon/mmf/effectparameter.h b/src/3rdparty/phonon/mmf/effectparameter.h index 3008159..27cc018 100644 --- a/src/3rdparty/phonon/mmf/effectparameter.h +++ b/src/3rdparty/phonon/mmf/effectparameter.h @@ -57,6 +57,8 @@ public: void setInternalRange(qint32 min, qint32 max); qint32 toInternalValue(qreal external) const; + static qreal toExternalValue(qint32 value, qint32 min, qint32 max); + private: bool m_hasInternalRange; QPair m_internalRange; diff --git a/src/3rdparty/phonon/mmf/environmentalreverb.cpp b/src/3rdparty/phonon/mmf/environmentalreverb.cpp new file mode 100644 index 0000000..2e30ca1 --- /dev/null +++ b/src/3rdparty/phonon/mmf/environmentalreverb.cpp @@ -0,0 +1,202 @@ +/* This file is part of the KDE project. + +Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). + +This library is free software: you can redistribute it and/or modify +it under the terms of the GNU Lesser General Public License as published by +the Free Software Foundation, either version 2.1 or 3 of the License. + +This library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU Lesser General Public License for more details. + +You should have received a copy of the GNU Lesser General Public License +along with this library. If not, see . + +*/ + +#include +#include "environmentalreverb.h" + +QT_BEGIN_NAMESPACE + +using namespace Phonon; +using namespace Phonon::MMF; + +/*! \class MMF::EnvironmentalReverb + \internal +*/ + +// Define functions which depend on concrete native effect class name +PHONON_MMF_DEFINE_EFFECT_FUNCTIONS(EnvironmentalReverb) + +enum Parameters +{ + DecayHFRatio, + DecayTime, + Density, + Diffusion, + ReflectionsDelay, + ReflectionsLevel, + ReverbDelay, + ReverbLevel, + RoomHFLevel, + RoomLevel +}; + +EnvironmentalReverb::EnvironmentalReverb(QObject *parent, const QList& parameters) + : AbstractAudioEffect::AbstractAudioEffect(parent, parameters) +{ + +} + +void EnvironmentalReverb::parameterChanged(const EffectParameter ¶m, + const QVariant &value) +{ + const qreal externalLevel = value.toReal(); + const int internalLevel = param.toInternalValue(externalLevel); + + TInt err = 0; + + switch(param.id()) { + case DecayHFRatio: + TRAP(err, concreteEffect()->SetDecayHFRatioL(internalLevel)); + break; + case DecayTime: + TRAP(err, concreteEffect()->SetDecayTimeL(internalLevel)); + break; + case Density: + TRAP(err, concreteEffect()->SetDensityL(internalLevel)); + break; + case Diffusion: + TRAP(err, concreteEffect()->SetDiffusionL(internalLevel)); + break; + case ReflectionsDelay: + TRAP(err, concreteEffect()->SetReflectionsDelayL(internalLevel)); + break; + case ReflectionsLevel: + TRAP(err, concreteEffect()->SetReflectionsLevelL(internalLevel)); + break; + case ReverbDelay: + TRAP(err, concreteEffect()->SetReverbDelayL(internalLevel)); + break; + case ReverbLevel: + TRAP(err, concreteEffect()->SetReverbLevelL(internalLevel)); + break; + case RoomHFLevel: + TRAP(err, concreteEffect()->SetRoomHFLevelL(internalLevel)); + break; + case RoomLevel: + TRAP(err, concreteEffect()->SetRoomLevelL(internalLevel)); + break; + default: + Q_ASSERT_X(false, Q_FUNC_INFO, "Unknown parameter"); + } + + // TODO: handle audio effect errors + Q_UNUSED(err); +} + + +//----------------------------------------------------------------------------- +// Static functions +//----------------------------------------------------------------------------- + +const char* EnvironmentalReverb::description() +{ + return "Reverb"; +} + +// Internal helper function +Phonon::MMF::EffectParameter createParameter(int id, const QString &name, + int defaultValue, int minValue, int maxValue, + Phonon::EffectParameter::Hint hint = Phonon::EffectParameter::IntegerHint) +{ + const qreal externalDefaultValue = + Phonon::MMF::EffectParameter::toExternalValue + (defaultValue, minValue, maxValue); + + Phonon::MMF::EffectParameter param(id, name, hint, + /* defaultValue */ QVariant(externalDefaultValue), + /* minimumValue */ QVariant(qreal(-1.0)), + /* maximumValue */ QVariant(qreal(+1.0))); + + param.setInternalRange(minValue, maxValue); + return param; +} + +bool EnvironmentalReverb::getParameters(CMdaAudioOutputStream *stream, + QList& parameters) +{ + bool supported = false; + + QScopedPointer effect; + TRAPD(err, effect.reset(CEnvironmentalReverb::NewL(*stream))); + + if (KErrNone == err) { + supported = true; + + TInt32 min, max; + TUint32 umin, umax; + + // DecayHFRatio + effect->DecayHFRatioRange(umin, umax); + parameters.append(createParameter( + DecayHFRatio, tr("Decay HF ratio (%)"), effect->DecayHFRatio(), + umin, umax)); + + // DecayTime + effect->DecayTimeRange(umin, umax); + parameters.append(createParameter( + DecayTime, tr("Decay time (ms)"), effect->DecayTime(), + umin, umax)); + + // Density + parameters.append(createParameter( + Density, tr("Density (%)"), effect->Density(), 0, 100)); + + // Diffusion + parameters.append(createParameter( + Diffusion, tr("Diffusion (%)"), effect->Diffusion(), 0, 100)); + + // ReflectionsDelay + parameters.append(createParameter( + ReflectionsDelay, tr("Reflections delay (ms)"), + effect->ReflectionsDelay(), 0, effect->ReflectionsDelayMax())); + + // ReflectionsLevel + effect->ReflectionLevelRange(min, max); + parameters.append(createParameter( + ReflectionsLevel, tr("Reflections level (mB)"), + effect->ReflectionsLevel(), + min, max, EffectParameter::LogarithmicHint)); + + // ReverbDelay + parameters.append(createParameter( + ReverbDelay, tr("Reverb delay (ms)"), effect->ReverbDelay(), + 0, effect->ReverbDelayMax())); + + // ReverbLevel + effect->ReverbLevelRange(min, max); + parameters.append(createParameter( + ReverbLevel, tr("Reverb level (mB)"), effect->ReverbLevel(), + min, max, EffectParameter::LogarithmicHint)); + + // RoomHFLevel + effect->RoomHFLevelRange(min, max); + parameters.append(createParameter( + RoomHFLevel, tr("Room HF level"), effect->RoomHFLevel(), + min, max)); + + // RoomLevel + effect->RoomLevelRange(min, max); + parameters.append(createParameter( + RoomLevel, tr("Room level (mB)"), effect->RoomLevel(), + min, max, EffectParameter::LogarithmicHint)); + } + + return supported; +} + +QT_END_NAMESPACE diff --git a/src/3rdparty/phonon/mmf/environmentalreverb.h b/src/3rdparty/phonon/mmf/environmentalreverb.h new file mode 100644 index 0000000..5760c0a --- /dev/null +++ b/src/3rdparty/phonon/mmf/environmentalreverb.h @@ -0,0 +1,62 @@ +/* This file is part of the KDE project. + +Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). + +This library is free software: you can redistribute it and/or modify +it under the terms of the GNU Lesser General Public License as published by +the Free Software Foundation, either version 2.1 or 3 of the License. + +This library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU Lesser General Public License for more details. + +You should have received a copy of the GNU Lesser General Public License +along with this library. If not, see . + +*/ + +#ifndef PHONON_MMF_ENVIRONMENTALREVERB_H +#define PHONON_MMF_ENVIRONMENTALREVERB_H + +#include "abstractaudioeffect.h" + +class CEnvironmentalReverb; + +QT_BEGIN_NAMESPACE + +namespace Phonon +{ +namespace MMF +{ +/** + * @short A reverb effect. + */ +class EnvironmentalReverb : public AbstractAudioEffect +{ + Q_OBJECT +public: + EnvironmentalReverb(QObject *parent, const QList& parameters); + + // Static interface required by EffectFactory + static const char* description(); + static bool getParameters(CMdaAudioOutputStream *stream, + QList& parameters); + +protected: + // AbstractAudioEffect + virtual void createEffect(AudioPlayer::NativePlayer *player); + virtual void parameterChanged(const EffectParameter ¶m, + const QVariant &value); + +private: + CEnvironmentalReverb *concreteEffect(); + +}; +} +} + +QT_END_NAMESPACE + +#endif + diff --git a/src/plugins/phonon/mmf/mmf.pro b/src/plugins/phonon/mmf/mmf.pro index 37c613c..78e23d9 100644 --- a/src/plugins/phonon/mmf/mmf.pro +++ b/src/plugins/phonon/mmf/mmf.pro @@ -36,6 +36,7 @@ HEADERS += \ $$PHONON_MMF_DIR/dummyplayer.h \ $$PHONON_MMF_DIR/effectfactory.h \ $$PHONON_MMF_DIR/effectparameter.h \ + $$PHONON_MMF_DIR/environmentalreverb.h \ $$PHONON_MMF_DIR/loudness.h \ $$PHONON_MMF_DIR/mediaobject.h \ $$PHONON_MMF_DIR/mmf_medianode.h \ @@ -60,6 +61,7 @@ SOURCES += \ $$PHONON_MMF_DIR/dummyplayer.cpp \ $$PHONON_MMF_DIR/effectfactory.cpp \ $$PHONON_MMF_DIR/effectparameter.cpp \ + $$PHONON_MMF_DIR/environmentalreverb.cpp \ $$PHONON_MMF_DIR/loudness.cpp \ $$PHONON_MMF_DIR/mediaobject.cpp \ $$PHONON_MMF_DIR/mmf_medianode.cpp \ -- cgit v0.12 From f42624c9f88cbbb71d6857566e00348b119d486c Mon Sep 17 00:00:00 2001 From: Gareth Stockwell Date: Thu, 10 Dec 2009 17:44:39 +0000 Subject: Implemented stereo widening effect in Phonon MMF backend Task-number: QTBUG-4659 Reviewed-by: Espen Riskedal --- src/3rdparty/phonon/mmf/effectfactory.cpp | 6 +- src/3rdparty/phonon/mmf/stereowidening.cpp | 94 ++++++++++++++++++++++++++++++ src/3rdparty/phonon/mmf/stereowidening.h | 62 ++++++++++++++++++++ src/plugins/phonon/mmf/mmf.pro | 2 + 4 files changed, 163 insertions(+), 1 deletion(-) create mode 100644 src/3rdparty/phonon/mmf/stereowidening.cpp create mode 100644 src/3rdparty/phonon/mmf/stereowidening.h diff --git a/src/3rdparty/phonon/mmf/effectfactory.cpp b/src/3rdparty/phonon/mmf/effectfactory.cpp index ef2ddf7..081f6a3 100644 --- a/src/3rdparty/phonon/mmf/effectfactory.cpp +++ b/src/3rdparty/phonon/mmf/effectfactory.cpp @@ -25,6 +25,7 @@ along with this library. If not, see . #include "bassboost.h" #include "environmentalreverb.h" #include "loudness.h" +#include "stereowidening.h" #include "effectfactory.h" @@ -80,12 +81,14 @@ AbstractAudioEffect *EffectFactory::createAudioEffect(Type type, case TypeLoudness: effect = new Loudness(parent, parameters); break; + case TypeStereoWidening: + effect = new StereoWidening(parent, parameters); + break; // Not implemented case TypeDistanceAttenuation: case TypeListenerOrientation: case TypeSourceOrientation: - case TypeStereoWidening: // Fall through default: Q_ASSERT_X(false, Q_FUNC_INFO, "Unknown effect"); @@ -137,6 +140,7 @@ void EffectFactory::initialize() INITIALIZE_EFFECT(BassBoost) INITIALIZE_EFFECT(EnvironmentalReverb) INITIALIZE_EFFECT(Loudness) + INITIALIZE_EFFECT(StereoWidening) m_initialized = true; } diff --git a/src/3rdparty/phonon/mmf/stereowidening.cpp b/src/3rdparty/phonon/mmf/stereowidening.cpp new file mode 100644 index 0000000..4fee1aa --- /dev/null +++ b/src/3rdparty/phonon/mmf/stereowidening.cpp @@ -0,0 +1,94 @@ +/* This file is part of the KDE project. + +Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). + +This library is free software: you can redistribute it and/or modify +it under the terms of the GNU Lesser General Public License as published by +the Free Software Foundation, either version 2.1 or 3 of the License. + +This library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU Lesser General Public License for more details. + +You should have received a copy of the GNU Lesser General Public License +along with this library. If not, see . + +*/ + +#include +#include "stereowidening.h" + +QT_BEGIN_NAMESPACE + +using namespace Phonon; +using namespace Phonon::MMF; + +// Define functions which depend on concrete native effect class name +PHONON_MMF_DEFINE_EFFECT_FUNCTIONS(StereoWidening) + +/*! \class MMF::StereoWidening + \internal +*/ + +StereoWidening::StereoWidening(QObject *parent, const QList& parameters) + : AbstractAudioEffect::AbstractAudioEffect(parent, parameters) +{ + +} + +void StereoWidening::parameterChanged(const EffectParameter ¶m, + const QVariant &value) +{ + Q_ASSERT_X(param.id() == 0, Q_FUNC_INFO, "Invalid parameter ID"); + + const qreal externalLevel = value.toReal(); + const int internalLevel = param.toInternalValue(externalLevel); + + TRAPD(err, concreteEffect()->SetStereoWideningLevelL(internalLevel)); + + // TODO: handle audio effect errors + Q_UNUSED(err); +} + +//----------------------------------------------------------------------------- +// Static functions +//----------------------------------------------------------------------------- + +const char* StereoWidening::description() +{ + return "Stereo widening"; +} + +bool StereoWidening::getParameters(CMdaAudioOutputStream *stream, + QList ¶meters) +{ + bool supported = false; + + QScopedPointer effect; + TRAPD(err, effect.reset(CStereoWidening::NewL(*stream))); + + if (KErrNone == err) { + supported = true; + + const qreal defaultValue = + Phonon::MMF::EffectParameter::toExternalValue + (effect->StereoWideningLevel(), 0, 100); + + EffectParameter param( + /* parameterId */ 0, + /* name */ tr("Level (%)"), + /* hints */ EffectParameter::IntegerHint, + /* defaultValue */ QVariant(defaultValue), + /* minimumValue */ QVariant(qreal(-1.0)), + /* maximumValue */ QVariant(qreal(+1.0))); + + param.setInternalRange(0, 100); + parameters.append(param); + } + + return supported; +} + +QT_END_NAMESPACE + diff --git a/src/3rdparty/phonon/mmf/stereowidening.h b/src/3rdparty/phonon/mmf/stereowidening.h new file mode 100644 index 0000000..249c279 --- /dev/null +++ b/src/3rdparty/phonon/mmf/stereowidening.h @@ -0,0 +1,62 @@ +/* This file is part of the KDE project. + +Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). + +This library is free software: you can redistribute it and/or modify +it under the terms of the GNU Lesser General Public License as published by +the Free Software Foundation, either version 2.1 or 3 of the License. + +This library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU Lesser General Public License for more details. + +You should have received a copy of the GNU Lesser General Public License +along with this library. If not, see . + +*/ + +#ifndef PHONON_MMF_STEREOWIDENING_H +#define PHONON_MMF_STEREOWIDENING_H + +#include "abstractaudioeffect.h" + +class CStereoWidening; + +QT_BEGIN_NAMESPACE + +namespace Phonon +{ +namespace MMF +{ +/** + * @short A "bass boost" effect. + */ +class StereoWidening : public AbstractAudioEffect +{ + Q_OBJECT +public: + StereoWidening(QObject *parent, const QList& parameters); + + // Static interface required by EffectFactory + static const char* description(); + static bool getParameters(CMdaAudioOutputStream *stream, + QList& parameters); + +protected: + // AbstractAudioEffect + virtual void createEffect(AudioPlayer::NativePlayer *player); + virtual void parameterChanged(const EffectParameter ¶m, + const QVariant &value); + +private: + CStereoWidening *concreteEffect(); + +}; +} +} + +QT_END_NAMESPACE + +#endif + diff --git a/src/plugins/phonon/mmf/mmf.pro b/src/plugins/phonon/mmf/mmf.pro index 78e23d9..cfaca9d 100644 --- a/src/plugins/phonon/mmf/mmf.pro +++ b/src/plugins/phonon/mmf/mmf.pro @@ -41,6 +41,7 @@ HEADERS += \ $$PHONON_MMF_DIR/mediaobject.h \ $$PHONON_MMF_DIR/mmf_medianode.h \ $$PHONON_MMF_DIR/mmf_videoplayer.h \ + $$PHONON_MMF_DIR/stereowidening.h \ $$PHONON_MMF_DIR/objectdump.h \ $$PHONON_MMF_DIR/objectdump_symbian.h \ $$PHONON_MMF_DIR/objecttree.h \ @@ -66,6 +67,7 @@ SOURCES += \ $$PHONON_MMF_DIR/mediaobject.cpp \ $$PHONON_MMF_DIR/mmf_medianode.cpp \ $$PHONON_MMF_DIR/mmf_videoplayer.cpp \ + $$PHONON_MMF_DIR/stereowidening.cpp \ $$PHONON_MMF_DIR/objectdump.cpp \ $$PHONON_MMF_DIR/objectdump_symbian.cpp \ $$PHONON_MMF_DIR/objecttree.cpp \ -- cgit v0.12 From 5a8c0ded599263446010dfc1729dcab8b2f62f0d Mon Sep 17 00:00:00 2001 From: Gareth Stockwell Date: Mon, 11 Jan 2010 17:41:23 +0000 Subject: Simplified error handling for audio effects Task-number: QTBUG-4659 Reviewed-by: Espen Riskedal --- src/3rdparty/phonon/mmf/abstractaudioeffect.cpp | 22 ++++++++++++---------- src/3rdparty/phonon/mmf/abstractaudioeffect.h | 2 +- src/3rdparty/phonon/mmf/audioequalizer.cpp | 6 +++--- src/3rdparty/phonon/mmf/audioequalizer.h | 2 +- src/3rdparty/phonon/mmf/bassboost.cpp | 3 ++- src/3rdparty/phonon/mmf/bassboost.h | 4 ++-- src/3rdparty/phonon/mmf/environmentalreverb.cpp | 5 ++--- src/3rdparty/phonon/mmf/environmentalreverb.h | 4 ++-- src/3rdparty/phonon/mmf/loudness.cpp | 3 ++- src/3rdparty/phonon/mmf/loudness.h | 4 ++-- src/3rdparty/phonon/mmf/stereowidening.cpp | 5 ++--- src/3rdparty/phonon/mmf/stereowidening.h | 4 ++-- 12 files changed, 33 insertions(+), 31 deletions(-) diff --git a/src/3rdparty/phonon/mmf/abstractaudioeffect.cpp b/src/3rdparty/phonon/mmf/abstractaudioeffect.cpp index 593e00f..e3672e6 100644 --- a/src/3rdparty/phonon/mmf/abstractaudioeffect.cpp +++ b/src/3rdparty/phonon/mmf/abstractaudioeffect.cpp @@ -71,9 +71,10 @@ void AbstractAudioEffect::setParameterValue(const Phonon::EffectParameter ¶m if (m_effect.data()) { const EffectParameter& internalParam = internalParameter(param.id()); - parameterChanged(internalParam, newValue); + int err = parameterChanged(internalParam, newValue); + TRAP(err, m_effect->ApplyL()); // TODO: handle audio effect errors - TRAP_IGNORE(m_effect->ApplyL()); + Q_UNUSED(err); } } @@ -116,12 +117,16 @@ void AbstractAudioEffect::disconnectMediaObject(MediaObject *mediaObject) void AbstractAudioEffect::setEnabled(bool enabled) { + TInt err = KErrNone; + if (enabled) // TODO: handle audio effect errors - TRAP_IGNORE(m_effect->EnableL()) + TRAP(err, m_effect->EnableL()) else // TODO: handle audio effect errors - TRAP_IGNORE(m_effect->DisableL()) + TRAP(err, m_effect->DisableL()) + + Q_UNUSED(err); } void AbstractAudioEffect::createEffect() @@ -134,15 +139,12 @@ void AbstractAudioEffect::createEffect() if (m_effect.data()) { EffectParameter param; + int err = 0; foreach (param, m_params) { const QVariant value = parameterValue(param); - parameterChanged(param, value); + err = parameterChanged(param, value); } - - // TODO: handle audio effect errors - TRAP_IGNORE(m_effect->EnableL()); - - setEnabled(true); + Q_UNUSED(err) } } diff --git a/src/3rdparty/phonon/mmf/abstractaudioeffect.h b/src/3rdparty/phonon/mmf/abstractaudioeffect.h index 57427e7..a3b35c2 100644 --- a/src/3rdparty/phonon/mmf/abstractaudioeffect.h +++ b/src/3rdparty/phonon/mmf/abstractaudioeffect.h @@ -86,7 +86,7 @@ protected: virtual void createEffect(AudioPlayer::NativePlayer *player) = 0; - virtual void parameterChanged(const EffectParameter ¶m, + virtual int parameterChanged(const EffectParameter ¶m, const QVariant &value) = 0; private: diff --git a/src/3rdparty/phonon/mmf/audioequalizer.cpp b/src/3rdparty/phonon/mmf/audioequalizer.cpp index 1584cf7..201a5fc 100644 --- a/src/3rdparty/phonon/mmf/audioequalizer.cpp +++ b/src/3rdparty/phonon/mmf/audioequalizer.cpp @@ -37,15 +37,15 @@ AudioEqualizer::AudioEqualizer(QObject *parent, const QList& pa } -void AudioEqualizer::parameterChanged(const EffectParameter ¶m, +int AudioEqualizer::parameterChanged(const EffectParameter ¶m, const QVariant &value) { const int band = param.id() + 1; const qreal externalLevel = value.toReal(); const int internalLevel = param.toInternalValue(externalLevel); - // TODO: handle audio effect errors - TRAP_IGNORE(concreteEffect()->SetBandLevelL(band, internalLevel)); + TRAPD(err, concreteEffect()->SetBandLevelL(band, internalLevel)); + return err; } diff --git a/src/3rdparty/phonon/mmf/audioequalizer.h b/src/3rdparty/phonon/mmf/audioequalizer.h index 3a9a5ca..acfe9b5 100644 --- a/src/3rdparty/phonon/mmf/audioequalizer.h +++ b/src/3rdparty/phonon/mmf/audioequalizer.h @@ -51,7 +51,7 @@ public: protected: // AbstractAudioEffect virtual void createEffect(AudioPlayer::NativePlayer *player); - virtual void parameterChanged(const EffectParameter ¶m, + virtual int parameterChanged(const EffectParameter ¶m, const QVariant &value); private: diff --git a/src/3rdparty/phonon/mmf/bassboost.cpp b/src/3rdparty/phonon/mmf/bassboost.cpp index a8631e0..6996ba9 100644 --- a/src/3rdparty/phonon/mmf/bassboost.cpp +++ b/src/3rdparty/phonon/mmf/bassboost.cpp @@ -37,11 +37,12 @@ BassBoost::BassBoost(QObject *parent, const QList ¶meters) } -void BassBoost::parameterChanged(const EffectParameter ¶m, +int BassBoost::parameterChanged(const EffectParameter ¶m, const QVariant &value) { Q_ASSERT_X(param.id() == 0, Q_FUNC_INFO, "Invalid parameter ID"); setEnabled(value.toBool()); + return 0; } //----------------------------------------------------------------------------- diff --git a/src/3rdparty/phonon/mmf/bassboost.h b/src/3rdparty/phonon/mmf/bassboost.h index 82a3bab..e8e8094 100644 --- a/src/3rdparty/phonon/mmf/bassboost.h +++ b/src/3rdparty/phonon/mmf/bassboost.h @@ -46,8 +46,8 @@ public: protected: // AbstractAudioEffect virtual void createEffect(AudioPlayer::NativePlayer *player); - virtual void parameterChanged(const EffectParameter ¶m, - const QVariant &value); + virtual int parameterChanged(const EffectParameter ¶m, + const QVariant &value); private: CBassBoost *concreteEffect(); diff --git a/src/3rdparty/phonon/mmf/environmentalreverb.cpp b/src/3rdparty/phonon/mmf/environmentalreverb.cpp index 2e30ca1..f362afd 100644 --- a/src/3rdparty/phonon/mmf/environmentalreverb.cpp +++ b/src/3rdparty/phonon/mmf/environmentalreverb.cpp @@ -51,7 +51,7 @@ EnvironmentalReverb::EnvironmentalReverb(QObject *parent, const QList& parameters) } -void Loudness::parameterChanged(const EffectParameter ¶m, +int Loudness::parameterChanged(const EffectParameter ¶m, const QVariant &value) { Q_ASSERT_X(param.id() == 0, Q_FUNC_INFO, "Invalid parameter ID"); setEnabled(value.toBool()); + return 0; } //----------------------------------------------------------------------------- diff --git a/src/3rdparty/phonon/mmf/loudness.h b/src/3rdparty/phonon/mmf/loudness.h index f772d7f..bb3380e 100644 --- a/src/3rdparty/phonon/mmf/loudness.h +++ b/src/3rdparty/phonon/mmf/loudness.h @@ -46,8 +46,8 @@ public: protected: // AbstractAudioEffect virtual void createEffect(AudioPlayer::NativePlayer *player); - virtual void parameterChanged(const EffectParameter ¶m, - const QVariant &value); + virtual int parameterChanged(const EffectParameter ¶m, + const QVariant &value); private: CLoudness *concreteEffect(); diff --git a/src/3rdparty/phonon/mmf/stereowidening.cpp b/src/3rdparty/phonon/mmf/stereowidening.cpp index 4fee1aa..d14617d 100644 --- a/src/3rdparty/phonon/mmf/stereowidening.cpp +++ b/src/3rdparty/phonon/mmf/stereowidening.cpp @@ -37,7 +37,7 @@ StereoWidening::StereoWidening(QObject *parent, const QList& pa } -void StereoWidening::parameterChanged(const EffectParameter ¶m, +int StereoWidening::parameterChanged(const EffectParameter ¶m, const QVariant &value) { Q_ASSERT_X(param.id() == 0, Q_FUNC_INFO, "Invalid parameter ID"); @@ -47,8 +47,7 @@ void StereoWidening::parameterChanged(const EffectParameter ¶m, TRAPD(err, concreteEffect()->SetStereoWideningLevelL(internalLevel)); - // TODO: handle audio effect errors - Q_UNUSED(err); + return err; } //----------------------------------------------------------------------------- diff --git a/src/3rdparty/phonon/mmf/stereowidening.h b/src/3rdparty/phonon/mmf/stereowidening.h index 249c279..c967e37 100644 --- a/src/3rdparty/phonon/mmf/stereowidening.h +++ b/src/3rdparty/phonon/mmf/stereowidening.h @@ -46,8 +46,8 @@ public: protected: // AbstractAudioEffect virtual void createEffect(AudioPlayer::NativePlayer *player); - virtual void parameterChanged(const EffectParameter ¶m, - const QVariant &value); + virtual int parameterChanged(const EffectParameter ¶m, + const QVariant &value); private: CStereoWidening *concreteEffect(); -- cgit v0.12 From 24392fb62bb34a80eb7ce13662b0a8744c9ab415 Mon Sep 17 00:00:00 2001 From: Gareth Stockwell Date: Mon, 11 Jan 2010 18:08:00 +0000 Subject: Added enable/disable parameter to each effect in Phonon MMF backend Task-number: QTBUG-4659 Reviewed-by: Espen Riskedal --- src/3rdparty/phonon/mmf/abstractaudioeffect.cpp | 33 ++++++++++++++++++++++++- src/3rdparty/phonon/mmf/abstractaudioeffect.h | 17 ++++++++++--- src/3rdparty/phonon/mmf/audioequalizer.cpp | 7 +++--- src/3rdparty/phonon/mmf/audioequalizer.h | 4 +-- src/3rdparty/phonon/mmf/bassboost.cpp | 25 +------------------ src/3rdparty/phonon/mmf/bassboost.h | 2 -- src/3rdparty/phonon/mmf/effectfactory.cpp | 15 +++++++++++ src/3rdparty/phonon/mmf/environmentalreverb.cpp | 4 +-- src/3rdparty/phonon/mmf/environmentalreverb.h | 4 +-- src/3rdparty/phonon/mmf/loudness.cpp | 25 +------------------ src/3rdparty/phonon/mmf/loudness.h | 2 -- src/3rdparty/phonon/mmf/stereowidening.cpp | 4 +-- 12 files changed, 74 insertions(+), 68 deletions(-) diff --git a/src/3rdparty/phonon/mmf/abstractaudioeffect.cpp b/src/3rdparty/phonon/mmf/abstractaudioeffect.cpp index e3672e6..132eb79 100644 --- a/src/3rdparty/phonon/mmf/abstractaudioeffect.cpp +++ b/src/3rdparty/phonon/mmf/abstractaudioeffect.cpp @@ -72,7 +72,6 @@ void AbstractAudioEffect::setParameterValue(const Phonon::EffectParameter ¶m if (m_effect.data()) { const EffectParameter& internalParam = internalParameter(param.id()); int err = parameterChanged(internalParam, newValue); - TRAP(err, m_effect->ApplyL()); // TODO: handle audio effect errors Q_UNUSED(err); } @@ -159,5 +158,37 @@ const MMF::EffectParameter& AbstractAudioEffect::internalParameter(int id) const return *result; } +int AbstractAudioEffect::parameterChanged(const EffectParameter ¶m, + const QVariant &value) +{ + int err = 0; + + switch (param.id()) { + case ParameterEnable: + setEnabled(value.toBool()); + break; + default: + { + const EffectParameter& internalParam = internalParameter(param.id()); + err = effectParameterChanged(internalParam, value); + } + break; + } + + if (!err) + TRAP(err, m_effect->ApplyL()); + + return err; +} + +int AbstractAudioEffect::effectParameterChanged( + const EffectParameter ¶m, const QVariant &value) +{ + // Default implementation + Q_ASSERT_X(false, Q_FUNC_INFO, "Effect has no parameters"); + return 0; +} + + QT_END_NAMESPACE diff --git a/src/3rdparty/phonon/mmf/abstractaudioeffect.h b/src/3rdparty/phonon/mmf/abstractaudioeffect.h index a3b35c2..9878472 100644 --- a/src/3rdparty/phonon/mmf/abstractaudioeffect.h +++ b/src/3rdparty/phonon/mmf/abstractaudioeffect.h @@ -72,6 +72,13 @@ public: virtual void setParameterValue(const Phonon::EffectParameter &, const QVariant &newValue); + // Parameters which are shared by all effects + enum CommonParameters + { + ParameterEnable = 0, + ParameterBase // must be last entry in enum + }; + public Q_SLOTS: void abstractPlayerChanged(AbstractPlayer *player); void stateChanged(Phonon::State newState, @@ -82,16 +89,18 @@ protected: void connectMediaObject(MediaObject *mediaObject); void disconnectMediaObject(MediaObject *mediaObject); - void setEnabled(bool enabled); - virtual void createEffect(AudioPlayer::NativePlayer *player) = 0; - virtual int parameterChanged(const EffectParameter ¶m, - const QVariant &value) = 0; + // Effect-specific parameter changed + virtual int effectParameterChanged(const EffectParameter ¶m, + const QVariant &value); private: void createEffect(); + void setEnabled(bool enabled); const EffectParameter& internalParameter(int id) const; + int parameterChanged(const EffectParameter ¶m, + const QVariant &value); protected: QScopedPointer m_effect; diff --git a/src/3rdparty/phonon/mmf/audioequalizer.cpp b/src/3rdparty/phonon/mmf/audioequalizer.cpp index 201a5fc..1d2bbd4 100644 --- a/src/3rdparty/phonon/mmf/audioequalizer.cpp +++ b/src/3rdparty/phonon/mmf/audioequalizer.cpp @@ -37,10 +37,11 @@ AudioEqualizer::AudioEqualizer(QObject *parent, const QList& pa } -int AudioEqualizer::parameterChanged(const EffectParameter ¶m, +int AudioEqualizer::effectParameterChanged(const EffectParameter ¶m, const QVariant &value) { - const int band = param.id() + 1; + const int band = param.id() - ParameterBase + 1; + const qreal externalLevel = value.toReal(); const int internalLevel = param.toInternalValue(externalLevel); @@ -87,7 +88,7 @@ bool AudioEqualizer::getParameters(CMdaAudioOutputStream *stream, // Phonon::EffectWidget. See documentation of EffectParameter // for more details. EffectParameter param( - /* parameterId */ i, + /* parameterId */ ParameterBase + i, /* name */ tr("%1 Hz").arg(hz), /* hints */ EffectParameter::LogarithmicHint, /* defaultValue */ QVariant(qreal(0.0)), diff --git a/src/3rdparty/phonon/mmf/audioequalizer.h b/src/3rdparty/phonon/mmf/audioequalizer.h index acfe9b5..9c3770a 100644 --- a/src/3rdparty/phonon/mmf/audioequalizer.h +++ b/src/3rdparty/phonon/mmf/audioequalizer.h @@ -51,8 +51,8 @@ public: protected: // AbstractAudioEffect virtual void createEffect(AudioPlayer::NativePlayer *player); - virtual int parameterChanged(const EffectParameter ¶m, - const QVariant &value); + virtual int effectParameterChanged(const EffectParameter ¶m, + const QVariant &value); private: CAudioEqualizer *concreteEffect(); diff --git a/src/3rdparty/phonon/mmf/bassboost.cpp b/src/3rdparty/phonon/mmf/bassboost.cpp index 6996ba9..c7af939 100644 --- a/src/3rdparty/phonon/mmf/bassboost.cpp +++ b/src/3rdparty/phonon/mmf/bassboost.cpp @@ -37,14 +37,6 @@ BassBoost::BassBoost(QObject *parent, const QList ¶meters) } -int BassBoost::parameterChanged(const EffectParameter ¶m, - const QVariant &value) -{ - Q_ASSERT_X(param.id() == 0, Q_FUNC_INFO, "Invalid parameter ID"); - setEnabled(value.toBool()); - return 0; -} - //----------------------------------------------------------------------------- // Static functions //----------------------------------------------------------------------------- @@ -57,24 +49,9 @@ const char* BassBoost::description() bool BassBoost::getParameters(CMdaAudioOutputStream *stream, QList ¶meters) { - bool supported = false; - QScopedPointer effect; TRAPD(err, effect.reset(CBassBoost::NewL(*stream))); - - if(KErrNone == err) { - supported = true; - - EffectParameter param( - /* parameterId */ 0, - /* name */ tr("Enabled"), - /* hints */ EffectParameter::ToggledHint, - /* defaultValue */ QVariant(bool(true))); - - parameters.append(param); - } - - return supported; + return (KErrNone == err); } QT_END_NAMESPACE diff --git a/src/3rdparty/phonon/mmf/bassboost.h b/src/3rdparty/phonon/mmf/bassboost.h index e8e8094..fc40e21 100644 --- a/src/3rdparty/phonon/mmf/bassboost.h +++ b/src/3rdparty/phonon/mmf/bassboost.h @@ -46,8 +46,6 @@ public: protected: // AbstractAudioEffect virtual void createEffect(AudioPlayer::NativePlayer *player); - virtual int parameterChanged(const EffectParameter ¶m, - const QVariant &value); private: CBassBoost *concreteEffect(); diff --git a/src/3rdparty/phonon/mmf/effectfactory.cpp b/src/3rdparty/phonon/mmf/effectfactory.cpp index 081f6a3..c5e33d5 100644 --- a/src/3rdparty/phonon/mmf/effectfactory.cpp +++ b/src/3rdparty/phonon/mmf/effectfactory.cpp @@ -176,6 +176,13 @@ EffectFactory::EffectData EffectFactory::getData() OutputStreamFactory streamFactory; QScopedPointer stream(streamFactory.create()); + EffectParameter param( + /* parameterId */ AbstractAudioEffect::ParameterEnable, + /* name */ tr("Enabled"), + /* hints */ EffectParameter::ToggledHint, + /* defaultValue */ QVariant(bool(true))); + data.m_parameters.append(param); + if (data.m_supported = BackendNode::getParameters (stream.data(), data.m_parameters)) { const QString description = QCoreApplication::translate @@ -185,6 +192,14 @@ EffectFactory::EffectData EffectFactory::getData() data.m_descriptions.insert("available", true); } + // Sanity check to ensure that all parameter IDs are unique + QSet ids; + foreach (param, data.m_parameters) { + Q_ASSERT_X(ids.find(param.id()) == ids.end(), Q_FUNC_INFO, + "Parameter list contains duplicates"); + ids.insert(param.id()); + } + return data; } diff --git a/src/3rdparty/phonon/mmf/environmentalreverb.cpp b/src/3rdparty/phonon/mmf/environmentalreverb.cpp index f362afd..89f8d60 100644 --- a/src/3rdparty/phonon/mmf/environmentalreverb.cpp +++ b/src/3rdparty/phonon/mmf/environmentalreverb.cpp @@ -33,7 +33,7 @@ PHONON_MMF_DEFINE_EFFECT_FUNCTIONS(EnvironmentalReverb) enum Parameters { - DecayHFRatio, + DecayHFRatio = AbstractAudioEffect::ParameterBase, DecayTime, Density, Diffusion, @@ -51,7 +51,7 @@ EnvironmentalReverb::EnvironmentalReverb(QObject *parent, const QList& parameters) } -int Loudness::parameterChanged(const EffectParameter ¶m, - const QVariant &value) -{ - Q_ASSERT_X(param.id() == 0, Q_FUNC_INFO, "Invalid parameter ID"); - setEnabled(value.toBool()); - return 0; -} - //----------------------------------------------------------------------------- // Static functions //----------------------------------------------------------------------------- @@ -57,24 +49,9 @@ const char* Loudness::description() bool Loudness::getParameters(CMdaAudioOutputStream *stream, QList ¶meters) { - bool supported = false; - QScopedPointer effect; TRAPD(err, effect.reset(CLoudness::NewL(*stream))); - - if(KErrNone == err) { - supported = true; - - EffectParameter param( - /* parameterId */ 0, - /* name */ tr("Enabled"), - /* hints */ EffectParameter::ToggledHint, - /* defaultValue */ QVariant(bool(true))); - - parameters.append(param); - } - - return supported; + return (KErrNone == err); } QT_END_NAMESPACE diff --git a/src/3rdparty/phonon/mmf/loudness.h b/src/3rdparty/phonon/mmf/loudness.h index bb3380e..a688a67 100644 --- a/src/3rdparty/phonon/mmf/loudness.h +++ b/src/3rdparty/phonon/mmf/loudness.h @@ -46,8 +46,6 @@ public: protected: // AbstractAudioEffect virtual void createEffect(AudioPlayer::NativePlayer *player); - virtual int parameterChanged(const EffectParameter ¶m, - const QVariant &value); private: CLoudness *concreteEffect(); diff --git a/src/3rdparty/phonon/mmf/stereowidening.cpp b/src/3rdparty/phonon/mmf/stereowidening.cpp index d14617d..f90651b 100644 --- a/src/3rdparty/phonon/mmf/stereowidening.cpp +++ b/src/3rdparty/phonon/mmf/stereowidening.cpp @@ -40,7 +40,7 @@ StereoWidening::StereoWidening(QObject *parent, const QList& pa int StereoWidening::parameterChanged(const EffectParameter ¶m, const QVariant &value) { - Q_ASSERT_X(param.id() == 0, Q_FUNC_INFO, "Invalid parameter ID"); + Q_ASSERT_X(param.id() == ParameterBase, Q_FUNC_INFO, "Invalid parameter ID"); const qreal externalLevel = value.toReal(); const int internalLevel = param.toInternalValue(externalLevel); @@ -75,7 +75,7 @@ bool StereoWidening::getParameters(CMdaAudioOutputStream *stream, (effect->StereoWideningLevel(), 0, 100); EffectParameter param( - /* parameterId */ 0, + /* parameterId */ ParameterBase, /* name */ tr("Level (%)"), /* hints */ EffectParameter::IntegerHint, /* defaultValue */ QVariant(defaultValue), -- cgit v0.12 From bb689ca42deee2034a3475fa0c5f9337ec1aebbb Mon Sep 17 00:00:00 2001 From: axis Date: Tue, 12 Jan 2010 09:20:02 +0100 Subject: Added changelog entries. --- dist/changes-4.6.1 | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/dist/changes-4.6.1 b/dist/changes-4.6.1 index 145e09e..e26cc8d 100644 --- a/dist/changes-4.6.1 +++ b/dist/changes-4.6.1 @@ -145,6 +145,15 @@ Qt for Windows CE - +Qt for Symbian +-------------- + + - QApplication + * [QTBUG-6098] Added a flag to avoid construction of application panes. + + - Other: + * [QTBUG-4990] Rewrote most of the regular pointer handling. + **************************************************************************** * Tools * **************************************************************************** -- cgit v0.12 From 008bae01b016926209dddacc6e31c79b9d99d4f7 Mon Sep 17 00:00:00 2001 From: Miikka Heikkinen Date: Tue, 12 Jan 2010 12:29:35 +0200 Subject: Added absolute path to sqlite3.sis in s60installs.pro Relative path was only working when package was created from s60installs directory. Binary installer creation requires package creation to work also from Qt root, so added absolute path to sqlite3.sis. Task-number: QTBUG-7275 Reviewed-by: Janne Anttila --- src/s60installs/s60installs.pro | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/s60installs/s60installs.pro b/src/s60installs/s60installs.pro index eb35419..bbc758b 100644 --- a/src/s60installs/s60installs.pro +++ b/src/s60installs/s60installs.pro @@ -36,7 +36,7 @@ symbian: { sqlitedeployment = \ "; Deploy sqlite onto phone that does not have it already" \ - "@\"sqlite3.sis\", (0x2002af5f)" + "@\"$$PWD/sqlite3.sis\", (0x2002af5f)" qtlibraries.pkg_postrules += sqlitedeployment qtlibraries.path = c:/sys/bin -- cgit v0.12 From c90c5b6124bb952500c1d3ca0114163729414771 Mon Sep 17 00:00:00 2001 From: Prasanth Ullattil Date: Tue, 12 Jan 2010 13:13:35 +0100 Subject: Changed log updated --- dist/changes-4.6.1 | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/dist/changes-4.6.1 b/dist/changes-4.6.1 index 5255894..40066bb 100644 --- a/dist/changes-4.6.1 +++ b/dist/changes-4.6.1 @@ -160,7 +160,12 @@ Qt for Windows Qt for Mac OS X --------------- - - + - [QTBUG-6973] Fixed a memory leak when using QWidget::setWindowIcon() in carbon. + - [QTBUG-5186] Fixed a bug which caused drag and drop icons to show + incorrectly. + - [QTBUG-6636] Fixed a crash due to stack overflow in QColorDialog on cocoa. + - [QTBUG-6378] Fix a text cursor rendering bug. + - [QTBUG-6636] Fixed a crash when calling removeToolBar on Mac native toolbars using cocoa. Qt for Embedded Linux --------------------- -- cgit v0.12 From 5a4a0af70184888fa05769bae2d22ee39d905bc0 Mon Sep 17 00:00:00 2001 From: Prasanth Ullattil Date: Tue, 12 Jan 2010 14:53:30 +0100 Subject: Revert "Fixed qxmlstream autotest when using shadow builds." This reverts commit f8780558e3fc68321a0dd6dcef611eeee0805a2e. --- tests/auto/qxmlstream/qxmlstream.pro | 4 ---- tests/auto/qxmlstream/tst_qxmlstream.cpp | 6 +++--- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/tests/auto/qxmlstream/qxmlstream.pro b/tests/auto/qxmlstream/qxmlstream.pro index 89d7bc1..ac03d42 100644 --- a/tests/auto/qxmlstream/qxmlstream.pro +++ b/tests/auto/qxmlstream/qxmlstream.pro @@ -8,8 +8,4 @@ wince*|symbian*: { addFiles.sources = data XML-Test-Suite addFiles.path = . DEPLOYMENT += addFiles - DEFINES += SRCDIR=\\\"\\\" -} else { - DEFINES += SRCDIR=\\\"$$PWD/\\\" } - diff --git a/tests/auto/qxmlstream/tst_qxmlstream.cpp b/tests/auto/qxmlstream/tst_qxmlstream.cpp index 6aa9955..27ae089 100644 --- a/tests/auto/qxmlstream/tst_qxmlstream.cpp +++ b/tests/auto/qxmlstream/tst_qxmlstream.cpp @@ -57,7 +57,7 @@ Q_DECLARE_METATYPE(QXmlStreamReader::ReadElementTextBehaviour) -static const char *const catalogFile = SRCDIR "XML-Test-Suite/xmlconf/finalCatalog.xml"; +static const char *const catalogFile = "XML-Test-Suite/xmlconf/finalCatalog.xml"; static const int expectedRunCount = 1646; static const int expectedSkipCount = 532; @@ -804,7 +804,7 @@ void tst_QXmlStream::testReader_data() const QTest::addColumn("xml"); QTest::addColumn("ref"); QDir dir; - dir.cd(SRCDIR "data/"); + dir.cd("data/"); foreach(QString filename , dir.entryList(QStringList() << "*.xml")) { QString reference = QFileInfo(filename).baseName() + ".ref"; QTest::newRow(dir.filePath(filename).toLatin1().data()) << dir.filePath(filename) << dir.filePath(reference); @@ -1183,7 +1183,7 @@ void tst_QXmlStream::crashInUTF16Codec() const QEventLoop eventLoop; QNetworkAccessManager networkManager; - QNetworkRequest request(QUrl::fromLocalFile(QLatin1String(SRCDIR "data/051reduced.xml"))); + QNetworkRequest request(QUrl::fromLocalFile(QLatin1String("data/051reduced.xml"))); QNetworkReply *const reply = networkManager.get(request); eventLoop.connect(reply, SIGNAL(finished()), SLOT(quit())); -- cgit v0.12 From ddd193b39ba0fa26c18cb13743d9f68cb3749054 Mon Sep 17 00:00:00 2001 From: Peter Hartmann Date: Tue, 12 Jan 2010 14:57:17 +0100 Subject: my changelog for 4.6.1 --- dist/changes-4.6.1 | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/dist/changes-4.6.1 b/dist/changes-4.6.1 index 40066bb..b7073fc 100644 --- a/dist/changes-4.6.1 +++ b/dist/changes-4.6.1 @@ -45,6 +45,9 @@ QtCore and Symbian by using realpath() system call * Avoid stat() when opening a file + - QXmlStreamreader + * [merge request 1926] Fix parsing of DTDs that contain empty markup + declarations QtGui ----- @@ -84,6 +87,8 @@ QtNetwork - QNetworkProxyFactory * Fixed systemProxyForQuery(), it could sometimes return invalid empty list on Windows + - QNetworkCookieJar + * [QTBUG-5815] do not check paths when accepting cookies - QHostInfo * Use 5 parallel threads for host lookup instead of 1 -- cgit v0.12 From 30ea9ef54bc54a122263dd3174c5ee8b70355088 Mon Sep 17 00:00:00 2001 From: Richard Moe Gustavsen Date: Tue, 12 Jan 2010 15:22:15 +0100 Subject: My changes to changes-4.6.1 --- dist/changes-4.6.1 | 2 ++ 1 file changed, 2 insertions(+) diff --git a/dist/changes-4.6.1 b/dist/changes-4.6.1 index b7073fc..4372423 100644 --- a/dist/changes-4.6.1 +++ b/dist/changes-4.6.1 @@ -171,6 +171,8 @@ Qt for Mac OS X - [QTBUG-6636] Fixed a crash due to stack overflow in QColorDialog on cocoa. - [QTBUG-6378] Fix a text cursor rendering bug. - [QTBUG-6636] Fixed a crash when calling removeToolBar on Mac native toolbars using cocoa. + - [QTBUG-5613] Fixed a bug where the application refued to quit when showing a single modal dialog. + - Gestures are now available for the Carbon port also when building Qt against SDK < 10.6 Qt for Embedded Linux --------------------- -- cgit v0.12 From 4f7ebc24de5496c468e38b36aaba3ad3d877198a Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Tue, 12 Jan 2010 15:19:45 +0100 Subject: Autotest: don't depend on QtGui just because of QDesktopServices::storageLocation Task-number: QTBUG-7060 Reviewed-by: Trust Me --- tests/auto/qabstractnetworkcache/qabstractnetworkcache.pro | 1 + tests/auto/qabstractnetworkcache/tst_qabstractnetworkcache.cpp | 4 +--- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/tests/auto/qabstractnetworkcache/qabstractnetworkcache.pro b/tests/auto/qabstractnetworkcache/qabstractnetworkcache.pro index 11e340d..a57c56f 100644 --- a/tests/auto/qabstractnetworkcache/qabstractnetworkcache.pro +++ b/tests/auto/qabstractnetworkcache/qabstractnetworkcache.pro @@ -1,5 +1,6 @@ load(qttest_p4) QT += network +QT -= gui SOURCES += tst_qabstractnetworkcache.cpp wince*|symbian: { diff --git a/tests/auto/qabstractnetworkcache/tst_qabstractnetworkcache.cpp b/tests/auto/qabstractnetworkcache/tst_qabstractnetworkcache.cpp index e5646c1..ac73f08 100644 --- a/tests/auto/qabstractnetworkcache/tst_qabstractnetworkcache.cpp +++ b/tests/auto/qabstractnetworkcache/tst_qabstractnetworkcache.cpp @@ -41,7 +41,6 @@ #include -#include #include #include "../../shared/util.h" #include "../network-settings.h" @@ -83,8 +82,7 @@ public: : QNetworkDiskCache(parent) , gotData(false) { - QString location = QDesktopServices::storageLocation(QDesktopServices::CacheLocation) - + QLatin1String("/qnetworkdiskcache/"); + QString location = QDir::tempPath() + QLatin1String("/tst_qnetworkdiskcache/"); setCacheDirectory(location); clear(); } -- cgit v0.12 From 589568759b074dd0478615f785a2297a1800d79f Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Tue, 12 Jan 2010 15:20:28 +0100 Subject: Fix an issue with HTTP headers like "private, max-age=300". The parsing would ignore the fact that "private" ended at the comma and would instead try to get the continuation as the value. We have to check if equal < comma and it's not -1. Using unsigned comparisons does both things at once for us. Task-number: QTBUG-7060 Reviewed-by: Peter Hartmann --- src/network/access/qnetworkaccesshttpbackend.cpp | 2 +- .../tests/httpcachetest_cachecontrol200.cgi | 9 +++++++++ tests/auto/qabstractnetworkcache/tst_qabstractnetworkcache.cpp | 8 +++++++- 3 files changed, 17 insertions(+), 2 deletions(-) create mode 100644 tests/auto/qabstractnetworkcache/tests/httpcachetest_cachecontrol200.cgi diff --git a/src/network/access/qnetworkaccesshttpbackend.cpp b/src/network/access/qnetworkaccesshttpbackend.cpp index a639e0d..58123b2 100644 --- a/src/network/access/qnetworkaccesshttpbackend.cpp +++ b/src/network/access/qnetworkaccesshttpbackend.cpp @@ -144,7 +144,7 @@ static QHash parseHttpOptionHeader(const QByteArray &hea QByteArray key = QByteArray(header.constData() + pos, end - pos).trimmed().toLower(); pos = end + 1; - if (equal != -1) { + if (uint(equal) < uint(comma)) { // case: token "=" (token | quoted-string) // skip spaces pos = nextNonWhitespace(header, pos); diff --git a/tests/auto/qabstractnetworkcache/tests/httpcachetest_cachecontrol200.cgi b/tests/auto/qabstractnetworkcache/tests/httpcachetest_cachecontrol200.cgi new file mode 100644 index 0000000..e44d5ed --- /dev/null +++ b/tests/auto/qabstractnetworkcache/tests/httpcachetest_cachecontrol200.cgi @@ -0,0 +1,9 @@ +#!/bin/bash +cc=`echo "${QUERY_STRING}" | sed -e s/%20/\ /g` +echo "Status: 200" +echo "Cache-Control: $cc" +echo "Last-Modified: Sat, 31 Oct 1981 06:00:00 GMT" +echo "Content-type: text/html"; +echo "X-Script: $0" +echo "" +echo "Hello World!" diff --git a/tests/auto/qabstractnetworkcache/tst_qabstractnetworkcache.cpp b/tests/auto/qabstractnetworkcache/tst_qabstractnetworkcache.cpp index ac73f08..04bd432 100644 --- a/tests/auto/qabstractnetworkcache/tst_qabstractnetworkcache.cpp +++ b/tests/auto/qabstractnetworkcache/tst_qabstractnetworkcache.cpp @@ -205,6 +205,11 @@ void tst_QAbstractNetworkCache::cacheControl_data() QTest::newRow("304-2") << QNetworkRequest::PreferNetwork << "httpcachetest_cachecontrol.cgi?max-age=1000, must-revalidate" << true; QTest::newRow("304-3") << QNetworkRequest::AlwaysCache << "httpcachetest_cachecontrol.cgi?max-age=1000, must-revalidate" << AlwaysTrue; QTest::newRow("304-4") << QNetworkRequest::PreferCache << "httpcachetest_cachecontrol.cgi?max-age=1000, must-revalidate" << true; + + // see QTBUG-7060 + //QTest::newRow("nokia-boston") << QNetworkRequest::PreferNetwork << "http://waplabdc.nokia-boston.com/browser/users/venkat/cache/Cache_directives/private_1b.asp" << true; + QTest::newRow("304-2b") << QNetworkRequest::PreferNetwork << "httpcachetest_cachecontrol200.cgi?private, max-age=1000" << true; + QTest::newRow("304-4b") << QNetworkRequest::PreferCache << "httpcachetest_cachecontrol200.cgi?private, max-age=1000" << true; } void tst_QAbstractNetworkCache::cacheControl() @@ -223,7 +228,8 @@ void tst_QAbstractNetworkCache::check() manager.setCache(diskCache); QCOMPARE(diskCache->gotData, false); - QNetworkRequest request(QUrl(TESTFILE + url)); + QUrl realUrl = url.contains("://") ? url : TESTFILE + url; + QNetworkRequest request(realUrl); // prime the cache QNetworkReply *reply = manager.get(request); -- cgit v0.12 From d09836caf877ad8ebd03899a2033320682c5154f Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Tue, 12 Jan 2010 15:52:11 +0100 Subject: Autotest: set these files to executable. They are CGI scripts. Reviewed-by: Trust Me --- .../qabstractnetworkcache/tests/httpcachetest_cachecontrol-expire.cgi | 0 tests/auto/qabstractnetworkcache/tests/httpcachetest_cachecontrol.cgi | 0 tests/auto/qabstractnetworkcache/tests/httpcachetest_cachecontrol200.cgi | 0 tests/auto/qabstractnetworkcache/tests/httpcachetest_etag200.cgi | 0 tests/auto/qabstractnetworkcache/tests/httpcachetest_etag304.cgi | 0 tests/auto/qabstractnetworkcache/tests/httpcachetest_expires200.cgi | 0 tests/auto/qabstractnetworkcache/tests/httpcachetest_expires304.cgi | 0 tests/auto/qabstractnetworkcache/tests/httpcachetest_expires500.cgi | 0 tests/auto/qabstractnetworkcache/tests/httpcachetest_lastModified200.cgi | 0 tests/auto/qabstractnetworkcache/tests/httpcachetest_lastModified304.cgi | 0 10 files changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 tests/auto/qabstractnetworkcache/tests/httpcachetest_cachecontrol-expire.cgi mode change 100644 => 100755 tests/auto/qabstractnetworkcache/tests/httpcachetest_cachecontrol.cgi mode change 100644 => 100755 tests/auto/qabstractnetworkcache/tests/httpcachetest_cachecontrol200.cgi mode change 100644 => 100755 tests/auto/qabstractnetworkcache/tests/httpcachetest_etag200.cgi mode change 100644 => 100755 tests/auto/qabstractnetworkcache/tests/httpcachetest_etag304.cgi mode change 100644 => 100755 tests/auto/qabstractnetworkcache/tests/httpcachetest_expires200.cgi mode change 100644 => 100755 tests/auto/qabstractnetworkcache/tests/httpcachetest_expires304.cgi mode change 100644 => 100755 tests/auto/qabstractnetworkcache/tests/httpcachetest_expires500.cgi mode change 100644 => 100755 tests/auto/qabstractnetworkcache/tests/httpcachetest_lastModified200.cgi mode change 100644 => 100755 tests/auto/qabstractnetworkcache/tests/httpcachetest_lastModified304.cgi diff --git a/tests/auto/qabstractnetworkcache/tests/httpcachetest_cachecontrol-expire.cgi b/tests/auto/qabstractnetworkcache/tests/httpcachetest_cachecontrol-expire.cgi old mode 100644 new mode 100755 diff --git a/tests/auto/qabstractnetworkcache/tests/httpcachetest_cachecontrol.cgi b/tests/auto/qabstractnetworkcache/tests/httpcachetest_cachecontrol.cgi old mode 100644 new mode 100755 diff --git a/tests/auto/qabstractnetworkcache/tests/httpcachetest_cachecontrol200.cgi b/tests/auto/qabstractnetworkcache/tests/httpcachetest_cachecontrol200.cgi old mode 100644 new mode 100755 diff --git a/tests/auto/qabstractnetworkcache/tests/httpcachetest_etag200.cgi b/tests/auto/qabstractnetworkcache/tests/httpcachetest_etag200.cgi old mode 100644 new mode 100755 diff --git a/tests/auto/qabstractnetworkcache/tests/httpcachetest_etag304.cgi b/tests/auto/qabstractnetworkcache/tests/httpcachetest_etag304.cgi old mode 100644 new mode 100755 diff --git a/tests/auto/qabstractnetworkcache/tests/httpcachetest_expires200.cgi b/tests/auto/qabstractnetworkcache/tests/httpcachetest_expires200.cgi old mode 100644 new mode 100755 diff --git a/tests/auto/qabstractnetworkcache/tests/httpcachetest_expires304.cgi b/tests/auto/qabstractnetworkcache/tests/httpcachetest_expires304.cgi old mode 100644 new mode 100755 diff --git a/tests/auto/qabstractnetworkcache/tests/httpcachetest_expires500.cgi b/tests/auto/qabstractnetworkcache/tests/httpcachetest_expires500.cgi old mode 100644 new mode 100755 diff --git a/tests/auto/qabstractnetworkcache/tests/httpcachetest_lastModified200.cgi b/tests/auto/qabstractnetworkcache/tests/httpcachetest_lastModified200.cgi old mode 100644 new mode 100755 diff --git a/tests/auto/qabstractnetworkcache/tests/httpcachetest_lastModified304.cgi b/tests/auto/qabstractnetworkcache/tests/httpcachetest_lastModified304.cgi old mode 100644 new mode 100755 -- cgit v0.12 From ecef74a8ecfd75b58c99a0131d1a42750051eb76 Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Tue, 12 Jan 2010 16:10:40 +0100 Subject: Skip tst_QSystemLock::processes This test is currently taking 15 minutes to execute, slowing down the entire Qt integration. It needs to be trimmed down before re-enabling it. Reviewed-by: Paul --- tests/auto/qsharedmemory/qsystemlock/tst_qsystemlock.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/auto/qsharedmemory/qsystemlock/tst_qsystemlock.cpp b/tests/auto/qsharedmemory/qsystemlock/tst_qsystemlock.cpp index 8c4eeb1..ea906b7 100644 --- a/tests/auto/qsharedmemory/qsystemlock/tst_qsystemlock.cpp +++ b/tests/auto/qsharedmemory/qsystemlock/tst_qsystemlock.cpp @@ -197,6 +197,7 @@ void tst_QSystemLock::processes_data() */ void tst_QSystemLock::processes() { + QSKIP("This test takes about 15 minutes and needs to be trimmed down before we can re-enable it", SkipAll); QFETCH(int, readOnly); QFETCH(int, readWrite); -- cgit v0.12 From 58a319f851bb5d1a4634df36215694ae1786fbd0 Mon Sep 17 00:00:00 2001 From: Jens Bache-Wiig Date: Tue, 12 Jan 2010 16:13:16 +0100 Subject: Fixes: Add some changes for 4.6.1 --- dist/changes-4.6.1 | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/dist/changes-4.6.1 b/dist/changes-4.6.1 index 4372423..4aa4d5a 100644 --- a/dist/changes-4.6.1 +++ b/dist/changes-4.6.1 @@ -68,6 +68,7 @@ QtGui * [QTBUG-6654] Fix crashes when deleting QGraphicsItems in touch event handlers. + QtDBus ------ @@ -151,6 +152,12 @@ Qt for Linux/X11 - QFileSystemWatcher * [QTBUG-4840] Fix memory leak in the dnotify implementation. + - QIcon + * [QTBUG-6121] Fixed a problem causing svg-based icon themes to look fuzzy. + + - QGtkStyle + * [QTBUG-6484] Ensure that gtk-enable-mnemonics is respected. + Qt for Windows -------------- @@ -161,6 +168,9 @@ Qt for Windows * [QTBUG-6083] Fix a performance regression introduced in 4.6.0 that would cause all Qt posted events to be sent at 15-16ms intervals (instead of as quickly as possible). + - Vista/XP styles + * [QTBUG-6271] Fixed a compatibility issue with MDI windows in + certain non-standard themes. Qt for Mac OS X --------------- -- cgit v0.12 From 152e4ee249915b15241c5f37830f37bb569151b6 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Tue, 12 Jan 2010 16:14:07 +0100 Subject: Fix D-Bus calls with QDBus::BlockWithGui. We must wait for a reply in case the reply hasn't been received yet, not if it has already been received. Simple typo. Task-number: QT-2307 Reviewed-by: Trust Me --- src/dbus/qdbusintegrator.cpp | 2 +- tests/auto/qdbusconnection/tst_qdbusconnection.cpp | 17 +++++++++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/src/dbus/qdbusintegrator.cpp b/src/dbus/qdbusintegrator.cpp index 572c050..30fa0b6 100644 --- a/src/dbus/qdbusintegrator.cpp +++ b/src/dbus/qdbusintegrator.cpp @@ -1826,7 +1826,7 @@ QDBusMessage QDBusConnectionPrivate::sendWithReply(const QDBusMessage &message, QDBusPendingCallPrivate *pcall = sendWithReplyAsync(message, timeout); Q_ASSERT(pcall); - if (pcall->replyMessage.type() != QDBusMessage::InvalidMessage) { + if (pcall->replyMessage.type() == QDBusMessage::InvalidMessage) { pcall->watcherHelper = new QDBusPendingCallWatcherHelper; QEventLoop loop; loop.connect(pcall->watcherHelper, SIGNAL(reply(QDBusMessage)), SLOT(quit())); diff --git a/tests/auto/qdbusconnection/tst_qdbusconnection.cpp b/tests/auto/qdbusconnection/tst_qdbusconnection.cpp index 606659f..5e2f3a9 100644 --- a/tests/auto/qdbusconnection/tst_qdbusconnection.cpp +++ b/tests/auto/qdbusconnection/tst_qdbusconnection.cpp @@ -86,6 +86,7 @@ private slots: void connectToBus(); void connect(); void send(); + void sendWithGui(); void sendAsync(); void sendSignal(); @@ -173,6 +174,22 @@ void tst_QDBusConnection::send() QVERIFY(reply.arguments().at(0).toStringList().contains(con.baseService())); } +void tst_QDBusConnection::sendWithGui() +{ + QDBusConnection con = QDBusConnection::sessionBus(); + + QVERIFY(con.isConnected()); + + QDBusMessage msg = QDBusMessage::createMethodCall("org.freedesktop.DBus", + "/org/freedesktop/DBus", "org.freedesktop.DBus", "ListNames"); + + QDBusMessage reply = con.call(msg, QDBus::BlockWithGui); + + QCOMPARE(reply.arguments().count(), 1); + QCOMPARE(reply.arguments().at(0).typeName(), "QStringList"); + QVERIFY(reply.arguments().at(0).toStringList().contains(con.baseService())); +} + void tst_QDBusConnection::sendAsync() { QDBusConnection con = QDBusConnection::sessionBus(); -- cgit v0.12 From 4db1405ffa66c33f3746baa09301cdc4e05cacc7 Mon Sep 17 00:00:00 2001 From: Pierre Rossi Date: Thu, 7 Jan 2010 13:25:23 +0100 Subject: Modifies the google chat example to use the DOM API Now that it's there, we might as well use it! Reviewed-by: Benjamin Poulain --- examples/webkit/googlechat/form.ui | 6 +++++ examples/webkit/googlechat/googlechat.cpp | 38 +++++++++++++++++-------------- examples/webkit/googlechat/googlechat.h | 3 ++- 3 files changed, 29 insertions(+), 18 deletions(-) diff --git a/examples/webkit/googlechat/form.ui b/examples/webkit/googlechat/form.ui index 3b9fb82..4939ea1 100644 --- a/examples/webkit/googlechat/form.ui +++ b/examples/webkit/googlechat/form.ui @@ -48,6 +48,9 @@ Qt::AlignCenter + + true + @@ -160,6 +163,9 @@ Login + + true + diff --git a/examples/webkit/googlechat/googlechat.cpp b/examples/webkit/googlechat/googlechat.cpp index 12ea071..8eb033c 100644 --- a/examples/webkit/googlechat/googlechat.cpp +++ b/examples/webkit/googlechat/googlechat.cpp @@ -80,9 +80,8 @@ void GoogleChat::showError(const QString &msg) { showStatus(QString("Error: %1").arg(msg)); } -QString GoogleChat::evalJS(const QString &js) { - QWebFrame *frame = form.webView->page()->mainFrame(); - return frame->evaluateJavaScript(js).toString(); +QWebElement GoogleChat::document() const { + return form.webView->page()->mainFrame()->documentElement(); } void GoogleChat::adjustLoginButton() { @@ -112,9 +111,11 @@ void GoogleChat::doLogin() { showStatus("Logging in..."); QString userEmail = userName + "@gmail.com"; - evalJS(QString("document.getElementById('Email').value = \"%1\";").arg(userEmail)); - evalJS(QString("document.getElementById('Passwd').value = \"%1\";").arg(password)); - evalJS("document.getElementById('gaia_loginform').submit();"); + + document().findFirst("#Email").setAttribute("value", userEmail); + document().findFirst("#Passwd").setAttribute("value", password); + document().findFirst("#gaia_loginform").evaluateJavaScript("this.submit();"); + } void GoogleChat::initialPage(bool ok) { @@ -124,11 +125,12 @@ void GoogleChat::initialPage(bool ok) { } if (ok) { - QString s1 = evalJS("document.getElementById('Email').name"); - QString s2 = evalJS("document.getElementById('Passwd').name"); - QString s3 = evalJS("document.getElementById('gaia_loginform').id"); - if (s1 == "Email" && s2 == "Passwd" && s3 == "gaia_loginform") { + QWebElement email = document().findFirst("#Email"); + QWebElement passwd = document().findFirst("#Passwd"); + QWebElement loginForm = document().findFirst("#gaia_loginform"); + if (!email.isNull() && !passwd.isNull() && !loginForm.isNull()) { form.stackedWidget->setCurrentIndex(1); + form.userNameEdit->setFocus(); form.webView->disconnect(); return; } @@ -139,8 +141,8 @@ void GoogleChat::initialPage(bool ok) { void GoogleChat::hideElements() { - evalJS("var e = document.getElementsByClassName('footer-footer')[0]; e.parentElement.removeChild(e)"); - evalJS("var e = document.getElementsByClassName('title-bar-bg title-bar')[0]; e.parentElement.removeChild(e)"); + document().findFirst(".footer-footer").removeFromDocument(); + document().findFirst(".title-bar-bg .title-bar").removeFromDocument(); QTimer::singleShot(2000, this, SLOT(hideElements())); } @@ -152,16 +154,18 @@ void GoogleChat::loginPage(bool ok) { showError("Service unavailable"); } else { // check for any error message - QString c = evalJS("document.getElementsByClassName('errormsg').length"); - if (c == "0") { + + QWebElement e = document().findFirst(".errormsg"); + if (e.isNull()) { form.stackedWidget->setCurrentIndex(2); QTimer::singleShot(500, this, SLOT(hideElements())); return; } - QString err = "Unknown login failure."; - if (c == "1") { - err = evalJS("document.getElementsByClassName('errormsg')[0].textContent"); + QString err = "Unknown login failure."; + const QString errorMessage = e.toPlainText(); + if (!errorMessage.isEmpty()) { + err = errorMessage; err = err.simplified(); } showError(err); diff --git a/examples/webkit/googlechat/googlechat.h b/examples/webkit/googlechat/googlechat.h index 70f921e..617587a 100644 --- a/examples/webkit/googlechat/googlechat.h +++ b/examples/webkit/googlechat/googlechat.h @@ -40,6 +40,7 @@ ****************************************************************************/ #include +#include #include "ui_form.h" @@ -53,7 +54,7 @@ public: protected: void showStatus(const QString &msg); void showError(const QString &msg); - QString evalJS(const QString &js); + QWebElement document() const; private slots: -- cgit v0.12 From c603ca1c8e99dd0ec7e1d0b56b432d8eca21226a Mon Sep 17 00:00:00 2001 From: Pierre Rossi Date: Mon, 11 Jan 2010 15:10:17 +0100 Subject: Make compile on HPUX Reviewed-by: axis --- src/corelib/kernel/qcore_unix.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/corelib/kernel/qcore_unix.cpp b/src/corelib/kernel/qcore_unix.cpp index 328fd3d..0fd965b 100644 --- a/src/corelib/kernel/qcore_unix.cpp +++ b/src/corelib/kernel/qcore_unix.cpp @@ -42,7 +42,9 @@ #include "qcore_unix_p.h" #ifndef Q_OS_VXWORKS +# if !defined(Q_OS_HPUX) || defined(__ia64) # include +# endif # include #else # include -- cgit v0.12 From 06b513193715d5f442a6fd749667aed83944927a Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Tue, 12 Jan 2010 21:57:13 +0100 Subject: QtWebKit changelog for Qt 4.6.1 From qtwebkit-4.6.0 to de77f8ee69c434bde9306c8f407ee2e443a00188 --- dist/changes-4.6.1 | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/dist/changes-4.6.1 b/dist/changes-4.6.1 index 4aa4d5a..612aeda 100644 --- a/dist/changes-4.6.1 +++ b/dist/changes-4.6.1 @@ -101,6 +101,18 @@ QtOpenGL compressed textures if the appropriate extensions are present in the GL implementation. +QtwebKit +-------- + + - Fixed user agent string on Symbian (webkit.org/b/31961) + - QWebInspector: Don't disable when hiding (webkit.org/b/31851) + - Fix JavaScript prompt behaviour for empty/null strings (webkit.org/b/30914) + - Fixed lastIndexOf() on Symbian (webkit.org/b/31773) + - Fixed crash with Flash on Windows with MinGW + - Fixed wrapping of QObjects with recurring identity (webkit.org/b/31681) + - Fixed compilation with ICC + - Fixed assertion when dragging SVG images (webkit.org/b/32511) + QtScript -------- -- cgit v0.12 From dd62687182830aa353ef573f653fe913fd42a8d0 Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Wed, 13 Jan 2010 10:21:04 +0100 Subject: Updated WebKit from /home/shausman/src/webkit/trunk to qtwebkit/qtwebkit-4.6 ( 8b9165d3bc84d1c8cc7df49a191cc3857b5530d4 ) Changes in WebKit/qt since the last update: * Cherry-pick of http://trac.webkit.org/changeset/53181 ( http://bugreports.qt.nokia.com/browse/QTBUG-7290 ) --- src/3rdparty/webkit/VERSION | 2 +- src/3rdparty/webkit/WebCore/ChangeLog | 12 ++++++++++++ src/3rdparty/webkit/WebCore/WebCore.pro | 9 +++++++++ 3 files changed, 22 insertions(+), 1 deletion(-) diff --git a/src/3rdparty/webkit/VERSION b/src/3rdparty/webkit/VERSION index b69ac98..bc6d661 100644 --- a/src/3rdparty/webkit/VERSION +++ b/src/3rdparty/webkit/VERSION @@ -8,4 +8,4 @@ The commit imported was from the and has the sha1 checksum - bd6591b4acaf2172ab05702153ef539c0ac89cbb + 8b9165d3bc84d1c8cc7df49a191cc3857b5530d4 diff --git a/src/3rdparty/webkit/WebCore/ChangeLog b/src/3rdparty/webkit/WebCore/ChangeLog index ab5b131..02daf86 100644 --- a/src/3rdparty/webkit/WebCore/ChangeLog +++ b/src/3rdparty/webkit/WebCore/ChangeLog @@ -1,3 +1,15 @@ +2010-01-13 Miikka Heikkinen + + Reviewed by Simon Hausmann. + + [Qt/Symbian] Added missing vendor information to qtwebkit.sis + + This information is necessary to Symbian sign the package. + + http://bugreports.qt.nokia.com/browse/QTBUG-7290 + + * WebCore.pro: + 2010-01-12 Jakub Wieczorek Reviewed by Adam Barth. diff --git a/src/3rdparty/webkit/WebCore/WebCore.pro b/src/3rdparty/webkit/WebCore/WebCore.pro index 3eba696..9432217 100644 --- a/src/3rdparty/webkit/WebCore/WebCore.pro +++ b/src/3rdparty/webkit/WebCore/WebCore.pro @@ -9,6 +9,15 @@ symbian: { webkitlibs.sources = QtWebKit.dll webkitlibs.path = /sys/bin + vendorinfo = \ + "; Localised Vendor name" \ + "%{\"Nokia, Qt\"}" \ + " " \ + "; Unique Vendor name" \ + ":\"Nokia, Qt\"" \ + " " + webkitlibs.pkg_prerules = vendorinfo + DEPLOYMENT += webkitlibs TARGET.UID3 = 0x200267C2 -- cgit v0.12 From 15b10bf77dde5235083f383c186e809c16e2e56a Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Wed, 13 Jan 2010 10:37:10 +0100 Subject: Remove erroneous warning in QFileInfo::absolutePath() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit QFileInfo().absolutePath() is legal and shouldn't produce a warning. Reviewed-by: João Abecasis --- src/corelib/io/qfileinfo.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/corelib/io/qfileinfo.cpp b/src/corelib/io/qfileinfo.cpp index b4437db..e90529e 100644 --- a/src/corelib/io/qfileinfo.cpp +++ b/src/corelib/io/qfileinfo.cpp @@ -573,10 +573,13 @@ QString QFileInfo::canonicalFilePath() const QString QFileInfo::absolutePath() const { Q_D(const QFileInfo); - if (d->data->fileName.isEmpty()) + + if (!d->data->fileEngine) { + return QLatin1String(""); + } else if (d->data->fileName.isEmpty()) { qWarning("QFileInfo::absolutePath: Constructed with empty filename"); - if(!d->data->fileEngine) return QLatin1String(""); + } return d->getFileName(QAbstractFileEngine::AbsolutePathName); } -- cgit v0.12 From 42fc59ed04e1675ecae7fa87303a148c4b0c1ed1 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Wed, 13 Jan 2010 12:21:09 +0100 Subject: My changes for 4.6.1 --- dist/changes-4.6.1 | 66 +++++++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 60 insertions(+), 6 deletions(-) diff --git a/dist/changes-4.6.1 b/dist/changes-4.6.1 index 0f8c2bc..b07551a 100644 --- a/dist/changes-4.6.1 +++ b/dist/changes-4.6.1 @@ -29,7 +29,9 @@ New features Optimizations ------------- - - Optimized foo in QSomeClass + - Optimized empty QUrl creation + * Empty QUrls no longer allocate memory now + * See list of Important Behavior Changes below @@ -45,6 +47,17 @@ QtCore and Symbian by using realpath() system call * Avoid stat() when opening a file + - QLibrary and QPluginLoader + * Do not look at the Qt patch-level version embedded in plugins' + buildkeys when trying to determine if the plugin is compatible + + - QProcessEnvironment + * [QTBUG-6701] Ensure we don't crash in operator== + + - QTextEncoder + * [merge request 399] QTextEncoder::fromUnicode as QT3 support + member + - QXmlStreamreader * [merge request 1926] Fix parsing of DTDs that contain empty markup declarations @@ -72,8 +85,30 @@ QtGui QtDBus ------ - - foo - * bar + - QDBusConnection + * [QTBUG-5979] Fixed the signal-delivery mechanism to update + correctly when the sender name changes/appears on the bus. + * [QTBUG-7041] Fixed marshalling of booleans in release mode. + * [QT-2307] Fixed calls with the QDBus::BlockWithGui mode. + + - QDBusInterface + * Made it continue working even when the remote object + introspection fails. + + - QDBusInterface and qdbuscpp2xml + * [QTBUG-5563] Fixed an issue with generating annotations in + signals + + - QDBusPendingReply and QDBusReply + * [QTBUG-6571] Fixed a crash that would happen if you tried to + make a call with a disconnected QDBusConnection + +QtMultimedia +------------ + + - QAudioOutput + * [Merge request 418] Fixed compilation the example provided for + QAudioOutput::start QtNetwork --------- @@ -82,6 +117,8 @@ QtNetwork * HTTP: Smaller improvements * HTTP: Send our locale with the HTTP request * HTTP: Start Accept-language and Authorization header with capital letter + * HTTP: Fix caching algorithm, matching RFC 2612 and the documentation + * HTTP [QTBUG-7060]: Fix an issue with headers like "private, max-age=300" * file: Introduce special subclass for higher performance with file:// URLs - QTcpSocket * [QTBUG-5799] Fix waitForConnected() on Windows @@ -101,7 +138,7 @@ QtOpenGL compressed textures if the appropriate extensions are present in the GL implementation. -QtwebKit +QtWebKit -------- - Fixed user agent string on Symbian (webkit.org/b/31961) @@ -112,6 +149,7 @@ QtwebKit - Fixed wrapping of QObjects with recurring identity (webkit.org/b/31681) - Fixed compilation with ICC - Fixed assertion when dragging SVG images (webkit.org/b/32511) + - Added the framecapture example to the default build (merge request 2235) QtScript -------- @@ -152,7 +190,15 @@ Third party components Qt for Unix (X11 and Mac OS X) ------------------------------ - - + - [QTBUG-6755] Ensure we don't call select(2) with a negative timeout + if the timer expires during timeout recalculation. + + - Added mkspecs for Sun CC that enable -library=stlport by default, + to restore STL capability with that compiler. + + - [QTBUG-6576] Fixed compilation on HP-UX 11.11 + + - [QTBUG-6961] Fixed compilation on HURD Qt for Linux/X11 ---------------- @@ -244,5 +290,13 @@ Qt for Symbian * Important Behavior Changes * **************************************************************************** - - + - Phonon + * Include headers have been changed. The only official method for + including Phonon headers is or + . This change was necessary because of + frameworks on Mac. + + Compatibility is provided for includes, but is not + guaranteed to work. Including and is not + supported. -- cgit v0.12 From 8c7e85c7b9933949c7a7c05489f5f6bfd1ce4312 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Wed, 13 Jan 2010 12:39:16 +0100 Subject: Update my changelog for 4.6.1 --- dist/changes-4.6.1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dist/changes-4.6.1 b/dist/changes-4.6.1 index b07551a..b8994df 100644 --- a/dist/changes-4.6.1 +++ b/dist/changes-4.6.1 @@ -30,9 +30,9 @@ Optimizations ------------- - Optimized empty QUrl creation - * Empty QUrls no longer allocate memory now + * [QTBUG-4030] Empty QUrls no longer allocate memory now - * See list of Important Behavior Changes below + * See list of Important Behavior Changes below **************************************************************************** -- cgit v0.12