os/mm/devsound/a3fdevsound/src/mmfdevsound/sounddevice.cpp
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/mm/devsound/a3fdevsound/src/mmfdevsound/sounddevice.cpp	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,716 @@
     1.4 +// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
     1.5 +// All rights reserved.
     1.6 +// This component and the accompanying materials are made available
     1.7 +// under the terms of "Eclipse Public License v1.0"
     1.8 +// which accompanies this distribution, and is available
     1.9 +// at the URL "http://www.eclipse.org/legal/epl-v10.html".
    1.10 +//
    1.11 +// Initial Contributors:
    1.12 +// Nokia Corporation - initial contribution.
    1.13 +//
    1.14 +// Contributors:
    1.15 +//
    1.16 +// Description:
    1.17 +//
    1.18 +
    1.19 +
    1.20 +
    1.21 +//  INCLUDES
    1.22 +#include <mmf/server/sounddevice.h>
    1.23 +#include "sounddevicebody.h"
    1.24 +
    1.25 +/*
    1.26 + *  Default Constructor.
    1.27 + */
    1.28 +CMMFDevSound::CMMFDevSound()
    1.29 +	{
    1.30 +	}
    1.31 +
    1.32 +/*
    1.33 + *  Destructor.
    1.34 + */
    1.35 +EXPORT_C CMMFDevSound::~CMMFDevSound()
    1.36 +	{
    1.37 +	delete iBody;
    1.38 +	}
    1.39 +
    1.40 +/*
    1.41 + *  CMMFDevSound::NewL
    1.42 + *
    1.43 + *  Constructs and returns a pointer to a new CMMFDevSound object.
    1.44 + */
    1.45 +EXPORT_C CMMFDevSound* CMMFDevSound::NewL()
    1.46 +	{
    1.47 +	CMMFDevSound* self = new (ELeave) CMMFDevSound;
    1.48 +	CleanupStack::PushL(self);
    1.49 +	self->ConstructL();
    1.50 +	CleanupStack::Pop(self);
    1.51 +	return self;
    1.52 +	}
    1.53 +
    1.54 +/*
    1.55 + *  CMMFDevSound::ConstructL
    1.56 + *
    1.57 + *  Second phase constructor.
    1.58 + */
    1.59 +void CMMFDevSound::ConstructL()
    1.60 +	{
    1.61 +	iBody = CBody::NewL();
    1.62 +	}
    1.63 +
    1.64 +/*
    1.65 + *  CMMFDevSound::InitializeL
    1.66 + *
    1.67 + *  Initializes CMMFDevSound object. On completion of Initialization will
    1.68 + *  call InitializeComplete() on aDevSoundObserver.
    1.69 + *
    1.70 + *  @param  aDevSoundObserver. A reference to the DevSound Observer instance.
    1.71 + *  @param  aMode. A mode for which this object will be used.
    1.72 + */
    1.73 +EXPORT_C void CMMFDevSound::InitializeL(MDevSoundObserver& aDevSoundObserver,TMMFState aMode)
    1.74 +
    1.75 +	{
    1.76 +	iBody->InitializeL(aDevSoundObserver,aMode);
    1.77 +	}
    1.78 +
    1.79 +/*
    1.80 + *  CMMFDevSound::InitializeL
    1.81 + *
    1.82 + *  Initializes CMMFDevSound object with hardware device aHWDev. On completion
    1.83 + *  of Initialization will call InitializeComplete() on aDevSoundObserver.
    1.84 + *
    1.85 + *	Method is deprecated from OS release 9.5
    1.86 + *
    1.87 + *  @param  aDevSoundObserver. A reference to the DevSound Observer instance.
    1.88 + *  @param  aHWDev. CMMFHwDevice implementation identifier.
    1.89 + *  @param  aMode. A mode for which this object will be used.
    1.90 + */
    1.91 +EXPORT_C void CMMFDevSound::InitializeL(
    1.92 +							MDevSoundObserver& /*aDevSoundObserver*/,
    1.93 +							TUid /*aHWDev*/,
    1.94 +							TMMFState /*aMode*/)
    1.95 +	{
    1.96 +	User::Leave(KErrNotSupported);
    1.97 +	}
    1.98 +
    1.99 +/*
   1.100 + *  CMMFDevSound::InitializeL
   1.101 + *
   1.102 + *  Initializes CMMFDevSound object with hardware device with hardware
   1.103 + *  device's FourCC code. On completion of Initialization will call
   1.104 + *  InitializeComplete() on aDevSoundObserver.
   1.105 + *
   1.106 + *  @param  aDevSoundObserver. A reference to the DevSound Observer instance.
   1.107 + *  @param  aDesiredFourCC. CMMFHwDevice implementation FourCC.
   1.108 + *  @param  aMode. A mode for which this object will be used.
   1.109 + */
   1.110 +EXPORT_C void CMMFDevSound::InitializeL(
   1.111 +							MDevSoundObserver& aDevSoundObserver,
   1.112 +							TFourCC aDesiredFourCC,
   1.113 +							TMMFState aMode)
   1.114 +	{
   1.115 +	iBody->InitializeL(aDevSoundObserver, aDesiredFourCC, aMode);
   1.116 +	}
   1.117 +
   1.118 +/*
   1.119 + *  CMMFDevSound::Capabilities
   1.120 + *
   1.121 + *  Returns supported Audio settings.
   1.122 + *
   1.123 + *  @return TMMFCapabilities device settings.
   1.124 + */
   1.125 +EXPORT_C TMMFCapabilities CMMFDevSound::Capabilities()
   1.126 +	{
   1.127 +	return iBody->Capabilities();
   1.128 +	}
   1.129 +
   1.130 +/*
   1.131 + *  CMMFDevSound::Config
   1.132 + *
   1.133 + *  Returns current audio settings.
   1.134 + *
   1.135 + *  @return TMMFCapabilities device settings.
   1.136 + */
   1.137 +EXPORT_C TMMFCapabilities CMMFDevSound::Config() const
   1.138 +	{
   1.139 +	return iBody->Config();
   1.140 +	}
   1.141 +
   1.142 +/*
   1.143 + *  CMMFDevSound::SetConfigL
   1.144 + *
   1.145 + *  ConfigureS CMMFDevSound object with the settings in aConfig.
   1.146 + *
   1.147 + *  Use this to set sampling rate, Encoding and Mono/Stereo.
   1.148 + *
   1.149 + *  @param  aConfig. CMMFDevSound configuration settings.
   1.150 + */
   1.151 +EXPORT_C void CMMFDevSound::SetConfigL(const TMMFCapabilities& aConfig)
   1.152 +	{
   1.153 +	iBody->SetConfigL(aConfig);
   1.154 +	}
   1.155 +
   1.156 +/*
   1.157 + *  CMMFDevSound::MaxVolume
   1.158 + *
   1.159 + *  Returns an integer representing the maximum volume.
   1.160 + *
   1.161 + *  This is the maximum volume which can be passed to CMMFDevSound::SetVolume.
   1.162 + *
   1.163 + *  @return TInt
   1.164 + *          The maximum volume. This value is platform dependent but is always
   1.165 + *          greater than or equal to one.
   1.166 + */
   1.167 +EXPORT_C TInt CMMFDevSound::MaxVolume()
   1.168 +	{
   1.169 +	return iBody->MaxVolume();
   1.170 +	}
   1.171 +
   1.172 +/*
   1.173 + *  CMMFDevSound::Volume
   1.174 + *
   1.175 + *  Returns an integer representing current volume level.
   1.176 + *
   1.177 + *  @return TInt
   1.178 + *          Current volume level.
   1.179 + */
   1.180 +EXPORT_C TInt CMMFDevSound::Volume()
   1.181 +	{
   1.182 +	return iBody->Volume();
   1.183 +	}
   1.184 +
   1.185 +/*
   1.186 + *  CMMFDevSound::SetVolume
   1.187 + *
   1.188 + *  Changes current volume level to the specified value.
   1.189 + *
   1.190 + *  The volume can be changed before or during playback and is effective
   1.191 + *  immediately.
   1.192 + *
   1.193 + *  @param  TInt
   1.194 + *          The volume setting. This can be any value between zero and the
   1.195 + *          value returned by the call to CMMFDevSound::MaxVolume(). If the
   1.196 + *          volume is out of range, it is automatically set to the minimum or
   1.197 + *          maximum level closest to the value being passed in. Setting a zero
   1.198 + *          value mutes the sound.
   1.199 + */
   1.200 +EXPORT_C void CMMFDevSound::SetVolume(TInt aVolume)
   1.201 +	{
   1.202 +	iBody->SetVolume(aVolume);
   1.203 +	}
   1.204 +
   1.205 +/*
   1.206 + *  CMMFDevSound::MaxGain
   1.207 + *
   1.208 + *  Returns an integer representing the maximum microphone gain.
   1.209 + *
   1.210 + *  This is the maximum value which can be passed to CMMFDevSound::SetGain.
   1.211 + *
   1.212 + *  @return TInt
   1.213 + *          The maximum gain. This value is platform dependent but is always
   1.214 + *          greater than or equal to one.
   1.215 + */
   1.216 +EXPORT_C TInt CMMFDevSound::MaxGain()
   1.217 +	{
   1.218 +	return iBody->MaxGain();
   1.219 +	}
   1.220 +
   1.221 +/*
   1.222 + *  CMMFDevSound::Gain
   1.223 + *
   1.224 + *  Returns an integer representing current gain.
   1.225 + *
   1.226 + *  @return TInt
   1.227 + *          The current gain level.
   1.228 + */
   1.229 +EXPORT_C TInt CMMFDevSound::Gain()
   1.230 +	{
   1.231 +	return iBody->Gain();
   1.232 +	}
   1.233 +
   1.234 +/*
   1.235 + *  CMMFDevSound::SetGain
   1.236 + *
   1.237 + *  Changes current recording gain to a specified value.
   1.238 + *
   1.239 + *  The gain can be changed before or during recording and is effective
   1.240 + *  immediately.
   1.241 + *
   1.242 + *  @param  aGain. This can be any value between zero and the
   1.243 + *          value returned by the call to CMMFDevSound::MaxGain(). If the
   1.244 + *          gain is out of range, it is automatically set to minimum or maximum
   1.245 + *          value closest to the value that is being passed.
   1.246 + *          Setting a zero value mutes the microphone.
   1.247 + */
   1.248 +EXPORT_C void CMMFDevSound::SetGain(TInt aGain)
   1.249 +	{
   1.250 +	iBody->SetGain(aGain);
   1.251 +	}
   1.252 +
   1.253 +/*
   1.254 + *  CMMFDevSound::GetPlayBalanceL
   1.255 + *
   1.256 + *  Returns the speaker balance set for playing.
   1.257 + *
   1.258 + *  @param  aLeftPercentage. On return contains the left speaker volume percentage.
   1.259 + *  @param  aRightPercentage. On return contains the left speaker volume percentage.
   1.260 + */
   1.261 +EXPORT_C void CMMFDevSound::GetPlayBalanceL(TInt& aLeftPercentage,TInt& aRightPercentage)
   1.262 +	{
   1.263 +	iBody->GetPlayBalanceL(aLeftPercentage, aRightPercentage);
   1.264 +	}
   1.265 +
   1.266 +/*
   1.267 + *  CMMFDevSound::SetPlayBalanceL
   1.268 + *
   1.269 + *  Sets the speaker balance for playing.
   1.270 + *
   1.271 + *  The speaker balance can be changed before or during playback and is
   1.272 + *  effective immediately.
   1.273 + *
   1.274 + *  @param  aLeftPercentage. Left speaker volume perecentage. This can be any value between
   1.275 + *          zero and 100. Setting a zero value mutes the sound on the left
   1.276 + *          speaker.
   1.277 + *  @param  aRightPercentage. Right speaker volume perecentage. This can be any value between
   1.278 + *          zero and 100. Setting a zero value mutes the sound on the right
   1.279 + *          speaker.
   1.280 + */
   1.281 +EXPORT_C void CMMFDevSound::SetPlayBalanceL(TInt aLeftPercentage, TInt aRightPercentage)
   1.282 +	{
   1.283 +	iBody->SetPlayBalanceL(aLeftPercentage, aRightPercentage);
   1.284 +	}
   1.285 +
   1.286 +/*
   1.287 + *  CMMFDevSound::GetRecordBalanceL
   1.288 + *
   1.289 + *  Returns the microphone gain balance set for recording.
   1.290 + *
   1.291 + *  @param  aLeftPercentage. On return contains the left microphone gain percentage.
   1.292 + *  @param  aRightPercentage. On return contains the right microphone gain percentage.
   1.293 + */
   1.294 +EXPORT_C void CMMFDevSound::GetRecordBalanceL(TInt& aLeftPercentage, TInt& aRightPercentage)
   1.295 +	{
   1.296 +	iBody->GetRecordBalanceL(aLeftPercentage, aRightPercentage);
   1.297 +	}
   1.298 +
   1.299 +/*
   1.300 + *  CMMFDevSound::SetRecordBalanceL
   1.301 + *
   1.302 + *  Sets the microphone gain balance for recording.
   1.303 + *
   1.304 + *  The microphone gain balance can be changed before or during recording and
   1.305 + *  is effective immediately.
   1.306 + *
   1.307 + *  @param  aLeftPercentage. Left microphone gain precentage. This can be any value between zero
   1.308 + *          and 100. Setting a zero value mutes the gain on the left microphone.
   1.309 + *  @param  aRightPercentage. Right microphone gain precentage. This can be any value between zero
   1.310 + *          and 100. Setting a zero value mutes the gain on the right microphone
   1.311 + */
   1.312 +EXPORT_C void CMMFDevSound::SetRecordBalanceL(TInt aLeftPercentage,TInt aRightPercentage)
   1.313 +	{
   1.314 +	iBody->SetRecordBalanceL(aLeftPercentage, aRightPercentage);
   1.315 +	}
   1.316 +
   1.317 +/*
   1.318 + *  CMMFDevSound::PlayInitL
   1.319 + *
   1.320 + *  Initializes audio device and starts the playback. Before playback can be
   1.321 + *  started, its current client's access priority is first verified by the
   1.322 + *  audio policy. In case of an error during the policy initialization, the
   1.323 + *  PlayError() method will be called on the observer with KErrAccessDenied
   1.324 + *  error code, otherwise BufferToBeFilled() method will be called with a
   1.325 + *  buffer reference. After filling the buffer with the data, the client
   1.326 + *  should call PlayData() to start playback.
   1.327 + *
   1.328 + *  The amount of data that can be played is specified in
   1.329 + *  CMMFBuffer::RequestSize(). Any data that is read into the buffer beyond
   1.330 + *  this size will be ignored.
   1.331 + *
   1.332 + */
   1.333 +EXPORT_C void CMMFDevSound::PlayInitL()
   1.334 +	{
   1.335 +	iBody->PlayInitL();
   1.336 +	}
   1.337 +
   1.338 +/*
   1.339 + *  CMMFDevSound::RecordInitL
   1.340 + *
   1.341 + *  Initializes audio device and starts the recording. Before recording can be
   1.342 + *  started, its current client's access priority is first verified by the
   1.343 + *  audio policy. In case of an error during the policy initialization, the
   1.344 + *  RecordError() method will be called on the observer with KErrAccessDenied
   1.345 + *  error code, otherwise BufferToBeEmptied() method will be called with a
   1.346 + *  buffer reference. This buffer contains recorded or encoded data. After
   1.347 + *  processing the data in the buffer, the client should call RecordData()
   1.348 + *  to continue recording process.
   1.349 + *
   1.350 + *  The amount of data that is available is specified in
   1.351 + *  CMMFBuffer::RequestSize().
   1.352 + *
   1.353 + */
   1.354 +EXPORT_C void CMMFDevSound::RecordInitL()
   1.355 +	{
   1.356 +	iBody->RecordInitL();
   1.357 +	}
   1.358 +
   1.359 +/*
   1.360 + *  CMMFDevSound::PlayData
   1.361 + *
   1.362 + *  Plays data in the buffer. The client should fill the buffer with a stream
   1.363 + *  of sampled audio data before calling this method. The observer gets the
   1.364 + *  reference to the buffer along with BufferToBeFilled() callback. When
   1.365 + *  playing of the audio sample is complete, with success or not, the
   1.366 + *  PlayError() method is called on the observer.
   1.367 + */
   1.368 +EXPORT_C void CMMFDevSound::PlayData()
   1.369 +	{
   1.370 +	iBody->PlayData();
   1.371 +	}
   1.372 +
   1.373 +/*
   1.374 + *  CMMFDevSound::RecordData
   1.375 + *
   1.376 + *  Records audio data. Once the buffer is filled with recorded sampled audio
   1.377 + *  data, the observer gets reference to the buffer along with
   1.378 + *  BufferToBeEmptied() callback. After processing of the buffer (copying over
   1.379 + *  to a different buffer or writing to a file) the client should call this
   1.380 + *  method again to continue recording process.
   1.381 + */
   1.382 +EXPORT_C void CMMFDevSound::RecordData()
   1.383 +	{
   1.384 +	iBody->RecordData();
   1.385 +	}
   1.386 +
   1.387 +/*
   1.388 + *  CMMFDevSound::Stop
   1.389 + *
   1.390 + *  Stops the ongoing operation (Play, Record, TonePlay)
   1.391 + */
   1.392 +EXPORT_C void CMMFDevSound::Stop()
   1.393 +	{
   1.394 +	iBody->Stop();
   1.395 +	}
   1.396 +
   1.397 +/*
   1.398 + *  CMMFDevSound::Pause
   1.399 + *
   1.400 + *  Temporarily suspends the ongoing operation (Play, Record, TonePlay)
   1.401 + */
   1.402 +EXPORT_C void CMMFDevSound::Pause()
   1.403 +	{
   1.404 +	iBody->Pause();
   1.405 +	}
   1.406 +
   1.407 +/*
   1.408 + *  CMMFDevSound::SamplesRecorded
   1.409 + *
   1.410 + *  Returns the number of recorded samples up to this point.
   1.411 + *
   1.412 + *  @return TInt
   1.413 + *          Value representing recorded samples.
   1.414 + */
   1.415 +EXPORT_C TInt CMMFDevSound::SamplesRecorded()
   1.416 +	{
   1.417 +	return iBody->SamplesRecorded();
   1.418 +	}
   1.419 +
   1.420 +/*
   1.421 + *  CMMFDevSound::SamplesPlayed
   1.422 + *
   1.423 + *  Returns the number of played samples up to this point.
   1.424 + *
   1.425 + *  @return TInt
   1.426 + *          Value representing played samples.
   1.427 + */
   1.428 +EXPORT_C TInt CMMFDevSound::SamplesPlayed()
   1.429 +	{
   1.430 +	return iBody->SamplesPlayed();
   1.431 +	}
   1.432 +
   1.433 +/*
   1.434 + *  CMMFDevSound::PlayToneL
   1.435 + *
   1.436 + *  Initializes audio device and starts playing a single tone according with
   1.437 + *  the specified frequency and duration attributes.
   1.438 + *
   1.439 + *  @param  aFrequency. Frequency at with the tone will be played.
   1.440 + *  @param  aDuration. The period over which the tone will be played. A zero value causes
   1.441 + *          no tone to be played.
   1.442 + */
   1.443 +EXPORT_C void CMMFDevSound::PlayToneL(TInt aFrequency,const TTimeIntervalMicroSeconds& aDuration)
   1.444 +	{
   1.445 +	iBody->PlayToneL(aFrequency, aDuration);
   1.446 +	}
   1.447 +
   1.448 +/*
   1.449 + *  CMMFDevSound::PlayDualToneL
   1.450 + *
   1.451 + *  Initializes audio device and starts playing a dual tone.
   1.452 + *  The tone consists of two sine waves of different frequencies summed
   1.453 + *  together. Both frequencies and the duration are specified in the passed
   1.454 + *  in attributes.
   1.455 + *
   1.456 + *  @param  aFrequencyOne. Value representing first frequency of the dual tone.
   1.457 + *
   1.458 + *  @param  aFrequencyTwo. Value representing second frequency of the dual tone.
   1.459 + *
   1.460 + *  @param  aDuration. The period over which the tone will be played. A zero value causes
   1.461 + *          no tone to be played.
   1.462 + */
   1.463 +EXPORT_C void CMMFDevSound::PlayDualToneL(
   1.464 +								TInt aFrequencyOne,
   1.465 +								TInt aFrequencyTwo,
   1.466 +								const TTimeIntervalMicroSeconds& aDuration)
   1.467 +	{
   1.468 +	iBody->PlayDualToneL(aFrequencyOne, aFrequencyTwo, aDuration);
   1.469 +	}
   1.470 +
   1.471 +/*
   1.472 + *  CMMFDevSound::PlayDTMFStringL
   1.473 + *
   1.474 + *  Initializes audio device and starts playing DTMF string.
   1.475 + *
   1.476 + *  @param  aDTMFString. DTMF sequence in a descriptor.
   1.477 + */
   1.478 +EXPORT_C void CMMFDevSound::PlayDTMFStringL(const TDesC& aDTMFString)
   1.479 +	{
   1.480 +	iBody->PlayDTMFStringL(aDTMFString);
   1.481 +	}
   1.482 +
   1.483 +/*
   1.484 + *  CMMFDevSound::PlayToneSequenceL
   1.485 + *
   1.486 + *  Initializes audio device and starts playing tone sequence.
   1.487 + *
   1.488 + *  @param  aData. Tone sequence in a descriptor.
   1.489 + */
   1.490 +EXPORT_C void CMMFDevSound::PlayToneSequenceL(const TDesC8& aData)
   1.491 +	{
   1.492 +	iBody->PlayToneSequenceL(aData);
   1.493 +	}
   1.494 +
   1.495 +/*
   1.496 + *  CMMFDevSound::PlayFixedSequenceL
   1.497 + *
   1.498 + *  Initializes audio device and starts playing the specified tone sequence.
   1.499 + *
   1.500 + *	Method is deprecated from OS release 9.5
   1.501 + *
   1.502 + *  @param  aSequenceNumber. The index identifying the specific pre-defined tone sequence. The
   1.503 + *          index values are relative to zero. This can be any value between
   1.504 + *          zero and the value returned by the call to
   1.505 + *          CMdaAudioPlayerUtility::FixedSequenceCount() - 1. The function
   1.506 + *          raises a panic if sequence number is out of range.
   1.507 + */
   1.508 +EXPORT_C void CMMFDevSound::PlayFixedSequenceL(TInt /*aSequenceNumber*/)
   1.509 +	{
   1.510 +	User::Leave(KErrNotSupported);
   1.511 +	}
   1.512 +
   1.513 +/*
   1.514 + *  CMMFDevSound::SetToneRepeats
   1.515 + *
   1.516 + *  Defines the number of times the audio is to be repeated during the tone
   1.517 + *  playback operation.
   1.518 + *
   1.519 + *  A period of silence can follow each playing of tone. The tone playing can
   1.520 + *  be repeated indefinitely.
   1.521 + *
   1.522 + *  @param  aRepeatCount. The number of times the tone, together with the trailing silence,
   1.523 + *          is to be repeated. If this is set to KMdaRepeatForever, then the
   1.524 + *          tone, together with the trailing silence, is repeated indefinitely
   1.525 + *          or until Stop() is called. If this is set to zero, then the tone is
   1.526 + *          not repeated.  Supported only during the tone playing.
   1.527 +
   1.528 + *  @param  aRepeatTrailingSilence. The duration of the trailing silence.
   1.529 + */
   1.530 +EXPORT_C void CMMFDevSound::SetToneRepeats(TInt aRepeatCount,const TTimeIntervalMicroSeconds& aRepeatTrailingSilence)
   1.531 +	{
   1.532 +	iBody->SetToneRepeats(aRepeatCount, aRepeatTrailingSilence);
   1.533 +	}
   1.534 +
   1.535 +/*
   1.536 + *  CMMFDevSound::SetDTMFLengths
   1.537 + *
   1.538 + *  Defines the duration of 'tone on/tone off' and 'tone pause' to be used
   1.539 + *  during the DTMF playback.
   1.540 + *
   1.541 + *  Supported only during tone playing.
   1.542 + *
   1.543 + *  @param  aToneOnLength. The period over which the tone will be played. If this is set to
   1.544 + *          zero, then the tone is not played.
   1.545 + *
   1.546 + *  @param  aToneOffLength. The period over which 'no tone' will be played.
   1.547 + *
   1.548 + *  @param  aPauseLength. The period over which the tone playing will be paused.
   1.549 + */
   1.550 +EXPORT_C void CMMFDevSound::SetDTMFLengths(
   1.551 +									TTimeIntervalMicroSeconds32& aToneOnLength,
   1.552 +									TTimeIntervalMicroSeconds32& aToneOffLength,
   1.553 +									TTimeIntervalMicroSeconds32& aPauseLength)
   1.554 +	{
   1.555 +	iBody->SetDTMFLengths(aToneOnLength, aToneOffLength, aPauseLength);
   1.556 +	}
   1.557 +
   1.558 +/*
   1.559 + *  CMMFDevSound::SetVolumeRamp
   1.560 + *
   1.561 + *  Defines the period over which the volume level will rise smoothly from
   1.562 + *  mute to the normal volume level.
   1.563 + *
   1.564 + *  @param  aRampDuration. The period over which the volume is to rise. A zero value causes
   1.565 + *          the tone sample to be played at the normal level for the full duration of the 
   1.566 + *          playback. A value, which is longer than the duration
   1.567 + *          of the tone sample, will result in the sample never reaching its
   1.568 + *          normal volume level.
   1.569 + */
   1.570 +EXPORT_C void CMMFDevSound::SetVolumeRamp(const TTimeIntervalMicroSeconds& aRampDuration)
   1.571 +	{
   1.572 +	iBody->SetVolumeRamp(aRampDuration);
   1.573 +	}
   1.574 +
   1.575 +/*
   1.576 + *  CMMFDevSound::SetPrioritySettings
   1.577 + *
   1.578 + *  Defines the priority settings that should be used for this instance.
   1.579 + *
   1.580 + *  @param  aPrioritySettings. A structure representing client's priority, priority
   1.581 + *          preference and the state.
   1.582 + */
   1.583 +EXPORT_C void CMMFDevSound::SetPrioritySettings(const TMMFPrioritySettings& aPrioritySettings)
   1.584 +	{
   1.585 +	iBody->SetPrioritySettings(aPrioritySettings);
   1.586 +	}
   1.587 +
   1.588 +/*
   1.589 + *  CMMFDevSound::CustomInterface
   1.590 + *
   1.591 + *  Sends request to the DevSound Server to start custom interface specified
   1.592 + *  by the TUid attribute.
   1.593 + *
   1.594 + *  @param  aInterface. Unique ID of the custom interface
   1.595 + *
   1.596 + *  @return TAny*
   1.597 + *          Pointer to the custom interface object.
   1.598 + */
   1.599 +EXPORT_C TAny* CMMFDevSound::CustomInterface(TUid aInterface)
   1.600 +	{
   1.601 +	return iBody->CustomInterface(aInterface);
   1.602 +	}
   1.603 +
   1.604 +/*
   1.605 + *  CMMFDevSound::FixedSequenceCount
   1.606 + *
   1.607 + *  Returns the number of available pre-defined tone sequences.
   1.608 + *
   1.609 + *	Method is deprecated from OS release 9.5
   1.610 + *
   1.611 + *  This is the number of fixed sequence supported by the DevSound by default.
   1.612 + *
   1.613 + *  @return TInt
   1.614 + *          The fixed sequence count. This value is implementation dependent
   1.615 + *          but is always greater than or equal to zero.
   1.616 + */
   1.617 +EXPORT_C TInt CMMFDevSound::FixedSequenceCount()
   1.618 +	{
   1.619 +	return 0;
   1.620 +	}
   1.621 +
   1.622 +/*
   1.623 + *  CMMFDevSound::FixedSequenceName
   1.624 + *
   1.625 + *  Returns the name assigned to a specific pre-defined tone sequence.
   1.626 + *
   1.627 + *	Method is deprecated from OS release 9.5
   1.628 + *
   1.629 + *  @param  aSequenceNumber. The index identifying the specific pre-defined tone sequence.
   1.630 + *          Index values are relative to zero. This can be any value between
   1.631 + *          zero and the value returned by the call to
   1.632 + *          CMdaAudioPlayerUtility::FixedSequenceCount() - 1. The function
   1.633 + *          raises a panic if sequence number is out of range.
   1.634 + *
   1.635 + *  @return TDesC&
   1.636 + *          A reference to a descriptor containing fixed sequence name
   1.637 + *          indexed by aSequenceNumber.
   1.638 + */
   1.639 +EXPORT_C const TDesC& CMMFDevSound::FixedSequenceName(TInt /*aSequenceNumber*/)
   1.640 +	{
   1.641 +	return KNullDesC;
   1.642 +	}
   1.643 +
   1.644 +/*
   1.645 + *  CMMFDevSound::GetSupportedInputDataTypesL
   1.646 + *
   1.647 + *  Returns a list of supported input data types that can be sent to the
   1.648 + *  DevSound for playing audio.
   1.649 + *
   1.650 + *  @param  aSupportedDataTypes. An array of supported data types.
   1.651 + *  @param  aPrioritySettings. Structure containing priority settings.
   1.652 + */
   1.653 +EXPORT_C void CMMFDevSound::GetSupportedInputDataTypesL(RArray<TFourCC>& aSupportedDataTypes,const TMMFPrioritySettings& aPrioritySettings) const
   1.654 +	{
   1.655 +	iBody->GetSupportedInputDataTypesL(aSupportedDataTypes,
   1.656 +									aPrioritySettings);
   1.657 +	}
   1.658 +
   1.659 +/*
   1.660 + *  CMMFDevSound::GetSupportedOutputDataTypesL
   1.661 + *
   1.662 + *  Returns a list of supported output data types that can be received from
   1.663 + *  the DevSound for recording audio.
   1.664 + *
   1.665 + *  @param  aSupportedDataTypes. An array of supported data types.
   1.666 + *  @param aPrioritySettings. Structure containing priority settings.
   1.667 + */
   1.668 +EXPORT_C void CMMFDevSound::GetSupportedOutputDataTypesL(RArray<TFourCC>& aSupportedDataTypes,const TMMFPrioritySettings& aPrioritySettings) const
   1.669 +	{
   1.670 +	iBody->GetSupportedOutputDataTypesL(aSupportedDataTypes,aPrioritySettings);
   1.671 +	}
   1.672 +
   1.673 +/********************************************************************************
   1.674 + *				Non Exported public functions ends here		*					
   1.675 + ********************************************************************************/
   1.676 +
   1.677 +/******************************************************************************
   1.678 + *	Function Name:	E32Dll
   1.679 + *	
   1.680 + *	Description:	Entry point for applications.
   1.681 + *
   1.682 + ******************************************************************************/
   1.683 +
   1.684 +enum TDllReason {};
   1.685 +EXPORT_C TInt E32Dll(TDllReason /*aReason*/)
   1.686 +	{
   1.687 +	return KErrNone;
   1.688 +	}
   1.689 +
   1.690 +// CMMFDevSoundEventHandler::NewL() has been declared in export table
   1.691 +// but since it is the only class method to be so, and .h is in source
   1.692 +// it is not actually usable. Just declare the following to keep linker happy
   1.693 +
   1.694 +// Need dummy abstract type - this is not the real class
   1.695 +class RMMFAudioPolicyProxy;
   1.696 +
   1.697 +class CMMFDevSoundEventHandler : public CActive
   1.698 +	{
   1.699 +public:
   1.700 +	IMPORT_C static CMMFDevSoundEventHandler* NewL(RMMFAudioPolicyProxy*);
   1.701 +private:
   1.702 +	CMMFDevSoundEventHandler();
   1.703 +	};
   1.704 +	
   1.705 +EXPORT_C CMMFDevSoundEventHandler* CMMFDevSoundEventHandler::NewL(RMMFAudioPolicyProxy*)
   1.706 +	{
   1.707 +	_LIT(KModule, "DevSound");
   1.708 +	User::Panic(KModule, 1000);
   1.709 +	return NULL;
   1.710 +	}
   1.711 +
   1.712 +// default constructor - keep compilers happy
   1.713 +CMMFDevSoundEventHandler::CMMFDevSoundEventHandler():
   1.714 +	CActive(EPriorityStandard)
   1.715 +	{
   1.716 +	}
   1.717 +
   1.718 +
   1.719 +// End of File