diff options
author | Gareth Stockwell <ext-gareth.stockwell@nokia.com> | 2010-03-12 12:58:45 (GMT) |
---|---|---|
committer | Gareth Stockwell <ext-gareth.stockwell@nokia.com> | 2010-03-12 16:43:38 (GMT) |
commit | d73df73c556b0a225fdde7341549ed834bc691f4 (patch) | |
tree | 7cf50ae355c8fe758c8ca86b7cab04a3f96b3230 | |
parent | bd4329cc96d9dadb1e4ef490884c17bcd1201741 (diff) | |
download | Qt-d73df73c556b0a225fdde7341549ed834bc691f4.zip Qt-d73df73c556b0a225fdde7341549ed834bc691f4.tar.gz Qt-d73df73c556b0a225fdde7341549ed834bc691f4.tar.bz2 |
Moved Symbian audio backend into QtMultimedia.dll
Changed backend from being a plugin, to being statically compiled into
QtMultimedia.dll. This is to achieve consistency with the backends for
other plugins, and to allow the plugin API to be modified.
Task-number: QTBUG-8994
Reviewed-by: trustme
-rw-r--r-- | src/multimedia/audio/audio.pri | 15 | ||||
-rw-r--r-- | src/multimedia/audio/qaudio_symbian_p.cpp (renamed from src/plugins/audio/symbian/symbianaudioutils.cpp) | 2 | ||||
-rw-r--r-- | src/multimedia/audio/qaudio_symbian_p.h (renamed from src/plugins/audio/symbian/symbianaudioutils.h) | 37 | ||||
-rw-r--r-- | src/multimedia/audio/qaudiodevicefactory.cpp | 16 | ||||
-rw-r--r-- | src/multimedia/audio/qaudiodeviceinfo_symbian_p.cpp (renamed from src/plugins/audio/symbian/symbianaudiodeviceinfo.cpp) | 51 | ||||
-rw-r--r-- | src/multimedia/audio/qaudiodeviceinfo_symbian_p.h (renamed from src/plugins/audio/symbian/symbianaudiodeviceinfo.h) | 25 | ||||
-rw-r--r-- | src/multimedia/audio/qaudioinput_symbian_p.cpp (renamed from src/plugins/audio/symbian/symbianaudioinput.cpp) | 85 | ||||
-rw-r--r-- | src/multimedia/audio/qaudioinput_symbian_p.h (renamed from src/plugins/audio/symbian/symbianaudioinput.h) | 31 | ||||
-rw-r--r-- | src/multimedia/audio/qaudiooutput_symbian_p.cpp (renamed from src/plugins/audio/symbian/symbianaudiooutput.cpp) | 89 | ||||
-rw-r--r-- | src/multimedia/audio/qaudiooutput_symbian_p.h (renamed from src/plugins/audio/symbian/symbianaudiooutput.h) | 31 | ||||
-rw-r--r-- | src/plugins/audio/audio.pro | 6 | ||||
-rw-r--r-- | src/plugins/audio/symbian/main.cpp | 121 | ||||
-rw-r--r-- | src/plugins/audio/symbian/symbian.pro | 31 | ||||
-rw-r--r-- | src/plugins/audio/symbian/symbianaudio.h | 76 | ||||
-rw-r--r-- | src/s60installs/s60installs.pro | 6 |
15 files changed, 237 insertions, 385 deletions
diff --git a/src/multimedia/audio/audio.pri b/src/multimedia/audio/audio.pri index 625b871c..ae28a26 100644 --- a/src/multimedia/audio/audio.pri +++ b/src/multimedia/audio/audio.pri @@ -41,6 +41,21 @@ mac { !wince*:LIBS += -lwinmm wince*:LIBS += -lcoredll +} else:symbian { + INCLUDEPATH += /epoc32/include/mmf/common + INCLUDEPATH += /epoc32/include/mmf/server + + HEADERS += $$PWD/qaudio_symbian_p.h \ + $$PWD/qaudiodeviceinfo_symbian_p.h \ + $$PWD/qaudioinput_symbian_p.h \ + $$PWD/qaudiooutput_symbian_p.h + + SOURCES += $$PWD/qaudio_symbian_p.cpp \ + $$PWD/qaudiodeviceinfo_symbian_p.cpp \ + $$PWD/qaudioinput_symbian_p.cpp \ + $$PWD/qaudiooutput_symbian_p.cpp + + LIBS += -lmmfdevsound } else:unix { unix:contains(QT_CONFIG, alsa) { linux-*|freebsd-*|openbsd-*:{ diff --git a/src/plugins/audio/symbian/symbianaudioutils.cpp b/src/multimedia/audio/qaudio_symbian_p.cpp index f04c198..58e3745 100644 --- a/src/plugins/audio/symbian/symbianaudioutils.cpp +++ b/src/multimedia/audio/qaudio_symbian_p.cpp @@ -39,7 +39,7 @@ ** ****************************************************************************/ -#include "symbianaudioutils.h" +#include "qaudio_symbian_p.h" #include <mmffourcc.h> QT_BEGIN_NAMESPACE diff --git a/src/plugins/audio/symbian/symbianaudioutils.h b/src/multimedia/audio/qaudio_symbian_p.h index 53274e0..d5238b4 100644 --- a/src/plugins/audio/symbian/symbianaudioutils.h +++ b/src/multimedia/audio/qaudio_symbian_p.h @@ -39,19 +39,50 @@ ** ****************************************************************************/ -#ifndef SYMBIANAUDIOUTILS_H -#define SYMBIANAUDIOUTILS_H +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists for the convenience +// of other Qt classes. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + +#ifndef QAUDIO_SYMBIAN_P_H +#define QAUDIO_SYMBIAN_P_H #include <QtCore/qnamespace.h> #include <QtMultimedia/qaudioformat.h> #include <QtMultimedia/qaudio.h> #include <sounddevice.h> -#include "symbianaudio.h" QT_BEGIN_NAMESPACE namespace SymbianAudio { +/** + * Default values used by audio input and output classes, when underlying + * DevSound instance has not yet been created. + */ + +const int DefaultBufferSize = 4096; // bytes +const int DefaultNotifyInterval = 1000; // ms + +/** + * Enumeration used to track state of internal DevSound instances. + * Values are translated to the corresponding QAudio::State values by + * SymbianAudio::Utils::stateNativeToQt. + */ +enum State { + ClosedState + , InitializingState + , ActiveState + , IdleState + , SuspendedState +}; + /* * Helper class for querying DevSound codec / format support */ diff --git a/src/multimedia/audio/qaudiodevicefactory.cpp b/src/multimedia/audio/qaudiodevicefactory.cpp index 459b7f5..4f45110 100644 --- a/src/multimedia/audio/qaudiodevicefactory.cpp +++ b/src/multimedia/audio/qaudiodevicefactory.cpp @@ -58,6 +58,10 @@ #include "qaudiodeviceinfo_alsa_p.h" #include "qaudiooutput_alsa_p.h" #include "qaudioinput_alsa_p.h" +#elif defined(Q_OS_SYMBIAN) +#include "qaudiodeviceinfo_symbian_p.h" +#include "qaudiooutput_symbian_p.h" +#include "qaudioinput_symbian_p.h" #endif #endif @@ -128,7 +132,7 @@ QList<QAudioDeviceInfo> QAudioDeviceFactory::availableDevices(QAudio::Mode mode) { QList<QAudioDeviceInfo> devices; #ifndef QT_NO_AUDIO_BACKEND -#if (defined(Q_OS_WIN) || defined(Q_OS_MAC) || defined(HAS_ALSA)) +#if (defined(Q_OS_WIN) || defined(Q_OS_MAC) || defined(HAS_ALSA) || defined(Q_OS_SYMBIAN)) foreach (const QByteArray &handle, QAudioDeviceInfoInternal::availableDevices(mode)) devices << QAudioDeviceInfo(QLatin1String("builtin"), handle, mode); #endif @@ -158,7 +162,7 @@ QAudioDeviceInfo QAudioDeviceFactory::defaultInputDevice() return QAudioDeviceInfo(QLatin1String("default"), list.at(0), QAudio::AudioInput); } #ifndef QT_NO_AUDIO_BACKEND -#if (defined(Q_OS_WIN) || defined(Q_OS_MAC) || defined(HAS_ALSA)) +#if (defined(Q_OS_WIN) || defined(Q_OS_MAC) || defined(HAS_ALSA) || defined(Q_OS_SYMBIAN)) return QAudioDeviceInfo(QLatin1String("builtin"), QAudioDeviceInfoInternal::defaultInputDevice(), QAudio::AudioInput); #endif #endif @@ -175,7 +179,7 @@ QAudioDeviceInfo QAudioDeviceFactory::defaultOutputDevice() return QAudioDeviceInfo(QLatin1String("default"), list.at(0), QAudio::AudioOutput); } #ifndef QT_NO_AUDIO_BACKEND -#if (defined(Q_OS_WIN) || defined(Q_OS_MAC) || defined(HAS_ALSA)) +#if (defined(Q_OS_WIN) || defined(Q_OS_MAC) || defined(HAS_ALSA) || defined(Q_OS_SYMBIAN)) return QAudioDeviceInfo(QLatin1String("builtin"), QAudioDeviceInfoInternal::defaultOutputDevice(), QAudio::AudioOutput); #endif #endif @@ -187,7 +191,7 @@ QAbstractAudioDeviceInfo* QAudioDeviceFactory::audioDeviceInfo(const QString &re QAbstractAudioDeviceInfo *rc = 0; #ifndef QT_NO_AUDIO_BACKEND -#if (defined(Q_OS_WIN) || defined(Q_OS_MAC) || defined(HAS_ALSA)) +#if (defined(Q_OS_WIN) || defined(Q_OS_MAC) || defined(HAS_ALSA) || defined(Q_OS_SYMBIAN)) if (realm == QLatin1String("builtin")) return new QAudioDeviceInfoInternal(handle, mode); #endif @@ -216,7 +220,7 @@ QAbstractAudioInput* QAudioDeviceFactory::createInputDevice(QAudioDeviceInfo con if (deviceInfo.isNull()) return new QNullInputDevice(); #ifndef QT_NO_AUDIO_BACKEND -#if (defined(Q_OS_WIN) || defined(Q_OS_MAC) || defined(HAS_ALSA)) +#if (defined(Q_OS_WIN) || defined(Q_OS_MAC) || defined(HAS_ALSA) || defined(Q_OS_SYMBIAN)) if (deviceInfo.realm() == QLatin1String("builtin")) return new QAudioInputPrivate(deviceInfo.handle(), format); #endif @@ -235,7 +239,7 @@ QAbstractAudioOutput* QAudioDeviceFactory::createOutputDevice(QAudioDeviceInfo c if (deviceInfo.isNull()) return new QNullOutputDevice(); #ifndef QT_NO_AUDIO_BACKEND -#if (defined(Q_OS_WIN) || defined(Q_OS_MAC) || defined(HAS_ALSA)) +#if (defined(Q_OS_WIN) || defined(Q_OS_MAC) || defined(HAS_ALSA) || defined(Q_OS_SYMBIAN)) if (deviceInfo.realm() == QLatin1String("builtin")) return new QAudioOutputPrivate(deviceInfo.handle(), format); #endif diff --git a/src/plugins/audio/symbian/symbianaudiodeviceinfo.cpp b/src/multimedia/audio/qaudiodeviceinfo_symbian_p.cpp index 9701dad..36284d3 100644 --- a/src/plugins/audio/symbian/symbianaudiodeviceinfo.cpp +++ b/src/multimedia/audio/qaudiodeviceinfo_symbian_p.cpp @@ -39,26 +39,26 @@ ** ****************************************************************************/ -#include "symbianaudiodeviceinfo.h" -#include "symbianaudioutils.h" +#include "qaudiodeviceinfo_symbian_p.h" +#include "qaudio_symbian_p.h" QT_BEGIN_NAMESPACE -SymbianAudioDeviceInfo::SymbianAudioDeviceInfo(QByteArray device, +QAudioDeviceInfoInternal::QAudioDeviceInfoInternal(QByteArray device, QAudio::Mode mode) - : m_deviceName(device) + : m_deviceName(QLatin1String(device)) , m_mode(mode) , m_updated(false) { QT_TRAP_THROWING(m_devsound.reset(CMMFDevSound::NewL())); } -SymbianAudioDeviceInfo::~SymbianAudioDeviceInfo() +QAudioDeviceInfoInternal::~QAudioDeviceInfoInternal() { } -QAudioFormat SymbianAudioDeviceInfo::preferredFormat() const +QAudioFormat QAudioDeviceInfoInternal::preferredFormat() const { QAudioFormat format; switch (m_mode) { @@ -100,7 +100,7 @@ QAudioFormat SymbianAudioDeviceInfo::preferredFormat() const return format; } -bool SymbianAudioDeviceInfo::isFormatSupported( +bool QAudioDeviceInfoInternal::isFormatSupported( const QAudioFormat &format) const { getSupportedFormats(); @@ -115,7 +115,7 @@ bool SymbianAudioDeviceInfo::isFormatSupported( return supported; } -QAudioFormat SymbianAudioDeviceInfo::nearestFormat(const QAudioFormat &format) const +QAudioFormat QAudioDeviceInfoInternal::nearestFormat(const QAudioFormat &format) const { if (isFormatSupported(format)) return format; @@ -123,56 +123,65 @@ QAudioFormat SymbianAudioDeviceInfo::nearestFormat(const QAudioFormat &format) c return preferredFormat(); } -QString SymbianAudioDeviceInfo::deviceName() const +QString QAudioDeviceInfoInternal::deviceName() const { return m_deviceName; } -QStringList SymbianAudioDeviceInfo::codecList() +QStringList QAudioDeviceInfoInternal::codecList() { getSupportedFormats(); return m_codecs; } -QList<int> SymbianAudioDeviceInfo::frequencyList() +QList<int> QAudioDeviceInfoInternal::frequencyList() { getSupportedFormats(); return m_frequencies; } -QList<int> SymbianAudioDeviceInfo::channelsList() +QList<int> QAudioDeviceInfoInternal::channelsList() { getSupportedFormats(); return m_channels; } -QList<int> SymbianAudioDeviceInfo::sampleSizeList() +QList<int> QAudioDeviceInfoInternal::sampleSizeList() { getSupportedFormats(); return m_sampleSizes; } -QList<QAudioFormat::Endian> SymbianAudioDeviceInfo::byteOrderList() +QList<QAudioFormat::Endian> QAudioDeviceInfoInternal::byteOrderList() { getSupportedFormats(); return m_byteOrders; } -QList<QAudioFormat::SampleType> SymbianAudioDeviceInfo::sampleTypeList() +QList<QAudioFormat::SampleType> QAudioDeviceInfoInternal::sampleTypeList() { getSupportedFormats(); return m_sampleTypes; } -QList<QByteArray> SymbianAudioDeviceInfo::deviceList(QAudio::Mode mode) +QByteArray QAudioDeviceInfoInternal::defaultInputDevice() { - Q_UNUSED(mode) - QList<QByteArray> devices; - devices.append("default"); - return devices; + return QByteArray("default"); } -void SymbianAudioDeviceInfo::getSupportedFormats() const +QByteArray QAudioDeviceInfoInternal::defaultOutputDevice() +{ + return QByteArray("default"); +} + +QList<QByteArray> QAudioDeviceInfoInternal::availableDevices(QAudio::Mode) +{ + QList<QByteArray> result; + result += QByteArray("default"); + return result; +} + +void QAudioDeviceInfoInternal::getSupportedFormats() const { if (!m_updated) { QScopedPointer<SymbianAudio::DevSoundCapabilities> caps( diff --git a/src/plugins/audio/symbian/symbianaudiodeviceinfo.h b/src/multimedia/audio/qaudiodeviceinfo_symbian_p.h index 250804d..89e539f 100644 --- a/src/plugins/audio/symbian/symbianaudiodeviceinfo.h +++ b/src/multimedia/audio/qaudiodeviceinfo_symbian_p.h @@ -39,22 +39,33 @@ ** ****************************************************************************/ -#ifndef SYMBIANAUDIODEVICEINFO_H -#define SYMBIANAUDIODEVICEINFO_H +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists for the convenience +// of other Qt classes. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + +#ifndef QAUDIODEVICEINFO_SYMBIAN_P_H +#define QAUDIODEVICEINFO_SYMBIAN_P_H #include <QtMultimedia/qaudioengine.h> #include <sounddevice.h> QT_BEGIN_NAMESPACE -class SymbianAudioDeviceInfo +class QAudioDeviceInfoInternal : public QAbstractAudioDeviceInfo { Q_OBJECT public: - SymbianAudioDeviceInfo(QByteArray device, QAudio::Mode mode); - ~SymbianAudioDeviceInfo(); + QAudioDeviceInfoInternal(QByteArray device, QAudio::Mode mode); + ~QAudioDeviceInfoInternal(); // QAbstractAudioDeviceInfo QAudioFormat preferredFormat() const; @@ -67,7 +78,9 @@ public: QList<int> sampleSizeList(); QList<QAudioFormat::Endian> byteOrderList(); QList<QAudioFormat::SampleType> sampleTypeList(); - QList<QByteArray> deviceList(QAudio::Mode); + static QByteArray defaultInputDevice(); + static QByteArray defaultOutputDevice(); + static QList<QByteArray> availableDevices(QAudio::Mode); private: void getSupportedFormats() const; diff --git a/src/plugins/audio/symbian/symbianaudioinput.cpp b/src/multimedia/audio/qaudioinput_symbian_p.cpp index 8200925..52daa88 100644 --- a/src/plugins/audio/symbian/symbianaudioinput.cpp +++ b/src/multimedia/audio/qaudioinput_symbian_p.cpp @@ -39,8 +39,7 @@ ** ****************************************************************************/ -#include "symbianaudioinput.h" -#include "symbianaudioutils.h" +#include "qaudioinput_symbian_p.h" QT_BEGIN_NAMESPACE @@ -56,7 +55,7 @@ const int PushInterval = 50; // ms //----------------------------------------------------------------------------- SymbianAudioInputPrivate::SymbianAudioInputPrivate( - SymbianAudioInput *audioDevice) + QAudioInputPrivate *audioDevice) : m_audioDevice(audioDevice) { @@ -104,7 +103,7 @@ void SymbianAudioInputPrivate::dataReady() // Public functions //----------------------------------------------------------------------------- -SymbianAudioInput::SymbianAudioInput(const QByteArray &device, +QAudioInputPrivate::QAudioInputPrivate(const QByteArray &device, const QAudioFormat &format) : m_device(device) , m_format(format) @@ -132,12 +131,12 @@ SymbianAudioInput::SymbianAudioInput(const QByteArray &device, connect(m_pullTimer.data(), SIGNAL(timeout()), this, SLOT(pullData())); } -SymbianAudioInput::~SymbianAudioInput() +QAudioInputPrivate::~QAudioInputPrivate() { close(); } -QIODevice* SymbianAudioInput::start(QIODevice *device) +QIODevice* QAudioInputPrivate::start(QIODevice *device) { stop(); @@ -157,19 +156,19 @@ QIODevice* SymbianAudioInput::start(QIODevice *device) return m_sink; } -void SymbianAudioInput::stop() +void QAudioInputPrivate::stop() { close(); } -void SymbianAudioInput::reset() +void QAudioInputPrivate::reset() { m_totalSamplesRecorded += getSamplesRecorded(); m_devSound->Stop(); startRecording(); } -void SymbianAudioInput::suspend() +void QAudioInputPrivate::suspend() { if (SymbianAudio::ActiveState == m_internalState || SymbianAudio::IdleState == m_internalState) { @@ -188,24 +187,24 @@ void SymbianAudioInput::suspend() } } -void SymbianAudioInput::resume() +void QAudioInputPrivate::resume() { if (SymbianAudio::SuspendedState == m_internalState) startDataTransfer(); } -int SymbianAudioInput::bytesReady() const +int QAudioInputPrivate::bytesReady() const { Q_ASSERT(m_devSoundBufferPos <= m_totalBytesReady); return m_totalBytesReady - m_devSoundBufferPos; } -int SymbianAudioInput::periodSize() const +int QAudioInputPrivate::periodSize() const { return bufferSize(); } -void SymbianAudioInput::setBufferSize(int value) +void QAudioInputPrivate::setBufferSize(int value) { // Note that DevSound does not allow its client to specify the buffer size. // This functionality is available via custom interfaces, but since these @@ -218,12 +217,12 @@ void SymbianAudioInput::setBufferSize(int value) m_clientBufferSize = value; } -int SymbianAudioInput::bufferSize() const +int QAudioInputPrivate::bufferSize() const { return m_devSoundBufferSize ? m_devSoundBufferSize : m_clientBufferSize; } -void SymbianAudioInput::setNotifyInterval(int ms) +void QAudioInputPrivate::setNotifyInterval(int ms) { if (ms > 0) { const int oldNotifyInterval = m_notifyInterval; @@ -233,12 +232,12 @@ void SymbianAudioInput::setNotifyInterval(int ms) } } -int SymbianAudioInput::notifyInterval() const +int QAudioInputPrivate::notifyInterval() const { return m_notifyInterval; } -qint64 SymbianAudioInput::processedUSecs() const +qint64 QAudioInputPrivate::processedUSecs() const { int samplesPlayed = 0; if (m_devSound && SymbianAudio::SuspendedState != m_internalState) @@ -254,24 +253,24 @@ qint64 SymbianAudioInput::processedUSecs() const return result; } -qint64 SymbianAudioInput::elapsedUSecs() const +qint64 QAudioInputPrivate::elapsedUSecs() const { const qint64 result = (QAudio::StoppedState == state()) ? 0 : m_elapsed.elapsed() * 1000; return result; } -QAudio::Error SymbianAudioInput::error() const +QAudio::Error QAudioInputPrivate::error() const { return m_error; } -QAudio::State SymbianAudioInput::state() const +QAudio::State QAudioInputPrivate::state() const { return m_externalState; } -QAudioFormat SymbianAudioInput::format() const +QAudioFormat QAudioInputPrivate::format() const { return m_format; } @@ -280,7 +279,7 @@ QAudioFormat SymbianAudioInput::format() const // MDevSoundObserver implementation //----------------------------------------------------------------------------- -void SymbianAudioInput::InitializeComplete(TInt aError) +void QAudioInputPrivate::InitializeComplete(TInt aError) { Q_ASSERT_X(SymbianAudio::InitializingState == m_internalState, Q_FUNC_INFO, "Invalid state"); @@ -289,7 +288,7 @@ void SymbianAudioInput::InitializeComplete(TInt aError) startRecording(); } -void SymbianAudioInput::ToneFinished(TInt aError) +void QAudioInputPrivate::ToneFinished(TInt aError) { Q_UNUSED(aError) // This class doesn't use DevSound's tone playback functions, so should @@ -297,7 +296,7 @@ void SymbianAudioInput::ToneFinished(TInt aError) Q_ASSERT_X(false, Q_FUNC_INFO, "Unexpected callback"); } -void SymbianAudioInput::BufferToBeFilled(CMMFBuffer *aBuffer) +void QAudioInputPrivate::BufferToBeFilled(CMMFBuffer *aBuffer) { Q_UNUSED(aBuffer) // This class doesn't use DevSound in play mode, so should never receive @@ -305,7 +304,7 @@ void SymbianAudioInput::BufferToBeFilled(CMMFBuffer *aBuffer) Q_ASSERT_X(false, Q_FUNC_INFO, "Unexpected callback"); } -void SymbianAudioInput::PlayError(TInt aError) +void QAudioInputPrivate::PlayError(TInt aError) { Q_UNUSED(aError) // This class doesn't use DevSound in play mode, so should never receive @@ -313,7 +312,7 @@ void SymbianAudioInput::PlayError(TInt aError) Q_ASSERT_X(false, Q_FUNC_INFO, "Unexpected callback"); } -void SymbianAudioInput::BufferToBeEmptied(CMMFBuffer *aBuffer) +void QAudioInputPrivate::BufferToBeEmptied(CMMFBuffer *aBuffer) { // Following receipt of this callback, DevSound should not provide another // buffer until we have returned the current one. @@ -338,13 +337,13 @@ void SymbianAudioInput::BufferToBeEmptied(CMMFBuffer *aBuffer) } } -void SymbianAudioInput::RecordError(TInt aError) +void QAudioInputPrivate::RecordError(TInt aError) { Q_UNUSED(aError) setError(QAudio::IOError); } -void SymbianAudioInput::ConvertError(TInt aError) +void QAudioInputPrivate::ConvertError(TInt aError) { Q_UNUSED(aError) // This class doesn't use DevSound's format conversion functions, so @@ -352,7 +351,7 @@ void SymbianAudioInput::ConvertError(TInt aError) Q_ASSERT_X(false, Q_FUNC_INFO, "Unexpected callback"); } -void SymbianAudioInput::DeviceMessage(TUid aMessageType, const TDesC8 &aMsg) +void QAudioInputPrivate::DeviceMessage(TUid aMessageType, const TDesC8 &aMsg) { Q_UNUSED(aMessageType) Q_UNUSED(aMsg) @@ -363,7 +362,7 @@ void SymbianAudioInput::DeviceMessage(TUid aMessageType, const TDesC8 &aMsg) // Private functions //----------------------------------------------------------------------------- -void SymbianAudioInput::open() +void QAudioInputPrivate::open() { Q_ASSERT_X(SymbianAudio::ClosedState == m_internalState, Q_FUNC_INFO, "DevSound already opened"); @@ -388,7 +387,7 @@ void SymbianAudioInput::open() } } -void SymbianAudioInput::startRecording() +void QAudioInputPrivate::startRecording() { const int samplesRecorded = m_devSound->SamplesRecorded(); Q_ASSERT(samplesRecorded == 0); @@ -402,7 +401,7 @@ void SymbianAudioInput::startRecording() } } -void SymbianAudioInput::startDevSoundL() +void QAudioInputPrivate::startDevSoundL() { TMMFCapabilities nativeFormat = m_devSound->Config(); m_nativeFormat.iBufferSize = nativeFormat.iBufferSize; @@ -410,7 +409,7 @@ void SymbianAudioInput::startDevSoundL() m_devSound->RecordInitL(); } -void SymbianAudioInput::startDataTransfer() +void QAudioInputPrivate::startDataTransfer() { m_notifyTimer->start(m_notifyInterval); @@ -429,7 +428,7 @@ void SymbianAudioInput::startDataTransfer() } } -CMMFDataBuffer* SymbianAudioInput::currentBuffer() const +CMMFDataBuffer* QAudioInputPrivate::currentBuffer() const { CMMFDataBuffer *result = m_devSoundBuffer; if (!result && !m_devSoundBufferQ.empty()) @@ -437,14 +436,14 @@ CMMFDataBuffer* SymbianAudioInput::currentBuffer() const return result; } -void SymbianAudioInput::pushData() +void QAudioInputPrivate::pushData() { Q_ASSERT_X(bytesReady(), Q_FUNC_INFO, "No data available"); Q_ASSERT_X(!m_pullMode, Q_FUNC_INFO, "pushData called when in pull mode"); qobject_cast<SymbianAudioInputPrivate *>(m_sink)->dataReady(); } -qint64 SymbianAudioInput::read(char *data, qint64 len) +qint64 QAudioInputPrivate::read(char *data, qint64 len) { // SymbianAudioInputPrivate is ready to read data @@ -478,7 +477,7 @@ qint64 SymbianAudioInput::read(char *data, qint64 len) return bytesRead; } -void SymbianAudioInput::pullData() +void QAudioInputPrivate::pullData() { Q_ASSERT_X(m_pullMode, Q_FUNC_INFO, "pullData called when in push mode"); @@ -504,7 +503,7 @@ void SymbianAudioInput::pullData() } } -void SymbianAudioInput::bufferEmptied() +void QAudioInputPrivate::bufferEmptied() { m_devSoundBufferPos = 0; @@ -525,7 +524,7 @@ void SymbianAudioInput::bufferEmptied() Q_ASSERT(m_totalBytesReady >= 0); } -void SymbianAudioInput::close() +void QAudioInputPrivate::close() { m_notifyTimer->stop(); m_pullTimer->stop(); @@ -551,7 +550,7 @@ void SymbianAudioInput::close() setState(SymbianAudio::ClosedState); } -qint64 SymbianAudioInput::getSamplesRecorded() const +qint64 QAudioInputPrivate::getSamplesRecorded() const { qint64 result = 0; if (m_devSound) @@ -559,7 +558,7 @@ qint64 SymbianAudioInput::getSamplesRecorded() const return result; } -void SymbianAudioInput::setError(QAudio::Error error) +void QAudioInputPrivate::setError(QAudio::Error error) { m_error = error; @@ -576,7 +575,7 @@ void SymbianAudioInput::setError(QAudio::Error error) QMetaObject::invokeMethod(this, "close", Qt::QueuedConnection); } -void SymbianAudioInput::setState(SymbianAudio::State newInternalState) +void QAudioInputPrivate::setState(SymbianAudio::State newInternalState) { const QAudio::State oldExternalState = m_externalState; m_internalState = newInternalState; @@ -587,7 +586,7 @@ void SymbianAudioInput::setState(SymbianAudio::State newInternalState) emit stateChanged(m_externalState); } -QAudio::State SymbianAudioInput::initializingState() const +QAudio::State QAudioInputPrivate::initializingState() const { return QAudio::IdleState; } diff --git a/src/plugins/audio/symbian/symbianaudioinput.h b/src/multimedia/audio/qaudioinput_symbian_p.h index 34b7d38..ca3ccf7 100644 --- a/src/plugins/audio/symbian/symbianaudioinput.h +++ b/src/multimedia/audio/qaudioinput_symbian_p.h @@ -39,25 +39,36 @@ ** ****************************************************************************/ -#ifndef SYMBIANAUDIOINPUT_H -#define SYMBIANAUDIOINPUT_H +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists for the convenience +// of other Qt classes. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + +#ifndef QAUDIOINPUT_SYMBIAN_P_H +#define QAUDIOINPUT_SYMBIAN_P_H #include <QtMultimedia/qaudioengine.h> #include <QTime> #include <QTimer> #include <sounddevice.h> -#include "symbianaudio.h" +#include "qaudio_symbian_p.h" QT_BEGIN_NAMESPACE -class SymbianAudioInput; +class QAudioInputPrivate; class SymbianAudioInputPrivate : public QIODevice { - friend class SymbianAudioInput; + friend class QAudioInputPrivate; Q_OBJECT public: - SymbianAudioInputPrivate(SymbianAudioInput *audio); + SymbianAudioInputPrivate(QAudioInputPrivate *audio); ~SymbianAudioInputPrivate(); qint64 readData(char *data, qint64 len); @@ -66,19 +77,19 @@ public: void dataReady(); private: - SymbianAudioInput *const m_audioDevice; + QAudioInputPrivate *const m_audioDevice; }; -class SymbianAudioInput +class QAudioInputPrivate : public QAbstractAudioInput , public MDevSoundObserver { friend class SymbianAudioInputPrivate; Q_OBJECT public: - SymbianAudioInput(const QByteArray &device, + QAudioInputPrivate(const QByteArray &device, const QAudioFormat &audioFormat); - ~SymbianAudioInput(); + ~QAudioInputPrivate(); // QAbstractAudioInput QIODevice* start(QIODevice *device = 0); diff --git a/src/plugins/audio/symbian/symbianaudiooutput.cpp b/src/multimedia/audio/qaudiooutput_symbian_p.cpp index 385e169..945a08d 100644 --- a/src/plugins/audio/symbian/symbianaudiooutput.cpp +++ b/src/multimedia/audio/qaudiooutput_symbian_p.cpp @@ -39,8 +39,7 @@ ** ****************************************************************************/ -#include "symbianaudiooutput.h" -#include "symbianaudioutils.h" +#include "qaudiooutput_symbian_p.h" QT_BEGIN_NAMESPACE @@ -56,7 +55,7 @@ const int UnderflowTimerInterval = 50; // ms //----------------------------------------------------------------------------- SymbianAudioOutputPrivate::SymbianAudioOutputPrivate( - SymbianAudioOutput *audioDevice) + QAudioOutputPrivate *audioDevice) : m_audioDevice(audioDevice) { @@ -99,7 +98,7 @@ qint64 SymbianAudioOutputPrivate::writeData(const char *data, qint64 len) // Public functions //----------------------------------------------------------------------------- -SymbianAudioOutput::SymbianAudioOutput(const QByteArray &device, +QAudioOutputPrivate::QAudioOutputPrivate(const QByteArray &device, const QAudioFormat &format) : m_device(device) , m_format(format) @@ -132,12 +131,12 @@ SymbianAudioOutput::SymbianAudioOutput(const QByteArray &device, SLOT(underflowTimerExpired())); } -SymbianAudioOutput::~SymbianAudioOutput() +QAudioOutputPrivate::~QAudioOutputPrivate() { close(); } -QIODevice* SymbianAudioOutput::start(QIODevice *device) +QIODevice* QAudioOutputPrivate::start(QIODevice *device) { stop(); @@ -164,12 +163,12 @@ QIODevice* SymbianAudioOutput::start(QIODevice *device) return m_source; } -void SymbianAudioOutput::stop() +void QAudioOutputPrivate::stop() { close(); } -void SymbianAudioOutput::reset() +void QAudioOutputPrivate::reset() { m_totalSamplesPlayed += getSamplesPlayed(); m_devSound->Stop(); @@ -177,7 +176,7 @@ void SymbianAudioOutput::reset() startPlayback(); } -void SymbianAudioOutput::suspend() +void QAudioOutputPrivate::suspend() { if (SymbianAudio::ActiveState == m_internalState || SymbianAudio::IdleState == m_internalState) { @@ -208,13 +207,13 @@ void SymbianAudioOutput::suspend() } } -void SymbianAudioOutput::resume() +void QAudioOutputPrivate::resume() { if (SymbianAudio::SuspendedState == m_internalState) startPlayback(); } -int SymbianAudioOutput::bytesFree() const +int QAudioOutputPrivate::bytesFree() const { int result = 0; if (m_devSoundBuffer) { @@ -224,12 +223,12 @@ int SymbianAudioOutput::bytesFree() const return result; } -int SymbianAudioOutput::periodSize() const +int QAudioOutputPrivate::periodSize() const { return bufferSize(); } -void SymbianAudioOutput::setBufferSize(int value) +void QAudioOutputPrivate::setBufferSize(int value) { // Note that DevSound does not allow its client to specify the buffer size. // This functionality is available via custom interfaces, but since these @@ -242,12 +241,12 @@ void SymbianAudioOutput::setBufferSize(int value) m_clientBufferSize = value; } -int SymbianAudioOutput::bufferSize() const +int QAudioOutputPrivate::bufferSize() const { return m_devSoundBufferSize ? m_devSoundBufferSize : m_clientBufferSize; } -void SymbianAudioOutput::setNotifyInterval(int ms) +void QAudioOutputPrivate::setNotifyInterval(int ms) { if (ms > 0) { const int oldNotifyInterval = m_notifyInterval; @@ -257,12 +256,12 @@ void SymbianAudioOutput::setNotifyInterval(int ms) } } -int SymbianAudioOutput::notifyInterval() const +int QAudioOutputPrivate::notifyInterval() const { return m_notifyInterval; } -qint64 SymbianAudioOutput::processedUSecs() const +qint64 QAudioOutputPrivate::processedUSecs() const { int samplesPlayed = 0; if (m_devSound && SymbianAudio::SuspendedState != m_internalState) @@ -278,24 +277,24 @@ qint64 SymbianAudioOutput::processedUSecs() const return result; } -qint64 SymbianAudioOutput::elapsedUSecs() const +qint64 QAudioOutputPrivate::elapsedUSecs() const { const qint64 result = (QAudio::StoppedState == state()) ? 0 : m_elapsed.elapsed() * 1000; return result; } -QAudio::Error SymbianAudioOutput::error() const +QAudio::Error QAudioOutputPrivate::error() const { return m_error; } -QAudio::State SymbianAudioOutput::state() const +QAudio::State QAudioOutputPrivate::state() const { return m_externalState; } -QAudioFormat SymbianAudioOutput::format() const +QAudioFormat QAudioOutputPrivate::format() const { return m_format; } @@ -304,7 +303,7 @@ QAudioFormat SymbianAudioOutput::format() const // MDevSoundObserver implementation //----------------------------------------------------------------------------- -void SymbianAudioOutput::InitializeComplete(TInt aError) +void QAudioOutputPrivate::InitializeComplete(TInt aError) { Q_ASSERT_X(SymbianAudio::InitializingState == m_internalState, Q_FUNC_INFO, "Invalid state"); @@ -313,7 +312,7 @@ void SymbianAudioOutput::InitializeComplete(TInt aError) startPlayback(); } -void SymbianAudioOutput::ToneFinished(TInt aError) +void QAudioOutputPrivate::ToneFinished(TInt aError) { Q_UNUSED(aError) // This class doesn't use DevSound's tone playback functions, so should @@ -321,7 +320,7 @@ void SymbianAudioOutput::ToneFinished(TInt aError) Q_ASSERT_X(false, Q_FUNC_INFO, "Unexpected callback"); } -void SymbianAudioOutput::BufferToBeFilled(CMMFBuffer *aBuffer) +void QAudioOutputPrivate::BufferToBeFilled(CMMFBuffer *aBuffer) { // Following receipt of this callback, DevSound should not provide another // buffer until we have returned the current one. @@ -339,7 +338,7 @@ void SymbianAudioOutput::BufferToBeFilled(CMMFBuffer *aBuffer) pullData(); } -void SymbianAudioOutput::PlayError(TInt aError) +void QAudioOutputPrivate::PlayError(TInt aError) { switch (aError) { case KErrUnderflow: @@ -355,7 +354,7 @@ void SymbianAudioOutput::PlayError(TInt aError) } } -void SymbianAudioOutput::BufferToBeEmptied(CMMFBuffer *aBuffer) +void QAudioOutputPrivate::BufferToBeEmptied(CMMFBuffer *aBuffer) { Q_UNUSED(aBuffer) // This class doesn't use DevSound in record mode, so should never receive @@ -363,7 +362,7 @@ void SymbianAudioOutput::BufferToBeEmptied(CMMFBuffer *aBuffer) Q_ASSERT_X(false, Q_FUNC_INFO, "Unexpected callback"); } -void SymbianAudioOutput::RecordError(TInt aError) +void QAudioOutputPrivate::RecordError(TInt aError) { Q_UNUSED(aError) // This class doesn't use DevSound in record mode, so should never receive @@ -371,7 +370,7 @@ void SymbianAudioOutput::RecordError(TInt aError) Q_ASSERT_X(false, Q_FUNC_INFO, "Unexpected callback"); } -void SymbianAudioOutput::ConvertError(TInt aError) +void QAudioOutputPrivate::ConvertError(TInt aError) { Q_UNUSED(aError) // This class doesn't use DevSound's format conversion functions, so @@ -379,7 +378,7 @@ void SymbianAudioOutput::ConvertError(TInt aError) Q_ASSERT_X(false, Q_FUNC_INFO, "Unexpected callback"); } -void SymbianAudioOutput::DeviceMessage(TUid aMessageType, const TDesC8 &aMsg) +void QAudioOutputPrivate::DeviceMessage(TUid aMessageType, const TDesC8 &aMsg) { Q_UNUSED(aMessageType) Q_UNUSED(aMsg) @@ -390,7 +389,7 @@ void SymbianAudioOutput::DeviceMessage(TUid aMessageType, const TDesC8 &aMsg) // Private functions //----------------------------------------------------------------------------- -void SymbianAudioOutput::dataReady() +void QAudioOutputPrivate::dataReady() { // Client-provided QIODevice has data ready to read. @@ -401,7 +400,7 @@ void SymbianAudioOutput::dataReady() pullData(); } -void SymbianAudioOutput::underflowTimerExpired() +void QAudioOutputPrivate::underflowTimerExpired() { const TInt samplesPlayed = getSamplesPlayed(); if (m_samplesPlayed && (samplesPlayed == m_samplesPlayed)) { @@ -412,7 +411,7 @@ void SymbianAudioOutput::underflowTimerExpired() } } -void SymbianAudioOutput::open() +void QAudioOutputPrivate::open() { Q_ASSERT_X(SymbianAudio::ClosedState == m_internalState, Q_FUNC_INFO, "DevSound already opened"); @@ -438,7 +437,7 @@ void SymbianAudioOutput::open() } } -void SymbianAudioOutput::startPlayback() +void QAudioOutputPrivate::startPlayback() { TRAPD(err, startDevSoundL()); if (KErrNone == err) { @@ -462,7 +461,7 @@ void SymbianAudioOutput::startPlayback() } } -void SymbianAudioOutput::startDevSoundL() +void QAudioOutputPrivate::startDevSoundL() { TMMFCapabilities nativeFormat = m_devSound->Config(); m_nativeFormat.iBufferSize = nativeFormat.iBufferSize; @@ -470,7 +469,7 @@ void SymbianAudioOutput::startDevSoundL() m_devSound->PlayInitL(); } -void SymbianAudioOutput::writePaddingData() +void QAudioOutputPrivate::writePaddingData() { // See comments in suspend() @@ -494,7 +493,7 @@ void SymbianAudioOutput::writePaddingData() } } -qint64 SymbianAudioOutput::pushData(const char *data, qint64 len) +qint64 QAudioOutputPrivate::pushData(const char *data, qint64 len) { // Data has been written to SymbianAudioOutputPrivate @@ -538,7 +537,7 @@ qint64 SymbianAudioOutput::pushData(const char *data, qint64 len) return bytesWritten; } -void SymbianAudioOutput::pullData() +void QAudioOutputPrivate::pullData() { Q_ASSERT_X(m_pullMode, Q_FUNC_INFO, "pullData called when in push mode"); @@ -575,7 +574,7 @@ void SymbianAudioOutput::pullData() } } -void SymbianAudioOutput::bufferFilled() +void QAudioOutputPrivate::bufferFilled() { Q_ASSERT_X(m_devSoundBuffer, Q_FUNC_INFO, "No buffer to return"); @@ -593,7 +592,7 @@ void SymbianAudioOutput::bufferFilled() m_devSound->PlayData(); } -void SymbianAudioOutput::lastBufferFilled() +void QAudioOutputPrivate::lastBufferFilled() { Q_ASSERT_X(m_devSoundBuffer, Q_FUNC_INFO, "No buffer to fill"); Q_ASSERT_X(!m_lastBuffer, Q_FUNC_INFO, "Last buffer already sent"); @@ -602,7 +601,7 @@ void SymbianAudioOutput::lastBufferFilled() bufferFilled(); } -void SymbianAudioOutput::close() +void QAudioOutputPrivate::close() { m_notifyTimer->stop(); m_underflowTimer->stop(); @@ -631,7 +630,7 @@ void SymbianAudioOutput::close() setState(SymbianAudio::ClosedState); } -qint64 SymbianAudioOutput::getSamplesPlayed() const +qint64 QAudioOutputPrivate::getSamplesPlayed() const { qint64 result = 0; if (m_devSound) { @@ -651,7 +650,7 @@ qint64 SymbianAudioOutput::getSamplesPlayed() const return result; } -void SymbianAudioOutput::setError(QAudio::Error error) +void QAudioOutputPrivate::setError(QAudio::Error error) { m_error = error; @@ -671,7 +670,7 @@ void SymbianAudioOutput::setError(QAudio::Error error) QMetaObject::invokeMethod(this, "close", Qt::QueuedConnection); } -void SymbianAudioOutput::setState(SymbianAudio::State newInternalState) +void QAudioOutputPrivate::setState(SymbianAudio::State newInternalState) { const QAudio::State oldExternalState = m_externalState; m_internalState = newInternalState; @@ -682,14 +681,14 @@ void SymbianAudioOutput::setState(SymbianAudio::State newInternalState) emit stateChanged(m_externalState); } -bool SymbianAudioOutput::isDataReady() const +bool QAudioOutputPrivate::isDataReady() const { return (m_source && m_source->bytesAvailable()) || m_bytesPadding || m_pushDataReady; } -QAudio::State SymbianAudioOutput::initializingState() const +QAudio::State QAudioOutputPrivate::initializingState() const { return isDataReady() ? QAudio::ActiveState : QAudio::IdleState; } diff --git a/src/plugins/audio/symbian/symbianaudiooutput.h b/src/multimedia/audio/qaudiooutput_symbian_p.h index 8994e46..00ccb24 100644 --- a/src/plugins/audio/symbian/symbianaudiooutput.h +++ b/src/multimedia/audio/qaudiooutput_symbian_p.h @@ -39,44 +39,55 @@ ** ****************************************************************************/ -#ifndef SYMBIANAUDIOOUTPUT_H -#define SYMBIANAUDIOOUTPUT_H +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists for the convenience +// of other Qt classes. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + +#ifndef QAUDIOOUTPUT_SYMBIAN_P_H +#define QAUDIOOUTPUT_SYMBIAN_P_H #include <QtMultimedia/qaudioengine.h> #include <QTime> #include <QTimer> #include <sounddevice.h> -#include "symbianaudio.h" +#include "qaudio_symbian_p.h" QT_BEGIN_NAMESPACE -class SymbianAudioOutput; +class QAudioOutputPrivate; class SymbianAudioOutputPrivate : public QIODevice { - friend class SymbianAudioOutput; + friend class QAudioOutputPrivate; Q_OBJECT public: - SymbianAudioOutputPrivate(SymbianAudioOutput *audio); + SymbianAudioOutputPrivate(QAudioOutputPrivate *audio); ~SymbianAudioOutputPrivate(); qint64 readData(char *data, qint64 len); qint64 writeData(const char *data, qint64 len); private: - SymbianAudioOutput *const m_audioDevice; + QAudioOutputPrivate *const m_audioDevice; }; -class SymbianAudioOutput +class QAudioOutputPrivate : public QAbstractAudioOutput , public MDevSoundObserver { friend class SymbianAudioOutputPrivate; Q_OBJECT public: - SymbianAudioOutput(const QByteArray &device, + QAudioOutputPrivate(const QByteArray &device, const QAudioFormat &audioFormat); - ~SymbianAudioOutput(); + ~QAudioOutputPrivate(); // QAbstractAudioOutput QIODevice* start(QIODevice *device = 0); diff --git a/src/plugins/audio/audio.pro b/src/plugins/audio/audio.pro index 5f75a8d..b7a775b 100644 --- a/src/plugins/audio/audio.pro +++ b/src/plugins/audio/audio.pro @@ -1,9 +1,3 @@ TEMPLATE = subdirs SUBDIRS = -contains(QT_CONFIG, audio-backend) { - symbian { - SUBDIRS += symbian - } -} - diff --git a/src/plugins/audio/symbian/main.cpp b/src/plugins/audio/symbian/main.cpp deleted file mode 100644 index 536a8ec..0000000 --- a/src/plugins/audio/symbian/main.cpp +++ /dev/null @@ -1,121 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the QtMultimedia module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include <QtMultimedia/qaudioengineplugin.h> -#include <QtMultimedia/qaudioengine.h> - -#include <qstringlist.h> -#include <qiodevice.h> -#include <qbytearray.h> -#include <qdebug.h> - -#include "symbianaudiodeviceinfo.h" -#include "symbianaudioinput.h" -#include "symbianaudiooutput.h" - -QT_BEGIN_NAMESPACE - -class SymbianAudioPlugin : public QAudioEnginePlugin -{ -public: - SymbianAudioPlugin(QObject *parent = 0); - ~SymbianAudioPlugin(); - - QStringList keys() const; - - QList<QByteArray> availableDevices(QAudio::Mode) const; - QAbstractAudioInput* createInput(const QByteArray& device, - const QAudioFormat& format = QAudioFormat()); - QAbstractAudioOutput* createOutput(const QByteArray& device, - const QAudioFormat& format = QAudioFormat()); - QAbstractAudioDeviceInfo* createDeviceInfo(const QByteArray& device, - QAudio::Mode mode); -}; - -SymbianAudioPlugin::SymbianAudioPlugin(QObject *parent) - : QAudioEnginePlugin(parent) -{ - -} - -SymbianAudioPlugin::~SymbianAudioPlugin() -{ - -} - -QStringList SymbianAudioPlugin::keys() const -{ - QStringList keys(QLatin1String("default")); - keys << QLatin1String("default"); - return keys; -} - -QList<QByteArray> SymbianAudioPlugin::availableDevices(QAudio::Mode mode) const -{ - Q_UNUSED(mode) - QList<QByteArray> devices; - devices.append("default"); - return devices; -} - -QAbstractAudioInput* SymbianAudioPlugin::createInput( - const QByteArray &device, const QAudioFormat &format) -{ - return new SymbianAudioInput(device, format); -} - -QAbstractAudioOutput* SymbianAudioPlugin::createOutput( - const QByteArray &device, const QAudioFormat &format) -{ - return new SymbianAudioOutput(device, format); -} - -QAbstractAudioDeviceInfo* SymbianAudioPlugin::createDeviceInfo( - const QByteArray& device, QAudio::Mode mode) -{ - return new SymbianAudioDeviceInfo(device, mode); -} - -Q_EXPORT_STATIC_PLUGIN(SymbianAudioPlugin) -Q_EXPORT_PLUGIN2(qaudio, SymbianAudioPlugin) - -QT_END_NAMESPACE - diff --git a/src/plugins/audio/symbian/symbian.pro b/src/plugins/audio/symbian/symbian.pro deleted file mode 100644 index 7355daa..0000000 --- a/src/plugins/audio/symbian/symbian.pro +++ /dev/null @@ -1,31 +0,0 @@ -QT += multimedia -TARGET = qaudio - -# Paths to DevSound headers -INCLUDEPATH += /epoc32/include/mmf/common -INCLUDEPATH += /epoc32/include/mmf/server - -HEADERS += \ - symbianaudio.h \ - symbianaudiodeviceinfo.h \ - symbianaudioinput.h \ - symbianaudiooutput.h \ - symbianaudioutils.h - -SOURCES += \ - main.cpp \ - symbianaudiodeviceinfo.cpp \ - symbianaudioinput.cpp \ - symbianaudiooutput.cpp \ - symbianaudioutils.cpp - -LIBS += -lmmfdevsound - -QTDIR_build:DESTDIR = $$QT_BUILD_TREE/plugins/audio -target.path = $$[QT_INSTALL_PLUGINS]/audio -INSTALLS += target - -include(../../qpluginbase.pri) - -TARGET.UID3 = 0x2001E630 - diff --git a/src/plugins/audio/symbian/symbianaudio.h b/src/plugins/audio/symbian/symbianaudio.h deleted file mode 100644 index 3fc0419..0000000 --- a/src/plugins/audio/symbian/symbianaudio.h +++ /dev/null @@ -1,76 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the QtMultimedia module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef SYMBIANAUDIO_H -#define SYMBIANAUDIO_H - -#include <QtCore/qnamespace.h> - -QT_BEGIN_NAMESPACE - -namespace SymbianAudio { - -/** - * Default values used by audio input and output classes, when underlying - * DevSound instance has not yet been created. - */ - -const int DefaultBufferSize = 4096; // bytes -const int DefaultNotifyInterval = 1000; // ms - -/** - * Enumeration used to track state of internal DevSound instances. - * Values are translated to the corresponding QAudio::State values by - * SymbianAudio::Utils::stateNativeToQt. - */ -enum State { - ClosedState - , InitializingState - , ActiveState - , IdleState - , SuspendedState -}; - -} // namespace SymbianAudio - -QT_END_NAMESPACE - -#endif diff --git a/src/s60installs/s60installs.pro b/src/s60installs/s60installs.pro index 86deb40..1b1e965 100644 --- a/src/s60installs/s60installs.pro +++ b/src/s60installs/s60installs.pro @@ -78,12 +78,6 @@ symbian: { DEPLOYMENT += phonon_backend_plugins } - contains(QT_CONFIG, audio-backend) { - qaudio_backend_plugins.sources += qaudio.dll - qaudio_backend_plugins.path = c:$$QT_PLUGINS_BASE_DIR/audio - DEPLOYMENT += qaudio_backend_plugins - } - # Support backup & restore for Qt libraries qtbackup.sources = backup_registration.xml qtbackup.path = c:/private/10202D56/import/packages/$$replace(TARGET.UID3, 0x,) |