Update contrib.
1 // Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
2 // All rights reserved.
3 // This component and the accompanying materials are made available
4 // under the terms of "Eclipse Public License v1.0"
5 // which accompanies this distribution, and is available
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
20 #include "mmfdevsoundadaptation.h"
21 #include "mmfdevsoundadaptationbody.h"
23 // ============================ MEMBER FUNCTIONS ===============================
25 // -----------------------------------------------------------------------------
26 // CMMFDevSoundAdaptation::CMMFDevSoundAdaptation
27 // C++ default constructor can NOT contain any code, that
29 // -----------------------------------------------------------------------------
31 CMMFDevSoundAdaptation::CMMFDevSoundAdaptation()
34 DP_CONTEXT(CMMFDevSoundAdaptation::CMMFDevSoundAdaptation *CD1*, CtxDevSound, DPLOCAL);
36 PRF_HEAP_STATUS(PRF_MEM, HEAP_DS_Session);
40 // -----------------------------------------------------------------------------
41 // CMMFDevSoundAdaptation::ConstructL
42 // Symbian 2nd phase constructor can leave.
43 // -----------------------------------------------------------------------------
44 void CMMFDevSoundAdaptation::ConstructL(MDevSoundAdaptationObserver& aDevSoundObserver,
45 MGlobalProperties& aGlobalProperties)
47 DP_CONTEXT(CMMFDevSoundAdaptation::ConstructL *CD1*, CtxDevSound, DPLOCAL);
49 iBody = CBody::NewL(aDevSoundObserver, aGlobalProperties);
53 // -----------------------------------------------------------------------------
54 // CMMFDevSoundAdaptation::NewL
55 // Two-phased constructor.
56 // -----------------------------------------------------------------------------
58 EXPORT_C CMMFDevSoundAdaptation* CMMFDevSoundAdaptation::NewL(MDevSoundAdaptationObserver& aDevSoundObserver,
59 MGlobalProperties& aGlobalProperties)
61 DP_STATIC_CONTEXT(CMMFDevSoundAdaptation::NewL *CD0*, CtxDevSound, DPLOCAL);
63 CMMFDevSoundAdaptation* self = new (ELeave)CMMFDevSoundAdaptation();
64 CleanupStack::PushL(self);
65 self->ConstructL(aDevSoundObserver, aGlobalProperties);
66 CleanupStack::Pop(self);
67 DP0_RET(self, "0x%x");
70 // -----------------------------------------------------------------------------
71 // CMMFDevSoundAdaptation::ConstructL
73 // -----------------------------------------------------------------------------
75 EXPORT_C CMMFDevSoundAdaptation::~CMMFDevSoundAdaptation()
77 DP_CONTEXT(CMMFDevSoundAdaptation::~CMMFDevSoundAdaptation *CD1*, CtxDevSound, DPLOCAL);
80 PRF_HEAP_STATUS(PRF_MEM, HEAP_DS_Session);
84 // PostOpenL() - asynchronous 2nd-phase open operation
85 EXPORT_C void CMMFDevSoundAdaptation::PostOpenL()
87 DP_CONTEXT(CMMFDevSoundAdaptation::PostOpenL *CD1*, CtxDevSound, DPLOCAL);
93 // -----------------------------------------------------------------------------
94 // CMMFDevSoundAdaptation::InitializeL
95 // Initializes CMMFDevSoundProxy object to play and record PCM16 raw audio data
96 // with sampling rate of 8 KHz.On completion of Initialization, calls
97 // InitializeComplete() on aDevSoundObserver.
99 // (other items were commented in a header).
100 // -----------------------------------------------------------------------------
102 EXPORT_C void CMMFDevSoundAdaptation::InitializeL(TMMFState aMode)
104 DP_CONTEXT(CMMFDevSoundAdaptation::InitializeL *CD1*, CtxDevSound, DPLOCAL);
106 iBody->InitializeL(aMode);
110 // -----------------------------------------------------------------------------
111 // CMMFDevSoundAdaptation::InitializeL
112 // Initializes DevSound object for the mode aMode for processing audio data
113 // with hardware device aHWDev. On completion of Initialization, the observer
114 // will be notified via call back InitializeComplete().
115 // Leaves on failure.
116 // (other items were commented in a header).
117 // -----------------------------------------------------------------------------
119 EXPORT_C void CMMFDevSoundAdaptation::InitializeL(TUid aHWDev,
122 DP_CONTEXT(CMMFDevSoundAdaptation::InitializeL *CD1*, CtxDevSound, DPLOCAL);
124 iBody->InitializeL(aHWDev, aMode);
128 // -----------------------------------------------------------------------------
129 // CMMFDevSoundAdaptation::InitializeL
130 // Initializes DevSound object for the mode aMode for processing audio data
131 // with hardware device supporting FourCC aDesiredFourCC. On completion of
132 // Initialization, the observer will be notified via callback
133 // InitializeComplete().
134 // Leaves on failure.
135 // (other items were commented in a header).
136 // -----------------------------------------------------------------------------
138 EXPORT_C void CMMFDevSoundAdaptation::InitializeL(TFourCC aDesiredFourCC,
141 DP_CONTEXT(CMMFDevSoundAdaptation::InitializeL *CD1*, CtxDevSound, DPLOCAL);
143 iBody->InitializeL(aDesiredFourCC, aMode);
147 // -----------------------------------------------------------------------------
148 // CMMFDevSoundAdaptation::CancelInitialize
149 // Cancels the initialization of DevSound object
150 // returns an error code
151 // (other items were commented in a header).
152 // -----------------------------------------------------------------------------
154 EXPORT_C TInt CMMFDevSoundAdaptation::CancelInitialize()
156 DP_CONTEXT(CMMFDevSoundAdaptation::CancelInitialize *CD1*, CtxDevSound, DPLOCAL);
158 TInt retVal = iBody->CancelInitialize();
159 DP0_RET(retVal, "%d");
162 // -----------------------------------------------------------------------------
163 // CMMFDevSoundAdaptation::Capabilities
164 // Returns the supported Audio settings.
165 // (other items were commented in a header).
166 // -----------------------------------------------------------------------------
168 EXPORT_C TInt CMMFDevSoundAdaptation::Capabilities(TMMFCapabilities& aCap)
170 DP_CONTEXT(CMMFDevSoundAdaptation::Capabilities *CD1*, CtxDevSound, DPLOCAL);
172 TInt retVal = iBody->Capabilities(aCap);
173 DP0_RET(retVal, "%d");
176 // -----------------------------------------------------------------------------
177 // CMMFDevSoundAdaptation::Config
178 // Returns the current audio settings.
179 // (other items were commented in a header).
180 // -----------------------------------------------------------------------------
182 EXPORT_C TMMFCapabilities CMMFDevSoundAdaptation::Config() const
184 DP_CONTEXT(CMMFDevSoundAdaptation::Config *CD1*, CtxDevSound, DPLOCAL);
186 TMMFCapabilities retVal = iBody->Config();
187 DP0_RET(retVal, "%d");
190 // -----------------------------------------------------------------------------
191 // CMMFDevSoundAdaptation::SetConfigL
192 // Configure CMMFDevSoundProxy object for the settings in aConfig.
193 // Use this to set sampling rate, Encoding and Mono/Stereo.
194 // As part of defect 20796, the iRecordFormat has been set under the iPlayFormat,
195 // before it was not set at all.
196 // (other items were commented in a header).
197 // -----------------------------------------------------------------------------
199 EXPORT_C void CMMFDevSoundAdaptation::SetConfigL(
200 const TMMFCapabilities& aConfig)
202 DP_CONTEXT(CMMFDevSoundAdaptation::SetConfigL *CD1*, CtxDevSound, DPLOCAL);
204 iBody->SetConfigL(aConfig);
208 // -----------------------------------------------------------------------------
209 // CMMFDevSoundAdaptation::MaxVolume
210 // Returns an integer representing the maximum volume.
211 // This is the maximum value which can be passed to CMMFDevSoundProxy::SetVolume.
212 // (other items were commented in a header).
213 // -----------------------------------------------------------------------------
215 EXPORT_C TInt CMMFDevSoundAdaptation::MaxVolume()
217 DP_CONTEXT(CMMFDevSoundAdaptation::MaxVolume *CD1*, CtxDevSound, DPLOCAL);
219 TInt retVal = iBody->MaxVolume();
220 DP0_RET(retVal, "%d");
223 // -----------------------------------------------------------------------------
224 // CMMFDevSoundAdaptation::Volume
225 // Returns an integer representing the current volume.
226 // (other items were commented in a header).
227 // -----------------------------------------------------------------------------
229 EXPORT_C TInt CMMFDevSoundAdaptation::Volume()
231 DP_CONTEXT(CMMFDevSoundAdaptation::Volume *CD1*, CtxDevSound, DPLOCAL);
233 TInt retVal = iBody->Volume();
234 DP0_RET(retVal, "%d");
237 // -----------------------------------------------------------------------------
238 // CMMFDevSoundAdaptation::SetVolume
239 // Changes the current playback volume to a specified value.
240 // The volume can be changed before or during playback and is effective
242 // (other items were commented in a header).
243 // -----------------------------------------------------------------------------
245 EXPORT_C TInt CMMFDevSoundAdaptation::SetVolume(TInt aVolume, TBool& aAsyncCompletion)
247 DP_CONTEXT(CMMFDevSoundAdaptation::SetVolume *CD1*, CtxDevSound, DPLOCAL);
249 TInt error = iBody->SetVolume(aVolume, aAsyncCompletion);
250 DP0_RET(error, "%d");
253 // -----------------------------------------------------------------------------
254 // CMMFDevSoundAdaptation::MaxGain
255 // Returns an integer representing the maximum gain.
256 // This is the maximum value which can be passed to CMMFDevSoundProxy::SetGain.
257 // (other items were commented in a header).
258 // -----------------------------------------------------------------------------
260 EXPORT_C TInt CMMFDevSoundAdaptation::MaxGain()
262 DP_CONTEXT(CMMFDevSoundAdaptation::MaxGain *CD1*, CtxDevSound, DPLOCAL);
264 TInt retVal = iBody->MaxGain();
265 DP0_RET(retVal, "%d");
268 // -----------------------------------------------------------------------------
269 // CMMFDevSoundAdaptation::Gain
270 // Returns an integer representing the current gain.
271 // (other items were commented in a header).
272 // -----------------------------------------------------------------------------
274 EXPORT_C TInt CMMFDevSoundAdaptation::Gain()
276 DP_CONTEXT(CMMFDevSoundAdaptation::Gain *CD1*, CtxDevSound, DPLOCAL);
278 TInt retVal = iBody->Gain();
279 DP0_RET(retVal, "%d");
282 // -----------------------------------------------------------------------------
283 // CMMFDevSoundAdaptation::SetGain
284 // Changes the current recording gain to a specified value.
285 // The gain can be changed before or during recording and is effective
287 // (other items were commented in a header).
288 // -----------------------------------------------------------------------------
290 EXPORT_C TInt CMMFDevSoundAdaptation::SetGain(TInt aGain, TBool& aAsyncCompletion)
292 DP_CONTEXT(CMMFDevSoundAdaptation::SetGain *CD1*, CtxDevSound, DPLOCAL);
294 TInt error = iBody->SetGain(aGain, aAsyncCompletion);
295 DP0_RET(error, "%d");
298 // -----------------------------------------------------------------------------
299 // CMMFDevSoundAdaptation::GetPlayBalanceL
300 // Returns the speaker balance set for playing.
301 // Leaves on failure.
302 // (other items were commented in a header).
303 // -----------------------------------------------------------------------------
305 EXPORT_C void CMMFDevSoundAdaptation::GetPlayBalanceL(
306 TInt& aLeftPercentage,
307 TInt& aRightPercentage)
309 DP_CONTEXT(CMMFDevSoundAdaptation::GetPlayBalanceL *CD1*, CtxDevSound, DPLOCAL);
311 iBody->GetPlayBalanceL(aLeftPercentage, aRightPercentage);
315 // -----------------------------------------------------------------------------
316 // CMMFDevSoundAdaptation::SetPlayBalanceL
317 // Sets the speaker balance for playing. The speaker balance can be changed
318 // before or during playback and is effective immediately.
319 // (other items were commented in a header).
320 // -----------------------------------------------------------------------------
322 EXPORT_C void CMMFDevSoundAdaptation::SetPlayBalanceL(
323 TInt aLeftPercentage,
324 TInt aRightPercentage,
325 TBool& aAsyncCompletion)
327 DP_CONTEXT(CMMFDevSoundAdaptation::SetPlayBalanceL *CD1*, CtxDevSound, DPLOCAL);
329 iBody->SetPlayBalanceL(aLeftPercentage, aRightPercentage, aAsyncCompletion);
333 // -----------------------------------------------------------------------------
334 // CMMFDevSoundAdaptation::GetRecordBalanceL
335 // Returns the microphone gain balance set for recording.
336 // Leaves on failure.
337 // (other items were commented in a header).
338 // -----------------------------------------------------------------------------
340 EXPORT_C void CMMFDevSoundAdaptation::GetRecordBalanceL(
341 TInt& aLeftPercentage,
342 TInt& aRightPercentage)
344 DP_CONTEXT(CMMFDevSoundAdaptation::GetRecordBalanceL *CD1*, CtxDevSound, DPLOCAL);
346 iBody->GetRecordBalanceL(aLeftPercentage, aRightPercentage);
350 // -----------------------------------------------------------------------------
351 // CMMFDevSoundAdaptation::SetRecordBalanceL
352 // Sets the microphone gain balance for recording.
353 // The microphone gain balance can be changed before or during recording and
354 // is effective immediately.
355 // (other items were commented in a header).
356 // -----------------------------------------------------------------------------
358 EXPORT_C void CMMFDevSoundAdaptation::SetRecordBalanceL(
359 TInt aLeftPercentage,
360 TInt aRightPercentage,
361 TBool& aAsyncCompletion)
363 DP_CONTEXT(CMMFDevSoundAdaptation::SetRecordBalanceL *CD1*, CtxDevSound, DPLOCAL);
365 iBody->SetRecordBalanceL(aLeftPercentage, aRightPercentage, aAsyncCompletion);
369 // -----------------------------------------------------------------------------
370 // CMMFDevSoundAdaptation::PlayInitL
371 // Initializes audio device and start play process. This method queries and
372 // acquires the audio policy before initializing audio device. If there was an
373 // error during policy initialization, PlayError() method will be called on
374 // the observer with error code KErrAccessDenied, otherwise BufferToBeFilled()
375 // method will be called with a buffer reference. After reading data into the
376 // buffer reference passed, the client should call PlayData() to play data.
378 // The amount of data that can be played is specified in
379 // CMMFBuffer::RequestSize(). Any data that is read into buffer beyond this
380 // size will be ignored.
382 // Leaves on failure.
383 // (other items were commented in a header).
384 // -----------------------------------------------------------------------------
386 EXPORT_C void CMMFDevSoundAdaptation::PlayInitL()
388 DP_CONTEXT(CMMFDevSoundAdaptation::PlayInitL *CD1*, CtxDevSound, DPLOCAL);
394 // -----------------------------------------------------------------------------
395 // CMMFDevSoundAdaptation::RecordInitL
396 // Initializes audio device and start record process. This method queries and
397 // acquires the audio policy before initializing audio device. If there was an
398 // error during policy initialization, RecordError() method will be called on
399 // the observer with error code KErrAccessDenied, otherwise BufferToBeEmptied()
400 // method will be called with a buffer reference. This buffer contains recorded
401 // or encoded data. After processing data in the buffer reference passed, the
402 // client should call RecordData() to continue recording process.
404 // The amount of data that is available is specified in
405 // CMMFBuffer::RequestSize().
407 // Leaves on failure.
408 // (other items were commented in a header).
409 // -----------------------------------------------------------------------------
411 EXPORT_C void CMMFDevSoundAdaptation::RecordInitL()
413 DP_CONTEXT(CMMFDevSoundAdaptation::RecordInitL *CD1*, CtxDevSound, DPLOCAL);
415 iBody->RecordInitL();
419 // -----------------------------------------------------------------------------
420 // CMMFDevSoundAdaptation::PlayData
421 // Plays data in the buffer at the current volume. The client should fill
422 // the buffer with audio data before calling this method. The Observer gets
423 // reference to buffer along with callback BufferToBeFilled(). When playing of
424 // the audio sample is complete, successfully or otherwise, the method
425 // PlayError() on observer is called.
426 // (other items were commented in a header).
427 // -----------------------------------------------------------------------------
429 EXPORT_C void CMMFDevSoundAdaptation::PlayData()
431 DP_CONTEXT(CMMFDevSoundAdaptation::PlayData *CD1*, CtxDevSound, DPLOCAL);
437 // -----------------------------------------------------------------------------
438 // CMMFDevSoundAdaptation::RecordData
439 // Contine the process of recording. Once the buffer is filled with recorded
440 // data, the Observer gets reference to buffer along with callback
441 // BufferToBeEmptied(). After processing the buffer (copying over to a
442 // different buffer or writing to file) the client should call this
443 // method to continue recording process.
444 // (other items were commented in a header).
445 // -----------------------------------------------------------------------------
447 EXPORT_C void CMMFDevSoundAdaptation::RecordData()
449 DP_CONTEXT(CMMFDevSoundAdaptation::RecordData *CD1*, CtxDevSound, DPLOCAL);
455 // -----------------------------------------------------------------------------
456 // CMMFDevSoundAdaptation::Stop
457 // Stops the ongoing operation (Play, Record, TonePlay)
458 // (other items were commented in a header).
459 // -----------------------------------------------------------------------------
461 EXPORT_C TBool CMMFDevSoundAdaptation::Stop()
463 DP_CONTEXT(CMMFDevSoundAdaptation::Stop *CD1*, CtxDevSound, DPLOCAL);
465 TBool retVal = iBody->Stop();
466 DP0_RET(retVal, "%d");
469 // -----------------------------------------------------------------------------
470 // CMMFDevSoundAdaptation::Pause
471 // Temporarily Stops the ongoing operation (Play, Record, TonePlay)
472 // (other items were commented in a header).
473 // -----------------------------------------------------------------------------
475 EXPORT_C TInt CMMFDevSoundAdaptation::Pause()
477 DP_CONTEXT(CMMFDevSoundAdaptation::Pause *CD1*, CtxDevSound, DPLOCAL);
479 TInt retVal = iBody->Pause();
480 DP0_RET(retVal, "%d");
483 // -----------------------------------------------------------------------------
484 // CMMFDevSoundAdaptation::SamplesRecorded
485 // Returns the sample recorded so far.
486 // (other items were commented in a header).
487 // -----------------------------------------------------------------------------
489 EXPORT_C TInt CMMFDevSoundAdaptation::SamplesRecorded()
491 DP_CONTEXT(CMMFDevSoundAdaptation::SamplesRecorded *CD1*, CtxDevSound, DPLOCAL);
493 TInt retVal = iBody->SamplesRecorded();
494 DP0_RET(retVal, "%d");
497 // -----------------------------------------------------------------------------
498 // CMMFDevSoundAdaptation::SamplesPlayed
499 // Returns the sample played so far.
500 // (other items were commented in a header).
501 // -----------------------------------------------------------------------------
503 EXPORT_C TInt CMMFDevSoundAdaptation::SamplesPlayed()
505 DP_CONTEXT(CMMFDevSoundAdaptation::SamplesPlayed *CD1*, CtxDevSound, DPLOCAL);
507 TInt retVal = iBody->SamplesPlayed();
508 DP0_RET(retVal, "%d");
511 // -----------------------------------------------------------------------------
512 // CMMFDevSoundAdaptation::PlayToneL
513 // Initializes audio device and start playing tone. Tone is played with
514 // frequency and for duration specified.
515 // Leaves on failure.
516 // (other items were commented in a header).
517 // -----------------------------------------------------------------------------
519 EXPORT_C void CMMFDevSoundAdaptation::PlayToneL(
521 const TTimeIntervalMicroSeconds& aDuration)
523 DP_CONTEXT(CMMFDevSoundAdaptation::PlayToneL *CD1*, CtxDevSound, DPLOCAL);
525 iBody->PlayToneL(aFrequency, aDuration);
529 // -----------------------------------------------------------------------------
530 // CMMFDevSoundAdaptation::PlayDualToneL
531 // Initializes audio device and start playing a dual tone.
532 // The tone consists of two sine waves of different frequencies summed together
533 // Dual Tone is played with specified frequencies and for specified duration.
534 // (other items were commented in a header).
535 // -----------------------------------------------------------------------------
537 EXPORT_C void CMMFDevSoundAdaptation::PlayDualToneL(
540 const TTimeIntervalMicroSeconds& aDuration)
542 DP_CONTEXT(CMMFDevSoundAdaptation::PlayDualToneL *CD1*, CtxDevSound, DPLOCAL);
544 iBody->PlayDualToneL(aFrequencyOne, aFrequencyTwo, aDuration);
548 // -----------------------------------------------------------------------------
549 // CMMFDevSoundAdaptation::PlayDTMFStringL
550 // Initializes audio device and start playing DTMF string aDTMFString.
551 // Leaves on failure.
552 // (other items were commented in a header).
553 // -----------------------------------------------------------------------------
555 EXPORT_C void CMMFDevSoundAdaptation::PlayDTMFStringL(
556 const TDesC& aDTMFString)
558 DP_CONTEXT(CMMFDevSoundAdaptation::PlayDTMFStringL *CD1*, CtxDevSound, DPLOCAL);
560 iBody->PlayDTMFStringL(aDTMFString);
564 // -----------------------------------------------------------------------------
565 // CMMFDevSoundAdaptation::PlayToneSequenceL
566 // Initializes audio device and start playing tone sequence.
567 // Leaves on failure.
568 // (other items were commented in a header).
569 // -----------------------------------------------------------------------------
571 EXPORT_C void CMMFDevSoundAdaptation::PlayToneSequenceL(
574 DP_CONTEXT(CMMFDevSoundAdaptation::PlayToneSequenceL *CD1*, CtxDevSound, DPLOCAL);
576 iBody->PlayToneSequenceL(aData);
580 // -----------------------------------------------------------------------------
581 // CMMFDevSoundAdaptation::PlayFixedSequenceL
582 // Initializes audio device and start playing the specified pre-defined tone
584 // Leaves on failure.
585 // (other items were commented in a header).
586 // -----------------------------------------------------------------------------
588 EXPORT_C void CMMFDevSoundAdaptation::PlayFixedSequenceL(
589 TInt aSequenceNumber)
591 DP_CONTEXT(CMMFDevSoundAdaptation::PlayFixedSequenceL *CD1*, CtxDevSound, DPLOCAL);
593 iBody->PlayFixedSequenceL(aSequenceNumber);
597 // -----------------------------------------------------------------------------
598 // CMMFDevSoundAdaptation::SetToneRepeats
599 // Defines the number of times the audio is to be repeated during the tone
600 // playback operation. A period of silence can follow each playing of tone.
601 // The tone playing can be repeated indefinitely.
602 // (other items were commented in a header).
603 // -----------------------------------------------------------------------------
605 EXPORT_C TInt CMMFDevSoundAdaptation::SetToneRepeats(
607 const TTimeIntervalMicroSeconds& aRepeatTrailingSilence)
609 DP_CONTEXT(CMMFDevSoundAdaptation::SetToneRepeats *CD1*, CtxDevSound, DPLOCAL);
611 TInt retVal = iBody->SetToneRepeats(aRepeatCount, aRepeatTrailingSilence);
612 DP0_RET(retVal, "%d");
615 // -----------------------------------------------------------------------------
616 // CMMFDevSoundAdaptation::SetDTMFLengths
617 // Defines the duration of tone on, tone off and tone pause to be used during the
618 // DTMF tone playback operation.
619 // Supported only during tone playing.
620 // (other items were commented in a header).
621 // -----------------------------------------------------------------------------
623 EXPORT_C TInt CMMFDevSoundAdaptation::SetDTMFLengths(
624 TTimeIntervalMicroSeconds32& aToneOnLength,
625 TTimeIntervalMicroSeconds32& aToneOffLength,
626 TTimeIntervalMicroSeconds32& aPauseLength)
628 DP_CONTEXT(CMMFDevSoundAdaptation::SetDTMFLengths *CD1*, CtxDevSound, DPLOCAL);
630 TInt retVal = iBody->SetDTMFLengths(aToneOnLength, aToneOffLength, aPauseLength);
631 DP0_RET(retVal, "%d");
634 // -----------------------------------------------------------------------------
635 // CMMFDevSoundAdaptation::SetVolumeRamp
636 // Defines the period over which the volume level is to rise smoothly from
637 // nothing to the normal volume level.
638 // (other items were commented in a header).
639 // -----------------------------------------------------------------------------
641 EXPORT_C TInt CMMFDevSoundAdaptation::SetVolumeRamp(
642 const TTimeIntervalMicroSeconds& aRampDuration)
644 DP_CONTEXT(CMMFDevSoundAdaptation::SetVolumeRamp *CD1*, CtxDevSound, DPLOCAL);
646 TInt retVal = iBody->SetVolumeRamp(aRampDuration);
647 DP0_RET(retVal, "%d");
650 // -----------------------------------------------------------------------------
651 // CMMFDevSoundAdaptation::SetPrioritySettings
652 // Defines the priority settings that should be used for this instance.
653 // (other items were commented in a header).
654 // -----------------------------------------------------------------------------
656 EXPORT_C TInt CMMFDevSoundAdaptation::SetPrioritySettings(
657 const TMMFPrioritySettings& aPrioritySettings)
659 DP_CONTEXT(CMMFDevSoundAdaptation::SetPrioritySettings *CD1*, CtxDevSound, DPLOCAL);
661 TInt retVal = iBody->SetPrioritySettings(aPrioritySettings);
662 DP0_RET(retVal, "%d");
665 // -----------------------------------------------------------------------------
666 // CMMFDevSoundAdaptation::CustomInterface
668 // (other items were commented in a header).
669 // -----------------------------------------------------------------------------
671 EXPORT_C TAny* CMMFDevSoundAdaptation::CustomInterface(
674 DP_CONTEXT(CMMFDevSoundAdaptation::CustomInterface *CD1*, CtxDevSound, DPLOCAL);
677 // TODO - Need to revisit this to allow for async operation
678 TAny* retVal = iBody->CustomInterface(aInterfaceId);
679 DP0_RET(retVal, "0x%x");
682 // -----------------------------------------------------------------------------
683 // CMMFDevSoundAdaptation::FixedSequenceCount
684 // Returns the number of available pre-defined tone sequences.
685 // This is the number of fixed sequence supported by DevSound by default.
686 // (other items were commented in a header).
687 // -----------------------------------------------------------------------------
689 EXPORT_C TInt CMMFDevSoundAdaptation::FixedSequenceCount()
691 DP_CONTEXT(CMMFDevSoundAdaptation::FixedSequenceCount *CD1*, CtxDevSound, DPLOCAL);
693 TInt retVal = iBody->FixedSequenceCount();
694 DP0_RET(retVal, "%d");
697 // -----------------------------------------------------------------------------
698 // CMMFDevSoundAdaptation::FixedSequenceName
699 // Returns the name assigned to a specific pre-defined tone sequence.
700 // This is the number of fixed sequence supported by DevSound by default.
701 // The function raises a panic if sequence number specified invalid.
702 // (other items were commented in a header).
703 // -----------------------------------------------------------------------------
705 EXPORT_C const TDesC& CMMFDevSoundAdaptation::FixedSequenceName(
706 TInt aSequenceNumber)
708 DP_CONTEXT(CMMFDevSoundAdaptation::FixedSequenceName *CD1*, CtxDevSound, DPLOCAL);
711 return(iBody->FixedSequenceName(aSequenceNumber));
714 // -----------------------------------------------------------------------------
715 // CMMFDevSoundAdaptation::GetSupportedInputDataTypesL
717 // (other items were commented in a header).
718 // -----------------------------------------------------------------------------
720 EXPORT_C void CMMFDevSoundAdaptation::GetSupportedInputDataTypesL(
721 RArray<TFourCC>& aSupportedDataTypes,
722 const TMMFPrioritySettings& aPrioritySettings) const
724 DP_CONTEXT(CMMFDevSoundAdaptation::GetSupportedInputDataTypesL *CD1*, CtxDevSound, DPLOCAL);
726 iBody->GetSupportedInputDataTypesL(aSupportedDataTypes, aPrioritySettings);
730 // -----------------------------------------------------------------------------
731 // CMMFDevSoundAdaptation::GetSupportedOutputDataTypesL
733 // (other items were commented in a header).
734 // -----------------------------------------------------------------------------
736 EXPORT_C void CMMFDevSoundAdaptation::GetSupportedOutputDataTypesL(
737 RArray<TFourCC>& aSupportedDataTypes,
738 const TMMFPrioritySettings& aPrioritySettings) const
740 DP_CONTEXT(CMMFDevSoundAdaptation::GetSupportedOutputDataTypesL *CD1*, CtxDevSound, DPLOCAL);
742 iBody->GetSupportedOutputDataTypesL(aSupportedDataTypes, aPrioritySettings);
746 // -----------------------------------------------------------------------------
748 // Sets client capabilities for this instance of DevSound Adaptation.
749 // (other items were commented in a header).
750 // -----------------------------------------------------------------------------
752 EXPORT_C TInt CMMFDevSoundAdaptation::SetClientConfig(
753 const TProcessId& aProcessId)
755 DP_CONTEXT(CMMFDevSoundAdaptation::SetClientConfig *CD1*, CtxDevSound, DPLOCAL);
757 TInt retVal = iBody->SetClientConfig(aProcessId);
758 DP0_RET(retVal, "%d");
761 EXPORT_C TInt CMMFDevSoundAdaptation::SetClientConfig(
762 const TProcessId& aActualProcessId,
763 const TProcessId& aProcessId)
765 DP_CONTEXT(CMMFDevSoundAdaptation::SetClientConfig *CD1*, CtxDevSound, DPLOCAL);
767 TInt retVal = iBody->SetClientConfig(aActualProcessId, aProcessId);
768 DP0_RET(retVal, "%d");
771 // -----------------------------------------------------------------------------
772 // CMMFDevSoundAdaptation::EmptyBuffers
774 // (other items were commented in a header).
775 // -----------------------------------------------------------------------------
777 EXPORT_C TInt CMMFDevSoundAdaptation::EmptyBuffers()
779 DP_CONTEXT(CMMFDevSoundAdaptation::EmptyBuffers *CD1*, CtxDevSound, DPLOCAL);
781 TInt retVal = iBody->EmptyBuffers();
782 DP0_RET(retVal, "%d");
785 // -----------------------------------------------------------------------------
786 // CMMFDevSoundAdaptation::CloseDevSound
787 // (other items were commented in a header).
788 // -----------------------------------------------------------------------------
790 EXPORT_C TBool CMMFDevSoundAdaptation::CloseDevSound()
792 DP_CONTEXT(CMMFDevSoundAdaptation::::CloseDevSound *CD1*, CtxDevSound, DPLOCAL);
794 TBool rerVal= iBody->CloseDevSound();
795 DP0_RET(rerVal, "%d");
798 // -----------------------------------------------------------------------------
799 // CMMFDevSoundAdaptation::ProcessingFinished
800 // (other items were commented in a header).
801 // -----------------------------------------------------------------------------
803 EXPORT_C TInt CMMFDevSoundAdaptation::ProcessingFinishedReceived(TBool& asyncOperation)
805 DP_CONTEXT(CMMFDevSoundAdaptation::::ProcessingFinished *CD1*, CtxDevSound, DPLOCAL);
807 TInt retVal = iBody->ProcessingFinishedReceived(asyncOperation);
808 DP0_RET(retVal, "%d");
811 // -----------------------------------------------------------------------------
812 // CMMFDevSoundAdaptation::ProcessingFinished
813 // (other items were commented in a header).
814 // -----------------------------------------------------------------------------
816 EXPORT_C TInt CMMFDevSoundAdaptation::ProcessingError(TBool& asyncOperation)
818 DP_CONTEXT(CMMFDevSoundAdaptation::::ProcessingError *CD1*, CtxDevSound, DPLOCAL);
820 TInt retVal = iBody->ProcessingError(asyncOperation);
821 DP0_RET(retVal, "%d");
824 // -----------------------------------------------------------------------------
825 // CMMFDevSoundAdaptation::RegisterAsClient
826 // (other items were commented in a header).
827 // -----------------------------------------------------------------------------
829 EXPORT_C TInt CMMFDevSoundAdaptation::RegisterAsClient(TUid aEventType, const TDesC8& aNotificationRegistrationData)
831 DP_CONTEXT(CMMFDevSoundAdaptation::RegisterAsClient *CD1*, CtxDevSound, DPLOCAL);
833 TInt error = iBody->RegisterAsClient(aEventType, aNotificationRegistrationData);
834 DP0_RET(error, "%d");
838 // -----------------------------------------------------------------------------
839 // CMMFDevSoundAdaptation::CancelRegisterAsClient
840 // (other items were commented in a header).
841 // -----------------------------------------------------------------------------
843 EXPORT_C TInt CMMFDevSoundAdaptation::CancelRegisterAsClient(TUid aEventType)
845 DP_CONTEXT(CMMFDevSoundAdaptation::CancelRegisterAsClient *CD1*, CtxDevSound, DPLOCAL);
847 TInt error = iBody->CancelRegisterAsClient(aEventType);
848 DP0_RET(error, "%d");
852 // -----------------------------------------------------------------------------
853 // CMMFDevSoundAdaptation::GetResourceNotificationData
854 // (other items were commented in a header).
855 // -----------------------------------------------------------------------------
857 EXPORT_C TInt CMMFDevSoundAdaptation::GetResourceNotificationData(TUid aEventType, TDes8& aNotificationData)
859 DP_CONTEXT(CMMFDevSoundAdaptation::GetResourceNotificationData *CD1*, CtxDevSound, DPLOCAL);
861 TInt error = iBody->GetResourceNotificationData(aEventType, aNotificationData);
862 DP0_RET(error, "%d");
866 // -----------------------------------------------------------------------------
867 // CMMFDevSoundAdaptation::WillResumePlay
868 // (other items were commented in a header).
869 // -----------------------------------------------------------------------------
871 EXPORT_C TInt CMMFDevSoundAdaptation::WillResumePlay()
873 DP_CONTEXT(CMMFDevSoundAdaptation::WillResumePlay *CD1*, CtxDevSound, DPLOCAL);
875 TInt error = iBody->WillResumePlay();
876 DP0_RET(error, "%d");
879 // -----------------------------------------------------------------------------
880 // CMMFDevSoundAdaptation::GetTimePlayed
881 // (other items were commented in a header).
882 // -----------------------------------------------------------------------------
884 EXPORT_C TInt CMMFDevSoundAdaptation::GetTimePlayed(TTimeIntervalMicroSeconds& aTime)
886 DP_CONTEXT(CMMFDevSoundAdaptation::GetTimePlayed *CD1*, CtxDevSound, DPLOCAL);
889 return iBody->GetTimePlayed(aTime);
892 // -----------------------------------------------------------------------------
893 // CMMFDevSoundAdaptation::IsResumeSupported
894 // (other items were commented in a header).
895 // -----------------------------------------------------------------------------
897 EXPORT_C TBool CMMFDevSoundAdaptation::IsResumeSupported()
899 DP_CONTEXT(CMMFDevSoundAdaptation::IsResumeSupported *CD1*, CtxDevSound, DPLOCAL);
901 TBool isSupported = iBody->IsResumeSupported();
902 DP0_RET(isSupported , "%d");
905 // -----------------------------------------------------------------------------
906 // CMMFDevSoundAdaptation::IsResumeSupported
907 // (other items were commented in a header).
908 // -----------------------------------------------------------------------------
910 EXPORT_C TInt CMMFDevSoundAdaptation::Resume()
912 DP_CONTEXT(CMMFDevSoundAdaptation::Resume *CD1*, CtxDevSound, DPLOCAL);
914 TInt error = iBody->Resume();
915 DP0_RET(error, "%d");
918 EXPORT_C void CMMFDevSoundAdaptation::BufferErrorEvent()
920 iBody->BufferErrorEvent();
923 EXPORT_C void CMMFDevSoundAdaptation::RollbackAdaptorActiveStateToBeforeCommit()
925 DP_CONTEXT(CMMFDevSoundAdaptation::RollbackAdaptorActiveStateToBeforeCommit *CD1*, CtxDevSound, DPLOCAL);
927 iBody->RollbackAdaptorActiveStateToBeforeCommit();