os/mm/devsound/a3fdevsound/src/mmfdevsound/sounddevicebody.h
author sl
Tue, 10 Jun 2014 14:32:02 +0200
changeset 1 260cb5ec6c19
permissions -rw-r--r--
Update contrib.
sl@0
     1
/*
sl@0
     2
* Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
sl@0
     3
* All rights reserved.
sl@0
     4
* This component and the accompanying materials are made available
sl@0
     5
* under the terms of "Eclipse Public License v1.0"
sl@0
     6
* which accompanies this distribution, and is available
sl@0
     7
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
sl@0
     8
*
sl@0
     9
* Initial Contributors:
sl@0
    10
* Nokia Corporation - initial contribution.
sl@0
    11
*
sl@0
    12
* Contributors:
sl@0
    13
*
sl@0
    14
* Description:
sl@0
    15
*
sl@0
    16
*/
sl@0
    17
sl@0
    18
sl@0
    19
sl@0
    20
#ifndef SOUNDDEVICEBODY_H
sl@0
    21
#define SOUNDDEVICEBODY_H
sl@0
    22
sl@0
    23
//  INCLUDES
sl@0
    24
#include <mmf/server/sounddevice.h>
sl@0
    25
#include "mmfdevsoundproxy.h"
sl@0
    26
#include <mmf/server/mmfdevsoundcustominterfacesupport.h>
sl@0
    27
#include <mmf/server/mmfdevsoundcustominterface.h>
sl@0
    28
#include <a3f/mmfdevsoundcustominterfaceextensions.h>
sl@0
    29
#include "MmfDevSoundCIMuxUtility.h"
sl@0
    30
sl@0
    31
/**
sl@0
    32
*  This is the Body for CMMFDevSound.
sl@0
    33
*
sl@0
    34
*  @lib MMFDevSound.lib
sl@0
    35
*/
sl@0
    36
sl@0
    37
NONSHARABLE_CLASS( CMMFDevSound::CBody ) : public CBase,
sl@0
    38
										   public MMMFDevSoundCancelInitialize,
sl@0
    39
										   public MMMFDevSoundCustomInterfaceChannel,
sl@0
    40
										   public MMMFDevSoundCustomInterfaceObserver,
sl@0
    41
										   public MMMFDevSoundEmptyBuffers,
sl@0
    42
										   public MAutoPauseResumeSupport,
sl@0
    43
										   public MMMFDevSoundTimePlayed,
sl@0
    44
										   public MMMFDevSoundQueryIgnoresUnderflow,
sl@0
    45
										   public MAudioClientThreadInfo, 
sl@0
    46
										   public MMMFDevSoundTruePause
sl@0
    47
sl@0
    48
	{
sl@0
    49
public:  // Constructors and destructor
sl@0
    50
sl@0
    51
	/**
sl@0
    52
	* Factory function - returning instance of the class.
sl@0
    53
	*/
sl@0
    54
	static CBody* NewL();
sl@0
    55
sl@0
    56
	/**
sl@0
    57
	* Destructor.
sl@0
    58
sl@0
    59
	* Deletes all objects and releases all resources owned by this
sl@0
    60
	* instance.
sl@0
    61
	*/
sl@0
    62
	~CBody();
sl@0
    63
sl@0
    64
	/**
sl@0
    65
	* Initializes to raw audio data PCM16 and Sampling Rate of 8 KHz.
sl@0
    66
	* On completion of Initialization, calls InitializeComplete() on
sl@0
    67
	* aDevSoundObserver.
sl@0
    68
	* @param aDevSoundObserver. A reference to DevSound observer instance.
sl@0
    69
	* @param aMode. Mode for which this object will be used.
sl@0
    70
	*/
sl@0
    71
	void InitializeL(MDevSoundObserver& aDevSoundObserver,
sl@0
    72
	                 TMMFState aMode);
sl@0
    73
sl@0
    74
	/**
sl@0
    75
	* Initializes DevSound object for the mode aMode for processing audio
sl@0
    76
	* data with hardware device supporting FourCC aDesiredFourCC.
sl@0
    77
	* @param  aDevSoundObserver. A reference to DevSound observer instance.
sl@0
    78
	* @param  aDesiredFourCC. The CMMFHwDevice implementation FourCC code.
sl@0
    79
	* @param  aMode. The mode for which this object will be used
sl@0
    80
	*/
sl@0
    81
	void InitializeL(MDevSoundObserver& aDevSoundObserver,
sl@0
    82
	                 TFourCC aDesiredFourCC,
sl@0
    83
	                 TMMFState aMode);
sl@0
    84
sl@0
    85
	/**
sl@0
    86
	* Returns the supported Audio settings ie. encoding, sample rates,
sl@0
    87
	* mono/stereo operation, buffer size etc..
sl@0
    88
	* @return TMMFCapabilities. The device settings.
sl@0
    89
	*/
sl@0
    90
	inline TMMFCapabilities Capabilities();
sl@0
    91
sl@0
    92
	/**
sl@0
    93
	* Returns the current device configuration.
sl@0
    94
	* @return TMMFCapabilities. The device settings.
sl@0
    95
	*/
sl@0
    96
	inline TMMFCapabilities Config() const;
sl@0
    97
sl@0
    98
	/**
sl@0
    99
	* Configure CMMFDevSound object with the settings in aConfig. Use this
sl@0
   100
	* to set sampling rate, encoding and mono/stereo.
sl@0
   101
	* @param aConfig. The attribute values to which CMMFDevSound object will be configured to.
sl@0
   102
	*/
sl@0
   103
	inline void SetConfigL(const TMMFCapabilities& aCaps);
sl@0
   104
sl@0
   105
	/**
sl@0
   106
	* Returns an integer representing the maximum volume device supports.
sl@0
   107
	* This is the maximum value which can be passed to
sl@0
   108
	* CMMFDevSound::SetVolume.
sl@0
   109
	* @return TInt The maximum volume. This value is platform dependent but is always greater than or equal to one.
sl@0
   110
	*/
sl@0
   111
	inline TInt MaxVolume();
sl@0
   112
sl@0
   113
	/**
sl@0
   114
	* Returns an integer representing the current volume.
sl@0
   115
	* @return TInt The current volume level.
sl@0
   116
	*/
sl@0
   117
	inline TInt Volume();
sl@0
   118
sl@0
   119
	/**
sl@0
   120
	* Changes the current playback volume to a specified value. The volume
sl@0
   121
	* can be changed before or during playback and is effective immediately.
sl@0
   122
	* @param aVolume. The volume setting. This can be any value from 0
sl@0
   123
	*        to the value returned by a call to
sl@0
   124
	*        CMMFDevSound::MaxVolume(). If the volume is not
sl@0
   125
	*        within this range, the volume is automatically set
sl@0
   126
	*        to minimum or maximum value based on the value
sl@0
   127
	*        that is being passed. Setting a zero value mutes
sl@0
   128
	*        the sound. Setting the maximum value results in
sl@0
   129
	*        the loudest possible sound.
sl@0
   130
	*/
sl@0
   131
	inline void SetVolume(TInt aVolume);
sl@0
   132
sl@0
   133
	/**
sl@0
   134
	* Returns an integer representing the maximum gain the device supports.
sl@0
   135
	* This is the maximum value which can be passed to CMMFDevSound::SetGain
sl@0
   136
	* @return TInt The maximum gain. This value is platform dependent but is
sl@0
   137
	*        always greater than or equal to one.
sl@0
   138
	*/
sl@0
   139
	inline TInt MaxGain();
sl@0
   140
sl@0
   141
	/**
sl@0
   142
	* Returns an integer representing the current gain.
sl@0
   143
	* @return TInt The current gain level.
sl@0
   144
	*/
sl@0
   145
	inline TInt Gain();
sl@0
   146
sl@0
   147
	/**
sl@0
   148
	* Changes the current recording gain to a specified value. The gain can
sl@0
   149
	* be changed before or during recording and is effective immediately.
sl@0
   150
	* @param aGain. The gain setting. This can be any value from zero to
sl@0
   151
	*        the value returned by a call to
sl@0
   152
	*        CMMFDevSound::MaxGain(). If the volume
sl@0
   153
	*        is not within this range, the gain is automatically
sl@0
   154
	*        set to minimum or maximum value based on the value
sl@0
   155
	*        that is being passed. Setting a zero value mutes the
sl@0
   156
	*        sound. Setting the maximum value results in the
sl@0
   157
	*        loudest possible sound.
sl@0
   158
	*/
sl@0
   159
	inline void SetGain(TInt aGain);
sl@0
   160
sl@0
   161
	/**
sl@0
   162
	* Returns the speaker balance set for playing.
sl@0
   163
	* @param aLeftPercentage. On return contains the left speaker volume percentage.
sl@0
   164
	* @param aRightPercentage. On return contains the right speaker volume percentage.
sl@0
   165
	*/
sl@0
   166
	inline void GetPlayBalanceL(TInt& aLeftPercentage,TInt& aRightPercentage);
sl@0
   167
sl@0
   168
	/**
sl@0
   169
	* Sets the speaker balance for playing. The speaker balance can be
sl@0
   170
	* changed before or during playback and is effective immediately.
sl@0
   171
	* @param aLeftPercentage. The left speaker volume percentage. This
sl@0
   172
	*        can be any value from zero to 100. Setting
sl@0
   173
	*        a zero value mutes the sound on left
sl@0
   174
	*        speaker.
sl@0
   175
	* @param aRightPercentage. The right speaker volume percentage.
sl@0
   176
	*        This can be any value from zero to 100.
sl@0
   177
	*        Setting a zero value mutes the sound on
sl@0
   178
	*        right speaker.
sl@0
   179
	*/
sl@0
   180
	inline void SetPlayBalanceL(TInt aLeftPercentage,
sl@0
   181
	                            TInt aRightPercentage);
sl@0
   182
sl@0
   183
	/**
sl@0
   184
	* Returns the microphone gain balance set for recording.
sl@0
   185
	* @param aLeftPercentage On return contains the left microphone
sl@0
   186
	*        gain percentage.
sl@0
   187
	* @param aRightPercentage On return contains the right microphone
sl@0
   188
	*        gain percentage.
sl@0
   189
	*/
sl@0
   190
	inline void GetRecordBalanceL(TInt& aLeftPercentage, TInt& aRightPercentage);
sl@0
   191
sl@0
   192
	/**
sl@0
   193
	* Sets the microphone balance for recording. The microphone balance can
sl@0
   194
	* be changed before or during recording and is effective immediately.
sl@0
   195
	* @param aLeftPercentage. The left microphone gain percentage. This
sl@0
   196
	*        can be any value from zero to 100. Setting
sl@0
   197
	*        a zero value mutes the sound from left
sl@0
   198
	*        microphone.
sl@0
   199
	* @param aRightPercentage. The right microphone gain percentage.
sl@0
   200
	*        This can be any value from zero to 100.
sl@0
   201
	*        Setting a zero value mutes the sound from
sl@0
   202
	*        right microphone.
sl@0
   203
	*/
sl@0
   204
	inline void SetRecordBalanceL(TInt aLeftPercentage,
sl@0
   205
	                              TInt aRightPercentage);
sl@0
   206
sl@0
   207
	/**
sl@0
   208
	* Initializes the audio device and starts the play process. This
sl@0
   209
	* function queries and acquires the audio policy before initializing
sl@0
   210
	* audio device. If there was an error during policy initialization,
sl@0
   211
	* PlayError() function will be called on the observer with error code
sl@0
   212
	* KErrAccessDenied, otherwise BufferToBeFilled() function will be called
sl@0
   213
	* with a buffer reference. After reading data into the buffer reference
sl@0
   214
	* passed, the client should call PlayData() to play data.
sl@0
   215
	* The amount of data that can be played is specified in
sl@0
   216
	* CMMFBuffer::RequestSize(). Any data that is read into buffer beyond
sl@0
   217
	* this size will be ignored.
sl@0
   218
	*/
sl@0
   219
	inline void PlayInitL();
sl@0
   220
sl@0
   221
	/**
sl@0
   222
	* Initializes the audio device and starts the record process. This
sl@0
   223
	* function queries and acquires the audio policy before initializing
sl@0
   224
	* audio device. If there was an error during policy initialization,
sl@0
   225
	* RecordError() function will be called on the observer with error code
sl@0
   226
	* KErrAccessDenied, otherwise BufferToBeEmptied() function will be
sl@0
   227
	* called with a buffer reference. This buffer contains recorded or
sl@0
   228
	* encoded data. After processing data in the buffer reference passed,
sl@0
   229
	* the client should call RecordData() to continue recording process.
sl@0
   230
	* The amount of data that is available is specified in
sl@0
   231
	* CMMFBuffer::RequestSize().
sl@0
   232
	*/
sl@0
   233
	inline void RecordInitL();
sl@0
   234
sl@0
   235
	/**
sl@0
   236
	* Plays data in the buffer at the current volume.
sl@0
   237
	* The client should fill the buffer with audio data before calling this
sl@0
   238
	* function. The observer gets a reference to the buffer along with the
sl@0
   239
	* callback function BufferToBeFilled(). When playing of the audio sample
sl@0
   240
	* is complete, successfully or otherwise, the function PlayError() on
sl@0
   241
	* the observer is called.
sl@0
   242
	* The last buffer of the audio stream being played should have the last
sl@0
   243
	* buffer flag set using CMMFBuffer::SetLastBuffer(TBool). If a
sl@0
   244
	* subsequent attempt to play the clip is made, this flag will need
sl@0
   245
	* resetting by the client.
sl@0
   246
	*/
sl@0
   247
	inline void PlayData();
sl@0
   248
sl@0
   249
	/**
sl@0
   250
	* Contine the process of recording.
sl@0
   251
	* Once the buffer is filled with recorded data, the Observer gets a
sl@0
   252
	* reference to the buffer along with the callback function
sl@0
   253
	* BufferToBeEmptied(). After processing the buffer (copying over to a
sl@0
   254
	* different buffer or writing to file) the client should call this
sl@0
   255
	* function to continue the recording process.
sl@0
   256
	*/
sl@0
   257
	inline void RecordData();
sl@0
   258
sl@0
   259
	/**
sl@0
   260
	* Stops the ongoing operation (Play, Record, TonePlay).
sl@0
   261
	*/
sl@0
   262
	inline void Stop();
sl@0
   263
sl@0
   264
	/**
sl@0
   265
	* Temporarily Stops the ongoing operation (Play, Record, TonePlay).
sl@0
   266
	*/
sl@0
   267
	inline void Pause();
sl@0
   268
sl@0
   269
	/**
sl@0
   270
	* Returns the Sample recorded so far
sl@0
   271
	* @return TInt Returns the samples recorded.
sl@0
   272
	*/
sl@0
   273
	inline TInt SamplesRecorded();
sl@0
   274
sl@0
   275
	/**
sl@0
   276
	* Returns the Sample played so far
sl@0
   277
	* @return TInt Returns the samples played.
sl@0
   278
	*/
sl@0
   279
	inline TInt SamplesPlayed();
sl@0
   280
sl@0
   281
	/**
sl@0
   282
	* Initializes the audio device and starts playing a tone. The tone is
sl@0
   283
	* played with the frequency and duration specified.
sl@0
   284
	* Leaves on failure.
sl@0
   285
	* @param aFrequency. The frequency at which the tone will be played.
sl@0
   286
	* @param const TTimeIntervalMicroSeconds &aDuration The period over
sl@0
   287
	*        which the tone will be played. A zero value causes the no tone
sl@0
   288
	*        to be played.
sl@0
   289
	*/
sl@0
   290
	inline void PlayToneL(TInt aFrequency, const TTimeIntervalMicroSeconds& aDuration);
sl@0
   291
sl@0
   292
	/**
sl@0
   293
	* Initializes audio device and starts playing a dual tone. Dual Tone is
sl@0
   294
	* played with the specified frequencies and for the specified duration.
sl@0
   295
	* @param aFrequencyOne The first frequency of dual tone.
sl@0
   296
	* @param aFrequencyTwo The second frequency of dual tone.
sl@0
   297
	* @param aDuration The period over which the tone will be played. 
sl@0
   298
	* A zero value causes the no tone to be played.
sl@0
   299
	*/
sl@0
   300
	inline void PlayDualToneL(
sl@0
   301
	            TInt aFrequencyOne,
sl@0
   302
	            TInt aFrequencyTwo,
sl@0
   303
	            const TTimeIntervalMicroSeconds& aDuration);
sl@0
   304
sl@0
   305
	/**
sl@0
   306
	* Initializes the audio device and starts playing the DTMF string
sl@0
   307
	* aDTMFString.
sl@0
   308
	* @param aDTMFString The DTMF sequence in a descriptor.
sl@0
   309
	*/
sl@0
   310
	inline void PlayDTMFStringL(const TDesC& aDTMFString);
sl@0
   311
sl@0
   312
	/**
sl@0
   313
	* Initializes the audio device and starts playing a tone sequence.
sl@0
   314
	* @param aData The tone sequence in a descriptor.
sl@0
   315
	*/
sl@0
   316
	inline void PlayToneSequenceL(const TDesC8& aData);
sl@0
   317
sl@0
   318
	/**
sl@0
   319
	* Defines the number of times the audio is to be repeated during the
sl@0
   320
	* tone playback operation. A period of silence can follow each playing
sl@0
   321
	* of a tone. The tone playing can be repeated indefinitely
sl@0
   322
	* @param aRepeatCount. The number of times the tone, together with
sl@0
   323
	*        the trailing silence, is to be repeated. If this is set to
sl@0
   324
	*        KMdaRepeatForever, then the tone, together with the trailing
sl@0
   325
	*        silence, is repeated indefinitely or until Stop() is called.
sl@0
   326
	*        If this is set to zero, then the tone is not repeated.
sl@0
   327
	* @param aRepeatTrailingSilence An interval of silence which will be played after each tone.
sl@0
   328
	*        Supported only during tone playing.
sl@0
   329
	*/
sl@0
   330
	inline void SetToneRepeats(
sl@0
   331
	            TInt aRepeatCount,
sl@0
   332
	            const TTimeIntervalMicroSeconds& aRepeatTrailingSilence);
sl@0
   333
sl@0
   334
	/**
sl@0
   335
	* Defines the duration of tone on, tone off and tone pause to be used
sl@0
   336
	* during the DTMF tone playback operation.
sl@0
   337
	* Supported only during tone playing.
sl@0
   338
	* @param aToneOnLength The period over which the tone will be played.
sl@0
   339
	* If this is set to zero, then the tone is not played.
sl@0
   340
	* @param aToneOffLength The period over which the no tone will be played.
sl@0
   341
	* @param aPauseLength The period over which the tone playing will be paused.
sl@0
   342
	*/
sl@0
   343
	inline void SetDTMFLengths(
sl@0
   344
	            TTimeIntervalMicroSeconds32& aToneOnLength,
sl@0
   345
	            TTimeIntervalMicroSeconds32& aToneOffLength,
sl@0
   346
	            TTimeIntervalMicroSeconds32& aPauseLength);
sl@0
   347
sl@0
   348
	/**
sl@0
   349
	* Defines the period over which the volume level is to rise smoothly
sl@0
   350
	* from nothing to the normal volume level.
sl@0
   351
	* The function is only available before playing.
sl@0
   352
	* @param aRampDuration The period over which the volume is to rise. 
sl@0
   353
	* 	 A zero value causes the tone sample to be played at the 
sl@0
   354
	* 	 normal level for the full duration of the playback. 
sl@0
   355
	* 	 A value, which is longer than the duration of
sl@0
   356
	*        the tone sample means that the sample never reaches its normal
sl@0
   357
	*        volume level.
sl@0
   358
	*/
sl@0
   359
	inline void SetVolumeRamp(
sl@0
   360
	            const TTimeIntervalMicroSeconds& aRampDuration);
sl@0
   361
sl@0
   362
	/**
sl@0
   363
	* Defines the priority settings that should be used for this instance.
sl@0
   364
	* @param aPrioritySettings. A class type representing the client's priority, 
sl@0
   365
	* priority preference and state
sl@0
   366
	*/
sl@0
   367
	inline void SetPrioritySettings(
sl@0
   368
	            const TMMFPrioritySettings& aPrioritySettings);
sl@0
   369
sl@0
   370
	/**
sl@0
   371
	* Retrieves a custom interface to the device.
sl@0
   372
	* @param aInterfaceId. The interface UID, defined with the custom
sl@0
   373
	*        interface.
sl@0
   374
	* @return TAny* A pointer to the interface implementation, or NULL if
sl@0
   375
	*        the device does not implement the interface requested. The
sl@0
   376
	*        return value must be cast to the correct type by the user.
sl@0
   377
	*/
sl@0
   378
	TAny* CustomInterface(TUid aInterfaceId);
sl@0
   379
sl@0
   380
	/**
sl@0
   381
	* Returns a list of the supported input datatypes that can be sent to
sl@0
   382
	* DevSound for playing audio. The datatypes returned are those that the
sl@0
   383
	* DevSound supports given the priority settings passed in
sl@0
   384
	* aPrioritySettings. Note that if no supported data types are found this
sl@0
   385
	* does not constitute failure, the function will return normally with no
sl@0
   386
	* entries in aSupportedDataTypes.
sl@0
   387
	* @param aSupportedDataTypes The array of supported
sl@0
   388
	*        data types that will be filled in by this function. The
sl@0
   389
	*        supported data types of the DevSound are in the form of an
sl@0
   390
	*        array of TFourCC codes. Any existing entries in the array will
sl@0
   391
	*        be overwritten on calling this function. If no supported data
sl@0
   392
	*        types are found given the priority settings, then the
sl@0
   393
	*        aSupportedDatatypes array will have zero entries.
sl@0
   394
	* @param aPrioritySettings The priority settings used to determine the 
sl@0
   395
	* 	 supported datatypes. Note this does not set the priority settings. 
sl@0
   396
	* 	 For input datatypes the iState member of the priority settings would 
sl@0
   397
	* 	 be expected to be either EMMFStatePlaying or EMMFStatePlayingRecording.
sl@0
   398
	* 	 The priority settings may effect the supported datatypes depending
sl@0
   399
	*        on the audio routing.
sl@0
   400
	*/
sl@0
   401
	inline void GetSupportedInputDataTypesL(
sl@0
   402
	            RArray<TFourCC>& aSupportedDataTypesconst,
sl@0
   403
	            const TMMFPrioritySettings& aPrioritySettings) const;
sl@0
   404
sl@0
   405
	/**
sl@0
   406
	* Returns a list of the supported output dataypes that can be received
sl@0
   407
	* from DevSound for recording audio. The datatypes returned are those
sl@0
   408
	* that the DevSound supports given the priority settings passed in
sl@0
   409
	* aPrioritySettings. Note that if no supported data types are found this
sl@0
   410
	* does not constitute failure, the function will return normally with no
sl@0
   411
	* entries in aSupportedDataTypes.
sl@0
   412
	* @param aSupportedDataTypes. The array of supported
sl@0
   413
	*        data types that will be filled in by this function. The
sl@0
   414
	*        supported datatypes of the DevSound are in the form of an array
sl@0
   415
	*        of TFourCC codes. Any existing entries in the array will be
sl@0
   416
	*        overwritten on calling this function. If no supported datatypes
sl@0
   417
	*        are found given the priority settings, then the
sl@0
   418
	*        aSupportedDatatypes array will have zero entries.
sl@0
   419
	* @param aPrioritySettings. The priority settings used to determine the supported 
sl@0
   420
	*        data types. Note this does not set the priority settings. For output data types the
sl@0
   421
	*        iState member of the priority settings would expected to be
sl@0
   422
	*        either EMMFStateRecording or EMMFStatePlayingRecording. The
sl@0
   423
	*        priority settings may effect the supported datatypes depending
sl@0
   424
	*        on the audio routing.
sl@0
   425
	*/
sl@0
   426
	inline void GetSupportedOutputDataTypesL(
sl@0
   427
	            RArray<TFourCC>& aSupportedDataTypes,
sl@0
   428
	            const TMMFPrioritySettings& aPrioritySettings) const;
sl@0
   429
	            
sl@0
   430
	/** 
sl@0
   431
	Registers the client for notification of resource avalibility.
sl@0
   432
sl@0
   433
	@param  aEventType
sl@0
   434
	        The Notification event type for which the client needs notification.
sl@0
   435
	@param  aNotificationRegistrationData
sl@0
   436
	        The Notification Registration data has been reserved for future use and its value should be always NULL
sl@0
   437
	@return An error code indicating if the function call was successful. KErrNone on success, 
sl@0
   438
			KErrNotSupported if the event type is not supported, KErrArgument if the notification data
sl@0
   439
			is not null otherwise another of the system-wide error codes.
sl@0
   440
	*/
sl@0
   441
	inline TInt RegisterAsClient(TUid aEventType, const TDesC8& aNotificationRegistrationData = KNullDesC8);
sl@0
   442
sl@0
   443
	/**
sl@0
   444
	Cancels the Registered Notification.
sl@0
   445
sl@0
   446
	@param  aEventType. The Event type need to cancel
sl@0
   447
	@return An error code indicating if the function call was successful. KErrNone on success, KErrNotSupported
sl@0
   448
			if the event type is not supported otherwise another of the system-wide error codes.
sl@0
   449
	*/	
sl@0
   450
	inline TInt CancelRegisterAsClient(TUid aEventType);
sl@0
   451
sl@0
   452
	/**
sl@0
   453
	Returns the Notification data which the client needs to resume playing.
sl@0
   454
sl@0
   455
	@param aEventType. The Event type for which to get notification data  
sl@0
   456
	@param aNotificationData
sl@0
   457
			The reference data for which the client needs to resume the play. The actual data depends on the event type.
sl@0
   458
			Note that for the event type 'KMMFEventCategoryAudioResourceAvailable' the package buffer returned
sl@0
   459
			is TMMFTimeIntervalMicroSecondsPckg,but the contents should be converted to an integer and
sl@0
   460
			interpreted as the data returned is samples played ,but not as a microsecond value.
sl@0
   461
	@return An error code indicating if the function call was successful. KErrNone on success, otherwise
sl@0
   462
	        another of the system-wide error codes.
sl@0
   463
	*/
sl@0
   464
	inline TInt GetResourceNotificationData(TUid aEventType,TDes8& aNotificationData);
sl@0
   465
sl@0
   466
	/**
sl@0
   467
	Wait for the clients to resume play back even after the default timeout expires.
sl@0
   468
	Unless the client cancels the notification request or completes no other client gets
sl@0
   469
	notification.
sl@0
   470
sl@0
   471
	@return An error code indicating if the function call was successful. KErrNone on success, 
sl@0
   472
	        otherwise another of the system-wide error codes.
sl@0
   473
	*/
sl@0
   474
	inline TInt WillResumePlay();
sl@0
   475
sl@0
   476
	/**
sl@0
   477
	Empties the play buffers below DevSound without causing the codec to be deleted.
sl@0
   478
sl@0
   479
	@return An error code indicating if the function call was successful. KErrNone on success,
sl@0
   480
			KErrNotSupported if called in a mode other than EMMFStatePlaying or if the function is otherwise not supported,
sl@0
   481
			KErrNotReady if this is called before playing,
sl@0
   482
			otherwise another of the system-wide error codes.
sl@0
   483
			If this function is not supported, it is advised to use Stop().
sl@0
   484
	*/
sl@0
   485
	inline TInt EmptyBuffers();
sl@0
   486
	
sl@0
   487
	//from MMMFDevSoundCancelInitialize
sl@0
   488
	/** 
sl@0
   489
		
sl@0
   490
	Cancels the initialization process of a CMMFDevSound object
sl@0
   491
sl@0
   492
	@return An error code indicating if the function call was successful. 
sl@0
   493
			KErrNone on success,
sl@0
   494
			KerrNotReady if this is called before InitializeL() call or after      
sl@0
   495
			the object has been initialized 
sl@0
   496
	*/
sl@0
   497
	inline TInt CancelInitialize();
sl@0
   498
sl@0
   499
	// from MMMFDevSoundCustomInterfaceChannel
sl@0
   500
	/**
sl@0
   501
	Implements a synchronous custom command
sl@0
   502
	@param aUid
sl@0
   503
		   The UID of the custom command
sl@0
   504
	@param aParam1
sl@0
   505
		   A buffer of data to be supplied to the receiver
sl@0
   506
	@param aParam2
sl@0
   507
		   A buffer of data to be supplied to the receiver
sl@0
   508
	@param aOutParam
sl@0
   509
		   A buffer that will be written into by the receiver
sl@0
   510
		   and returned to the client
sl@0
   511
	@return the result of the custom command
sl@0
   512
	 */
sl@0
   513
	TInt SyncCustomCommand(TUid aUid, const TDesC8& aParam1, const TDesC8& aParam2, TDes8* aOutParam);
sl@0
   514
sl@0
   515
	/**
sl@0
   516
	Implements an asynchronous custom command
sl@0
   517
	@param aUid
sl@0
   518
		   The UID of the custom command
sl@0
   519
	@param aStatus
sl@0
   520
		   The request status of the active object that
sl@0
   521
		   will be called upon the completion of the request
sl@0
   522
	@param aParam1
sl@0
   523
		   A buffer of data to be supplied to the receiver
sl@0
   524
	@param aParam2
sl@0
   525
		   A buffer of data to be supplied to the receiver
sl@0
   526
	@param aOutParam
sl@0
   527
		   A buffer that will be written into by the receiver
sl@0
   528
		   and returned to the client
sl@0
   529
	 */
sl@0
   530
	void AsyncCustomCommand(TUid aUid, TRequestStatus& aStatus, const TDesC8& aParam1, const TDesC8& aParam2, TDes8* aOutParam);
sl@0
   531
sl@0
   532
	//from MMMFDevSoundCustomInterfaceObserver
sl@0
   533
	void CloseCustomInterface(TInt aInterfaceId);
sl@0
   534
sl@0
   535
	//from MMMFDevSoundTimePlayed
sl@0
   536
	TInt GetTimePlayed(TTimeIntervalMicroSeconds& aTime);
sl@0
   537
	
sl@0
   538
	//MMMFDevSoundQueryIgnoresUnderflow
sl@0
   539
	TBool QueryIgnoresUnderflow();
sl@0
   540
	
sl@0
   541
	// Set the real client thread with thread Id
sl@0
   542
	TInt SetClientThreadInfo(TThreadId aTid);
sl@0
   543
sl@0
   544
	// from MMMFDevSoundTruePause
sl@0
   545
	TBool IsResumeSupported();
sl@0
   546
	TInt Resume();
sl@0
   547
protected:
sl@0
   548
sl@0
   549
	/**
sl@0
   550
	* Constructor
sl@0
   551
	*/
sl@0
   552
	CBody();
sl@0
   553
sl@0
   554
	/**
sl@0
   555
	* Symbian constructor
sl@0
   556
	*/
sl@0
   557
	void ConstructL();
sl@0
   558
sl@0
   559
	TInt FindCustomInterface(TUid aInterfaceId);
sl@0
   560
sl@0
   561
	// custom interface storage
sl@0
   562
	RArray<TMMFDevSoundCustomInterfaceData> iCustomInterfaceArray;
sl@0
   563
	CMMFDevSoundCIMuxUtility* iMuxUtility;
sl@0
   564
	// Reference to DevSound proxy
sl@0
   565
	RMMFDevSoundProxy* iDevSoundProxy;
sl@0
   566
	// CI Extension
sl@0
   567
	MDevSoundCIClientExtension* iCIExtension;
sl@0
   568
	};
sl@0
   569
sl@0
   570
#include "sounddevicebody.inl"
sl@0
   571
sl@0
   572
#endif // SOUNDDEVICEBODY_H
sl@0
   573
sl@0
   574
// End of File