summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSami Merilä <sami.merila@nokia.com>2009-10-07 13:15:17 (GMT)
committerSami Merilä <sami.merila@nokia.com>2009-10-07 13:15:17 (GMT)
commitd65daa20e4a1df1479378fa166871dc2cf0e8612 (patch)
tree515ce9f271b20e42097f6ac131b4f1142dd73b32
parentf2363657d53f033488ca0ec141cb1261847eed5c (diff)
parent5695b50d2f21e94e8c284148367d2656d1158722 (diff)
downloadQt-d65daa20e4a1df1479378fa166871dc2cf0e8612.zip
Qt-d65daa20e4a1df1479378fa166871dc2cf0e8612.tar.gz
Qt-d65daa20e4a1df1479378fa166871dc2cf0e8612.tar.bz2
Merge branch '4.6' of git@scm.dev.nokia.troll.no:qt/qt into 4.6
-rw-r--r--mkspecs/features/qt_functions.prf2
-rw-r--r--src/3rdparty/phonon/mmf/audiooutput.cpp26
-rw-r--r--src/3rdparty/phonon/mmf/audiooutput.h13
-rw-r--r--src/3rdparty/phonon/mmf/audioplayer.cpp9
-rw-r--r--src/3rdparty/phonon/mmf/audioplayer.h5
-rw-r--r--src/3rdparty/phonon/mmf/backend.cpp18
6 files changed, 50 insertions, 23 deletions
diff --git a/mkspecs/features/qt_functions.prf b/mkspecs/features/qt_functions.prf
index 243a829..6322233 100644
--- a/mkspecs/features/qt_functions.prf
+++ b/mkspecs/features/qt_functions.prf
@@ -50,7 +50,7 @@ defineTest(qtAddLibrary) {
INCLUDEPATH *= $$MW_LAYER_SYSTEMINCLUDE
}
isEmpty(LINKAGE) {
- CONFIG(debug, debug|release) {
+ if(!debug_and_release|build_pass):CONFIG(debug, debug|release) {
win32:LINKAGE = -l$${LIB_NAME}$${QT_LIBINFIX}d
mac:LINKAGE = -l$${LIB_NAME}$${QT_LIBINFIX}_debug
}
diff --git a/src/3rdparty/phonon/mmf/audiooutput.cpp b/src/3rdparty/phonon/mmf/audiooutput.cpp
index 58e2f5e..5a00f60 100644
--- a/src/3rdparty/phonon/mmf/audiooutput.cpp
+++ b/src/3rdparty/phonon/mmf/audiooutput.cpp
@@ -18,6 +18,8 @@ along with this library. If not, see <http://www.gnu.org/licenses/>.
#include <e32debug.h>
+#include <QCoreApplication>
+
#include "audiooutput.h"
#include "defs.h"
#include "mediaobject.h"
@@ -74,16 +76,13 @@ void MMF::AudioOutput::setVolume(qreal volume)
int MMF::AudioOutput::outputDevice() const
{
- return 0;
-}
-
-bool MMF::AudioOutput::setOutputDevice(int)
-{
- return true;
+ return AudioOutputDeviceID;
}
-bool MMF::AudioOutput::setOutputDevice(const Phonon::AudioOutputDevice &)
+bool MMF::AudioOutput::setOutputDevice(int index)
{
+ Q_ASSERT_X(index == AudioOutputDeviceID, Q_FUNC_INFO,
+ "We only support one output device, with id 0");
return true;
}
@@ -101,4 +100,17 @@ bool MMF::AudioOutput::activateOnMediaObject(MediaObject *mo)
return true;
}
+QHash<QByteArray, QVariant> MMF::AudioOutput::audioOutputDescription(int index)
+{
+ if (index == AudioOutputDeviceID) {
+ QHash<QByteArray, QVariant> retval;
+
+ retval.insert("name", QCoreApplication::translate("Phonon::MMF", "Audio Output"));
+ retval.insert("description", QCoreApplication::translate("Phonon::MMF", "The audio output device"));
+ retval.insert("available", true);
+
+ return retval;
+ }
+}
+
QT_END_NAMESPACE
diff --git a/src/3rdparty/phonon/mmf/audiooutput.h b/src/3rdparty/phonon/mmf/audiooutput.h
index 0a962a9..d0ba086 100644
--- a/src/3rdparty/phonon/mmf/audiooutput.h
+++ b/src/3rdparty/phonon/mmf/audiooutput.h
@@ -19,6 +19,8 @@ along with this library. If not, see <http://www.gnu.org/licenses/>.
#ifndef PHONON_MMF_AUDIOOUTPUT_H
#define PHONON_MMF_AUDIOOUTPUT_H
+#include <QHash>
+
#include "mmf_medianode.h"
#include <phonon/audiooutputinterface.h>
@@ -65,10 +67,12 @@ public:
*/
virtual bool setOutputDevice(int);
- /**
- * Has no effect.
- */
- virtual bool setOutputDevice(const Phonon::AudioOutputDevice &);
+ static QHash<QByteArray, QVariant> audioOutputDescription(int index);
+
+ enum Constants
+ {
+ AudioOutputDeviceID = 0
+ };
protected:
virtual bool activateOnMediaObject(MediaObject *mo);
@@ -78,6 +82,7 @@ Q_SIGNALS:
void audioDeviceFailed();
private:
+
void setVolumeObserver(VolumeObserver* observer);
qreal m_volume;
diff --git a/src/3rdparty/phonon/mmf/audioplayer.cpp b/src/3rdparty/phonon/mmf/audioplayer.cpp
index 6c1fc68..ceaf305 100644
--- a/src/3rdparty/phonon/mmf/audioplayer.cpp
+++ b/src/3rdparty/phonon/mmf/audioplayer.cpp
@@ -34,14 +34,13 @@ using namespace Phonon::MMF;
// Constructor / destructor
//-----------------------------------------------------------------------------
-MMF::AudioPlayer::AudioPlayer() : m_player(0)
+MMF::AudioPlayer::AudioPlayer()
{
construct();
}
MMF::AudioPlayer::AudioPlayer(const AbstractPlayer& player)
: AbstractMediaPlayer(player)
- , m_player(0)
{
construct();
}
@@ -51,7 +50,7 @@ void MMF::AudioPlayer::construct()
TRACE_CONTEXT(AudioPlayer::AudioPlayer, EAudioApi);
TRACE_ENTRY_0();
- TRAPD(err, m_player = CPlayerType::NewL(*this, 0, EMdaPriorityPreferenceNone));
+ TRAPD(err, m_player.reset(CPlayerType::NewL(*this, 0, EMdaPriorityPreferenceNone)));
if (KErrNone != err) {
changeState(ErrorState);
}
@@ -64,8 +63,6 @@ MMF::AudioPlayer::~AudioPlayer()
TRACE_CONTEXT(AudioPlayer::~AudioPlayer, EAudioApi);
TRACE_ENTRY_0();
- delete m_player;
-
TRACE_EXIT_0();
}
@@ -237,7 +234,7 @@ void MMF::AudioPlayer::MapcPlayComplete(TInt aError)
CPlayerType *MMF::AudioPlayer::player() const
{
- return m_player;
+ return m_player.data();
}
diff --git a/src/3rdparty/phonon/mmf/audioplayer.h b/src/3rdparty/phonon/mmf/audioplayer.h
index f16de1d..60ef436 100644
--- a/src/3rdparty/phonon/mmf/audioplayer.h
+++ b/src/3rdparty/phonon/mmf/audioplayer.h
@@ -86,6 +86,9 @@ public:
virtual void MapcPlayComplete(TInt aError);
#endif
+ /**
+ * This class owns the pointer.
+ */
CPlayerType *player() const;
private:
@@ -96,7 +99,7 @@ private:
* Using CPlayerType typedef in order to be able to easily switch between
* CMdaAudioPlayerUtility and CDrmPlayerUtility
*/
- CPlayerType* m_player;
+ QScopedPointer<CPlayerType> m_player;
};
}
}
diff --git a/src/3rdparty/phonon/mmf/backend.cpp b/src/3rdparty/phonon/mmf/backend.cpp
index be43f46..f542ec9 100644
--- a/src/3rdparty/phonon/mmf/backend.cpp
+++ b/src/3rdparty/phonon/mmf/backend.cpp
@@ -107,6 +107,12 @@ QList<int> Backend::objectDescriptionIndexes(ObjectDescriptionType type) const
{
case EffectType:
retval.append(EffectFactory::effectIndexes());
+ break;
+ case AudioOutputDeviceType:
+ // We only have one possible output device, but we need at least
+ // one.
+ retval.append(AudioOutput::AudioOutputDeviceID);
+ break;
default:
;
}
@@ -119,10 +125,14 @@ QHash<QByteArray, QVariant> Backend::objectDescriptionProperties(ObjectDescripti
{
TRACE_CONTEXT(Backend::connectNodes, EBackend);
- if (type == EffectType)
- return EffectFactory::audioEffectDescriptions(AbstractAudioEffect::Type(index));
- else
- return QHash<QByteArray, QVariant>();
+ switch (type) {
+ case EffectType:
+ return EffectFactory::audioEffectDescriptions(AbstractAudioEffect::Type(index));
+ case AudioOutputDeviceType:
+ return AudioOutput::audioOutputDescription(index);
+ default:
+ return QHash<QByteArray, QVariant>();
+ }
}
bool Backend::startConnectionChange(QSet<QObject *>)