devsound/a3fdevsound/src/mmfdevsound/sounddevice.cpp
changeset 0 40261b775718
equal deleted inserted replaced
-1:000000000000 0:40261b775718
       
     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".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 //
       
    15 
       
    16 
       
    17 
       
    18 //  INCLUDES
       
    19 #include <mmf/server/sounddevice.h>
       
    20 #include "sounddevicebody.h"
       
    21 
       
    22 /*
       
    23  *  Default Constructor.
       
    24  */
       
    25 CMMFDevSound::CMMFDevSound()
       
    26 	{
       
    27 	}
       
    28 
       
    29 /*
       
    30  *  Destructor.
       
    31  */
       
    32 EXPORT_C CMMFDevSound::~CMMFDevSound()
       
    33 	{
       
    34 	delete iBody;
       
    35 	}
       
    36 
       
    37 /*
       
    38  *  CMMFDevSound::NewL
       
    39  *
       
    40  *  Constructs and returns a pointer to a new CMMFDevSound object.
       
    41  */
       
    42 EXPORT_C CMMFDevSound* CMMFDevSound::NewL()
       
    43 	{
       
    44 	CMMFDevSound* self = new (ELeave) CMMFDevSound;
       
    45 	CleanupStack::PushL(self);
       
    46 	self->ConstructL();
       
    47 	CleanupStack::Pop(self);
       
    48 	return self;
       
    49 	}
       
    50 
       
    51 /*
       
    52  *  CMMFDevSound::ConstructL
       
    53  *
       
    54  *  Second phase constructor.
       
    55  */
       
    56 void CMMFDevSound::ConstructL()
       
    57 	{
       
    58 	iBody = CBody::NewL();
       
    59 	}
       
    60 
       
    61 /*
       
    62  *  CMMFDevSound::InitializeL
       
    63  *
       
    64  *  Initializes CMMFDevSound object. On completion of Initialization will
       
    65  *  call InitializeComplete() on aDevSoundObserver.
       
    66  *
       
    67  *  @param  aDevSoundObserver. A reference to the DevSound Observer instance.
       
    68  *  @param  aMode. A mode for which this object will be used.
       
    69  */
       
    70 EXPORT_C void CMMFDevSound::InitializeL(MDevSoundObserver& aDevSoundObserver,TMMFState aMode)
       
    71 
       
    72 	{
       
    73 	iBody->InitializeL(aDevSoundObserver,aMode);
       
    74 	}
       
    75 
       
    76 /*
       
    77  *  CMMFDevSound::InitializeL
       
    78  *
       
    79  *  Initializes CMMFDevSound object with hardware device aHWDev. On completion
       
    80  *  of Initialization will call InitializeComplete() on aDevSoundObserver.
       
    81  *
       
    82  *	Method is deprecated from OS release 9.5
       
    83  *
       
    84  *  @param  aDevSoundObserver. A reference to the DevSound Observer instance.
       
    85  *  @param  aHWDev. CMMFHwDevice implementation identifier.
       
    86  *  @param  aMode. A mode for which this object will be used.
       
    87  */
       
    88 EXPORT_C void CMMFDevSound::InitializeL(
       
    89 							MDevSoundObserver& /*aDevSoundObserver*/,
       
    90 							TUid /*aHWDev*/,
       
    91 							TMMFState /*aMode*/)
       
    92 	{
       
    93 	User::Leave(KErrNotSupported);
       
    94 	}
       
    95 
       
    96 /*
       
    97  *  CMMFDevSound::InitializeL
       
    98  *
       
    99  *  Initializes CMMFDevSound object with hardware device with hardware
       
   100  *  device's FourCC code. On completion of Initialization will call
       
   101  *  InitializeComplete() on aDevSoundObserver.
       
   102  *
       
   103  *  @param  aDevSoundObserver. A reference to the DevSound Observer instance.
       
   104  *  @param  aDesiredFourCC. CMMFHwDevice implementation FourCC.
       
   105  *  @param  aMode. A mode for which this object will be used.
       
   106  */
       
   107 EXPORT_C void CMMFDevSound::InitializeL(
       
   108 							MDevSoundObserver& aDevSoundObserver,
       
   109 							TFourCC aDesiredFourCC,
       
   110 							TMMFState aMode)
       
   111 	{
       
   112 	iBody->InitializeL(aDevSoundObserver, aDesiredFourCC, aMode);
       
   113 	}
       
   114 
       
   115 /*
       
   116  *  CMMFDevSound::Capabilities
       
   117  *
       
   118  *  Returns supported Audio settings.
       
   119  *
       
   120  *  @return TMMFCapabilities device settings.
       
   121  */
       
   122 EXPORT_C TMMFCapabilities CMMFDevSound::Capabilities()
       
   123 	{
       
   124 	return iBody->Capabilities();
       
   125 	}
       
   126 
       
   127 /*
       
   128  *  CMMFDevSound::Config
       
   129  *
       
   130  *  Returns current audio settings.
       
   131  *
       
   132  *  @return TMMFCapabilities device settings.
       
   133  */
       
   134 EXPORT_C TMMFCapabilities CMMFDevSound::Config() const
       
   135 	{
       
   136 	return iBody->Config();
       
   137 	}
       
   138 
       
   139 /*
       
   140  *  CMMFDevSound::SetConfigL
       
   141  *
       
   142  *  ConfigureS CMMFDevSound object with the settings in aConfig.
       
   143  *
       
   144  *  Use this to set sampling rate, Encoding and Mono/Stereo.
       
   145  *
       
   146  *  @param  aConfig. CMMFDevSound configuration settings.
       
   147  */
       
   148 EXPORT_C void CMMFDevSound::SetConfigL(const TMMFCapabilities& aConfig)
       
   149 	{
       
   150 	iBody->SetConfigL(aConfig);
       
   151 	}
       
   152 
       
   153 /*
       
   154  *  CMMFDevSound::MaxVolume
       
   155  *
       
   156  *  Returns an integer representing the maximum volume.
       
   157  *
       
   158  *  This is the maximum volume which can be passed to CMMFDevSound::SetVolume.
       
   159  *
       
   160  *  @return TInt
       
   161  *          The maximum volume. This value is platform dependent but is always
       
   162  *          greater than or equal to one.
       
   163  */
       
   164 EXPORT_C TInt CMMFDevSound::MaxVolume()
       
   165 	{
       
   166 	return iBody->MaxVolume();
       
   167 	}
       
   168 
       
   169 /*
       
   170  *  CMMFDevSound::Volume
       
   171  *
       
   172  *  Returns an integer representing current volume level.
       
   173  *
       
   174  *  @return TInt
       
   175  *          Current volume level.
       
   176  */
       
   177 EXPORT_C TInt CMMFDevSound::Volume()
       
   178 	{
       
   179 	return iBody->Volume();
       
   180 	}
       
   181 
       
   182 /*
       
   183  *  CMMFDevSound::SetVolume
       
   184  *
       
   185  *  Changes current volume level to the specified value.
       
   186  *
       
   187  *  The volume can be changed before or during playback and is effective
       
   188  *  immediately.
       
   189  *
       
   190  *  @param  TInt
       
   191  *          The volume setting. This can be any value between zero and the
       
   192  *          value returned by the call to CMMFDevSound::MaxVolume(). If the
       
   193  *          volume is out of range, it is automatically set to the minimum or
       
   194  *          maximum level closest to the value being passed in. Setting a zero
       
   195  *          value mutes the sound.
       
   196  */
       
   197 EXPORT_C void CMMFDevSound::SetVolume(TInt aVolume)
       
   198 	{
       
   199 	iBody->SetVolume(aVolume);
       
   200 	}
       
   201 
       
   202 /*
       
   203  *  CMMFDevSound::MaxGain
       
   204  *
       
   205  *  Returns an integer representing the maximum microphone gain.
       
   206  *
       
   207  *  This is the maximum value which can be passed to CMMFDevSound::SetGain.
       
   208  *
       
   209  *  @return TInt
       
   210  *          The maximum gain. This value is platform dependent but is always
       
   211  *          greater than or equal to one.
       
   212  */
       
   213 EXPORT_C TInt CMMFDevSound::MaxGain()
       
   214 	{
       
   215 	return iBody->MaxGain();
       
   216 	}
       
   217 
       
   218 /*
       
   219  *  CMMFDevSound::Gain
       
   220  *
       
   221  *  Returns an integer representing current gain.
       
   222  *
       
   223  *  @return TInt
       
   224  *          The current gain level.
       
   225  */
       
   226 EXPORT_C TInt CMMFDevSound::Gain()
       
   227 	{
       
   228 	return iBody->Gain();
       
   229 	}
       
   230 
       
   231 /*
       
   232  *  CMMFDevSound::SetGain
       
   233  *
       
   234  *  Changes current recording gain to a specified value.
       
   235  *
       
   236  *  The gain can be changed before or during recording and is effective
       
   237  *  immediately.
       
   238  *
       
   239  *  @param  aGain. This can be any value between zero and the
       
   240  *          value returned by the call to CMMFDevSound::MaxGain(). If the
       
   241  *          gain is out of range, it is automatically set to minimum or maximum
       
   242  *          value closest to the value that is being passed.
       
   243  *          Setting a zero value mutes the microphone.
       
   244  */
       
   245 EXPORT_C void CMMFDevSound::SetGain(TInt aGain)
       
   246 	{
       
   247 	iBody->SetGain(aGain);
       
   248 	}
       
   249 
       
   250 /*
       
   251  *  CMMFDevSound::GetPlayBalanceL
       
   252  *
       
   253  *  Returns the speaker balance set for playing.
       
   254  *
       
   255  *  @param  aLeftPercentage. On return contains the left speaker volume percentage.
       
   256  *  @param  aRightPercentage. On return contains the left speaker volume percentage.
       
   257  */
       
   258 EXPORT_C void CMMFDevSound::GetPlayBalanceL(TInt& aLeftPercentage,TInt& aRightPercentage)
       
   259 	{
       
   260 	iBody->GetPlayBalanceL(aLeftPercentage, aRightPercentage);
       
   261 	}
       
   262 
       
   263 /*
       
   264  *  CMMFDevSound::SetPlayBalanceL
       
   265  *
       
   266  *  Sets the speaker balance for playing.
       
   267  *
       
   268  *  The speaker balance can be changed before or during playback and is
       
   269  *  effective immediately.
       
   270  *
       
   271  *  @param  aLeftPercentage. Left speaker volume perecentage. This can be any value between
       
   272  *          zero and 100. Setting a zero value mutes the sound on the left
       
   273  *          speaker.
       
   274  *  @param  aRightPercentage. Right speaker volume perecentage. This can be any value between
       
   275  *          zero and 100. Setting a zero value mutes the sound on the right
       
   276  *          speaker.
       
   277  */
       
   278 EXPORT_C void CMMFDevSound::SetPlayBalanceL(TInt aLeftPercentage, TInt aRightPercentage)
       
   279 	{
       
   280 	iBody->SetPlayBalanceL(aLeftPercentage, aRightPercentage);
       
   281 	}
       
   282 
       
   283 /*
       
   284  *  CMMFDevSound::GetRecordBalanceL
       
   285  *
       
   286  *  Returns the microphone gain balance set for recording.
       
   287  *
       
   288  *  @param  aLeftPercentage. On return contains the left microphone gain percentage.
       
   289  *  @param  aRightPercentage. On return contains the right microphone gain percentage.
       
   290  */
       
   291 EXPORT_C void CMMFDevSound::GetRecordBalanceL(TInt& aLeftPercentage, TInt& aRightPercentage)
       
   292 	{
       
   293 	iBody->GetRecordBalanceL(aLeftPercentage, aRightPercentage);
       
   294 	}
       
   295 
       
   296 /*
       
   297  *  CMMFDevSound::SetRecordBalanceL
       
   298  *
       
   299  *  Sets the microphone gain balance for recording.
       
   300  *
       
   301  *  The microphone gain balance can be changed before or during recording and
       
   302  *  is effective immediately.
       
   303  *
       
   304  *  @param  aLeftPercentage. Left microphone gain precentage. This can be any value between zero
       
   305  *          and 100. Setting a zero value mutes the gain on the left microphone.
       
   306  *  @param  aRightPercentage. Right microphone gain precentage. This can be any value between zero
       
   307  *          and 100. Setting a zero value mutes the gain on the right microphone
       
   308  */
       
   309 EXPORT_C void CMMFDevSound::SetRecordBalanceL(TInt aLeftPercentage,TInt aRightPercentage)
       
   310 	{
       
   311 	iBody->SetRecordBalanceL(aLeftPercentage, aRightPercentage);
       
   312 	}
       
   313 
       
   314 /*
       
   315  *  CMMFDevSound::PlayInitL
       
   316  *
       
   317  *  Initializes audio device and starts the playback. Before playback can be
       
   318  *  started, its current client's access priority is first verified by the
       
   319  *  audio policy. In case of an error during the policy initialization, the
       
   320  *  PlayError() method will be called on the observer with KErrAccessDenied
       
   321  *  error code, otherwise BufferToBeFilled() method will be called with a
       
   322  *  buffer reference. After filling the buffer with the data, the client
       
   323  *  should call PlayData() to start playback.
       
   324  *
       
   325  *  The amount of data that can be played is specified in
       
   326  *  CMMFBuffer::RequestSize(). Any data that is read into the buffer beyond
       
   327  *  this size will be ignored.
       
   328  *
       
   329  */
       
   330 EXPORT_C void CMMFDevSound::PlayInitL()
       
   331 	{
       
   332 	iBody->PlayInitL();
       
   333 	}
       
   334 
       
   335 /*
       
   336  *  CMMFDevSound::RecordInitL
       
   337  *
       
   338  *  Initializes audio device and starts the recording. Before recording can be
       
   339  *  started, its current client's access priority is first verified by the
       
   340  *  audio policy. In case of an error during the policy initialization, the
       
   341  *  RecordError() method will be called on the observer with KErrAccessDenied
       
   342  *  error code, otherwise BufferToBeEmptied() method will be called with a
       
   343  *  buffer reference. This buffer contains recorded or encoded data. After
       
   344  *  processing the data in the buffer, the client should call RecordData()
       
   345  *  to continue recording process.
       
   346  *
       
   347  *  The amount of data that is available is specified in
       
   348  *  CMMFBuffer::RequestSize().
       
   349  *
       
   350  */
       
   351 EXPORT_C void CMMFDevSound::RecordInitL()
       
   352 	{
       
   353 	iBody->RecordInitL();
       
   354 	}
       
   355 
       
   356 /*
       
   357  *  CMMFDevSound::PlayData
       
   358  *
       
   359  *  Plays data in the buffer. The client should fill the buffer with a stream
       
   360  *  of sampled audio data before calling this method. The observer gets the
       
   361  *  reference to the buffer along with BufferToBeFilled() callback. When
       
   362  *  playing of the audio sample is complete, with success or not, the
       
   363  *  PlayError() method is called on the observer.
       
   364  */
       
   365 EXPORT_C void CMMFDevSound::PlayData()
       
   366 	{
       
   367 	iBody->PlayData();
       
   368 	}
       
   369 
       
   370 /*
       
   371  *  CMMFDevSound::RecordData
       
   372  *
       
   373  *  Records audio data. Once the buffer is filled with recorded sampled audio
       
   374  *  data, the observer gets reference to the buffer along with
       
   375  *  BufferToBeEmptied() callback. After processing of the buffer (copying over
       
   376  *  to a different buffer or writing to a file) the client should call this
       
   377  *  method again to continue recording process.
       
   378  */
       
   379 EXPORT_C void CMMFDevSound::RecordData()
       
   380 	{
       
   381 	iBody->RecordData();
       
   382 	}
       
   383 
       
   384 /*
       
   385  *  CMMFDevSound::Stop
       
   386  *
       
   387  *  Stops the ongoing operation (Play, Record, TonePlay)
       
   388  */
       
   389 EXPORT_C void CMMFDevSound::Stop()
       
   390 	{
       
   391 	iBody->Stop();
       
   392 	}
       
   393 
       
   394 /*
       
   395  *  CMMFDevSound::Pause
       
   396  *
       
   397  *  Temporarily suspends the ongoing operation (Play, Record, TonePlay)
       
   398  */
       
   399 EXPORT_C void CMMFDevSound::Pause()
       
   400 	{
       
   401 	iBody->Pause();
       
   402 	}
       
   403 
       
   404 /*
       
   405  *  CMMFDevSound::SamplesRecorded
       
   406  *
       
   407  *  Returns the number of recorded samples up to this point.
       
   408  *
       
   409  *  @return TInt
       
   410  *          Value representing recorded samples.
       
   411  */
       
   412 EXPORT_C TInt CMMFDevSound::SamplesRecorded()
       
   413 	{
       
   414 	return iBody->SamplesRecorded();
       
   415 	}
       
   416 
       
   417 /*
       
   418  *  CMMFDevSound::SamplesPlayed
       
   419  *
       
   420  *  Returns the number of played samples up to this point.
       
   421  *
       
   422  *  @return TInt
       
   423  *          Value representing played samples.
       
   424  */
       
   425 EXPORT_C TInt CMMFDevSound::SamplesPlayed()
       
   426 	{
       
   427 	return iBody->SamplesPlayed();
       
   428 	}
       
   429 
       
   430 /*
       
   431  *  CMMFDevSound::PlayToneL
       
   432  *
       
   433  *  Initializes audio device and starts playing a single tone according with
       
   434  *  the specified frequency and duration attributes.
       
   435  *
       
   436  *  @param  aFrequency. Frequency at with the tone will be played.
       
   437  *  @param  aDuration. The period over which the tone will be played. A zero value causes
       
   438  *          no tone to be played.
       
   439  */
       
   440 EXPORT_C void CMMFDevSound::PlayToneL(TInt aFrequency,const TTimeIntervalMicroSeconds& aDuration)
       
   441 	{
       
   442 	iBody->PlayToneL(aFrequency, aDuration);
       
   443 	}
       
   444 
       
   445 /*
       
   446  *  CMMFDevSound::PlayDualToneL
       
   447  *
       
   448  *  Initializes audio device and starts playing a dual tone.
       
   449  *  The tone consists of two sine waves of different frequencies summed
       
   450  *  together. Both frequencies and the duration are specified in the passed
       
   451  *  in attributes.
       
   452  *
       
   453  *  @param  aFrequencyOne. Value representing first frequency of the dual tone.
       
   454  *
       
   455  *  @param  aFrequencyTwo. Value representing second frequency of the dual tone.
       
   456  *
       
   457  *  @param  aDuration. The period over which the tone will be played. A zero value causes
       
   458  *          no tone to be played.
       
   459  */
       
   460 EXPORT_C void CMMFDevSound::PlayDualToneL(
       
   461 								TInt aFrequencyOne,
       
   462 								TInt aFrequencyTwo,
       
   463 								const TTimeIntervalMicroSeconds& aDuration)
       
   464 	{
       
   465 	iBody->PlayDualToneL(aFrequencyOne, aFrequencyTwo, aDuration);
       
   466 	}
       
   467 
       
   468 /*
       
   469  *  CMMFDevSound::PlayDTMFStringL
       
   470  *
       
   471  *  Initializes audio device and starts playing DTMF string.
       
   472  *
       
   473  *  @param  aDTMFString. DTMF sequence in a descriptor.
       
   474  */
       
   475 EXPORT_C void CMMFDevSound::PlayDTMFStringL(const TDesC& aDTMFString)
       
   476 	{
       
   477 	iBody->PlayDTMFStringL(aDTMFString);
       
   478 	}
       
   479 
       
   480 /*
       
   481  *  CMMFDevSound::PlayToneSequenceL
       
   482  *
       
   483  *  Initializes audio device and starts playing tone sequence.
       
   484  *
       
   485  *  @param  aData. Tone sequence in a descriptor.
       
   486  */
       
   487 EXPORT_C void CMMFDevSound::PlayToneSequenceL(const TDesC8& aData)
       
   488 	{
       
   489 	iBody->PlayToneSequenceL(aData);
       
   490 	}
       
   491 
       
   492 /*
       
   493  *  CMMFDevSound::PlayFixedSequenceL
       
   494  *
       
   495  *  Initializes audio device and starts playing the specified tone sequence.
       
   496  *
       
   497  *	Method is deprecated from OS release 9.5
       
   498  *
       
   499  *  @param  aSequenceNumber. The index identifying the specific pre-defined tone sequence. The
       
   500  *          index values are relative to zero. This can be any value between
       
   501  *          zero and the value returned by the call to
       
   502  *          CMdaAudioPlayerUtility::FixedSequenceCount() - 1. The function
       
   503  *          raises a panic if sequence number is out of range.
       
   504  */
       
   505 EXPORT_C void CMMFDevSound::PlayFixedSequenceL(TInt /*aSequenceNumber*/)
       
   506 	{
       
   507 	User::Leave(KErrNotSupported);
       
   508 	}
       
   509 
       
   510 /*
       
   511  *  CMMFDevSound::SetToneRepeats
       
   512  *
       
   513  *  Defines the number of times the audio is to be repeated during the tone
       
   514  *  playback operation.
       
   515  *
       
   516  *  A period of silence can follow each playing of tone. The tone playing can
       
   517  *  be repeated indefinitely.
       
   518  *
       
   519  *  @param  aRepeatCount. The number of times the tone, together with the trailing silence,
       
   520  *          is to be repeated. If this is set to KMdaRepeatForever, then the
       
   521  *          tone, together with the trailing silence, is repeated indefinitely
       
   522  *          or until Stop() is called. If this is set to zero, then the tone is
       
   523  *          not repeated.  Supported only during the tone playing.
       
   524 
       
   525  *  @param  aRepeatTrailingSilence. The duration of the trailing silence.
       
   526  */
       
   527 EXPORT_C void CMMFDevSound::SetToneRepeats(TInt aRepeatCount,const TTimeIntervalMicroSeconds& aRepeatTrailingSilence)
       
   528 	{
       
   529 	iBody->SetToneRepeats(aRepeatCount, aRepeatTrailingSilence);
       
   530 	}
       
   531 
       
   532 /*
       
   533  *  CMMFDevSound::SetDTMFLengths
       
   534  *
       
   535  *  Defines the duration of 'tone on/tone off' and 'tone pause' to be used
       
   536  *  during the DTMF playback.
       
   537  *
       
   538  *  Supported only during tone playing.
       
   539  *
       
   540  *  @param  aToneOnLength. The period over which the tone will be played. If this is set to
       
   541  *          zero, then the tone is not played.
       
   542  *
       
   543  *  @param  aToneOffLength. The period over which 'no tone' will be played.
       
   544  *
       
   545  *  @param  aPauseLength. The period over which the tone playing will be paused.
       
   546  */
       
   547 EXPORT_C void CMMFDevSound::SetDTMFLengths(
       
   548 									TTimeIntervalMicroSeconds32& aToneOnLength,
       
   549 									TTimeIntervalMicroSeconds32& aToneOffLength,
       
   550 									TTimeIntervalMicroSeconds32& aPauseLength)
       
   551 	{
       
   552 	iBody->SetDTMFLengths(aToneOnLength, aToneOffLength, aPauseLength);
       
   553 	}
       
   554 
       
   555 /*
       
   556  *  CMMFDevSound::SetVolumeRamp
       
   557  *
       
   558  *  Defines the period over which the volume level will rise smoothly from
       
   559  *  mute to the normal volume level.
       
   560  *
       
   561  *  @param  aRampDuration. The period over which the volume is to rise. A zero value causes
       
   562  *          the tone sample to be played at the normal level for the full duration of the 
       
   563  *          playback. A value, which is longer than the duration
       
   564  *          of the tone sample, will result in the sample never reaching its
       
   565  *          normal volume level.
       
   566  */
       
   567 EXPORT_C void CMMFDevSound::SetVolumeRamp(const TTimeIntervalMicroSeconds& aRampDuration)
       
   568 	{
       
   569 	iBody->SetVolumeRamp(aRampDuration);
       
   570 	}
       
   571 
       
   572 /*
       
   573  *  CMMFDevSound::SetPrioritySettings
       
   574  *
       
   575  *  Defines the priority settings that should be used for this instance.
       
   576  *
       
   577  *  @param  aPrioritySettings. A structure representing client's priority, priority
       
   578  *          preference and the state.
       
   579  */
       
   580 EXPORT_C void CMMFDevSound::SetPrioritySettings(const TMMFPrioritySettings& aPrioritySettings)
       
   581 	{
       
   582 	iBody->SetPrioritySettings(aPrioritySettings);
       
   583 	}
       
   584 
       
   585 /*
       
   586  *  CMMFDevSound::CustomInterface
       
   587  *
       
   588  *  Sends request to the DevSound Server to start custom interface specified
       
   589  *  by the TUid attribute.
       
   590  *
       
   591  *  @param  aInterface. Unique ID of the custom interface
       
   592  *
       
   593  *  @return TAny*
       
   594  *          Pointer to the custom interface object.
       
   595  */
       
   596 EXPORT_C TAny* CMMFDevSound::CustomInterface(TUid aInterface)
       
   597 	{
       
   598 	return iBody->CustomInterface(aInterface);
       
   599 	}
       
   600 
       
   601 /*
       
   602  *  CMMFDevSound::FixedSequenceCount
       
   603  *
       
   604  *  Returns the number of available pre-defined tone sequences.
       
   605  *
       
   606  *	Method is deprecated from OS release 9.5
       
   607  *
       
   608  *  This is the number of fixed sequence supported by the DevSound by default.
       
   609  *
       
   610  *  @return TInt
       
   611  *          The fixed sequence count. This value is implementation dependent
       
   612  *          but is always greater than or equal to zero.
       
   613  */
       
   614 EXPORT_C TInt CMMFDevSound::FixedSequenceCount()
       
   615 	{
       
   616 	return 0;
       
   617 	}
       
   618 
       
   619 /*
       
   620  *  CMMFDevSound::FixedSequenceName
       
   621  *
       
   622  *  Returns the name assigned to a specific pre-defined tone sequence.
       
   623  *
       
   624  *	Method is deprecated from OS release 9.5
       
   625  *
       
   626  *  @param  aSequenceNumber. The index identifying the specific pre-defined tone sequence.
       
   627  *          Index values are relative to zero. This can be any value between
       
   628  *          zero and the value returned by the call to
       
   629  *          CMdaAudioPlayerUtility::FixedSequenceCount() - 1. The function
       
   630  *          raises a panic if sequence number is out of range.
       
   631  *
       
   632  *  @return TDesC&
       
   633  *          A reference to a descriptor containing fixed sequence name
       
   634  *          indexed by aSequenceNumber.
       
   635  */
       
   636 EXPORT_C const TDesC& CMMFDevSound::FixedSequenceName(TInt /*aSequenceNumber*/)
       
   637 	{
       
   638 	return KNullDesC;
       
   639 	}
       
   640 
       
   641 /*
       
   642  *  CMMFDevSound::GetSupportedInputDataTypesL
       
   643  *
       
   644  *  Returns a list of supported input data types that can be sent to the
       
   645  *  DevSound for playing audio.
       
   646  *
       
   647  *  @param  aSupportedDataTypes. An array of supported data types.
       
   648  *  @param  aPrioritySettings. Structure containing priority settings.
       
   649  */
       
   650 EXPORT_C void CMMFDevSound::GetSupportedInputDataTypesL(RArray<TFourCC>& aSupportedDataTypes,const TMMFPrioritySettings& aPrioritySettings) const
       
   651 	{
       
   652 	iBody->GetSupportedInputDataTypesL(aSupportedDataTypes,
       
   653 									aPrioritySettings);
       
   654 	}
       
   655 
       
   656 /*
       
   657  *  CMMFDevSound::GetSupportedOutputDataTypesL
       
   658  *
       
   659  *  Returns a list of supported output data types that can be received from
       
   660  *  the DevSound for recording audio.
       
   661  *
       
   662  *  @param  aSupportedDataTypes. An array of supported data types.
       
   663  *  @param aPrioritySettings. Structure containing priority settings.
       
   664  */
       
   665 EXPORT_C void CMMFDevSound::GetSupportedOutputDataTypesL(RArray<TFourCC>& aSupportedDataTypes,const TMMFPrioritySettings& aPrioritySettings) const
       
   666 	{
       
   667 	iBody->GetSupportedOutputDataTypesL(aSupportedDataTypes,aPrioritySettings);
       
   668 	}
       
   669 
       
   670 /********************************************************************************
       
   671  *				Non Exported public functions ends here		*					
       
   672  ********************************************************************************/
       
   673 
       
   674 /******************************************************************************
       
   675  *	Function Name:	E32Dll
       
   676  *	
       
   677  *	Description:	Entry point for applications.
       
   678  *
       
   679  ******************************************************************************/
       
   680 
       
   681 enum TDllReason {};
       
   682 EXPORT_C TInt E32Dll(TDllReason /*aReason*/)
       
   683 	{
       
   684 	return KErrNone;
       
   685 	}
       
   686 
       
   687 // CMMFDevSoundEventHandler::NewL() has been declared in export table
       
   688 // but since it is the only class method to be so, and .h is in source
       
   689 // it is not actually usable. Just declare the following to keep linker happy
       
   690 
       
   691 // Need dummy abstract type - this is not the real class
       
   692 class RMMFAudioPolicyProxy;
       
   693 
       
   694 class CMMFDevSoundEventHandler : public CActive
       
   695 	{
       
   696 public:
       
   697 	IMPORT_C static CMMFDevSoundEventHandler* NewL(RMMFAudioPolicyProxy*);
       
   698 private:
       
   699 	CMMFDevSoundEventHandler();
       
   700 	};
       
   701 	
       
   702 EXPORT_C CMMFDevSoundEventHandler* CMMFDevSoundEventHandler::NewL(RMMFAudioPolicyProxy*)
       
   703 	{
       
   704 	_LIT(KModule, "DevSound");
       
   705 	User::Panic(KModule, 1000);
       
   706 	return NULL;
       
   707 	}
       
   708 
       
   709 // default constructor - keep compilers happy
       
   710 CMMFDevSoundEventHandler::CMMFDevSoundEventHandler():
       
   711 	CActive(EPriorityStandard)
       
   712 	{
       
   713 	}
       
   714 
       
   715 
       
   716 // End of File