diff options
Diffstat (limited to 'src/plugins/symbian/mmf/audiosource')
13 files changed, 0 insertions, 2265 deletions
diff --git a/src/plugins/symbian/mmf/audiosource/audiosource_s60.pri b/src/plugins/symbian/mmf/audiosource/audiosource_s60.pri deleted file mode 100644 index 7732600fa..000000000 --- a/src/plugins/symbian/mmf/audiosource/audiosource_s60.pri +++ /dev/null @@ -1,31 +0,0 @@ -INCLUDEPATH += $$PWD - -DEFINES += AUDIOSOURCEUSED - -symbian:LIBS += -lmediaclientaudio \ - -lmmfcontrollerframework \ - -lefsrv \ - -lbafl \ - -!contains(S60_VERSION, 3.1) { - contains(audiorouting_s60_enabled,yes) { - #We use audioinputrouting.lib for recording audio from different sources -lmediaclientaudioinputstream \ -lcone \ - DEFINES += AUDIOINPUT_ROUTING - message("Audio Input Routing enabled onwards 3.2 SDK") - LIBS += -laudioinputrouting - } -} - -HEADERS += $$PWD/s60audioencodercontrol.h \ - $$PWD/s60audiomediarecordercontrol.h \ - $$PWD/s60audioendpointselector.h \ - $$PWD/s60audiocaptureservice.h \ - $$PWD/s60audiocapturesession.h \ - $$PWD/S60audiocontainercontrol.h - -SOURCES += $$PWD/s60audioencodercontrol.cpp \ - $$PWD/s60audiomediarecordercontrol.cpp \ - $$PWD/s60audioendpointselector.cpp \ - $$PWD/s60audiocaptureservice.cpp \ - $$PWD/s60audiocapturesession.cpp \ - $$PWD/S60audiocontainercontrol.cpp diff --git a/src/plugins/symbian/mmf/audiosource/s60audiocaptureservice.cpp b/src/plugins/symbian/mmf/audiosource/s60audiocaptureservice.cpp deleted file mode 100644 index f4357a023..000000000 --- a/src/plugins/symbian/mmf/audiosource/s60audiocaptureservice.cpp +++ /dev/null @@ -1,98 +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 Qt Mobility Components. -** -** $QT_BEGIN_LICENSE:LGPL$ -** GNU Lesser General Public License Usage -** 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. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU General -** Public License version 3.0 as published by the Free Software Foundation -** and appearing in the file LICENSE.GPL included in the packaging of this -** file. Please review the following information to ensure the GNU General -** Public License version 3.0 requirements will be met: -** http://www.gnu.org/copyleft/gpl.html. -** -** Other Usage -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "DebugMacros.h" -#include <QDebug> - -#include "s60audiocaptureservice.h" -#include "s60audiocapturesession.h" -#include "s60audioendpointselector.h" -#include "s60audioencodercontrol.h" -#include "s60audiomediarecordercontrol.h" -#include "s60audiocontainercontrol.h" - -S60AudioCaptureService::S60AudioCaptureService(QObject *parent): - QMediaService(parent) -{ - DP0("S60AudioCaptureService::S60AudioCaptureService +++"); - - m_session = new S60AudioCaptureSession(this); - m_encoderControl = new S60AudioEncoderControl(m_session,this); - m_recorderControl = new S60AudioMediaRecorderControl(m_session,this); - m_endpointSelector = new S60AudioEndpointSelector(m_session,this); - m_containerControl = new S60AudioContainerControl(m_session, this); - - DP0("S60AudioCaptureService::S60AudioCaptureService ---"); -} - -S60AudioCaptureService::~S60AudioCaptureService() -{ - DP0("S60AudioCaptureService::~S60AudioCaptureService +++"); - DP0("S60AudioCaptureService::~S60AudioCaptureService ---"); -} - -QMediaControl *S60AudioCaptureService::requestControl(const char *name) -{ - DP0("S60AudioCaptureService::requestControl"); - - if (qstrcmp(name,QMediaRecorderControl_iid) == 0) - return m_recorderControl; - - if (qstrcmp(name,QAudioEncoderControl_iid) == 0) - return m_encoderControl; - - if (qstrcmp(name,QAudioEndpointSelector_iid) == 0) - return m_endpointSelector; - - if (qstrcmp(name,QMediaContainerControl_iid) == 0) - return m_containerControl; - - return 0; -} - -void S60AudioCaptureService::releaseControl(QMediaControl *control) -{ - DP0("S60AudioCaptureService::releaseControl +++"); - - Q_UNUSED(control) - - DP0("S60AudioCaptureService::releaseControl ---"); -} diff --git a/src/plugins/symbian/mmf/audiosource/s60audiocaptureservice.h b/src/plugins/symbian/mmf/audiosource/s60audiocaptureservice.h deleted file mode 100644 index 040f97d29..000000000 --- a/src/plugins/symbian/mmf/audiosource/s60audiocaptureservice.h +++ /dev/null @@ -1,75 +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 Qt Mobility Components. -** -** $QT_BEGIN_LICENSE:LGPL$ -** GNU Lesser General Public License Usage -** 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. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU General -** Public License version 3.0 as published by the Free Software Foundation -** and appearing in the file LICENSE.GPL included in the packaging of this -** file. Please review the following information to ensure the GNU General -** Public License version 3.0 requirements will be met: -** http://www.gnu.org/copyleft/gpl.html. -** -** Other Usage -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef S60AUDIOCAPTURESERVICE_H -#define S60AUDIOCAPTURESERVICE_H - -#include <QtCore/qobject.h> - -#include <qmediaservice.h> - -QT_USE_NAMESPACE - -class S60AudioCaptureSession; -class S60AudioEncoderControl; -class S60AudioMediaRecorderControl; -class S60AudioEndpointSelector; -class S60AudioContainerControl; - - -class S60AudioCaptureService : public QMediaService -{ - Q_OBJECT -public: - S60AudioCaptureService(QObject *parent = 0); - ~S60AudioCaptureService(); - - QMediaControl *requestControl(const char *name); - void releaseControl(QMediaControl *control); -private: - S60AudioCaptureSession *m_session; - S60AudioEncoderControl *m_encoderControl; - S60AudioEndpointSelector *m_endpointSelector; - S60AudioMediaRecorderControl *m_recorderControl; - S60AudioContainerControl *m_containerControl; -}; - -#endif // S60AUDIOCAPTURESERVICE_H diff --git a/src/plugins/symbian/mmf/audiosource/s60audiocapturesession.cpp b/src/plugins/symbian/mmf/audiosource/s60audiocapturesession.cpp deleted file mode 100644 index e80549afe..000000000 --- a/src/plugins/symbian/mmf/audiosource/s60audiocapturesession.cpp +++ /dev/null @@ -1,937 +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 Qt Mobility Components. -** -** $QT_BEGIN_LICENSE:LGPL$ -** GNU Lesser General Public License Usage -** 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. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU General -** Public License version 3.0 as published by the Free Software Foundation -** and appearing in the file LICENSE.GPL included in the packaging of this -** file. Please review the following information to ensure the GNU General -** Public License version 3.0 requirements will be met: -** http://www.gnu.org/copyleft/gpl.html. -** -** Other Usage -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "DebugMacros.h" - -#include "s60audiocapturesession.h" -#include <QtCore/qdebug.h> -#include <QtCore/qurl.h> -#include <QDir> - -#include <mda/common/audio.h> -#include <mda/common/resource.h> -#include <mda/client/utility.h> -#include <mdaaudiosampleeditor.h> -#include <mmf/common/mmfcontrollerpluginresolver.h> -#include <mmf/common/mmfcontroller.h> -#include <badesca.h> -#include <bautils.h> -#include <f32file.h> - -#ifdef AUDIOINPUT_ROUTING -const QString S60AudioCaptureSession::microPhone("Microphone"); -const QString S60AudioCaptureSession::voiceCall("Voice Call"); -const QString S60AudioCaptureSession::fmRadio("FM Radio"); -#endif - -S60AudioCaptureSession::S60AudioCaptureSession(QObject *parent): - QObject(parent) - , m_recorderUtility(NULL) - , m_captureState(ENotInitialized) - , m_controllerIdMap(QHash<QString, ControllerData>()) - , m_audioCodeclist(QHash<QString, CodecData>()) - , m_error(QMediaRecorder::NoError) - , m_isMuted(false) -{ - DP0("S60AudioCaptureSession::S60AudioCaptureSession +++"); -#ifdef AUDIOINPUT_ROUTING - m_audioInput = NULL; - m_setActiveEndPoint = FALSE; - m_audioEndpoint = S60AudioCaptureSession::microPhone; -#endif //AUDIOINPUT_ROUTING - TRAPD(err, initializeSessionL()); - setError(err); - - DP0("S60AudioCaptureSession::S60AudioCaptureSession ---"); -} - -void S60AudioCaptureSession::initializeSessionL() -{ - DP0("S60AudioCaptureSession::initializeSessionL +++"); - - m_recorderUtility = CMdaAudioRecorderUtility::NewL(*this, 0, EMdaPriorityNormal, EMdaPriorityPreferenceTimeAndQuality); - updateAudioContainersL(); - populateAudioCodecsDataL(); - setDefaultSettings(); -#ifdef AUDIOINPUT_ROUTING - initAudioInputs(); -#endif - User::LeaveIfError(m_fsSession.Connect()); - m_captureState = EInitialized; - emit stateChanged(m_captureState); - - DP0("S60AudioCaptureSession::initializeSessionL ---"); -} - -void S60AudioCaptureSession::setError(TInt aError) -{ - DP0("S60AudioCaptureSession::setError +++"); - - DP1("S60AudioCaptureSession::setError:", aError); - - if (aError == KErrNone) - return; - - m_error = aError; - QMediaRecorder::Error recorderError = fromSymbianErrorToMultimediaError(m_error); - - // TODO: fix to user friendly string at some point - // These error string are only dev usable - QString symbianError; - symbianError.append("Symbian:"); - symbianError.append(QString::number(m_error)); - stop(); - emit error(recorderError, symbianError); - - DP0("S60AudioCaptureSession::setError ---"); -} - -QMediaRecorder::Error S60AudioCaptureSession::fromSymbianErrorToMultimediaError(int error) -{ - DP0("S60AudioCaptureSession::fromSymbianErrorToMultimediaError +++"); - - DP1("S60AudioCaptureSession::fromSymbianErrorToMultimediaError:", error); - - switch(error) { - case KErrNoMemory: - case KErrNotFound: - case KErrBadHandle: - case KErrAbort: - case KErrCorrupt: - case KErrGeneral: - case KErrPathNotFound: - case KErrUnknown: - case KErrNotReady: - case KErrInUse: - case KErrAccessDenied: - case KErrLocked: - case KErrPermissionDenied: - case KErrAlreadyExists: - return QMediaRecorder::ResourceError; - case KErrNotSupported: - case KErrArgument: - return QMediaRecorder::FormatError; - case KErrNone: - default: - DP0("S60AudioCaptureSession::fromSymbianErrorToMultimediaError: ---"); - return QMediaRecorder::NoError; - } -} - -S60AudioCaptureSession::~S60AudioCaptureSession() -{ - DP0("S60AudioCaptureSession::~S60AudioCaptureSession +++"); - //stop the utility before deleting it - stop(); - if (m_recorderUtility) - delete m_recorderUtility; - m_fsSession.Close(); - DP0("S60AudioCaptureSession::~S60AudioCaptureSession ---"); -} - -QAudioFormat S60AudioCaptureSession::format() const -{ - DP0("S60AudioCaptureSession::format"); - - return m_format; -} - -bool S60AudioCaptureSession::setFormat(const QAudioFormat &format) -{ - DP0("S60AudioCaptureSession::setFormat +++"); - - m_format = format; - - DP0("S60AudioCaptureSession::setFormat ---"); - - return true; -} - -QAudioEncoderSettings S60AudioCaptureSession::settings() const -{ - DP0("S60AudioCaptureSession::settings"); - - return m_audioEncoderSettings; -} - -bool S60AudioCaptureSession::setEncoderSettings(const QAudioEncoderSettings &setting) -{ - DP0("S60AudioCaptureSession::setEncoderSettings +++"); - - m_audioEncoderSettings = setting; - - DP0("S60AudioCaptureSession::setEncoderSettings ---"); - - return true; -} - -QStringList S60AudioCaptureSession::supportedAudioCodecs() const -{ - DP0("S60AudioCaptureSession::supportedAudioCodecs"); - - return m_audioCodeclist.keys(); -} - -QStringList S60AudioCaptureSession::supportedAudioContainers() const -{ - DP0("S60AudioCaptureSession::supportedAudioContainers"); - - return m_controllerIdMap.keys(); -} - -QString S60AudioCaptureSession::codecDescription(const QString &codecName) -{ - DP0("S60AudioCaptureSession::codecDescription +++"); - - if (m_audioCodeclist.keys().contains(codecName)) { - - DP0("S60AudioCaptureSession::codecDescription ---"); - return m_audioCodeclist.value(codecName).codecDescription; - } - else { - DP0("S60AudioCaptureSession::codecDescription ---"); - - return QString(); - } -} - -QString S60AudioCaptureSession::audioContainerDescription(const QString &containerName) -{ - DP0("S60AudioCaptureSession::audioContainerDescription +++"); - - if (m_controllerIdMap.keys().contains(containerName)) { - DP0("S60AudioCaptureSession::audioContainerDescription ---"); - - return m_controllerIdMap.value(containerName).destinationFormatDescription; - } - else { - DP0("S60AudioCaptureSession::audioContainerDescription ---"); - - return QString(); - } -} - -bool S60AudioCaptureSession::setAudioCodec(const QString &codecName) -{ - DP0("S60AudioCaptureSession::setAudioCodec"); - - QStringList codecs = supportedAudioCodecs(); - if(codecs.contains(codecName)) { - m_format.setCodec(codecName); - return true; - } - return false; -} - -bool S60AudioCaptureSession::setAudioContainer(const QString &containerMimeType) -{ - DP0("S60AudioCaptureSession::setAudioContainer"); - - QStringList containers = supportedAudioContainers(); - if (containerMimeType == "audio/mpeg") - { - m_container = "audio/mp4"; - return true; - } - if(containers.contains(containerMimeType)) { - m_container = containerMimeType; - return true; - } - return false; -} - -QString S60AudioCaptureSession::audioCodec() const -{ - DP0("S60AudioCaptureSession::audioCodec"); - - return m_format.codec(); -} - -QString S60AudioCaptureSession::audioContainer() const -{ - DP0("S60AudioCaptureSession::audioContainer"); - - return m_container; -} - -QUrl S60AudioCaptureSession::outputLocation() const -{ - DP0("S60AudioCaptureSession::outputLocation"); - - return m_sink; -} - -bool S60AudioCaptureSession::setOutputLocation(const QUrl& sink) -{ - DP0("S60AudioCaptureSession::setOutputLocation"); - - QString filename = QDir::toNativeSeparators(sink.toString()); - TPtrC16 path(reinterpret_cast<const TUint16*>(filename.utf16())); - TRAPD(err, BaflUtils::EnsurePathExistsL(m_fsSession,path)); - if (err == KErrNone) { - m_sink = sink; - setError(err); - return true; - }else { - setError(err); - return false; - } -} - -qint64 S60AudioCaptureSession::position() const -{ - DP0("S60AudioCaptureSession::position"); - - if ((m_captureState != ERecording) || !m_recorderUtility) - return 0; - - return m_recorderUtility->Duration().Int64() / 1000; -} - -void S60AudioCaptureSession::prepareSinkL() -{ - DP0("S60AudioCaptureSession::prepareSinkL +++"); - - /* If m_outputLocation is null, set a default location */ - if (m_sink.isEmpty()) { - QDir outputDir(QDir::rootPath()); - int lastImage = 0; - int fileCount = 0; - foreach(QString fileName, outputDir.entryList(QStringList() << "recordclip_*")) { - int imgNumber = fileName.mid(5, fileName.size() - 9).toInt(); - lastImage = qMax(lastImage, imgNumber); - if (outputDir.exists(fileName)) - fileCount += 1; - } - lastImage += fileCount; - m_sink = QUrl(QDir::toNativeSeparators(outputDir.canonicalPath() + QString("/recordclip_%1").arg(lastImage + 1, 4, 10, QLatin1Char('0')))); - } - - QString sink = QDir::toNativeSeparators(m_sink.toString()); - TPtrC16 path(reinterpret_cast<const TUint16*>(sink.utf16())); - if (BaflUtils::FileExists(m_fsSession, path)) - BaflUtils::DeleteFile(m_fsSession, path); - - int index = sink.lastIndexOf('.'); - if (index != -1) - sink.chop(sink.length()-index); - - sink.append(m_controllerIdMap.value(m_container).fileExtension); - m_sink.setUrl(sink); - - DP0("S60AudioCaptureSession::prepareSinkL ---"); -} - -void S60AudioCaptureSession::record() -{ - DP0("S60AudioCaptureSession::record +++"); - - if (!m_recorderUtility) - return; - - if (m_captureState == EInitialized || m_captureState == ERecordComplete) { - prepareSinkL(); - QString filename = m_sink.toString(); - TPtrC16 sink(reinterpret_cast<const TUint16*>(filename.utf16())); - TUid controllerUid(TUid::Uid(m_controllerIdMap.value(m_container).controllerUid)); - TUid formatUid(TUid::Uid(m_controllerIdMap.value(m_container).destinationFormatUid)); - - TRAPD(err,m_recorderUtility->OpenFileL(sink)); - setError(err); - }else if (m_captureState == EPaused) { - m_recorderUtility->SetPosition(m_pausedPosition); - TRAPD(error, m_recorderUtility->RecordL()); - setError(error); - m_captureState = ERecording; - emit stateChanged(m_captureState); - } - - DP0("S60AudioCaptureSession::record ---"); -} - -void S60AudioCaptureSession::mute(bool muted) -{ - DP0("S60AudioCaptureSession::mute +++"); - - if (!m_recorderUtility) - return; - - if (muted) - m_recorderUtility->SetGain(0); - else - m_recorderUtility->SetGain(m_recorderUtility->MaxGain()); - - m_isMuted = muted; - - DP0("S60AudioCaptureSession::mute ---"); -} - -bool S60AudioCaptureSession::muted() -{ - DP0("S60AudioCaptureSession::muted"); - - return m_isMuted; -} - -void S60AudioCaptureSession::setDefaultSettings() -{ - DP0("S60AudioCaptureSession::setDefaultSettings +++"); - - // Setting AMR to default format if supported - if (m_controllerIdMap.count() > 0) { - if ( m_controllerIdMap.contains("audio/amr")) - m_container = QString("audio/amr"); - else - m_container = m_controllerIdMap.keys()[0]; - } - if (m_audioCodeclist.keys().count() > 0) { - if (m_audioCodeclist.keys().contains("AMR")) { - m_format.setSampleSize(8); - m_format.setChannels(1); - m_format.setFrequency(8000); - m_format.setSampleType(QAudioFormat::SignedInt); - m_format.setCodec("AMR"); - }else - m_format.setCodec(m_audioCodeclist.keys()[0]); - } - - DP0("S60AudioCaptureSession::setDefaultSettings ---"); -} - -void S60AudioCaptureSession::pause() -{ - DP0("S60AudioCaptureSession::pause +++"); - - if (!m_recorderUtility) - return; - - m_pausedPosition = m_recorderUtility->Position(); - m_recorderUtility->Stop(); - m_captureState = EPaused; - emit stateChanged(m_captureState); - - DP0("S60AudioCaptureSession::pause ---"); -} - -void S60AudioCaptureSession::stop() -{ - DP0("S60AudioCaptureSession::stop +++"); - - if (!m_recorderUtility) - return; - - m_recorderUtility->Stop(); - -#ifdef AUDIOINPUT_ROUTING - //delete audio input instance before closing the utility. - if (m_audioInput) - { - delete m_audioInput; - m_audioInput = NULL; - } -#endif //AUDIOINPUT_ROUTING - - m_recorderUtility->Close(); - m_captureState = ERecordComplete; - emit stateChanged(m_captureState); -} - -#ifdef AUDIOINPUT_ROUTING - -void S60AudioCaptureSession::initAudioInputs() -{ - DP0(" S60AudioCaptureSession::initAudioInputs +++"); - - m_audioInputs[S60AudioCaptureSession::microPhone] = QString("Microphone associated with the currently active speaker."); - m_audioInputs[S60AudioCaptureSession::voiceCall] = QString("Audio stream associated with the current phone call."); - m_audioInputs[S60AudioCaptureSession::fmRadio] = QString("Audio of the currently tuned FM radio station."); - - DP0(" S60AudioCaptureSession::initAudioInputs ---"); -} - -#endif //AUDIOINPUT_ROUTING - -void S60AudioCaptureSession::setActiveEndpoint(const QString& audioEndpoint) -{ - DP0(" S60AudioCaptureSession::setActiveEndpoint +++"); - - if (!m_audioInputs.keys().contains(audioEndpoint)) - return; - - if (activeEndpoint().compare(audioEndpoint) != 0) { - m_audioEndpoint = audioEndpoint; -#ifdef AUDIOINPUT_ROUTING - m_setActiveEndPoint = TRUE; -#endif - } - - DP0(" S60AudioCaptureSession::setActiveEndpoint ---"); -} - -QList<QString> S60AudioCaptureSession::availableEndpoints() const -{ - DP0(" S60AudioCaptureSession::availableEndpoints"); - - return m_audioInputs.keys(); -} - -QString S60AudioCaptureSession::endpointDescription(const QString& name) const -{ - DP0(" S60AudioCaptureSession::endpointDescription +++"); - - if (m_audioInputs.keys().contains(name)) - return m_audioInputs.value(name); - return QString(); -} - -QString S60AudioCaptureSession::activeEndpoint() const -{ - DP0(" S60AudioCaptureSession::activeEndpoint"); - - QString inputSourceName = NULL; -#ifdef AUDIOINPUT_ROUTING - if (m_audioInput) { - CAudioInput::TAudioInputArray input = m_audioInput->AudioInput(); - inputSourceName = qStringFromTAudioInputPreference(input[0]); - } -#endif //AUDIOINPUT_ROUTING - return inputSourceName; -} - -QString S60AudioCaptureSession::defaultEndpoint() const -{ - DP0(" S60AudioCaptureSession::defaultEndpoint"); - -#ifdef AUDIOINPUT_ROUTING - return QString(S60AudioCaptureSession::microPhone); -#else - return NULL; -#endif -} - -#ifdef AUDIOINPUT_ROUTING - -void S60AudioCaptureSession::doSetAudioInputL(const QString& name) -{ - DP0(" S60AudioCaptureSession::doSetAudioInputL +++"); - DP1(" S60AudioCaptureSession::doSetAudioInputL:", name); - TInt err(KErrNone); - - if (!m_recorderUtility) - return; - - CAudioInput::TAudioInputPreference input = CAudioInput::EDefaultMic; - - if (name.compare(S60AudioCaptureSession::voiceCall) == 0) - input = CAudioInput::EVoiceCall; -// commented because they are not supported on 9.2 - else if (name.compare(S60AudioCaptureSession::fmRadio) == 0) - input = CAudioInput::EFMRadio; - else // S60AudioCaptureSession::microPhone - input = CAudioInput::EDefaultMic; - - RArray<CAudioInput::TAudioInputPreference> inputArray; - inputArray.Append(input); - - if (m_audioInput){ - TRAP(err,m_audioInput->SetAudioInputL(inputArray.Array())); - - if (err == KErrNone) { - emit activeEndpointChanged(name); - } - else{ - setError(err); - } - } - inputArray.Close(); - - DP0(" S60AudioCaptureSession::doSetAudioInputL ---"); -} - - -QString S60AudioCaptureSession::qStringFromTAudioInputPreference(CAudioInput::TAudioInputPreference input) const -{ - DP0(" S60AudioCaptureSession::qStringFromTAudioInputPreference"); - - if (input == CAudioInput::EVoiceCall) - return S60AudioCaptureSession::voiceCall; - else if (input == CAudioInput::EFMRadio) - return S60AudioCaptureSession::fmRadio; - else - return S60AudioCaptureSession::microPhone; // CAudioInput::EDefaultMic -} -#endif //AUDIOINPUT_ROUTING - - -void S60AudioCaptureSession::MoscoStateChangeEvent(CBase* aObject, - TInt aPreviousState, TInt aCurrentState, TInt aErrorCode) -{ - DP0("S60AudioCaptureSession::MoscoStateChangeEvent +++"); - - if (aErrorCode==KErrNone) { - TRAPD(err, MoscoStateChangeEventL(aObject, aPreviousState, aCurrentState, NULL)); - setError(err); - } - else { - setError(aErrorCode); - } - DP1("S60AudioCaptureSession::MoscoStateChangeEvent, aErrorCode:", aErrorCode); - DP0("S60AudioCaptureSession::MoscoStateChangeEvent ---"); -} - -void S60AudioCaptureSession::MoscoStateChangeEventL(CBase* aObject, - TInt aPreviousState, TInt aCurrentState, TInt aErrorCode) -{ - DP0("S60AudioCaptureSession::MoscoStateChangeEventL +++"); - - DP5("S60AudioCaptureSession::MoscoStateChangeEventL - aPreviousState:", aPreviousState, - "aCurrentState:", aCurrentState, "aErrorCode:", aErrorCode); - if (aObject != m_recorderUtility) - return; - - switch(aCurrentState) { - case CMdaAudioClipUtility::EOpen: { - if(aPreviousState == CMdaAudioClipUtility::ENotReady) { - applyAudioSettingsL(); - m_recorderUtility->SetGain(m_recorderUtility->MaxGain()); - TRAPD(err, m_recorderUtility->RecordL()); - setError(err); - m_captureState = EOpenCompelete; - emit stateChanged(m_captureState); - } - break; - } - case CMdaAudioClipUtility::ENotReady: { - m_captureState = EInitialized; - emit stateChanged(m_captureState); - break; - } - case CMdaAudioClipUtility::ERecording: { - m_captureState = ERecording; - emit stateChanged(m_captureState); - break; - } - default: { - break; - } - } - - DP0("S60AudioCaptureSession::MoscoStateChangeEventL ---"); -} - -void S60AudioCaptureSession::updateAudioContainersL() -{ - DP0("S60AudioCaptureSession::updateAudioContainersL +++"); - - CMMFControllerPluginSelectionParameters* pluginParameters = - CMMFControllerPluginSelectionParameters::NewLC(); - CMMFFormatSelectionParameters* formatParameters = - CMMFFormatSelectionParameters::NewLC(); - - pluginParameters->SetRequiredRecordFormatSupportL(*formatParameters); - - RArray<TUid> ids; - CleanupClosePushL(ids); - User::LeaveIfError(ids.Append(KUidMediaTypeAudio)); - - pluginParameters->SetMediaIdsL(ids, - CMMFPluginSelectionParameters::EAllowOnlySuppliedMediaIds); - - RMMFControllerImplInfoArray controllers; - CleanupResetAndDestroyPushL(controllers); - - //Get all audio record controllers/formats that are supported - pluginParameters->ListImplementationsL(controllers); - - for (TInt index=0; index<controllers.Count(); index++) { - const RMMFFormatImplInfoArray& recordFormats = - controllers[index]->RecordFormats(); - for (TInt j=0; j<recordFormats.Count(); j++) { - const CDesC8Array& mimeTypes = recordFormats[j]->SupportedMimeTypes(); - const CDesC8Array& fileExtensions = recordFormats[j]->SupportedFileExtensions(); - TInt mimeCount = mimeTypes.Count(); - TInt fileExtCount = fileExtensions.Count(); - - if (mimeCount > 0 && fileExtCount > 0) { - TPtrC8 extension = fileExtensions[0]; - TPtrC8 mimeType = mimeTypes[0]; - QString type = QString::fromUtf8((char *)mimeType.Ptr(), mimeType.Length()); - - if (type != "audio/basic") { - ControllerData data; - data.controllerUid = controllers[index]->Uid().iUid; - data.destinationFormatUid = recordFormats[j]->Uid().iUid; - data.destinationFormatDescription = QString::fromUtf16( - recordFormats[j]->DisplayName().Ptr(), - recordFormats[j]->DisplayName().Length()); - data.fileExtension = QString::fromUtf8((char *)extension.Ptr(), extension.Length()); - m_controllerIdMap[type] = data; - } - } - } - } - CleanupStack::PopAndDestroy(4);//controllers, ids, formatParameters, pluginParameters - - DP0("S60AudioCaptureSession::updateAudioContainersL ---"); -} - -void S60AudioCaptureSession::retrieveSupportedAudioSampleRatesL() -{ - DP0("S60AudioCaptureSession::retrieveSupportedAudioSampleRatesL +++"); - - if (!m_recorderUtility) { - DP0("No RecorderUtility"); - return; - } - - m_supportedSampleRates.clear(); - - RArray<TUint> supportedSampleRates; - CleanupClosePushL(supportedSampleRates); - m_recorderUtility->GetSupportedSampleRatesL(supportedSampleRates); - for (TInt j = 0; j < supportedSampleRates.Count(); j++ ) - m_supportedSampleRates.append(supportedSampleRates[j]); - - CleanupStack::PopAndDestroy(&supportedSampleRates); - - DP0("S60AudioCaptureSession::retrieveSupportedAudioSampleRatesL ---"); -} - -QList<int> S60AudioCaptureSession::supportedAudioSampleRates(const QAudioEncoderSettings &settings) const -{ - DP0("S60AudioCaptureSession::supportedAudioSampleRates +++"); - - QList<int> supportedSampleRates; - - if (!settings.codec().isEmpty()) { - if (settings.codec() == "AMR") - supportedSampleRates.append(8000); - else - supportedSampleRates = m_supportedSampleRates; - }else - supportedSampleRates = m_supportedSampleRates; - - DP0("S60AudioCaptureSession::supportedAudioSampleRates ---"); - - return supportedSampleRates; -} - -void S60AudioCaptureSession::populateAudioCodecsDataL() -{ - DP0("S60AudioCaptureSession::populateAudioCodecsDataL +++"); - - if (!m_recorderUtility) { - DP0("No RecorderUtility"); - - return; - } - - if (m_controllerIdMap.contains("audio/amr")) { - CodecData data; - data.codecDescription = QString("GSM AMR Codec"); - m_audioCodeclist[QString("AMR")]=data; - } - if (m_controllerIdMap.contains("audio/basic")) { - CodecData data; - data.fourCC = KMMFFourCCCodeALAW; - data.codecDescription = QString("Sun/Next ""Au"" audio codec"); - m_audioCodeclist[QString("AULAW")]=data; - } - if (m_controllerIdMap.contains("audio/wav")) { - CodecData data; - data.fourCC = KMMFFourCCCodePCM16; - data.codecDescription = QString("Pulse code modulation"); - m_audioCodeclist[QString("PCM")]=data; - } - if (m_controllerIdMap.contains("audio/mp4")) { - CodecData data; - data.fourCC = KMMFFourCCCodeAAC; - data.codecDescription = QString("Advanced Audio Codec"); - m_audioCodeclist[QString("AAC")]=data; - } - - // default samplerates - m_supportedSampleRates << 96000 << 88200 << 64000 << 48000 << 44100 << 32000 << 24000 << 22050 << 16000 << 12000 << 11025 << 8000; - - DP0("S60AudioCaptureSession::populateAudioCodecsDataL ---"); -} - -void S60AudioCaptureSession::applyAudioSettingsL() -{ - DP0("S60AudioCaptureSession::applyAudioSettingsL +++"); - - if (!m_recorderUtility) - return; - -#ifdef AUDIOINPUT_ROUTING - //CAudioInput needs to be re-initialized every time recording starts - if (m_audioInput) { - delete m_audioInput; - m_audioInput = NULL; - } - - if (m_setActiveEndPoint) { - m_audioInput = CAudioInput::NewL(*m_recorderUtility); - doSetAudioInputL(m_audioEndpoint); - } -#endif //AUDIOINPUT_ROUTING - - if (m_format.codec() == "AMR") - return; - - TFourCC fourCC = m_audioCodeclist.value(m_format.codec()).fourCC; - - if (m_format.codec() == "PCM") - fourCC = determinePCMFormat(); - - RArray<TFourCC> supportedDataTypes; - CleanupClosePushL(supportedDataTypes); - TRAPD(err,m_recorderUtility->GetSupportedDestinationDataTypesL(supportedDataTypes)); - TInt num = supportedDataTypes.Count(); - if (num > 0 ) { - supportedDataTypes.SortUnsigned(); - int index = supportedDataTypes.Find(fourCC.FourCC()); - if (index != KErrNotFound) { - TRAPD(err,m_recorderUtility->SetDestinationDataTypeL(supportedDataTypes[index])); - } - } - - supportedDataTypes.Reset(); - CleanupStack::PopAndDestroy(&supportedDataTypes); - - if (m_recorderUtility->DestinationSampleRateL() != m_format.frequency()) { - - RArray<TUint> supportedSampleRates; - CleanupClosePushL(supportedSampleRates); - m_recorderUtility->GetSupportedSampleRatesL(supportedSampleRates); - for (TInt i = 0; i < supportedSampleRates.Count(); i++ ) { - TUint supportedSampleRate = supportedSampleRates[i]; - if (supportedSampleRate == m_format.frequency()) { - m_recorderUtility->SetDestinationSampleRateL(m_format.frequency()); - break; - } - } - supportedSampleRates.Reset(); - CleanupStack::PopAndDestroy(&supportedSampleRates); - } - - /* If requested channel setting is different than current one */ - if (m_recorderUtility->DestinationNumberOfChannelsL() != m_format.channels()) { - RArray<TUint> supportedChannels; - CleanupClosePushL(supportedChannels); - m_recorderUtility->GetSupportedNumberOfChannelsL(supportedChannels); - for (TInt l = 0; l < supportedChannels.Count(); l++ ) { - if (supportedChannels[l] == m_format.channels()) { - m_recorderUtility->SetDestinationNumberOfChannelsL(m_format.channels()); - break; - } - } - supportedChannels.Reset(); - CleanupStack::PopAndDestroy(&supportedChannels); - } - - if (!(m_format.codec().compare("pcm",Qt::CaseInsensitive) == 0)) { - if (m_recorderUtility->DestinationBitRateL() != m_audioEncoderSettings.bitRate()) { - RArray<TUint> supportedBitRates; - CleanupClosePushL(supportedBitRates); - m_recorderUtility->GetSupportedBitRatesL(supportedBitRates); - for (TInt l = 0; l < supportedBitRates.Count(); l++ ) { - if (supportedBitRates[l] == m_audioEncoderSettings.bitRate()) { - m_recorderUtility->SetDestinationBitRateL(m_audioEncoderSettings.bitRate()); - break; - } - } - supportedBitRates.Reset(); - CleanupStack::PopAndDestroy(&supportedBitRates); - } - } - - DP0("S60AudioCaptureSession::applyAudioSettingsL ---"); -} - -TFourCC S60AudioCaptureSession::determinePCMFormat() -{ - DP0("S60AudioCaptureSession::determinePCMFormat +++"); - - TFourCC fourCC; - - if (m_format.sampleSize() == 8) { - // 8 bit - switch (m_format.sampleType()) { - case QAudioFormat::SignedInt: { - fourCC.Set(KMMFFourCCCodePCM8); - break; - } - case QAudioFormat::UnSignedInt: { - fourCC.Set(KMMFFourCCCodePCMU8); - break; - } - case QAudioFormat::Float: - case QAudioFormat::Unknown: - default: { - fourCC.Set(KMMFFourCCCodePCM8); - break; - } - } - } else if (m_format.sampleSize() == 16) { - // 16 bit - switch (m_format.sampleType()) { - case QAudioFormat::SignedInt: { - fourCC.Set(m_format.byteOrder()==QAudioFormat::BigEndian? - KMMFFourCCCodePCM16B:KMMFFourCCCodePCM16); - break; - } - case QAudioFormat::UnSignedInt: { - fourCC.Set(m_format.byteOrder()==QAudioFormat::BigEndian? - KMMFFourCCCodePCMU16B:KMMFFourCCCodePCMU16); - break; - } - default: { - fourCC.Set(KMMFFourCCCodePCM16); - break; - } - } - } - - DP0("S60AudioCaptureSession::determinePCMFormat ---"); - - return fourCC; -} diff --git a/src/plugins/symbian/mmf/audiosource/s60audiocapturesession.h b/src/plugins/symbian/mmf/audiosource/s60audiocapturesession.h deleted file mode 100644 index 78f018f3f..000000000 --- a/src/plugins/symbian/mmf/audiosource/s60audiocapturesession.h +++ /dev/null @@ -1,193 +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 Qt Mobility Components. -** -** $QT_BEGIN_LICENSE:LGPL$ -** GNU Lesser General Public License Usage -** 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. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU General -** Public License version 3.0 as published by the Free Software Foundation -** and appearing in the file LICENSE.GPL included in the packaging of this -** file. Please review the following information to ensure the GNU General -** Public License version 3.0 requirements will be met: -** http://www.gnu.org/copyleft/gpl.html. -** -** Other Usage -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef S60AUDIOCAPTURESESSION_H -#define S60AUDIOCAPTURESESSION_H - -#include <qmobilityglobal.h> -#include <QtCore/qobject.h> -#include <QFile> -#include <QUrl> -#include <QList> -#include <QHash> -#include <QMap> -#include "qaudioformat.h" -#include <qmediarecorder.h> - -#include <mda/common/audio.h> -#include <mda/common/resource.h> -#include <mda/client/utility.h> -#include <mdaaudiosampleeditor.h> -#include <mmf/common/mmfutilities.h> - -#ifdef AUDIOINPUT_ROUTING -#include <audioinput.h> -#endif //AUDIOINPUT_ROUTING - -QT_BEGIN_NAMESPACE -struct ControllerData -{ - int controllerUid; - int destinationFormatUid; - QString destinationFormatDescription; - QString fileExtension; -}; - -struct CodecData -{ - TFourCC fourCC; - QString codecDescription; -}; -QT_END_NAMESPACE - -QT_USE_NAMESPACE - -class S60AudioCaptureSession : public QObject, public MMdaObjectStateChangeObserver -{ - Q_OBJECT - Q_PROPERTY(qint64 position READ position NOTIFY positionChanged) - Q_ENUMS(TAudioCaptureState) -public: - - enum TAudioCaptureState - { - ENotInitialized = 0, - EInitialized, - EOpenCompelete, - ERecording, - EPaused, - ERecordComplete - }; - - S60AudioCaptureSession(QObject *parent = 0); - ~S60AudioCaptureSession(); - - QAudioFormat format() const; - bool setFormat(const QAudioFormat &format); - QAudioEncoderSettings settings() const; - bool setEncoderSettings(const QAudioEncoderSettings &setting); - QStringList supportedAudioCodecs() const; - QString codecDescription(const QString &codecName); - bool setAudioCodec(const QString &codecName); - QString audioCodec() const; - QString audioContainer() const; - QStringList supportedAudioContainers() const; - bool setAudioContainer(const QString &containerMimeType); - QString audioContainerDescription(const QString &containerName); - QList<int> supportedAudioSampleRates(const QAudioEncoderSettings &settings) const; - QUrl outputLocation() const; - bool setOutputLocation(const QUrl& sink); - qint64 position() const; - void record(); - void pause(); - void stop(); - void mute(bool muted); - bool muted(); - - QString activeEndpoint() const; - QString defaultEndpoint() const; - QList<QString> availableEndpoints() const; - QString endpointDescription(const QString& name) const; - -#ifdef AUDIOINPUT_ROUTING - static const QString microPhone; - static const QString voiceCall; - static const QString fmRadio; -#endif //AUDIOINPUT_ROUTING -private: - void initializeSessionL(); - void setError(TInt aError); - QMediaRecorder::Error fromSymbianErrorToMultimediaError(int error); - void prepareSinkL(); - void updateAudioContainersL(); - void populateAudioCodecsDataL(); - void retrieveSupportedAudioSampleRatesL(); - void applyAudioSettingsL(); - TFourCC determinePCMFormat(); - void setDefaultSettings(); - // MMdaObjectStateChangeObserver - void MoscoStateChangeEvent(CBase* aObject, TInt aPreviousState, - TInt aCurrentState, TInt aErrorCode); - void MoscoStateChangeEventL(CBase* aObject, TInt aPreviousState, - TInt aCurrentState, TInt aErrorCode); - -#ifdef AUDIOINPUT_ROUTING - QString qStringFromTAudioInputPreference(CAudioInput::TAudioInputPreference input) const; - void initAudioInputs(); - void doSetAudioInputL(const QString& name); -#endif //AUDIOINPUT_ROUTING - -public Q_SLOTS: - void setActiveEndpoint(const QString& audioEndpoint); - - -Q_SIGNALS: - void stateChanged(S60AudioCaptureSession::TAudioCaptureState); - void positionChanged(qint64 position); - void error(int error, const QString &errorString); - void activeEndpointChanged(const QString &audioEndpoint); -private: - QString m_container; - QUrl m_sink; - TTimeIntervalMicroSeconds m_pausedPosition; - CMdaAudioRecorderUtility *m_recorderUtility; - TAudioCaptureState m_captureState; - QAudioFormat m_format; - QAudioEncoderSettings m_audioEncoderSettings; - QHash<QString, ControllerData> m_controllerIdMap; - QHash<QString, CodecData> m_audioCodeclist; - QList<int> m_supportedSampleRates; - int m_error; - bool m_isMuted; - RFs m_fsSession; - -#ifdef AUDIOINPUT_ROUTING - bool m_setActiveEndPoint; - CAudioInput *m_audioInput; - -#endif //AUDIOINPUT_ROUTING - QMap<QString, QString> m_audioInputs; - QString m_audioEndpoint; - - -}; - -#endif // S60AUDIOCAPTURESESSION_H diff --git a/src/plugins/symbian/mmf/audiosource/s60audiocontainercontrol.cpp b/src/plugins/symbian/mmf/audiosource/s60audiocontainercontrol.cpp deleted file mode 100644 index 7227d7390..000000000 --- a/src/plugins/symbian/mmf/audiosource/s60audiocontainercontrol.cpp +++ /dev/null @@ -1,96 +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 Qt Mobility Components. -** -** $QT_BEGIN_LICENSE:LGPL$ -** GNU Lesser General Public License Usage -** 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. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU General -** Public License version 3.0 as published by the Free Software Foundation -** and appearing in the file LICENSE.GPL included in the packaging of this -** file. Please review the following information to ensure the GNU General -** Public License version 3.0 requirements will be met: -** http://www.gnu.org/copyleft/gpl.html. -** -** Other Usage -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "DebugMacros.h" - -#include "s60audiocontainercontrol.h" -#include "s60audiocapturesession.h" -#include <QtCore/qdebug.h> - -S60AudioContainerControl::S60AudioContainerControl(QObject *parent) - : QMediaContainerControl(parent) -{ - DP0("S60AudioContainerControl::S60AudioContainerControl(QObject *parent) +++"); - - DP0("S60AudioContainerControl::S60AudioContainerControl(QObject *parent) ---"); - -} - -S60AudioContainerControl::S60AudioContainerControl(QObject *session, QObject *parent) - : QMediaContainerControl(parent) -{ - DP0("S60AudioContainerControl::S60AudioContainerControl(QObject *session, QObject *parent) +++"); - - m_session = qobject_cast<S60AudioCaptureSession*>(session); - - DP0("S60AudioContainerControl::S60AudioContainerControl(QObject *session, QObject *parent) ---"); -} - -QStringList S60AudioContainerControl::supportedContainers() const -{ - DP0("S60AudioContainerControl::supportedContainers"); - - return m_session->supportedAudioContainers(); -} - -QString S60AudioContainerControl::containerMimeType() const -{ - DP0("S60AudioContainerControl::containerMimeType"); - - return m_session->audioContainer(); -} - -void S60AudioContainerControl::setContainerMimeType(const QString &containerMimeType) -{ - DP0("S60AudioContainerControl::setContainerMimeType +++"); - - m_session->setAudioContainer(containerMimeType); - - DP0("S60AudioContainerControl::setContainerMimeType ---"); -} - -QString S60AudioContainerControl::containerDescription(const QString &containerMimeType) const -{ - DP0("S60AudioContainerControl::containerDescription"); - - return m_session->audioContainerDescription(containerMimeType); -} - diff --git a/src/plugins/symbian/mmf/audiosource/s60audiocontainercontrol.h b/src/plugins/symbian/mmf/audiosource/s60audiocontainercontrol.h deleted file mode 100644 index e657b4319..000000000 --- a/src/plugins/symbian/mmf/audiosource/s60audiocontainercontrol.h +++ /dev/null @@ -1,70 +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 Qt Mobility Components. -** -** $QT_BEGIN_LICENSE:LGPL$ -** GNU Lesser General Public License Usage -** 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. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU General -** Public License version 3.0 as published by the Free Software Foundation -** and appearing in the file LICENSE.GPL included in the packaging of this -** file. Please review the following information to ensure the GNU General -** Public License version 3.0 requirements will be met: -** http://www.gnu.org/copyleft/gpl.html. -** -** Other Usage -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef S60AUDIOFORMATCONTROL_H -#define S60AUDIOFORMATCONTROL_H - -#include "qmediacontainercontrol.h" -#include <QtCore/qstringlist.h> - - -QT_USE_NAMESPACE - -class S60AudioCaptureSession; - -class S60AudioContainerControl : public QMediaContainerControl -{ -Q_OBJECT -public: - S60AudioContainerControl(QObject *parent = 0); - S60AudioContainerControl(QObject *session, QObject *parent = 0); - virtual ~S60AudioContainerControl() {}; - - QStringList supportedContainers() const; - QString containerMimeType() const; - void setContainerMimeType(const QString &containerMimeType); - QString containerDescription(const QString &containerMimeType) const; - -private: - S60AudioCaptureSession* m_session; -}; - -#endif // S60AUDIOFORMATCONTROL_H diff --git a/src/plugins/symbian/mmf/audiosource/s60audioencodercontrol.cpp b/src/plugins/symbian/mmf/audiosource/s60audioencodercontrol.cpp deleted file mode 100644 index 7f359aa3a..000000000 --- a/src/plugins/symbian/mmf/audiosource/s60audioencodercontrol.cpp +++ /dev/null @@ -1,235 +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 Qt Mobility Components. -** -** $QT_BEGIN_LICENSE:LGPL$ -** GNU Lesser General Public License Usage -** 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. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU General -** Public License version 3.0 as published by the Free Software Foundation -** and appearing in the file LICENSE.GPL included in the packaging of this -** file. Please review the following information to ensure the GNU General -** Public License version 3.0 requirements will be met: -** http://www.gnu.org/copyleft/gpl.html. -** -** Other Usage -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "DebugMacros.h" - -#include "s60audioencodercontrol.h" -#include "s60audiocapturesession.h" - -#include "qaudioformat.h" - -#include <QtCore/qdebug.h> - -S60AudioEncoderControl::S60AudioEncoderControl(QObject *session, QObject *parent) - :QAudioEncoderControl(parent), m_quality(QtMultimediaKit::NormalQuality) -{ - DP0("S60AudioEncoderControl::S60AudioEncoderControl +++"); - - m_session = qobject_cast<S60AudioCaptureSession*>(session); - QAudioFormat fmt = m_session->format(); - // medium, 22050Hz mono S16 - fmt.setSampleType(QAudioFormat::SignedInt); - if (fmt.codec().compare("PCM", Qt::CaseInsensitive) == 0) { - fmt.setSampleSize(16); - fmt.setFrequency(22050); - } - fmt.setChannels(1); - m_session->setFormat(fmt); - m_settings.setChannelCount(fmt.channels()); - m_settings.setCodec(fmt.codec()); - m_settings.setSampleRate(fmt.sampleRate()); - - DP0("S60AudioEncoderControl::S60AudioEncoderControl ---"); -} - -S60AudioEncoderControl::~S60AudioEncoderControl() -{ - DP0("S60AudioEncoderControl::~S60AudioEncoderControl +++"); - - DP0("S60AudioEncoderControl::~S60AudioEncoderControl ---"); -} - -QStringList S60AudioEncoderControl::supportedAudioCodecs() const -{ - DP0("S60AudioEncoderControl::supportedAudioCodecs"); - - return m_session->supportedAudioCodecs(); -} - -QString S60AudioEncoderControl::codecDescription(const QString &codecName) const -{ - DP0("S60AudioEncoderControl::codecDescription"); - - return m_session->codecDescription(codecName); -} - -QtMultimediaKit::EncodingQuality S60AudioEncoderControl::quality() const -{ - DP0("S60AudioEncoderControl::quality"); - - return m_quality; -} - -void S60AudioEncoderControl::setQuality(QtMultimediaKit::EncodingQuality value, QAudioFormat &fmt) -{ - DP0("S60AudioEncoderControl::setQuality +++"); - - switch (value) { - case QtMultimediaKit::VeryLowQuality: - case QtMultimediaKit::LowQuality: - // low, 8000Hz mono U8 - fmt.setSampleType(QAudioFormat::UnSignedInt); - fmt.setSampleSize(8); - fmt.setFrequency(8000); - fmt.setChannels(1); - break; - case QtMultimediaKit::NormalQuality: - // medium, 22050Hz mono S16 - fmt.setSampleType(QAudioFormat::SignedInt); - fmt.setSampleSize(16); - fmt.setFrequency(22050); - fmt.setChannels(1); - break; - case QtMultimediaKit::HighQuality: - case QtMultimediaKit::VeryHighQuality: - // high, 44100Hz mono S16 - fmt.setSampleType(QAudioFormat::SignedInt); - fmt.setSampleSize(16); - fmt.setFrequency(44100); - fmt.setChannels(2); - break; - default: - break; - } - - DP0("S60AudioEncoderControl::setQuality ---"); -} - -QStringList S60AudioEncoderControl::supportedEncodingOptions(const QString &codec) const -{ - DP0("S60AudioEncoderControl::supportedEncodingOptions"); - - Q_UNUSED(codec) - QStringList list; - if (codec == "PCM") - list << "quality" << "channels" << "samplerate"; - return list; -} - -QVariant S60AudioEncoderControl::encodingOption(const QString &codec, const QString &name) const -{ - DP0("S60AudioEncoderControl::encodingOption"); - - if (codec == "PCM") { - QAudioFormat fmt = m_session->format(); - - if(qstrcmp(name.toLocal8Bit().constData(), "quality") == 0) { - return QVariant(quality()); - } - else if(qstrcmp(name.toLocal8Bit().constData(), "channels") == 0) { - return QVariant(fmt.channels()); - } - else if(qstrcmp(name.toLocal8Bit().constData(), "samplerate") == 0) { - return QVariant(fmt.frequency()); - } - } - return QVariant(); -} - -void S60AudioEncoderControl::setEncodingOption( - const QString &codec, const QString &name, const QVariant &value) -{ - DP0("S60AudioEncoderControl::setEncodingOption +++"); - - if (codec == "PCM") { - QAudioFormat fmt = m_session->format(); - - if(qstrcmp(name.toLocal8Bit().constData(), "quality") == 0) { - setQuality((QtMultimediaKit::EncodingQuality)value.toInt(), fmt); - } else if(qstrcmp(name.toLocal8Bit().constData(), "channels") == 0) { - fmt.setChannels(value.toInt()); - } else if(qstrcmp(name.toLocal8Bit().constData(), "samplerate") == 0) { - fmt.setFrequency(value.toInt()); - } - m_session->setFormat(fmt); - } - - DP0("S60AudioEncoderControl::setEncodingOption ---"); -} - -QList<int> S60AudioEncoderControl::supportedSampleRates(const QAudioEncoderSettings &settings, bool *continuous) const -{ - DP0("S60AudioEncoderControl::supportedSampleRates"); - - if (continuous) - *continuous = false; - - return m_session->supportedAudioSampleRates(settings); -} - -QAudioEncoderSettings S60AudioEncoderControl::audioSettings() const -{ - DP0("S60AudioEncoderControl::audioSettings"); - - return m_settings; -} - -void S60AudioEncoderControl::setAudioSettings(const QAudioEncoderSettings &settings) -{ - DP0("S60AudioEncoderControl::setAudioSettings +++"); - - QAudioFormat fmt = m_session->format(); - if (settings.encodingMode() == QtMultimediaKit::ConstantQualityEncoding) { - fmt.setCodec(settings.codec()); - setQuality(settings.quality(), fmt); - if (settings.sampleRate() > 0) { - fmt.setFrequency(settings.sampleRate()); - } - if (settings.channelCount() > 0) - fmt.setChannels(settings.channelCount()); - }else { - if (settings.sampleRate() == 8000) { - fmt.setSampleType(QAudioFormat::UnSignedInt); - fmt.setSampleSize(8); - } else { - fmt.setSampleType(QAudioFormat::SignedInt); - fmt.setSampleSize(16); - } - fmt.setCodec(settings.codec()); - fmt.setFrequency(settings.sampleRate()); - fmt.setChannels(settings.channelCount()); - } - m_session->setFormat(fmt); - m_session->setEncoderSettings(settings); - m_settings = settings; - - DP0("S60AudioEncoderControl::setAudioSettings ---"); -} diff --git a/src/plugins/symbian/mmf/audiosource/s60audioencodercontrol.h b/src/plugins/symbian/mmf/audiosource/s60audioencodercontrol.h deleted file mode 100644 index df44b498d..000000000 --- a/src/plugins/symbian/mmf/audiosource/s60audioencodercontrol.h +++ /dev/null @@ -1,82 +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 Qt Mobility Components. -** -** $QT_BEGIN_LICENSE:LGPL$ -** GNU Lesser General Public License Usage -** 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. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU General -** Public License version 3.0 as published by the Free Software Foundation -** and appearing in the file LICENSE.GPL included in the packaging of this -** file. Please review the following information to ensure the GNU General -** Public License version 3.0 requirements will be met: -** http://www.gnu.org/copyleft/gpl.html. -** -** Other Usage -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef AUDIOENCODERCONTROL_H -#define AUDIOENCODERCONTROL_H - -#include <qaudioencodercontrol.h> -#include <QtCore/qstringlist.h> -#include "qaudioformat.h" - -QT_USE_NAMESPACE - -class S60AudioCaptureSession; - -class S60AudioEncoderControl : public QAudioEncoderControl -{ - Q_OBJECT -public: - S60AudioEncoderControl(QObject *session, QObject *parent = 0); - virtual ~S60AudioEncoderControl(); - - QStringList supportedAudioCodecs() const; - QString codecDescription(const QString &codecName) const; - - QList<int> supportedSampleRates(const QAudioEncoderSettings &settings, bool *continuous = 0) const; - - QAudioEncoderSettings audioSettings() const; - void setAudioSettings(const QAudioEncoderSettings&); - - QStringList supportedEncodingOptions(const QString &codec) const; - QVariant encodingOption(const QString &codec, const QString &name) const; - void setEncodingOption(const QString &codec, const QString &name, const QVariant &value); - -private: - QtMultimediaKit::EncodingQuality quality() const; - void setQuality(QtMultimediaKit::EncodingQuality, QAudioFormat &format); - -private: - S60AudioCaptureSession* m_session; - QAudioEncoderSettings m_settings; - QtMultimediaKit::EncodingQuality m_quality; -}; - -#endif diff --git a/src/plugins/symbian/mmf/audiosource/s60audioendpointselector.cpp b/src/plugins/symbian/mmf/audiosource/s60audioendpointselector.cpp deleted file mode 100644 index 3a2fcc32a..000000000 --- a/src/plugins/symbian/mmf/audiosource/s60audioendpointselector.cpp +++ /dev/null @@ -1,100 +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 Qt Mobility Components. -** -** $QT_BEGIN_LICENSE:LGPL$ -** GNU Lesser General Public License Usage -** 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. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU General -** Public License version 3.0 as published by the Free Software Foundation -** and appearing in the file LICENSE.GPL included in the packaging of this -** file. Please review the following information to ensure the GNU General -** Public License version 3.0 requirements will be met: -** http://www.gnu.org/copyleft/gpl.html. -** -** Other Usage -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "DebugMacros.h" - -#include "s60audiocapturesession.h" -#include "s60audioendpointselector.h" - -#include <qaudiodeviceinfo.h> - -S60AudioEndpointSelector::S60AudioEndpointSelector(QObject *session, QObject *parent) - :QAudioEndpointSelector(parent) -{ - DP0("S60AudioEndpointSelector::S60AudioEndpointSelector +++"); - m_session = qobject_cast<S60AudioCaptureSession*>(session); - - connect(m_session, SIGNAL(activeEndpointChanged(const QString &)), this, SIGNAL(activeEndpointChanged(const QString &))); - - DP0("S60AudioEndpointSelector::S60AudioEndpointSelector ---"); -} - -S60AudioEndpointSelector::~S60AudioEndpointSelector() -{ - DP0("S60AudioEndpointSelector::~S60AudioEndpointSelector +++"); - - DP0("S60AudioEndpointSelector::~S60AudioEndpointSelector ---"); -} - -QList<QString> S60AudioEndpointSelector::availableEndpoints() const -{ - DP0("S60AudioEndpointSelector::availableEndpoints"); - - return m_session->availableEndpoints(); -} - -QString S60AudioEndpointSelector::endpointDescription(const QString& name) const -{ - DP0("S60AudioEndpointSelector::endpointDescription"); - - return m_session->endpointDescription(name); -} - -QString S60AudioEndpointSelector::defaultEndpoint() const -{ - DP0("S60AudioEndpointSelector::defaultEndpoint"); - - return m_session->defaultEndpoint(); -} - -QString S60AudioEndpointSelector::activeEndpoint() const -{ - DP0("S60AudioEndpointSelector::activeEndpoint"); - - return m_session->activeEndpoint(); -} - -void S60AudioEndpointSelector::setActiveEndpoint(const QString& name) -{ - DP0("S60AudioEndpointSelector::setActiveEndpoint +++"); - m_session->setActiveEndpoint(name); - DP0("S60AudioEndpointSelector::setActiveEndpoint ---"); -} diff --git a/src/plugins/symbian/mmf/audiosource/s60audioendpointselector.h b/src/plugins/symbian/mmf/audiosource/s60audioendpointselector.h deleted file mode 100644 index f9668108b..000000000 --- a/src/plugins/symbian/mmf/audiosource/s60audioendpointselector.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 Qt Mobility Components. -** -** $QT_BEGIN_LICENSE:LGPL$ -** GNU Lesser General Public License Usage -** 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. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU General -** Public License version 3.0 as published by the Free Software Foundation -** and appearing in the file LICENSE.GPL included in the packaging of this -** file. Please review the following information to ensure the GNU General -** Public License version 3.0 requirements will be met: -** http://www.gnu.org/copyleft/gpl.html. -** -** Other Usage -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef S60AUDIOENDPOINTSELECTOR_H -#define S60AUDIOENDPOINTSELECTOR_H - -#include <QStringList> - -#include <qaudioendpointselector.h> - -QT_USE_NAMESPACE - -class S60AudioCaptureSession; - -class S60AudioEndpointSelector : public QAudioEndpointSelector -{ - -Q_OBJECT - -public: - S60AudioEndpointSelector(QObject *session, QObject *parent = 0); - ~S60AudioEndpointSelector(); - - QList<QString> availableEndpoints() const; - QString endpointDescription(const QString& name) const; - QString defaultEndpoint() const; - QString activeEndpoint() const; - - -public Q_SLOTS: - void setActiveEndpoint(const QString& name); - -private: - - S60AudioCaptureSession* m_session; -}; - -#endif // S60AUDIOENDPOINTSELECTOR_H diff --git a/src/plugins/symbian/mmf/audiosource/s60audiomediarecordercontrol.cpp b/src/plugins/symbian/mmf/audiosource/s60audiomediarecordercontrol.cpp deleted file mode 100644 index 8f89154f3..000000000 --- a/src/plugins/symbian/mmf/audiosource/s60audiomediarecordercontrol.cpp +++ /dev/null @@ -1,180 +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 Qt Mobility Components. -** -** $QT_BEGIN_LICENSE:LGPL$ -** GNU Lesser General Public License Usage -** 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. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU General -** Public License version 3.0 as published by the Free Software Foundation -** and appearing in the file LICENSE.GPL included in the packaging of this -** file. Please review the following information to ensure the GNU General -** Public License version 3.0 requirements will be met: -** http://www.gnu.org/copyleft/gpl.html. -** -** Other Usage -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "DebugMacros.h" - -#include "s60audiomediarecordercontrol.h" -#include "s60audiocapturesession.h" - -#include <QtCore/qdebug.h> - -S60AudioMediaRecorderControl::S60AudioMediaRecorderControl(QObject *session, QObject *parent) - :QMediaRecorderControl(parent), m_state(QMediaRecorder::StoppedState) -{ - DP0("S60AudioMediaRecorderControl::S60AudioMediaRecorderControl +++"); - - m_session = qobject_cast<S60AudioCaptureSession*>(session); - connect(m_session, SIGNAL(positionChanged(qint64)), this, SIGNAL(durationChanged(qint64))); - connect(m_session, SIGNAL(stateChanged(S60AudioCaptureSession::TAudioCaptureState)), this, SLOT(updateState(S60AudioCaptureSession::TAudioCaptureState))); - connect(m_session,SIGNAL(error(int,const QString &)),this,SIGNAL(error(int,const QString &))); - - DP0("S60AudioMediaRecorderControl::S60AudioMediaRecorderControl ---"); -} - -S60AudioMediaRecorderControl::~S60AudioMediaRecorderControl() -{ - DP0("S60AudioMediaRecorderControl::~S60AudioMediaRecorderControl +++"); - - DP0("S60AudioMediaRecorderControl::~S60AudioMediaRecorderControl - - "); -} - -QUrl S60AudioMediaRecorderControl::outputLocation() const -{ - DP0("S60AudioMediaRecorderControl::outputLocation"); - - return m_session->outputLocation(); -} - -bool S60AudioMediaRecorderControl::setOutputLocation(const QUrl& sink) -{ - DP0("S60AudioMediaRecorderControl::setOutputLocation"); - - return m_session->setOutputLocation(sink); -} - -QMediaRecorder::State S60AudioMediaRecorderControl::convertState(S60AudioCaptureSession::TAudioCaptureState aState) const -{ - DP0("S60AudioMediaRecorderControl::convertState +++"); - - QMediaRecorder::State state = QMediaRecorder::StoppedState;; - switch (aState) { - case S60AudioCaptureSession::ERecording: - state = QMediaRecorder::RecordingState; - break; - case S60AudioCaptureSession::EPaused: - state = QMediaRecorder::PausedState; - break; - case S60AudioCaptureSession::ERecordComplete: - case S60AudioCaptureSession::ENotInitialized: - case S60AudioCaptureSession::EOpenCompelete: - case S60AudioCaptureSession::EInitialized: - state = QMediaRecorder::StoppedState; - break; - } - - DP1("S60AudioMediaRecorderControl::convertState:", state); - - DP0("S60AudioMediaRecorderControl::convertState ---"); - - return state; -} - -void S60AudioMediaRecorderControl::updateState(S60AudioCaptureSession::TAudioCaptureState aState) -{ - DP0("S60AudioMediaRecorderControl::updateState +++"); - - QMediaRecorder::State newState = convertState(aState); - if (m_state != newState) { - m_state = newState; - emit stateChanged(m_state); - } - - DP0("S60AudioMediaRecorderControl::updateState ---"); -} - -QMediaRecorder::State S60AudioMediaRecorderControl::state() const -{ - DP0("S60AudioMediaRecorderControl::state"); - - return m_state; -} - -qint64 S60AudioMediaRecorderControl::duration() const -{ - // DP0("S60AudioMediaRecorderControl::duration +++"); - - return m_session->position(); -} - -void S60AudioMediaRecorderControl::record() -{ - DP0("S60AudioMediaRecorderControl::record +++"); - - m_session->record(); - - DP0("S60AudioMediaRecorderControl::record ---"); -} - -void S60AudioMediaRecorderControl::pause() -{ - DP0("S60AudioMediaRecorderControl::pause +++"); - - m_session->pause(); - - DP0("S60AudioMediaRecorderControl::pause ---"); -} - -void S60AudioMediaRecorderControl::stop() -{ - DP0("S60AudioMediaRecorderControl::stop +++"); - - m_session->stop(); - - DP0("S60AudioMediaRecorderControl::stop ---"); -} - -bool S60AudioMediaRecorderControl::isMuted() const -{ - DP0("S60AudioMediaRecorderControl::isMuted"); - - return m_session->muted(); -} - -void S60AudioMediaRecorderControl::setMuted(bool muted) -{ - DP0("S60AudioMediaRecorderControl::setMuted +++"); - - DP1("S60AudioMediaRecorderControl::setMuted:", muted); - - m_session->mute(muted); - - DP0("S60AudioMediaRecorderControl::setMuted +++"); -} diff --git a/src/plugins/symbian/mmf/audiosource/s60audiomediarecordercontrol.h b/src/plugins/symbian/mmf/audiosource/s60audiomediarecordercontrol.h deleted file mode 100644 index 1312050ca..000000000 --- a/src/plugins/symbian/mmf/audiosource/s60audiomediarecordercontrol.h +++ /dev/null @@ -1,92 +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 Qt Mobility Components. -** -** $QT_BEGIN_LICENSE:LGPL$ -** GNU Lesser General Public License Usage -** 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. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU General -** Public License version 3.0 as published by the Free Software Foundation -** and appearing in the file LICENSE.GPL included in the packaging of this -** file. Please review the following information to ensure the GNU General -** Public License version 3.0 requirements will be met: -** http://www.gnu.org/copyleft/gpl.html. -** -** Other Usage -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef S60AUDIOMEDIARECORDERCONTROL_H -#define S60AUDIOMEDIARECORDERCONTROL_H - -#include <QtCore/qobject.h> -#include <QUrl> - -#include "qmediarecorder.h" -#include "qmediarecordercontrol.h" - -#include "s60audiocapturesession.h" - -QT_USE_NAMESPACE - -//class S60AudioCaptureSession; - -class S60AudioMediaRecorderControl : public QMediaRecorderControl -{ - Q_OBJECT -public: - S60AudioMediaRecorderControl(QObject *session,QObject *parent = 0); - ~S60AudioMediaRecorderControl(); - - QUrl outputLocation() const; - bool setOutputLocation(const QUrl &sink); - - QMediaRecorder::State state() const; - - qint64 duration() const; - - bool isMuted() const; - - void applySettings() {} - -private: - QMediaRecorder::State convertState(S60AudioCaptureSession::TAudioCaptureState aState) const; - -public slots: - void record(); - void pause(); - void stop(); - void setMuted(bool); - -private slots: - void updateState(S60AudioCaptureSession::TAudioCaptureState aState); - -private: - S60AudioCaptureSession* m_session; - QMediaRecorder::State m_state; -}; - -#endif |