sl@0: // Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies). sl@0: // All rights reserved. sl@0: // This component and the accompanying materials are made available sl@0: // under the terms of "Eclipse Public License v1.0" sl@0: // which accompanies this distribution, and is available sl@0: // at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: // sl@0: // Initial Contributors: sl@0: // Nokia Corporation - initial contribution. sl@0: // sl@0: // Contributors: sl@0: // sl@0: // Description: sl@0: // sl@0: sl@0: sl@0: sl@0: sl@0: // INCLUDE FILES sl@0: #include "mmfdevsoundadaptation.h" sl@0: #include "mmfdevsoundadaptationbody.h" sl@0: sl@0: // ============================ MEMBER FUNCTIONS =============================== sl@0: sl@0: // ----------------------------------------------------------------------------- sl@0: // CMMFDevSoundAdaptation::CMMFDevSoundAdaptation sl@0: // C++ default constructor can NOT contain any code, that sl@0: // might leave. sl@0: // ----------------------------------------------------------------------------- sl@0: // sl@0: CMMFDevSoundAdaptation::CMMFDevSoundAdaptation() sl@0: { sl@0: TRACE_CREATE(); sl@0: DP_CONTEXT(CMMFDevSoundAdaptation::CMMFDevSoundAdaptation *CD1*, CtxDevSound, DPLOCAL); sl@0: DP_IN(); sl@0: PRF_HEAP_STATUS(PRF_MEM, HEAP_DS_Session); sl@0: DP_OUT(); sl@0: } sl@0: sl@0: // ----------------------------------------------------------------------------- sl@0: // CMMFDevSoundAdaptation::ConstructL sl@0: // Symbian 2nd phase constructor can leave. sl@0: // ----------------------------------------------------------------------------- sl@0: void CMMFDevSoundAdaptation::ConstructL(MDevSoundAdaptationObserver& aDevSoundObserver, sl@0: MGlobalProperties& aGlobalProperties) sl@0: { sl@0: DP_CONTEXT(CMMFDevSoundAdaptation::ConstructL *CD1*, CtxDevSound, DPLOCAL); sl@0: DP_IN(); sl@0: iBody = CBody::NewL(aDevSoundObserver, aGlobalProperties); sl@0: DP_OUT(); sl@0: } sl@0: sl@0: // ----------------------------------------------------------------------------- sl@0: // CMMFDevSoundAdaptation::NewL sl@0: // Two-phased constructor. sl@0: // ----------------------------------------------------------------------------- sl@0: // sl@0: EXPORT_C CMMFDevSoundAdaptation* CMMFDevSoundAdaptation::NewL(MDevSoundAdaptationObserver& aDevSoundObserver, sl@0: MGlobalProperties& aGlobalProperties) sl@0: { sl@0: DP_STATIC_CONTEXT(CMMFDevSoundAdaptation::NewL *CD0*, CtxDevSound, DPLOCAL); sl@0: DP_IN(); sl@0: CMMFDevSoundAdaptation* self = new (ELeave)CMMFDevSoundAdaptation(); sl@0: CleanupStack::PushL(self); sl@0: self->ConstructL(aDevSoundObserver, aGlobalProperties); sl@0: CleanupStack::Pop(self); sl@0: DP0_RET(self, "0x%x"); sl@0: } sl@0: sl@0: // ----------------------------------------------------------------------------- sl@0: // CMMFDevSoundAdaptation::ConstructL sl@0: // Destructor sl@0: // ----------------------------------------------------------------------------- sl@0: // sl@0: EXPORT_C CMMFDevSoundAdaptation::~CMMFDevSoundAdaptation() sl@0: { sl@0: DP_CONTEXT(CMMFDevSoundAdaptation::~CMMFDevSoundAdaptation *CD1*, CtxDevSound, DPLOCAL); sl@0: DP_IN(); sl@0: delete iBody; sl@0: PRF_HEAP_STATUS(PRF_MEM, HEAP_DS_Session); sl@0: DP_OUT(); sl@0: } sl@0: sl@0: // PostOpenL() - asynchronous 2nd-phase open operation sl@0: EXPORT_C void CMMFDevSoundAdaptation::PostOpenL() sl@0: { sl@0: DP_CONTEXT(CMMFDevSoundAdaptation::PostOpenL *CD1*, CtxDevSound, DPLOCAL); sl@0: DP_IN(); sl@0: iBody->PostOpenL(); sl@0: DP_OUT(); sl@0: } sl@0: sl@0: // ----------------------------------------------------------------------------- sl@0: // CMMFDevSoundAdaptation::InitializeL sl@0: // Initializes CMMFDevSoundProxy object to play and record PCM16 raw audio data sl@0: // with sampling rate of 8 KHz.On completion of Initialization, calls sl@0: // InitializeComplete() on aDevSoundObserver. sl@0: // Leaves on failure. sl@0: // (other items were commented in a header). sl@0: // ----------------------------------------------------------------------------- sl@0: // sl@0: EXPORT_C void CMMFDevSoundAdaptation::InitializeL(TMMFState aMode) sl@0: { sl@0: DP_CONTEXT(CMMFDevSoundAdaptation::InitializeL *CD1*, CtxDevSound, DPLOCAL); sl@0: DP_IN(); sl@0: iBody->InitializeL(aMode); sl@0: DP_OUT(); sl@0: } sl@0: sl@0: // ----------------------------------------------------------------------------- sl@0: // CMMFDevSoundAdaptation::InitializeL sl@0: // Initializes DevSound object for the mode aMode for processing audio data sl@0: // with hardware device aHWDev. On completion of Initialization, the observer sl@0: // will be notified via call back InitializeComplete(). sl@0: // Leaves on failure. sl@0: // (other items were commented in a header). sl@0: // ----------------------------------------------------------------------------- sl@0: // sl@0: EXPORT_C void CMMFDevSoundAdaptation::InitializeL(TUid aHWDev, sl@0: TMMFState aMode) sl@0: { sl@0: DP_CONTEXT(CMMFDevSoundAdaptation::InitializeL *CD1*, CtxDevSound, DPLOCAL); sl@0: DP_IN(); sl@0: iBody->InitializeL(aHWDev, aMode); sl@0: DP_OUT(); sl@0: } sl@0: sl@0: // ----------------------------------------------------------------------------- sl@0: // CMMFDevSoundAdaptation::InitializeL sl@0: // Initializes DevSound object for the mode aMode for processing audio data sl@0: // with hardware device supporting FourCC aDesiredFourCC. On completion of sl@0: // Initialization, the observer will be notified via callback sl@0: // InitializeComplete(). sl@0: // Leaves on failure. sl@0: // (other items were commented in a header). sl@0: // ----------------------------------------------------------------------------- sl@0: // sl@0: EXPORT_C void CMMFDevSoundAdaptation::InitializeL(TFourCC aDesiredFourCC, sl@0: TMMFState aMode) sl@0: { sl@0: DP_CONTEXT(CMMFDevSoundAdaptation::InitializeL *CD1*, CtxDevSound, DPLOCAL); sl@0: DP_IN(); sl@0: iBody->InitializeL(aDesiredFourCC, aMode); sl@0: DP_OUT(); sl@0: } sl@0: sl@0: // ----------------------------------------------------------------------------- sl@0: // CMMFDevSoundAdaptation::CancelInitialize sl@0: // Cancels the initialization of DevSound object sl@0: // returns an error code sl@0: // (other items were commented in a header). sl@0: // ----------------------------------------------------------------------------- sl@0: // sl@0: EXPORT_C TInt CMMFDevSoundAdaptation::CancelInitialize() sl@0: { sl@0: DP_CONTEXT(CMMFDevSoundAdaptation::CancelInitialize *CD1*, CtxDevSound, DPLOCAL); sl@0: DP_IN(); sl@0: TInt retVal = iBody->CancelInitialize(); sl@0: DP0_RET(retVal, "%d"); sl@0: } sl@0: sl@0: // ----------------------------------------------------------------------------- sl@0: // CMMFDevSoundAdaptation::Capabilities sl@0: // Returns the supported Audio settings. sl@0: // (other items were commented in a header). sl@0: // ----------------------------------------------------------------------------- sl@0: // sl@0: EXPORT_C TInt CMMFDevSoundAdaptation::Capabilities(TMMFCapabilities& aCap) sl@0: { sl@0: DP_CONTEXT(CMMFDevSoundAdaptation::Capabilities *CD1*, CtxDevSound, DPLOCAL); sl@0: DP_IN(); sl@0: TInt retVal = iBody->Capabilities(aCap); sl@0: DP0_RET(retVal, "%d"); sl@0: } sl@0: sl@0: // ----------------------------------------------------------------------------- sl@0: // CMMFDevSoundAdaptation::Config sl@0: // Returns the current audio settings. sl@0: // (other items were commented in a header). sl@0: // ----------------------------------------------------------------------------- sl@0: // sl@0: EXPORT_C TMMFCapabilities CMMFDevSoundAdaptation::Config() const sl@0: { sl@0: DP_CONTEXT(CMMFDevSoundAdaptation::Config *CD1*, CtxDevSound, DPLOCAL); sl@0: DP_IN(); sl@0: TMMFCapabilities retVal = iBody->Config(); sl@0: DP0_RET(retVal, "%d"); sl@0: } sl@0: sl@0: // ----------------------------------------------------------------------------- sl@0: // CMMFDevSoundAdaptation::SetConfigL sl@0: // Configure CMMFDevSoundProxy object for the settings in aConfig. sl@0: // Use this to set sampling rate, Encoding and Mono/Stereo. sl@0: // As part of defect 20796, the iRecordFormat has been set under the iPlayFormat, sl@0: // before it was not set at all. sl@0: // (other items were commented in a header). sl@0: // ----------------------------------------------------------------------------- sl@0: // sl@0: EXPORT_C void CMMFDevSoundAdaptation::SetConfigL( sl@0: const TMMFCapabilities& aConfig) sl@0: { sl@0: DP_CONTEXT(CMMFDevSoundAdaptation::SetConfigL *CD1*, CtxDevSound, DPLOCAL); sl@0: DP_IN(); sl@0: iBody->SetConfigL(aConfig); sl@0: DP_OUT(); sl@0: } sl@0: sl@0: // ----------------------------------------------------------------------------- sl@0: // CMMFDevSoundAdaptation::MaxVolume sl@0: // Returns an integer representing the maximum volume. sl@0: // This is the maximum value which can be passed to CMMFDevSoundProxy::SetVolume. sl@0: // (other items were commented in a header). sl@0: // ----------------------------------------------------------------------------- sl@0: // sl@0: EXPORT_C TInt CMMFDevSoundAdaptation::MaxVolume() sl@0: { sl@0: DP_CONTEXT(CMMFDevSoundAdaptation::MaxVolume *CD1*, CtxDevSound, DPLOCAL); sl@0: DP_IN(); sl@0: TInt retVal = iBody->MaxVolume(); sl@0: DP0_RET(retVal, "%d"); sl@0: } sl@0: sl@0: // ----------------------------------------------------------------------------- sl@0: // CMMFDevSoundAdaptation::Volume sl@0: // Returns an integer representing the current volume. sl@0: // (other items were commented in a header). sl@0: // ----------------------------------------------------------------------------- sl@0: // sl@0: EXPORT_C TInt CMMFDevSoundAdaptation::Volume() sl@0: { sl@0: DP_CONTEXT(CMMFDevSoundAdaptation::Volume *CD1*, CtxDevSound, DPLOCAL); sl@0: DP_IN(); sl@0: TInt retVal = iBody->Volume(); sl@0: DP0_RET(retVal, "%d"); sl@0: } sl@0: sl@0: // ----------------------------------------------------------------------------- sl@0: // CMMFDevSoundAdaptation::SetVolume sl@0: // Changes the current playback volume to a specified value. sl@0: // The volume can be changed before or during playback and is effective sl@0: // immediately. sl@0: // (other items were commented in a header). sl@0: // ----------------------------------------------------------------------------- sl@0: // sl@0: EXPORT_C TInt CMMFDevSoundAdaptation::SetVolume(TInt aVolume, TBool& aAsyncCompletion) sl@0: { sl@0: DP_CONTEXT(CMMFDevSoundAdaptation::SetVolume *CD1*, CtxDevSound, DPLOCAL); sl@0: DP_IN(); sl@0: TInt error = iBody->SetVolume(aVolume, aAsyncCompletion); sl@0: DP0_RET(error, "%d"); sl@0: } sl@0: sl@0: // ----------------------------------------------------------------------------- sl@0: // CMMFDevSoundAdaptation::MaxGain sl@0: // Returns an integer representing the maximum gain. sl@0: // This is the maximum value which can be passed to CMMFDevSoundProxy::SetGain. sl@0: // (other items were commented in a header). sl@0: // ----------------------------------------------------------------------------- sl@0: // sl@0: EXPORT_C TInt CMMFDevSoundAdaptation::MaxGain() sl@0: { sl@0: DP_CONTEXT(CMMFDevSoundAdaptation::MaxGain *CD1*, CtxDevSound, DPLOCAL); sl@0: DP_IN(); sl@0: TInt retVal = iBody->MaxGain(); sl@0: DP0_RET(retVal, "%d"); sl@0: } sl@0: sl@0: // ----------------------------------------------------------------------------- sl@0: // CMMFDevSoundAdaptation::Gain sl@0: // Returns an integer representing the current gain. sl@0: // (other items were commented in a header). sl@0: // ----------------------------------------------------------------------------- sl@0: // sl@0: EXPORT_C TInt CMMFDevSoundAdaptation::Gain() sl@0: { sl@0: DP_CONTEXT(CMMFDevSoundAdaptation::Gain *CD1*, CtxDevSound, DPLOCAL); sl@0: DP_IN(); sl@0: TInt retVal = iBody->Gain(); sl@0: DP0_RET(retVal, "%d"); sl@0: } sl@0: sl@0: // ----------------------------------------------------------------------------- sl@0: // CMMFDevSoundAdaptation::SetGain sl@0: // Changes the current recording gain to a specified value. sl@0: // The gain can be changed before or during recording and is effective sl@0: // immediately. sl@0: // (other items were commented in a header). sl@0: // ----------------------------------------------------------------------------- sl@0: // sl@0: EXPORT_C TInt CMMFDevSoundAdaptation::SetGain(TInt aGain, TBool& aAsyncCompletion) sl@0: { sl@0: DP_CONTEXT(CMMFDevSoundAdaptation::SetGain *CD1*, CtxDevSound, DPLOCAL); sl@0: DP_IN(); sl@0: TInt error = iBody->SetGain(aGain, aAsyncCompletion); sl@0: DP0_RET(error, "%d"); sl@0: } sl@0: sl@0: // ----------------------------------------------------------------------------- sl@0: // CMMFDevSoundAdaptation::GetPlayBalanceL sl@0: // Returns the speaker balance set for playing. sl@0: // Leaves on failure. sl@0: // (other items were commented in a header). sl@0: // ----------------------------------------------------------------------------- sl@0: // sl@0: EXPORT_C void CMMFDevSoundAdaptation::GetPlayBalanceL( sl@0: TInt& aLeftPercentage, sl@0: TInt& aRightPercentage) sl@0: { sl@0: DP_CONTEXT(CMMFDevSoundAdaptation::GetPlayBalanceL *CD1*, CtxDevSound, DPLOCAL); sl@0: DP_IN(); sl@0: iBody->GetPlayBalanceL(aLeftPercentage, aRightPercentage); sl@0: DP_OUT(); sl@0: } sl@0: sl@0: // ----------------------------------------------------------------------------- sl@0: // CMMFDevSoundAdaptation::SetPlayBalanceL sl@0: // Sets the speaker balance for playing. The speaker balance can be changed sl@0: // before or during playback and is effective immediately. sl@0: // (other items were commented in a header). sl@0: // ----------------------------------------------------------------------------- sl@0: // sl@0: EXPORT_C void CMMFDevSoundAdaptation::SetPlayBalanceL( sl@0: TInt aLeftPercentage, sl@0: TInt aRightPercentage, sl@0: TBool& aAsyncCompletion) sl@0: { sl@0: DP_CONTEXT(CMMFDevSoundAdaptation::SetPlayBalanceL *CD1*, CtxDevSound, DPLOCAL); sl@0: DP_IN(); sl@0: iBody->SetPlayBalanceL(aLeftPercentage, aRightPercentage, aAsyncCompletion); sl@0: DP_OUT(); sl@0: } sl@0: sl@0: // ----------------------------------------------------------------------------- sl@0: // CMMFDevSoundAdaptation::GetRecordBalanceL sl@0: // Returns the microphone gain balance set for recording. sl@0: // Leaves on failure. sl@0: // (other items were commented in a header). sl@0: // ----------------------------------------------------------------------------- sl@0: // sl@0: EXPORT_C void CMMFDevSoundAdaptation::GetRecordBalanceL( sl@0: TInt& aLeftPercentage, sl@0: TInt& aRightPercentage) sl@0: { sl@0: DP_CONTEXT(CMMFDevSoundAdaptation::GetRecordBalanceL *CD1*, CtxDevSound, DPLOCAL); sl@0: DP_IN(); sl@0: iBody->GetRecordBalanceL(aLeftPercentage, aRightPercentage); sl@0: DP_OUT(); sl@0: } sl@0: sl@0: // ----------------------------------------------------------------------------- sl@0: // CMMFDevSoundAdaptation::SetRecordBalanceL sl@0: // Sets the microphone gain balance for recording. sl@0: // The microphone gain balance can be changed before or during recording and sl@0: // is effective immediately. sl@0: // (other items were commented in a header). sl@0: // ----------------------------------------------------------------------------- sl@0: // sl@0: EXPORT_C void CMMFDevSoundAdaptation::SetRecordBalanceL( sl@0: TInt aLeftPercentage, sl@0: TInt aRightPercentage, sl@0: TBool& aAsyncCompletion) sl@0: { sl@0: DP_CONTEXT(CMMFDevSoundAdaptation::SetRecordBalanceL *CD1*, CtxDevSound, DPLOCAL); sl@0: DP_IN(); sl@0: iBody->SetRecordBalanceL(aLeftPercentage, aRightPercentage, aAsyncCompletion); sl@0: DP_OUT(); sl@0: } sl@0: sl@0: // ----------------------------------------------------------------------------- sl@0: // CMMFDevSoundAdaptation::PlayInitL sl@0: // Initializes audio device and start play process. This method queries and sl@0: // acquires the audio policy before initializing audio device. If there was an sl@0: // error during policy initialization, PlayError() method will be called on sl@0: // the observer with error code KErrAccessDenied, otherwise BufferToBeFilled() sl@0: // method will be called with a buffer reference. After reading data into the sl@0: // buffer reference passed, the client should call PlayData() to play data. sl@0: // sl@0: // The amount of data that can be played is specified in sl@0: // CMMFBuffer::RequestSize(). Any data that is read into buffer beyond this sl@0: // size will be ignored. sl@0: // sl@0: // Leaves on failure. sl@0: // (other items were commented in a header). sl@0: // ----------------------------------------------------------------------------- sl@0: // sl@0: EXPORT_C void CMMFDevSoundAdaptation::PlayInitL() sl@0: { sl@0: DP_CONTEXT(CMMFDevSoundAdaptation::PlayInitL *CD1*, CtxDevSound, DPLOCAL); sl@0: DP_IN(); sl@0: iBody->PlayInitL(); sl@0: DP_OUT(); sl@0: } sl@0: sl@0: // ----------------------------------------------------------------------------- sl@0: // CMMFDevSoundAdaptation::RecordInitL sl@0: // Initializes audio device and start record process. This method queries and sl@0: // acquires the audio policy before initializing audio device. If there was an sl@0: // error during policy initialization, RecordError() method will be called on sl@0: // the observer with error code KErrAccessDenied, otherwise BufferToBeEmptied() sl@0: // method will be called with a buffer reference. This buffer contains recorded sl@0: // or encoded data. After processing data in the buffer reference passed, the sl@0: // client should call RecordData() to continue recording process. sl@0: // sl@0: // The amount of data that is available is specified in sl@0: // CMMFBuffer::RequestSize(). sl@0: // sl@0: // Leaves on failure. sl@0: // (other items were commented in a header). sl@0: // ----------------------------------------------------------------------------- sl@0: // sl@0: EXPORT_C void CMMFDevSoundAdaptation::RecordInitL() sl@0: { sl@0: DP_CONTEXT(CMMFDevSoundAdaptation::RecordInitL *CD1*, CtxDevSound, DPLOCAL); sl@0: DP_IN(); sl@0: iBody->RecordInitL(); sl@0: DP_OUT(); sl@0: } sl@0: sl@0: // ----------------------------------------------------------------------------- sl@0: // CMMFDevSoundAdaptation::PlayData sl@0: // Plays data in the buffer at the current volume. The client should fill sl@0: // the buffer with audio data before calling this method. The Observer gets sl@0: // reference to buffer along with callback BufferToBeFilled(). When playing of sl@0: // the audio sample is complete, successfully or otherwise, the method sl@0: // PlayError() on observer is called. sl@0: // (other items were commented in a header). sl@0: // ----------------------------------------------------------------------------- sl@0: // sl@0: EXPORT_C void CMMFDevSoundAdaptation::PlayData() sl@0: { sl@0: DP_CONTEXT(CMMFDevSoundAdaptation::PlayData *CD1*, CtxDevSound, DPLOCAL); sl@0: DP_IN(); sl@0: iBody->PlayData(); sl@0: DP_OUT(); sl@0: } sl@0: sl@0: // ----------------------------------------------------------------------------- sl@0: // CMMFDevSoundAdaptation::RecordData sl@0: // Contine the process of recording. Once the buffer is filled with recorded sl@0: // data, the Observer gets reference to buffer along with callback sl@0: // BufferToBeEmptied(). After processing the buffer (copying over to a sl@0: // different buffer or writing to file) the client should call this sl@0: // method to continue recording process. sl@0: // (other items were commented in a header). sl@0: // ----------------------------------------------------------------------------- sl@0: // sl@0: EXPORT_C void CMMFDevSoundAdaptation::RecordData() sl@0: { sl@0: DP_CONTEXT(CMMFDevSoundAdaptation::RecordData *CD1*, CtxDevSound, DPLOCAL); sl@0: DP_IN(); sl@0: iBody->RecordData(); sl@0: DP_OUT(); sl@0: } sl@0: sl@0: // ----------------------------------------------------------------------------- sl@0: // CMMFDevSoundAdaptation::Stop sl@0: // Stops the ongoing operation (Play, Record, TonePlay) sl@0: // (other items were commented in a header). sl@0: // ----------------------------------------------------------------------------- sl@0: // sl@0: EXPORT_C TBool CMMFDevSoundAdaptation::Stop() sl@0: { sl@0: DP_CONTEXT(CMMFDevSoundAdaptation::Stop *CD1*, CtxDevSound, DPLOCAL); sl@0: DP_IN(); sl@0: TBool retVal = iBody->Stop(); sl@0: DP0_RET(retVal, "%d"); sl@0: } sl@0: sl@0: // ----------------------------------------------------------------------------- sl@0: // CMMFDevSoundAdaptation::Pause sl@0: // Temporarily Stops the ongoing operation (Play, Record, TonePlay) sl@0: // (other items were commented in a header). sl@0: // ----------------------------------------------------------------------------- sl@0: // sl@0: EXPORT_C TInt CMMFDevSoundAdaptation::Pause() sl@0: { sl@0: DP_CONTEXT(CMMFDevSoundAdaptation::Pause *CD1*, CtxDevSound, DPLOCAL); sl@0: DP_IN(); sl@0: TInt retVal = iBody->Pause(); sl@0: DP0_RET(retVal, "%d"); sl@0: } sl@0: sl@0: // ----------------------------------------------------------------------------- sl@0: // CMMFDevSoundAdaptation::SamplesRecorded sl@0: // Returns the sample recorded so far. sl@0: // (other items were commented in a header). sl@0: // ----------------------------------------------------------------------------- sl@0: // sl@0: EXPORT_C TInt CMMFDevSoundAdaptation::SamplesRecorded() sl@0: { sl@0: DP_CONTEXT(CMMFDevSoundAdaptation::SamplesRecorded *CD1*, CtxDevSound, DPLOCAL); sl@0: DP_IN(); sl@0: TInt retVal = iBody->SamplesRecorded(); sl@0: DP0_RET(retVal, "%d"); sl@0: } sl@0: sl@0: // ----------------------------------------------------------------------------- sl@0: // CMMFDevSoundAdaptation::SamplesPlayed sl@0: // Returns the sample played so far. sl@0: // (other items were commented in a header). sl@0: // ----------------------------------------------------------------------------- sl@0: // sl@0: EXPORT_C TInt CMMFDevSoundAdaptation::SamplesPlayed() sl@0: { sl@0: DP_CONTEXT(CMMFDevSoundAdaptation::SamplesPlayed *CD1*, CtxDevSound, DPLOCAL); sl@0: DP_IN(); sl@0: TInt retVal = iBody->SamplesPlayed(); sl@0: DP0_RET(retVal, "%d"); sl@0: } sl@0: sl@0: // ----------------------------------------------------------------------------- sl@0: // CMMFDevSoundAdaptation::PlayToneL sl@0: // Initializes audio device and start playing tone. Tone is played with sl@0: // frequency and for duration specified. sl@0: // Leaves on failure. sl@0: // (other items were commented in a header). sl@0: // ----------------------------------------------------------------------------- sl@0: // sl@0: EXPORT_C void CMMFDevSoundAdaptation::PlayToneL( sl@0: TInt aFrequency, sl@0: const TTimeIntervalMicroSeconds& aDuration) sl@0: { sl@0: DP_CONTEXT(CMMFDevSoundAdaptation::PlayToneL *CD1*, CtxDevSound, DPLOCAL); sl@0: DP_IN(); sl@0: iBody->PlayToneL(aFrequency, aDuration); sl@0: DP_OUT(); sl@0: } sl@0: sl@0: // ----------------------------------------------------------------------------- sl@0: // CMMFDevSoundAdaptation::PlayDualToneL sl@0: // Initializes audio device and start playing a dual tone. sl@0: // The tone consists of two sine waves of different frequencies summed together sl@0: // Dual Tone is played with specified frequencies and for specified duration. sl@0: // (other items were commented in a header). sl@0: // ----------------------------------------------------------------------------- sl@0: // sl@0: EXPORT_C void CMMFDevSoundAdaptation::PlayDualToneL( sl@0: TInt aFrequencyOne, sl@0: TInt aFrequencyTwo, sl@0: const TTimeIntervalMicroSeconds& aDuration) sl@0: { sl@0: DP_CONTEXT(CMMFDevSoundAdaptation::PlayDualToneL *CD1*, CtxDevSound, DPLOCAL); sl@0: DP_IN(); sl@0: iBody->PlayDualToneL(aFrequencyOne, aFrequencyTwo, aDuration); sl@0: DP_OUT(); sl@0: } sl@0: sl@0: // ----------------------------------------------------------------------------- sl@0: // CMMFDevSoundAdaptation::PlayDTMFStringL sl@0: // Initializes audio device and start playing DTMF string aDTMFString. sl@0: // Leaves on failure. sl@0: // (other items were commented in a header). sl@0: // ----------------------------------------------------------------------------- sl@0: // sl@0: EXPORT_C void CMMFDevSoundAdaptation::PlayDTMFStringL( sl@0: const TDesC& aDTMFString) sl@0: { sl@0: DP_CONTEXT(CMMFDevSoundAdaptation::PlayDTMFStringL *CD1*, CtxDevSound, DPLOCAL); sl@0: DP_IN(); sl@0: iBody->PlayDTMFStringL(aDTMFString); sl@0: DP_OUT(); sl@0: } sl@0: sl@0: // ----------------------------------------------------------------------------- sl@0: // CMMFDevSoundAdaptation::PlayToneSequenceL sl@0: // Initializes audio device and start playing tone sequence. sl@0: // Leaves on failure. sl@0: // (other items were commented in a header). sl@0: // ----------------------------------------------------------------------------- sl@0: // sl@0: EXPORT_C void CMMFDevSoundAdaptation::PlayToneSequenceL( sl@0: const TDesC8& aData) sl@0: { sl@0: DP_CONTEXT(CMMFDevSoundAdaptation::PlayToneSequenceL *CD1*, CtxDevSound, DPLOCAL); sl@0: DP_IN(); sl@0: iBody->PlayToneSequenceL(aData); sl@0: DP_OUT(); sl@0: } sl@0: sl@0: // ----------------------------------------------------------------------------- sl@0: // CMMFDevSoundAdaptation::PlayFixedSequenceL sl@0: // Initializes audio device and start playing the specified pre-defined tone sl@0: // sequence. sl@0: // Leaves on failure. sl@0: // (other items were commented in a header). sl@0: // ----------------------------------------------------------------------------- sl@0: // sl@0: EXPORT_C void CMMFDevSoundAdaptation::PlayFixedSequenceL( sl@0: TInt aSequenceNumber) sl@0: { sl@0: DP_CONTEXT(CMMFDevSoundAdaptation::PlayFixedSequenceL *CD1*, CtxDevSound, DPLOCAL); sl@0: DP_IN(); sl@0: iBody->PlayFixedSequenceL(aSequenceNumber); sl@0: DP_OUT(); sl@0: } sl@0: sl@0: // ----------------------------------------------------------------------------- sl@0: // CMMFDevSoundAdaptation::SetToneRepeats sl@0: // Defines the number of times the audio is to be repeated during the tone sl@0: // playback operation. A period of silence can follow each playing of tone. sl@0: // The tone playing can be repeated indefinitely. sl@0: // (other items were commented in a header). sl@0: // ----------------------------------------------------------------------------- sl@0: // sl@0: EXPORT_C TInt CMMFDevSoundAdaptation::SetToneRepeats( sl@0: TInt aRepeatCount, sl@0: const TTimeIntervalMicroSeconds& aRepeatTrailingSilence) sl@0: { sl@0: DP_CONTEXT(CMMFDevSoundAdaptation::SetToneRepeats *CD1*, CtxDevSound, DPLOCAL); sl@0: DP_IN(); sl@0: TInt retVal = iBody->SetToneRepeats(aRepeatCount, aRepeatTrailingSilence); sl@0: DP0_RET(retVal, "%d"); sl@0: } sl@0: sl@0: // ----------------------------------------------------------------------------- sl@0: // CMMFDevSoundAdaptation::SetDTMFLengths sl@0: // Defines the duration of tone on, tone off and tone pause to be used during the sl@0: // DTMF tone playback operation. sl@0: // Supported only during tone playing. sl@0: // (other items were commented in a header). sl@0: // ----------------------------------------------------------------------------- sl@0: // sl@0: EXPORT_C TInt CMMFDevSoundAdaptation::SetDTMFLengths( sl@0: TTimeIntervalMicroSeconds32& aToneOnLength, sl@0: TTimeIntervalMicroSeconds32& aToneOffLength, sl@0: TTimeIntervalMicroSeconds32& aPauseLength) sl@0: { sl@0: DP_CONTEXT(CMMFDevSoundAdaptation::SetDTMFLengths *CD1*, CtxDevSound, DPLOCAL); sl@0: DP_IN(); sl@0: TInt retVal = iBody->SetDTMFLengths(aToneOnLength, aToneOffLength, aPauseLength); sl@0: DP0_RET(retVal, "%d"); sl@0: } sl@0: sl@0: // ----------------------------------------------------------------------------- sl@0: // CMMFDevSoundAdaptation::SetVolumeRamp sl@0: // Defines the period over which the volume level is to rise smoothly from sl@0: // nothing to the normal volume level. sl@0: // (other items were commented in a header). sl@0: // ----------------------------------------------------------------------------- sl@0: // sl@0: EXPORT_C TInt CMMFDevSoundAdaptation::SetVolumeRamp( sl@0: const TTimeIntervalMicroSeconds& aRampDuration) sl@0: { sl@0: DP_CONTEXT(CMMFDevSoundAdaptation::SetVolumeRamp *CD1*, CtxDevSound, DPLOCAL); sl@0: DP_IN(); sl@0: TInt retVal = iBody->SetVolumeRamp(aRampDuration); sl@0: DP0_RET(retVal, "%d"); sl@0: } sl@0: sl@0: // ----------------------------------------------------------------------------- sl@0: // CMMFDevSoundAdaptation::SetPrioritySettings sl@0: // Defines the priority settings that should be used for this instance. sl@0: // (other items were commented in a header). sl@0: // ----------------------------------------------------------------------------- sl@0: // sl@0: EXPORT_C TInt CMMFDevSoundAdaptation::SetPrioritySettings( sl@0: const TMMFPrioritySettings& aPrioritySettings) sl@0: { sl@0: DP_CONTEXT(CMMFDevSoundAdaptation::SetPrioritySettings *CD1*, CtxDevSound, DPLOCAL); sl@0: DP_IN(); sl@0: TInt retVal = iBody->SetPrioritySettings(aPrioritySettings); sl@0: DP0_RET(retVal, "%d"); sl@0: } sl@0: sl@0: // ----------------------------------------------------------------------------- sl@0: // CMMFDevSoundAdaptation::CustomInterface sl@0: // see sounddevice.h sl@0: // (other items were commented in a header). sl@0: // ----------------------------------------------------------------------------- sl@0: // sl@0: EXPORT_C TAny* CMMFDevSoundAdaptation::CustomInterface( sl@0: TUid aInterfaceId) sl@0: { sl@0: DP_CONTEXT(CMMFDevSoundAdaptation::CustomInterface *CD1*, CtxDevSound, DPLOCAL); sl@0: DP_IN(); sl@0: DP_OUT(); sl@0: // TODO - Need to revisit this to allow for async operation sl@0: TAny* retVal = iBody->CustomInterface(aInterfaceId); sl@0: DP0_RET(retVal, "0x%x"); sl@0: } sl@0: sl@0: // ----------------------------------------------------------------------------- sl@0: // CMMFDevSoundAdaptation::FixedSequenceCount sl@0: // Returns the number of available pre-defined tone sequences. sl@0: // This is the number of fixed sequence supported by DevSound by default. sl@0: // (other items were commented in a header). sl@0: // ----------------------------------------------------------------------------- sl@0: // sl@0: EXPORT_C TInt CMMFDevSoundAdaptation::FixedSequenceCount() sl@0: { sl@0: DP_CONTEXT(CMMFDevSoundAdaptation::FixedSequenceCount *CD1*, CtxDevSound, DPLOCAL); sl@0: DP_IN(); sl@0: TInt retVal = iBody->FixedSequenceCount(); sl@0: DP0_RET(retVal, "%d"); sl@0: } sl@0: sl@0: // ----------------------------------------------------------------------------- sl@0: // CMMFDevSoundAdaptation::FixedSequenceName sl@0: // Returns the name assigned to a specific pre-defined tone sequence. sl@0: // This is the number of fixed sequence supported by DevSound by default. sl@0: // The function raises a panic if sequence number specified invalid. sl@0: // (other items were commented in a header). sl@0: // ----------------------------------------------------------------------------- sl@0: // sl@0: EXPORT_C const TDesC& CMMFDevSoundAdaptation::FixedSequenceName( sl@0: TInt aSequenceNumber) sl@0: { sl@0: DP_CONTEXT(CMMFDevSoundAdaptation::FixedSequenceName *CD1*, CtxDevSound, DPLOCAL); sl@0: DP_IN(); sl@0: DP_OUT(); sl@0: return(iBody->FixedSequenceName(aSequenceNumber)); sl@0: } sl@0: sl@0: // ----------------------------------------------------------------------------- sl@0: // CMMFDevSoundAdaptation::GetSupportedInputDataTypesL sl@0: // see sounddevice.h sl@0: // (other items were commented in a header). sl@0: // ----------------------------------------------------------------------------- sl@0: // sl@0: EXPORT_C void CMMFDevSoundAdaptation::GetSupportedInputDataTypesL( sl@0: RArray& aSupportedDataTypes, sl@0: const TMMFPrioritySettings& aPrioritySettings) const sl@0: { sl@0: DP_CONTEXT(CMMFDevSoundAdaptation::GetSupportedInputDataTypesL *CD1*, CtxDevSound, DPLOCAL); sl@0: DP_IN(); sl@0: iBody->GetSupportedInputDataTypesL(aSupportedDataTypes, aPrioritySettings); sl@0: DP_OUT(); sl@0: } sl@0: sl@0: // ----------------------------------------------------------------------------- sl@0: // CMMFDevSoundAdaptation::GetSupportedOutputDataTypesL sl@0: // see sounddevice.h sl@0: // (other items were commented in a header). sl@0: // ----------------------------------------------------------------------------- sl@0: // sl@0: EXPORT_C void CMMFDevSoundAdaptation::GetSupportedOutputDataTypesL( sl@0: RArray& aSupportedDataTypes, sl@0: const TMMFPrioritySettings& aPrioritySettings) const sl@0: { sl@0: DP_CONTEXT(CMMFDevSoundAdaptation::GetSupportedOutputDataTypesL *CD1*, CtxDevSound, DPLOCAL); sl@0: DP_IN(); sl@0: iBody->GetSupportedOutputDataTypesL(aSupportedDataTypes, aPrioritySettings); sl@0: DP_OUT(); sl@0: } sl@0: sl@0: // ----------------------------------------------------------------------------- sl@0: // SetClientConfig sl@0: // Sets client capabilities for this instance of DevSound Adaptation. sl@0: // (other items were commented in a header). sl@0: // ----------------------------------------------------------------------------- sl@0: // sl@0: EXPORT_C TInt CMMFDevSoundAdaptation::SetClientConfig( sl@0: const TProcessId& aProcessId) sl@0: { sl@0: DP_CONTEXT(CMMFDevSoundAdaptation::SetClientConfig *CD1*, CtxDevSound, DPLOCAL); sl@0: DP_IN(); sl@0: TInt retVal = iBody->SetClientConfig(aProcessId); sl@0: DP0_RET(retVal, "%d"); sl@0: } sl@0: sl@0: EXPORT_C TInt CMMFDevSoundAdaptation::SetClientConfig( sl@0: const TProcessId& aActualProcessId, sl@0: const TProcessId& aProcessId) sl@0: { sl@0: DP_CONTEXT(CMMFDevSoundAdaptation::SetClientConfig *CD1*, CtxDevSound, DPLOCAL); sl@0: DP_IN(); sl@0: TInt retVal = iBody->SetClientConfig(aActualProcessId, aProcessId); sl@0: DP0_RET(retVal, "%d"); sl@0: } sl@0: sl@0: // ----------------------------------------------------------------------------- sl@0: // CMMFDevSoundAdaptation::EmptyBuffers sl@0: // sl@0: // (other items were commented in a header). sl@0: // ----------------------------------------------------------------------------- sl@0: sl@0: EXPORT_C TInt CMMFDevSoundAdaptation::EmptyBuffers() sl@0: { sl@0: DP_CONTEXT(CMMFDevSoundAdaptation::EmptyBuffers *CD1*, CtxDevSound, DPLOCAL); sl@0: DP_IN(); sl@0: TInt retVal = iBody->EmptyBuffers(); sl@0: DP0_RET(retVal, "%d"); sl@0: } sl@0: sl@0: // ----------------------------------------------------------------------------- sl@0: // CMMFDevSoundAdaptation::CloseDevSound sl@0: // (other items were commented in a header). sl@0: // ----------------------------------------------------------------------------- sl@0: // sl@0: EXPORT_C TBool CMMFDevSoundAdaptation::CloseDevSound() sl@0: { sl@0: DP_CONTEXT(CMMFDevSoundAdaptation::::CloseDevSound *CD1*, CtxDevSound, DPLOCAL); sl@0: DP_IN(); sl@0: TBool rerVal= iBody->CloseDevSound(); sl@0: DP0_RET(rerVal, "%d"); sl@0: } sl@0: sl@0: // ----------------------------------------------------------------------------- sl@0: // CMMFDevSoundAdaptation::ProcessingFinished sl@0: // (other items were commented in a header). sl@0: // ----------------------------------------------------------------------------- sl@0: // sl@0: EXPORT_C TInt CMMFDevSoundAdaptation::ProcessingFinishedReceived(TBool& asyncOperation) sl@0: { sl@0: DP_CONTEXT(CMMFDevSoundAdaptation::::ProcessingFinished *CD1*, CtxDevSound, DPLOCAL); sl@0: DP_IN(); sl@0: TInt retVal = iBody->ProcessingFinishedReceived(asyncOperation); sl@0: DP0_RET(retVal, "%d"); sl@0: } sl@0: sl@0: // ----------------------------------------------------------------------------- sl@0: // CMMFDevSoundAdaptation::ProcessingFinished sl@0: // (other items were commented in a header). sl@0: // ----------------------------------------------------------------------------- sl@0: // sl@0: EXPORT_C TInt CMMFDevSoundAdaptation::ProcessingError(TBool& asyncOperation) sl@0: { sl@0: DP_CONTEXT(CMMFDevSoundAdaptation::::ProcessingError *CD1*, CtxDevSound, DPLOCAL); sl@0: DP_IN(); sl@0: TInt retVal = iBody->ProcessingError(asyncOperation); sl@0: DP0_RET(retVal, "%d"); sl@0: } sl@0: sl@0: // ----------------------------------------------------------------------------- sl@0: // CMMFDevSoundAdaptation::RegisterAsClient sl@0: // (other items were commented in a header). sl@0: // ----------------------------------------------------------------------------- sl@0: // sl@0: EXPORT_C TInt CMMFDevSoundAdaptation::RegisterAsClient(TUid aEventType, const TDesC8& aNotificationRegistrationData) sl@0: { sl@0: DP_CONTEXT(CMMFDevSoundAdaptation::RegisterAsClient *CD1*, CtxDevSound, DPLOCAL); sl@0: DP_IN(); sl@0: TInt error = iBody->RegisterAsClient(aEventType, aNotificationRegistrationData); sl@0: DP0_RET(error, "%d"); sl@0: } sl@0: sl@0: sl@0: // ----------------------------------------------------------------------------- sl@0: // CMMFDevSoundAdaptation::CancelRegisterAsClient sl@0: // (other items were commented in a header). sl@0: // ----------------------------------------------------------------------------- sl@0: // sl@0: EXPORT_C TInt CMMFDevSoundAdaptation::CancelRegisterAsClient(TUid aEventType) sl@0: { sl@0: DP_CONTEXT(CMMFDevSoundAdaptation::CancelRegisterAsClient *CD1*, CtxDevSound, DPLOCAL); sl@0: DP_IN(); sl@0: TInt error = iBody->CancelRegisterAsClient(aEventType); sl@0: DP0_RET(error, "%d"); sl@0: } sl@0: sl@0: sl@0: // ----------------------------------------------------------------------------- sl@0: // CMMFDevSoundAdaptation::GetResourceNotificationData sl@0: // (other items were commented in a header). sl@0: // ----------------------------------------------------------------------------- sl@0: // sl@0: EXPORT_C TInt CMMFDevSoundAdaptation::GetResourceNotificationData(TUid aEventType, TDes8& aNotificationData) sl@0: { sl@0: DP_CONTEXT(CMMFDevSoundAdaptation::GetResourceNotificationData *CD1*, CtxDevSound, DPLOCAL); sl@0: DP_IN(); sl@0: TInt error = iBody->GetResourceNotificationData(aEventType, aNotificationData); sl@0: DP0_RET(error, "%d"); sl@0: } sl@0: sl@0: sl@0: // ----------------------------------------------------------------------------- sl@0: // CMMFDevSoundAdaptation::WillResumePlay sl@0: // (other items were commented in a header). sl@0: // ----------------------------------------------------------------------------- sl@0: // sl@0: EXPORT_C TInt CMMFDevSoundAdaptation::WillResumePlay() sl@0: { sl@0: DP_CONTEXT(CMMFDevSoundAdaptation::WillResumePlay *CD1*, CtxDevSound, DPLOCAL); sl@0: DP_IN(); sl@0: TInt error = iBody->WillResumePlay(); sl@0: DP0_RET(error, "%d"); sl@0: } sl@0: sl@0: // ----------------------------------------------------------------------------- sl@0: // CMMFDevSoundAdaptation::GetTimePlayed sl@0: // (other items were commented in a header). sl@0: // ----------------------------------------------------------------------------- sl@0: // sl@0: EXPORT_C TInt CMMFDevSoundAdaptation::GetTimePlayed(TTimeIntervalMicroSeconds& aTime) sl@0: { sl@0: DP_CONTEXT(CMMFDevSoundAdaptation::GetTimePlayed *CD1*, CtxDevSound, DPLOCAL); sl@0: DP_IN(); sl@0: DP_OUT(); sl@0: return iBody->GetTimePlayed(aTime); sl@0: } sl@0: sl@0: // ----------------------------------------------------------------------------- sl@0: // CMMFDevSoundAdaptation::IsResumeSupported sl@0: // (other items were commented in a header). sl@0: // ----------------------------------------------------------------------------- sl@0: // sl@0: EXPORT_C TBool CMMFDevSoundAdaptation::IsResumeSupported() sl@0: { sl@0: DP_CONTEXT(CMMFDevSoundAdaptation::IsResumeSupported *CD1*, CtxDevSound, DPLOCAL); sl@0: DP_IN(); sl@0: TBool isSupported = iBody->IsResumeSupported(); sl@0: DP0_RET(isSupported , "%d"); sl@0: } sl@0: sl@0: // ----------------------------------------------------------------------------- sl@0: // CMMFDevSoundAdaptation::IsResumeSupported sl@0: // (other items were commented in a header). sl@0: // ----------------------------------------------------------------------------- sl@0: // sl@0: EXPORT_C TInt CMMFDevSoundAdaptation::Resume() sl@0: { sl@0: DP_CONTEXT(CMMFDevSoundAdaptation::Resume *CD1*, CtxDevSound, DPLOCAL); sl@0: DP_IN(); sl@0: TInt error = iBody->Resume(); sl@0: DP0_RET(error, "%d"); sl@0: } sl@0: sl@0: EXPORT_C void CMMFDevSoundAdaptation::BufferErrorEvent() sl@0: { sl@0: iBody->BufferErrorEvent(); sl@0: } sl@0: sl@0: EXPORT_C void CMMFDevSoundAdaptation::RollbackAdaptorActiveStateToBeforeCommit() sl@0: { sl@0: DP_CONTEXT(CMMFDevSoundAdaptation::RollbackAdaptorActiveStateToBeforeCommit *CD1*, CtxDevSound, DPLOCAL); sl@0: DP_IN(); sl@0: iBody->RollbackAdaptorActiveStateToBeforeCommit(); sl@0: DP_OUT(); sl@0: } sl@0: sl@0: // End of file