Update contrib.
2 * Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
4 * This component and the accompanying materials are made available
5 * under the terms of "Eclipse Public License v1.0"
6 * which accompanies this distribution, and is available
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
9 * Initial Contributors:
10 * Nokia Corporation - initial contribution.
20 #ifndef RMMFDEVSOUNDPROXY_H
21 #define RMMFDEVSOUNDPROXY_H
24 #include <mmf/common/mmfipc.h>
25 #ifdef SYMBIAN_ENABLE_SPLIT_HEADERS
26 #include <mmf/common/mmfipcserver.h>
28 #include <mmf/common/mcustomcommand.h>
29 #include "mmfdevsoundcallbackhandler.h"
30 #include "mmfaudioserverproxy.h"
32 _LIT(KMMFDevSoundProxyPanicCategory, "MmfDevSoundProxy");
34 enum TMMFDevSoundProxyPanicCodes
36 EMMFDevSoundProxyPlayDataWithoutInitialize,
37 EMMFDevSoundProxyRecordDataWithoutInitialize,
38 EMMFDevSoundProxyInitCompleteInWrongState,
39 EMMFDevSoundProxyToneFinishedInWrongState,
40 EMMFDevSoundProxyPlayErrorInWrongState,
41 EMMFDevSoundProxyRecordErrorInWrongState,
42 EMMFDevSoundProxyUnexpectedConvError,
43 EMMFDevSoundProxyCapabilitiesInWrongState,
44 EMMFDevSoundProxyConfigInWrongState,
45 EMMFDevSoundProxyBTBFInWrongState,
46 EMMFDevSoundProxyBTBEInWrongState,
47 EMMFDevSoundProxyPlayDataInWrongState,
48 EMMFDevSoundProxyRecordDataInWrongState,
49 EMMFDevSoundProxyNonEmptyLastBuffer,
53 // FORWARD DECLARATIONS
54 class RMMFDevSoundProxy; // declared here.
59 * Main interface to DevSound server.
61 * @lib MmfDevSoundProxy.lib
64 NONSHARABLE_CLASS( RMMFDevSoundProxy ) : public RMmfSessionBase,
65 public MCustomCommand,
66 public MDevSoundObserver,
67 public MMMFDevSoundCancelInitialize
69 public: // Constructors and destructor
74 IMPORT_C RMMFDevSoundProxy();
76 public: // New functions
79 * Open a DevSound server session
81 * @return KErrNone if successfull, else corresponding error code
86 * Post open - called following successful open to complete open process.
87 * Allows async opening
88 * @return KErrNone successful, otherwise one of the standard system errors
90 IMPORT_C TInt PostOpen();
93 * Launch DevSound instances that might have been waiting for audio
96 * @return KErrNone if successfull, else corresponding error code
98 IMPORT_C TInt SetDevSoundInfo();
101 * Initialize DevSound for the mode aMode.
104 * @param TMMFState aMode The mode for which this object will be used
105 * @param aDevSoundCIObserver Observer which will receive Custom Interface events
108 IMPORT_C void InitializeL(MDevSoundObserver& aDevSoundObserver,
110 MMMFDevSoundCustomInterfaceObserver& aDevSoundCIObserver);
113 * Initializes DevSound object for the mode aMode for processing audio
114 * data with hardware device aHWDev.
117 * @param TUid aHWDev The CMMFHwDevice implementation identifier.
118 * @param TMMFState aMode The mode for which this object will be used
119 * @param aDevSoundCIObserver Observer which will receive Custom Interface events
122 IMPORT_C void InitializeL(MDevSoundObserver& aDevSoundObserver,
125 MMMFDevSoundCustomInterfaceObserver& aDevSoundCIObserver);
128 * Initializes DevSound object for the mode aMode for processing audio
129 * data with hardware device supporting FourCC aDesiredFourCC.
132 * @param TFourCC aDesiredFourCC The CMMFHwDevice implementation FourCC
134 * @param TMMFState aMode The mode for which this object will be used
135 * @param aDevSoundCIObserver Observer which will receive Custom Interface events
138 IMPORT_C void InitializeL(MDevSoundObserver& aDevSoundObserver,
139 TFourCC aDesiredFourCC,
141 MMMFDevSoundCustomInterfaceObserver& aDevSoundCIObserver);
144 * Returns the supported Audio settings ie. encoding, sample rates,
145 * mono/stereo operation, buffer size etc..
147 * @return TMMFCapabilities The device settings.
149 IMPORT_C TMMFCapabilities Capabilities();
152 * Returns the current device configuration.
154 * @return TMMFCapabilities The device settings.
156 IMPORT_C TMMFCapabilities Config();
159 * Configure CMMFDevSound object with the settings in aConfig. Use this
160 * to set sampling rate, encoding and mono/stereo.
163 * @param const TMMFCapabilities& aConfig The attribute values to which
164 * CMMFDevSound object will be configured to.
165 * @return KErrNone if successfull, else corresponding error code
167 IMPORT_C void SetConfigL(const TMMFCapabilities& aConfig);
170 * Returns an integer representing the maximum volume device supports.
171 * This is the maximum value which can be passed to
172 * CMMFDevSound::SetVolume.
174 * @return TInt The maximum volume. This value is platform dependent but
175 * is always greater than or equal to one.
177 IMPORT_C TInt MaxVolume();
180 * Returns an integer representing the current volume.
182 * @return TInt The current volume level.
184 IMPORT_C TInt Volume();
187 * Changes the current playback volume to a specified value. The volume
188 * can be changed before or during playback and is effective immediately
190 * @param TInt aVolume The volume setting. This can be any value from 0
191 * to the value returned by a call to
192 * CMMFDevSound::MaxVolume(). If the volume is not
193 * within this range, the volume is automatically set
194 * to minimum or maximum value based on the value
195 * that is being passed. Setting a zero value mutes
196 * the sound. Setting the maximum value results in
197 * the loudest possible sound.
198 * @return KErrNone if successfull, else corresponding error code
200 IMPORT_C TInt SetVolume(TInt aVolume);
203 * Returns an integer representing the maximum gain the device supports.
204 * This is the maximum value which can be passed to CMMFDevSound::SetGain
206 * @return TInt The maximum gain. This value is platform dependent but is
207 * always greater than or equal to one.
209 IMPORT_C TInt MaxGain();
212 * Returns an integer representing the current gain.
214 * @return TInt The current gain level.
216 IMPORT_C TInt Gain();
219 * Changes the current recording gain to a specified value. The gain can
220 * be changed before or during recording and is effective immediately.
222 * @param TInt aGain The gain setting. This can be any value from zero to
223 * the value returned by a call to
224 * CMMFDevSound::MaxGain(). If the volume
225 * is not within this range, the gain is automatically
226 * set to minimum or maximum value based on the value
227 * that is being passed. Setting a zero value mutes the
228 * sound. Setting the maximum value results in the
229 * loudest possible sound.
230 * @return KErrNone if successfull, else corresponding error code
232 IMPORT_C TInt SetGain(TInt aGain);
235 * Returns the speaker balance set for playing.
238 * @param TInt &aLeftPercentage On return contains the left speaker
240 * @param TInt &aRightPercentage On return contains the right speaker
243 IMPORT_C void GetPlayBalanceL(TInt& aLeftPercentage,
244 TInt& aRightPercentage);
247 * Sets the speaker balance for playing. The speaker balance can be
248 * changed before or during playback and is effective immediately.
251 * @param TInt aLeftPercentage The left speaker volume percentage. This
252 * can be any value from zero to 100. Setting
253 * a zero value mutes the sound on left
255 * @param TInt aRightPercentage The right speaker volume percentage.
256 * This can be any value from zero to 100.
257 * Setting a zero value mutes the sound on
260 IMPORT_C void SetPlayBalanceL(TInt aLeftPercentage,
261 TInt aRightPercentage);
264 * Returns the microphone gain balance set for recording.
267 * @param TInt &aLeftPercentage On return contains the left microphone
269 * @param TInt &aRightPercentage On return contains the right microphone
273 IMPORT_C void GetRecordBalanceL(TInt& aLeftPercentage,
274 TInt& aRightPercentage);
277 * Sets the microphone balance for recording. The microphone balance can
278 * be changed before or during recording and is effective immediately.
281 * @param TInt aLeftPercentage The left microphone gain percentage. This
282 * can be any value from zero to 100. Setting
283 * a zero value mutes the sound from left
285 * @param TInt aRightPercentage The right microphone gain percentage.
286 * This can be any value from zero to 100.
287 * Setting a zero value mutes the sound from
291 IMPORT_C void SetRecordBalanceL(TInt aLeftPercentage,
292 TInt aRightPercentage);
295 * Close the server session
299 IMPORT_C void Close();
302 * Initializes the audio device and starts the play process. This
303 * function queries and acquires the audio policy before initializing
304 * audio device. If there was an error during policy initialization,
305 * PlayError() function will be called on the observer with error code
306 * KErrAccessDenied, otherwise BufferToBeFilled() function will be called
307 * with a buffer reference. After reading data into the buffer reference
308 * passed, the client should call PlayData() to play data.
309 * The amount of data that can be played is specified in
310 * CMMFBuffer::RequestSize(). Any data that is read into buffer beyond
311 * this size will be ignored.
316 IMPORT_C void PlayInitL();
319 * Initializes the audio device and starts the record process. This
320 * function queries and acquires the audio policy before initializing
321 * audio device. If there was an error during policy initialization,
322 * RecordError() function will be called on the observer with error code
323 * KErrAccessDenied, otherwise BufferToBeEmptied() function will be called
324 * with a buffer reference. This buffer contains recorded or encoded
325 * data. After processing data in the buffer reference passed, the client
326 * should call RecordData() to continue recording process.
327 * The amount of data that is available is specified in
328 * CMMFBuffer::RequestSize().
333 IMPORT_C void RecordInitL();
336 * Plays data in the buffer at the current volume.
337 * The client should fill the buffer with audio data before calling this
338 * function. The observer gets a reference to the buffer along with the
339 * callback function BufferToBeFilled(). When playing of the audio sample
340 * is complete, successfully or otherwise, the function PlayError() on
341 * the observer is called.
342 * The last buffer of the audio stream being played should have the last
343 * buffer flag set using CMMFBuffer::SetLastBuffer(TBool). If a
344 * subsequent attempt to play the clip is made, this flag will need
345 * resetting by the client.
348 IMPORT_C void PlayData();
351 * Contine the process of recording.
352 * Once the buffer is filled with recorded data, the Observer gets a
353 * reference to the buffer along with the callback function
354 * BufferToBeEmptied(). After processing the buffer (copying over to a
355 * different buffer or writing to file) the client should call this
356 * function to continue the recording process.
359 IMPORT_C void RecordData();
362 * Stops the ongoing operation (Play, Record, TonePlay).
366 IMPORT_C void Stop();
369 * Temporarily Stops the ongoing operation (Play, Record, TonePlay).
373 IMPORT_C void Pause();
376 * Initializes the audio device and starts playing a tone. The tone is
377 * played with the frequency and duration specified.
380 * @param TInt aFrequency The frequency at which the tone will be played.
381 * @param const TTimeIntervalMicroSeconds &aDuration The period over
382 * which the tone will be played. A zero value causes the no tone
386 IMPORT_C void PlayToneL(TInt aFrequency,
387 const TTimeIntervalMicroSeconds& aDuration);
390 * Initializes audio device and starts playing a dual tone. Dual Tone is
391 * played with the specified frequencies and for the specified duration.
394 * @param TInt aFrequencyOne The first frequency of dual tone.
395 * @param TInt aFrequencyTwo The second frequency of dual tone.
396 * @param const TTimeIntervalMicroSeconds &aDuration The period over
397 * which the tone will be played. A zero value causes the no tone
401 IMPORT_C void PlayDualToneL(
404 const TTimeIntervalMicroSeconds& aDuration);
407 * Initializes the audio device and starts playing the DTMF string
411 * @param const TDesC &aDTMFString The DTMF sequence in a descriptor.
414 IMPORT_C void PlayDTMFStringL(const TDesC& aDTMFString);
417 * Initializes the audio device and starts playing a tone sequence.
420 * @param const TDesC8 &aData The tone sequence in a descriptor.
423 IMPORT_C void PlayToneSequenceL(const TDesC8& aData);
426 * Initializes the audio device and starts playing the specified
427 * pre-defined tone sequence.
430 * @param TInt aSequenceNumber The index identifying the specific
431 * pre-defined tone sequence. Index values are relative to zero.
432 * This can be any value from zero to the value returned by a call
433 * to FixedSequenceCount() - 1. The function raises a panic if the
434 * sequence number is not within this range.
437 IMPORT_C void PlayFixedSequenceL(TInt aSequenceNumber);
440 * Defines the duration of tone on, tone off and tone pause to be used
441 * during the DTMF tone playback operation.
442 * Supported only during tone playing.
444 * @param TTimeIntervalMicroSeconds32 &aToneOnLength The period over
445 * which the tone will be played. If this is set to zero, then the
446 * tone is not played.
447 * @param TTimeIntervalMicroSeconds32 &aToneOffLength The period over
448 * which the no tone will be played.
449 * @param TTimeIntervalMicroSeconds32 &aPauseLength The period over which
450 * the tone playing will be paused.
453 IMPORT_C void SetDTMFLengths(
454 TTimeIntervalMicroSeconds32& aToneOnLength,
455 TTimeIntervalMicroSeconds32& aToneOffLength,
456 TTimeIntervalMicroSeconds32& aPauseLength);
459 * Defines the period over which the volume level is to rise smoothly
460 * from nothing to the normal volume level.
461 * The function is only available before playing.
463 * @param const TTimeIntervalMicroSeconds &aRampDuration The period over
464 * which the volume is to rise. A zero value causes the tone
465 * sample to be played at the normal level for the full duration
466 * of the playback. A value, which is longer than the duration of
467 * the tone sample means that the sample never reaches its normal
471 IMPORT_C void SetVolumeRamp(
472 const TTimeIntervalMicroSeconds& aRampDuration);
475 * Returns a list of the supported input datatypes that can be sent to
476 * DevSound for playing audio. The datatypes returned are those that the
477 * DevSound supports given the priority settings passed in
478 * aPrioritySettings. Note that if no supported data types are found this
479 * does not constitute failure, the function will return normally with no
480 * entries in aSupportedDataTypes.
482 * @param RArray< TFourCC > &aSupportedDataTypes The array of supported
483 * data types that will be filled in by this function. The
484 * supported data types of the DevSound are in the form of an
485 * array of TFourCC codes. Any existing entries in the array will
486 * be overwritten on calling this function. If no supported data
487 * types are found given the priority settings, then the
488 * aSupportedDatatypes array will have zero entries.
489 * @param const TMMFPrioritySettings &aPrioritySettings The priority
490 * settings used to determine the supported datatypes. Note this
491 * does not set the priority settings. For input datatypes the
492 * iState member of the priority settings would be expected to be
493 * either EMMFStatePlaying or EMMFStatePlayingRecording. The
494 * priority settings may effect the supported datatypes depending
495 * on the audio routing.
498 IMPORT_C void GetSupportedInputDataTypesL(
499 RArray<TFourCC>& aSupportedDataTypes,
500 const TMMFPrioritySettings& aPrioritySettings);
503 * Returns a list of the supported output dataypes that can be received
504 * from DevSound for recording audio. The datatypes returned are those
505 * that the DevSound supports given the priority settings passed in
506 * aPrioritySettings. Note that if no supported data types are found this
507 * does not constitute failure, the function will return normally with no
508 * entries in aSupportedDataTypes.
510 * @param RArray< TFourCC > &aSupportedDataTypes The array of supported
511 * data types that will be filled in by this function. The
512 * supported datatypes of the DevSound are in the form of an array
513 * of TFourCC codes. Any existing entries in the array will be
514 * overwritten on calling this function. If no supported datatypes
515 * are found given the priority settings, then the
516 * aSupportedDatatypes array will have zero entries.
517 * @param const TMMFPrioritySettings &aPrioritySettings The priority
518 * settings used to determine the supported data types. Note this
519 * does not set the priority settings. For output data types the
520 * iState member of the priority settings would expected to be
521 * either EMMFStateRecording or EMMFStatePlayingRecording. The
522 * priority settings may effect the supported datatypes depending
523 * on the audio routing.
526 IMPORT_C void GetSupportedOutputDataTypesL(
527 RArray<TFourCC>& aSupportedDataTypes,
528 const TMMFPrioritySettings& aPrioritySettings);
531 * Returns the number samples recorded so far.
533 * @return TInt The samples recorded.
535 IMPORT_C TInt SamplesRecorded();
538 * Returns the number samples played so far.
540 * @return TInt The samples played.
542 IMPORT_C TInt SamplesPlayed();
545 * Defines the number of times the audio is to be repeated during the
546 * tone playback operation. A period of silence can follow each playing
547 * of a tone. The tone playing can be repeated indefinitely
549 * @param TInt aRepeatCount The number of times the tone, together with
550 * the trailing silence, is to be repeated. If this is set to
551 * KMdaRepeatForever, then the tone, together with the trailing
552 * silence, is repeated indefinitely or until Stop() is called.
553 * If this is set to zero, then the tone is not repeated.
554 * @param const TTimeIntervalMicroSeconds &aRepeatTrailingSilence An
555 * interval of silence which will be played after each tone.
556 * Supported only during tone playing.
559 IMPORT_C void SetToneRepeats(
561 const TTimeIntervalMicroSeconds& aRepeatTrailingSilence);
564 * Defines the priority settings that should be used for this instance.
566 * @param const TMMFPrioritySettings &aPrioritySettings A class type
567 * representing the client's priority, priority preference and
571 IMPORT_C void SetPrioritySettings(
572 const TMMFPrioritySettings& aPrioritySettings);
575 * Returns the name assigned to a specific pre-defined tone sequence.
576 * This is the number of the fixed sequence supported by DevSound by
578 * The function raises a panic if sequence number specified is invalid.
580 * @param TInt aSequenceNumber The index identifying the specific
581 * pre-defined tone sequence. Index values are relative to zero.
582 * This can be any value from zero to the value returned by a call
583 * to CMdaAudioPlayerUtility::FixedSequenceCount() - 1. The
584 * function raises a panic if sequence number is not within this
586 * @return const TDesC & A reference to a Descriptor containing the fixed
587 * sequence name indexed by aSequenceNumber.
589 IMPORT_C const TDesC& FixedSequenceName(TInt aSequenceNumber);
592 * Retrieves a custom interface to the device.
594 * @param TUid aInterfaceId The interface UID, defined with the custom
596 * @return TAny* A pointer to the interface implementation, or NULL if
597 * the device does not implement the interface requested. The
598 * return value must be cast to the correct type by the user.
600 IMPORT_C TAny* CustomInterface(TUid aInterfaceId);
603 * Returns the number of available pre-defined tone sequences.
604 * This is the number of fixed sequence supported by DevSound by default.
606 * @return TInt The fixed sequence count. This value is implementation
609 IMPORT_C TInt FixedSequenceCount();
612 * Returns data buffer from the DevSound server for playback.
614 * @param TMMFDevSoundProxyHwBufPckg& aSetPckg A reference to pckg to
615 * receive buffer information.
616 * @return KErrNone if successfull, otherwise a corresponding error code
619 IMPORT_C TInt BufferToBeFilledData(
620 TBool aRequestChunk, TMMFDevSoundProxyHwBufPckg& aSetPckg);
623 * Returns data buffer from the DevSound server for recording.
625 * @param TMMFDevSoundProxyHwBufPckg& aSetPckg A reference to pckg to
626 * receive buffer information.
627 * @return KErrNone if successfull, otherwise a corresponding error code
629 IMPORT_C TInt BufferToBeEmptiedData(TMMFDevSoundProxyHwBufPckg& aSetPckg);
630 IMPORT_C TInt RegisterAsClient(TUid aEventType, const TDesC8& aNotificationRegistrationData = KNullDesC8);
631 IMPORT_C TInt CancelRegisterAsClient(TUid aEventType);
632 IMPORT_C TInt GetResourceNotificationData(TUid aEventType,TDes8& aNotificationData);
633 IMPORT_C TInt WillResumePlay();
634 IMPORT_C TInt EmptyBuffers();
635 IMPORT_C TInt CancelInitialize();
636 IMPORT_C TInt SetClientThreadInfo(TThreadId& aTid);
639 * Sends a custom command synchronously to the DevSound server. This
640 * method will not return until the server has serviced the command.
642 * @param "const TMMFMessageDestinationPckg& aDestination"
643 * The destination of the custom command. This consists of the
644 * unique ID of the interface of command handler.
645 * @param "TInt aFunction"
646 * The number of the function to be called on the command
648 * @param "const TDesC8& aDataTo1"
649 * A reference to data to be copied to the command handler.
650 * The exact contents of the data are dependent on the command
651 * hanlder on the DevSound server. Can be NULL.
652 * @param "const TDesC8& aDataTo2"
653 * A reference to data to be copied to the command handler.
654 * The exact contents of the data are dependent on the command
655 * hanlder on the DevSound server. Can be NULL.
656 * @param "TDes8& aDataFrom"
657 * A reference to an area of memory to which the command handler
658 * will write any data to be passed back to the client. Cannot
661 * The result of the custom command. The exact range of values
662 * is dependent on the command handler interface.
664 IMPORT_C TInt CustomCommandSync(
665 const TMMFMessageDestinationPckg& aDestination,
667 const TDesC8& aDataTo1,
668 const TDesC8& aDataTo2,
672 * Sends a custom command synchronously to the DevSound server. This
673 * method will not return until the server has serviced the command.
675 * @param "const TMMFMessageDestinationPckg& aDestination"
676 * The destination of the custom command. This consists of the
677 * unique ID of the interface of command handler.
678 * @param "TInt aFunction"
679 * The number of the function to be called on the command
681 * @param "const TDesC8& aDataTo1"
682 * A reference to data to be copied to the command handler.
683 * The exact contents of the data are dependent on the command
684 * hanlder on the DevSound server. Can be NULL.
685 * @param "const TDesC8& aDataTo2"
686 * A reference to data to be copied to the command handler.
687 * The exact contents of the data are dependent on the command
688 * hanlder on the DevSound server. Can be NULL.
690 * The result of the custom command. The exact range of values
691 * is dependent on the command handler interface.
693 IMPORT_C TInt CustomCommandSync(
694 const TMMFMessageDestinationPckg& aDestination,
696 const TDesC8& aDataTo1,
697 const TDesC8& aDataTo2);
700 * Sends a custom command asynchronously to the DevSound server.
701 * Note: This method will return immediately. The ::RunL() of the active
702 * object owning the aStatus parameter will be called when the command
703 * is completed by the command handler.
705 * @param "const TMMFMessageDestinationPckg& aDestination"
706 * The destination of the custom command. This consists of the
707 * unique ID of the interface of command handler.
708 * @param "TInt aFunction"
709 * The number of the function to be called on the command
711 * @param "const TDesC8& aDataTo1"
712 * A reference to data to be copied to the command handler.
713 * The exact contents of the data are dependent on the command
714 * hanlder on the DevSound server. Can be NULL.
715 * @param "const TDesC8& aDataTo2"
716 * A reference to data to be copied to the command handler.
717 * The exact contents of the data are dependent on the command
718 * hanlder on the DevSound server. Can be NULL.
719 * @param "TDes8& aDataFrom"
720 * A reference to an area of memory to which the command handler
721 * will write any data to be passed back to the client. Cannot
723 * @param "TRequestStatus& aStatus"
724 * The TRequestStatus of an active object. This will contain the
725 * result of the custom command on completion. The exact range
726 * of result values is dependent on the custom command
729 IMPORT_C void CustomCommandAsync(
730 const TMMFMessageDestinationPckg& aDestination,
732 const TDesC8& aDataTo1,
733 const TDesC8& aDataTo2,
735 TRequestStatus& aStatus);
738 * Sends a custom command asynchronously to the DevSound server.
739 * Note: This method will return immediately. The ::RunL() of the active
740 * object owning the aStatus parameter will be called when the command
741 * is completed by the command handler.
743 * @param "const TMMFMessageDestinationPckg& aDestination"
744 * The destination of the custom command. This consists of the
745 * unique ID of the interface of command handler.
746 * @param "TInt aFunction"
747 * The number of the function to be called on the command
749 * @param "const TDesC8& aDataTo1"
750 * A reference to data to be copied to the command handler. The
751 * exact contents of the data are dependent on the command
752 * hanlder on the DevSound server. Can be NULL.
753 * @param "const TDesC8& aDataTo2"
754 * A reference to data to be copied to the command handler. The
755 * exact contents of the data are dependent on the command
756 * hanlder on the DevSound server. Can be NULL.
757 * @param "TRequestStatus& aStatus"
758 * The TRequestStatus of an active object. This will contain the
759 * result of the custom command on completion. The exact range
760 * of result values is dependent on the custom command
763 IMPORT_C void CustomCommandAsync(
764 const TMMFMessageDestinationPckg& aDestination,
766 const TDesC8& aDataTo1,
767 const TDesC8& aDataTo2,
768 TRequestStatus& aStatus);
770 IMPORT_C TInt SyncCustomCommand(TUid aUid, const TDesC8& aParam1, const TDesC8& aParam2, TDes8* aOutParam);
771 IMPORT_C void AsyncCustomCommand(TUid aUid, TRequestStatus& aStatus, const TDesC8& aParam1, const TDesC8& aParam2, TDes8* aOutParam);
772 IMPORT_C TInt GetTimePlayed(TTimeIntervalMicroSeconds& aTime);
775 * Queries if the low layers does support resume operation.
777 * @return TBool ETrue if Resume is supported
780 IMPORT_C TBool IsResumeSupported();
783 * Resume the operation (Play, Record, TonePlay) temporarily paused .
785 * @return TInt KErrNone if succesful
786 * KErrNotSupported if the operation is not supported by this implementation
788 IMPORT_C TInt Resume();
790 // from MDevSoundObserver
791 void InitializeComplete(TInt aError);
792 void ToneFinished(TInt aError);
793 void BufferToBeFilled(CMMFBuffer* aBuffer);
794 void PlayError(TInt aError);
795 void BufferToBeEmptied(CMMFBuffer* aBuffer);
796 void RecordError(TInt aError);
797 void ConvertError(TInt aError);
798 void DeviceMessage(TUid aMessageType, const TDesC8& aMsg);
799 void SendEventToClient(const TMMFEvent& aEvent);
802 void StartReceivingMsgQueueHandlerEventsL(MMMFDevSoundCustomInterfaceObserver& aDevSoundCIObserver);
806 TMMFDevSoundProxySettingsPckg iDspsPckg;
807 CMMFDataBuffer* iBuffer; //Not Owned
810 TMMFMessageDestinationPckg iDestinationPckg;
821 ERecordingBufferWait,
822 ERecordingInLastBufferCycle,
823 ERecordingResumingInLastBufferCycle,
826 enum TTonePlayingMode
835 // Allows distinguish for operations supported for some tones
836 TTonePlayingMode iToneMode;
837 // Contains state information of this DLL instance. Allows client-size state checking.
839 // Reference to the devsound proxy object
840 RMMFAudioServerProxy* iAudioServerProxy;
841 // Reference to observer where the events need to be forwarded to.
842 MDevSoundObserver* iDevSoundObserver;
844 RMsgQueue<TMMFDevSoundQueueItem> iMsgQueue;
845 // Reference to the message queue handler
846 CMsgQueueHandler* iMsgQueueHandler;
847 TMMFMessageDestinationPckg iCustIntPckg;
850 #endif // RMMFDEVSOUNDPROXY_H