sl@0: // Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies). sl@0: // All rights reserved. sl@0: // This component and the accompanying materials are made available sl@0: // under the terms of "Eclipse Public License v1.0" sl@0: // which accompanies this distribution, and is available sl@0: // at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: // sl@0: // Initial Contributors: sl@0: // Nokia Corporation - initial contribution. sl@0: // sl@0: // Contributors: sl@0: // sl@0: // Description: sl@0: // sl@0: sl@0: #ifndef MMFDEVSOUNDSESSION_H sl@0: #define MMFDEVSOUNDSESSION_H sl@0: sl@0: #include sl@0: #include sl@0: #include sl@0: #include sl@0: #include sl@0: #include sl@0: #ifdef SYMBIAN_ENABLE_SPLIT_HEADERS sl@0: #include sl@0: #endif sl@0: #include sl@0: #include sl@0: #include "mmfaudioclientserver.h" sl@0: #include "mmfdevsoundadaptation.h" sl@0: sl@0: #include sl@0: #include "MmfDevSoundCIDeMuxUtility.h" sl@0: #include sl@0: sl@0: // FORWARD DECLARATIONS sl@0: class CMMFDevSoundServer; sl@0: class CMMFDevSoundAdaptation; sl@0: class MGlobalProperties; sl@0: sl@0: /** sl@0: Panic category and codes that MMFDevSoundSession raises on the client sl@0: */ sl@0: _LIT(KMMFDevSoundSessionPanicCategory, "MMFDevSoundSession"); sl@0: sl@0: enum TMMFDevSoundSessionPanicCodes sl@0: { sl@0: EMsgQueueFailedToSendMsg =1, sl@0: EQueueRequestsFailedToAppend, sl@0: EUnexpectedAsyncOpCompleteHandlingCI, sl@0: ERequestBeingServicedMismatch sl@0: }; sl@0: sl@0: // CLASS DECLARATION sl@0: sl@0: /* sl@0: This class is wrapper for RMmfIpcMessage sl@0: The main purpose of this class is to hold a messages and sl@0: keep the status of the process started with the request sl@0: This is not related to message status itself (if was completed or not) sl@0: sl@0: @lib MmfDevSoundServer.lib sl@0: @since sl@0: */ sl@0: class TMMFDevSoundRequest sl@0: { sl@0: public: sl@0: sl@0: enum TA3FDevSoundRequestType sl@0: { sl@0: EQuery_Synchronous, // Message completed immediately, doesn't involve commit cycle, can be serviced even when a commit operation is pending sl@0: EQuery_Asynchronous, // Message is not completed until operation is completed, doesn't involve commit cycle sl@0: EConfigure_Synchronous, // Message completed immediately, doesn't involve commit cycle, can be serviced even when a commit operation is pending sl@0: EConfigure_Asynchronous, // Message is not completed until operation is completed, cannot be serviced when a commit operation is pending sl@0: EAction_Asynchronous, // Message is not completed until operation is completed, cannot be serviced when a commit operation is pending sl@0: EAction_PseudoAsynchronous, // Message is completed, but all the incoming asynchronous request that involves commit are enqueued sl@0: EOther_Synchronous, // Message completed immediately, doesn't involve commit cycle, can be serviced even when a commit operation is pending sl@0: EBufferExchangeRelated, // Message completed immediately, doesn't involve commit cycle, can be serviced even when a commit operation is pending sl@0: ECustomInterfacesRelated, // Message completed immediately, doesn't involve commit cycle, can be serviced even when a commit operation is pending sl@0: EUndefinedType, sl@0: ECallBackType, sl@0: ESessionEvents, sl@0: }; sl@0: sl@0: public: sl@0: sl@0: TMMFDevSoundRequest(); sl@0: TMMFDevSoundRequest(TInt aIsCallBack); sl@0: TMMFDevSoundRequest(const TMMFDevSoundRequest& aRequest); sl@0: void SetMessage(const RMmfIpcMessage& aMessage); sl@0: void SetMessageCallback(); sl@0: TBool operator==(const TMMFDevSoundRequest& aRequest) const; sl@0: const RMmfIpcMessage& Message(); sl@0: TInt Function() const; sl@0: sl@0: TA3FDevSoundRequestType Type() const; sl@0: TInt IsCallBack() const; sl@0: sl@0: void Complete(TInt aError); sl@0: sl@0: private: sl@0: TA3FDevSoundRequestType ResolveType(); sl@0: sl@0: private: sl@0: TBool iMessageCompleted; sl@0: sl@0: /** sl@0: The encapsulated request message sl@0: */ sl@0: RMmfIpcMessage iMessage; sl@0: sl@0: /** sl@0: The classification for this request sl@0: */ sl@0: TA3FDevSoundRequestType iRequestType; sl@0: sl@0: TInt iCallBackPF; sl@0: }; sl@0: sl@0: // CLASS DECLARATION sl@0: sl@0: /* sl@0: Server-side session implementation. sl@0: This class handles all the request from RMmfDevSoundProxy. sl@0: This classes uses MmfDevSoundAdaptation library and forwards all the reqeusts sl@0: to it. The main purpose of this class is to handle client server sl@0: communication. sl@0: sl@0: @lib MmfDevSoundServer.lib sl@0: @since sl@0: */ sl@0: class CMMFDevSoundSession : public CMmfIpcSession, sl@0: public MDevSoundAdaptationObserver, sl@0: public MMMFDevSoundCustomInterfaceDeMuxInterface, sl@0: public MCustomInterface, sl@0: public MMMFDevSoundCustomInterfaceTarget sl@0: sl@0: { sl@0: sl@0: public: // Constructors and destructor sl@0: sl@0: /** sl@0: Constructs, and returns a pointer to, a new CMMFDevSoundSession sl@0: object. sl@0: Leaves on failure. sl@0: @param MGlobalProperties a reference to global properties such as FourCC to format converter sl@0: @return CMMFDevSoundSession* A pointer to newly created object. sl@0: */ sl@0: static CMMFDevSoundSession* NewL(MGlobalProperties& aGlobalProperties); sl@0: sl@0: /** sl@0: Destructor. sl@0: */ sl@0: ~CMMFDevSoundSession(); sl@0: sl@0: public: // New functions sl@0: sl@0: /** sl@0: Called by Client/Server framework when a new session is created. sl@0: Leaves on failure. sl@0: @since sl@0: @param const CMmfIpcServer& aServer A constant reference to server sl@0: creating this session. sl@0: @return void sl@0: */ sl@0: void CreateL(const CMmfIpcServer& aServer); sl@0: sl@0: /** sl@0: Called by Client/Server framework when service request is made by the sl@0: corresponding RMmfDevSoundProxy.object. sl@0: Leaves on failure. sl@0: @since sl@0: @param const RMmfIpcMessage& aMessage A reference to message object sl@0: containing request attributes. sl@0: @return void sl@0: */ sl@0: void ServiceL(const RMmfIpcMessage& aMessage); sl@0: sl@0: /** sl@0: Function to handle DevSound session id request. sl@0: @since sl@0: @return TInt A integer assigned to this DevSound server. sl@0: */ sl@0: TInt DevSoundSessionId() {return iDevSoundSessionId;}; sl@0: sl@0: // TODO: Review if the parameter should be kept or not sl@0: void SendEventToClient(/*TMMFAudioServerEvent& aEvent*/); sl@0: sl@0: /** sl@0: Method to service PostOpen request - 2nd phase async open. sl@0: Leaves on failure. sl@0: @since sl@0: @param const RMmfIpcMessage& aMessage A reference to message object sl@0: containing request attributes. sl@0: @return ETrue if the request is serviced completely else EFalse. sl@0: */ sl@0: TBool DoPostOpenL(const RMmfIpcMessage& aMessage); sl@0: sl@0: /** sl@0: Method to service Initialize1L request. sl@0: Leaves on failure. sl@0: @since sl@0: @param const RMmfIpcMessage& aMessage A reference to message object sl@0: containing request attributes. sl@0: @return ETrue if the request is serviced completely else EFalse. sl@0: */ sl@0: TBool DoInitialize1L(const RMmfIpcMessage& aMessage); sl@0: sl@0: /** sl@0: Method to service Initialize1L request that has already completed, but sl@0: not finished due to a pre-emption clash during its commit cycle(s). sl@0: Leaves on failure. sl@0: @return void sl@0: */ sl@0: void DoAlreadyCompletedInitialize1L(); sl@0: sl@0: /** sl@0: Method to service Initialize2L request. sl@0: Leaves on failure. sl@0: @since sl@0: @param const RMmfIpcMessage& aMessage A reference to message object sl@0: containing request attributes. sl@0: @return ETrue if the request is serviced completely else EFalse. sl@0: */ sl@0: TBool DoInitialize2L(const RMmfIpcMessage& aMessage); sl@0: sl@0: /** sl@0: Method to service Initialize2L request that has already completed, but sl@0: not finished due to a pre-emption clash during its commit cycle(s). sl@0: Leaves on failure. sl@0: @return void sl@0: */ sl@0: void DoAlreadyCompletedInitialize2L(); sl@0: sl@0: /** sl@0: Method to service Initialize3L request. sl@0: Leaves on failure. sl@0: @param const RMmfIpcMessage& aMessage A reference to message object sl@0: containing request attributes. sl@0: @return ETrue if the request is serviced completely else EFalse. sl@0: */ sl@0: TBool DoInitialize3L(const RMmfIpcMessage& aMessage); sl@0: /** sl@0: Method to service Initialize4L request. sl@0: Leaves on failure. sl@0: @since sl@0: @param const RMmfIpcMessage& aMessage A reference to message object sl@0: containing request attributes. sl@0: @return ETrue if the request is serviced completely else EFalse. sl@0: */ sl@0: TBool DoInitialize4L(const RMmfIpcMessage& aMessage); sl@0: sl@0: /** sl@0: Method to service Initialize4L request that has already completed, but sl@0: not finished due to a pre-emption clash during its commit cycle(s). sl@0: Leaves on failure. sl@0: @return void sl@0: */ sl@0: void DoAlreadyCompletedInitialize4L(); sl@0: sl@0: /** sl@0: Method to service CancelInitialize request. sl@0: Leaves on failure. sl@0: @since sl@0: @param const RMmfIpcMessage& aMessage A reference to message object sl@0: containing request attributes. sl@0: @return ETrue if the request is serviced completely else EFalse. sl@0: */ sl@0: TBool DoCancelInitializeL(const RMmfIpcMessage& aMessage); sl@0: sl@0: /** sl@0: Method to service capabilities query request from sl@0: RMmfDevSoundProxy. sl@0: Leaves on failure. sl@0: @since sl@0: @param const RMmfIpcMessage& aMessage A reference to message object sl@0: containing request attributes. sl@0: @return ETrue if the request is serviced completely else EFalse. sl@0: */ sl@0: TBool DoCapabilitiesL(const RMmfIpcMessage& aMessage); sl@0: sl@0: /** sl@0: Method to service current configuration query request from sl@0: RMmfDevSoundProxy. sl@0: Leaves on failure. sl@0: @since sl@0: @param const RMmfIpcMessage& aMessage A reference to message object sl@0: containing request attributes. sl@0: @return ETrue if the request is serviced completely else EFalse. sl@0: */ sl@0: TBool DoConfigL(const RMmfIpcMessage& aMessage); sl@0: sl@0: /** sl@0: Method to service set current configuration request from sl@0: RMmfDevSoundProxy. sl@0: Leaves on failure. sl@0: @since sl@0: @param const RMmfIpcMessage& aMessage A reference to message object sl@0: containing request attributes. sl@0: @return ETrue if the request is serviced completely else EFalse. sl@0: */ sl@0: TBool DoSetConfigL(const RMmfIpcMessage& aMessage); sl@0: sl@0: /** sl@0: Method to service maximum volume query request. sl@0: Leaves on failure. sl@0: @since sl@0: @param const RMmfIpcMessage& aMessage A reference to message object sl@0: containing request attributes. sl@0: @return ETrue if the request is serviced completely else EFalse. sl@0: */ sl@0: TBool DoMaxVolumeL(const RMmfIpcMessage& aMessage); sl@0: sl@0: /** sl@0: Method to service current volume level query request. sl@0: Leaves on failure. sl@0: @since sl@0: @param const RMmfIpcMessage& aMessage A reference to message object sl@0: containing request attributes. sl@0: @return ETrue if the request is serviced completely else EFalse. sl@0: */ sl@0: TBool DoVolumeL(const RMmfIpcMessage& aMessage); sl@0: sl@0: /** sl@0: Method to service set current volume level request. sl@0: Leaves on failure. sl@0: @since sl@0: @param const RMmfIpcMessage& aMessage A reference to message object sl@0: containing request attributes. sl@0: @return ETrue if the request is serviced completely else EFalse. sl@0: */ sl@0: TBool DoSetVolumeL(const RMmfIpcMessage& aMessage); sl@0: sl@0: /** sl@0: Method to service maximum gain query request. sl@0: Leaves on failure. sl@0: @since sl@0: @param const RMmfIpcMessage& aMessage A reference to message object sl@0: containing request attributes. sl@0: @return ETrue if the request is serviced completely else EFalse. sl@0: */ sl@0: TBool DoMaxGainL(const RMmfIpcMessage& aMessage); sl@0: sl@0: /** sl@0: Method to service current gain level query request. sl@0: Leaves on failure. sl@0: @since sl@0: @param const RMmfIpcMessage& aMessage A reference to message object sl@0: containing request attributes. sl@0: @return ETrue if the request is serviced completely else EFalse. sl@0: */ sl@0: TBool DoGainL(const RMmfIpcMessage& aMessage); sl@0: sl@0: /** sl@0: Method to service set current gain level request. sl@0: Leaves on failure. sl@0: @since sl@0: @param const RMmfIpcMessage& aMessage A reference to message object sl@0: containing request attributes. sl@0: @return ETrue if the request is serviced completely else EFalse. sl@0: */ sl@0: TBool DoSetGainL(const RMmfIpcMessage& aMessage); sl@0: sl@0: /** sl@0: Method to service current play balance level query request. sl@0: Leaves on failure. sl@0: @since sl@0: @param const RMmfIpcMessage& aMessage A reference to message object sl@0: containing request attributes. sl@0: @return ETrue if the request is serviced completely else EFalse. sl@0: */ sl@0: TBool DoGetPlayBalanceL(const RMmfIpcMessage& aMessage); sl@0: sl@0: /** sl@0: Method to service set current play balance level request. sl@0: Leaves on failure. sl@0: @since sl@0: @param const RMmfIpcMessage& aMessage A reference to message object sl@0: containing request attributes. sl@0: @return ETrue if the request is serviced completely else EFalse. sl@0: */ sl@0: TBool DoSetPlayBalanceL(const RMmfIpcMessage& aMessage); sl@0: sl@0: /** sl@0: Method to service current record balance level query request. sl@0: Leaves on failure. sl@0: @since sl@0: @param const RMmfIpcMessage& aMessage A reference to message object sl@0: containing request attributes. sl@0: @return ETrue if the request is serviced completely else EFalse. sl@0: */ sl@0: TBool DoGetRecordBalanceL(const RMmfIpcMessage& aMessage); sl@0: sl@0: /** sl@0: Method to service set current record balance level request. sl@0: Leaves on failure. sl@0: @since sl@0: @param const RMmfIpcMessage& aMessage A reference to message object sl@0: containing request attributes. sl@0: @return ETrue if the request is serviced completely else EFalse. sl@0: */ sl@0: TBool DoSetRecordBalanceL(const RMmfIpcMessage& aMessage); sl@0: sl@0: /** sl@0: Method to service initialize DevSound to play request. sl@0: Leaves on failure. sl@0: @since sl@0: @param const RMmfIpcMessage& aMessage A reference to message object sl@0: containing request attributes. sl@0: @return ETrue if the request is serviced completely else EFalse. sl@0: */ sl@0: TBool DoPlayInitL(const RMmfIpcMessage& aMessage); sl@0: sl@0: /** sl@0: Method to service initialize DevSound to play request that has already completed, sl@0: but not finished due to a pre-emption clash during its commit cycle(s). sl@0: Leaves on failure. sl@0: @return void sl@0: */ sl@0: void DoAlreadyCompletedPlayInitL(); sl@0: sl@0: /** sl@0: Method to service initialize DevSound to record request. sl@0: Leaves on failure. sl@0: @since sl@0: @param const RMmfIpcMessage& aMessage A reference to message object sl@0: containing request attributes. sl@0: @return ETrue if the request is serviced completely else EFalse. sl@0: */ sl@0: TBool DoRecordInitL(const RMmfIpcMessage& aMessage); sl@0: sl@0: /** sl@0: Method to service initialize DevSound to record request that has already completed, sl@0: but not finished due to a pre-emption clash during its commit cycle(s). sl@0: Leaves on failure. sl@0: @return void sl@0: */ sl@0: void DoAlreadyCompletedRecordInitL(); sl@0: sl@0: /** sl@0: Method to service signal DevSound to playing current buffer request. sl@0: Leaves on failure. sl@0: @since sl@0: @param const RMmfIpcMessage& aMessage A reference to message object sl@0: containing request attributes. sl@0: @return ETrue if the request is serviced completely else EFalse. sl@0: */ sl@0: TBool DoPlayDataL(const RMmfIpcMessage& aMessage); sl@0: sl@0: /** sl@0: Method to service signal DevSound to continue record request. sl@0: Leaves on failure. sl@0: @since sl@0: @param const RMmfIpcMessage& aMessage A reference to message object sl@0: containing request attributes. sl@0: @return ETrue if the request is serviced completely else EFalse. sl@0: */ sl@0: TBool DoRecordDataL(const RMmfIpcMessage& aMessage); sl@0: sl@0: /** sl@0: Method to service signal DevSound to stop ongoing operation request. sl@0: Leaves on failure. sl@0: @since sl@0: @param const RMmfIpcMessage& aMessage A reference to message object sl@0: containing request attributes. sl@0: @return ETrue if the request is serviced completely else EFalse. sl@0: */ sl@0: TBool DoStopL(const RMmfIpcMessage& aMessage); sl@0: sl@0: /** sl@0: Method to service signal DevSound to temporarily stop ongoing sl@0: operation request. sl@0: Leaves on failure. sl@0: @since sl@0: @param const RMmfIpcMessage& aMessage A reference to message object sl@0: containing request attributes. sl@0: @return ETrue if the request is serviced completely else EFalse. sl@0: */ sl@0: TBool DoPauseL(const RMmfIpcMessage& aMessage); sl@0: sl@0: /** sl@0: Method to service signal DevSound to play simple tone operation sl@0: request. sl@0: Leaves on failure. sl@0: @since sl@0: @param const RMmfIpcMessage& aMessage A reference to message object sl@0: containing request attributes. sl@0: @return ETrue if the request is serviced completely else EFalse. sl@0: */ sl@0: TBool DoPlayToneL(const RMmfIpcMessage& aMessage); sl@0: sl@0: /** sl@0: Method to service signal DevSound to play simple tone operation sl@0: request that has already completed, but not finished due to a sl@0: pre-emption clash during its commit cycle(s). sl@0: Leaves on failure. sl@0: @return void sl@0: */ sl@0: void DoAlreadyCompletedPlayToneL(); sl@0: sl@0: /** sl@0: Method to service signal DevSound to play dual tone operation sl@0: request. sl@0: Leaves on failure. sl@0: @since sl@0: @param const RMmfIpcMessage& aMessage A reference to message object sl@0: containing request attributes. sl@0: @return ETrue if the request is serviced completely else EFalse. sl@0: */ sl@0: TBool DoPlayDualToneL(const RMmfIpcMessage& aMessage); sl@0: sl@0: /** sl@0: Method to service signal DevSound to play dual tone operation sl@0: request that has already completed, but not finished due to a sl@0: pre-emption clash during its commit cycle(s). sl@0: Leaves on failure. sl@0: @return void sl@0: */ sl@0: void DoAlreadyCompletedPlayDualToneL(); sl@0: sl@0: /** sl@0: Method to service signal DevSound to play DTMFString operation sl@0: request. sl@0: Leaves on failure. sl@0: @since sl@0: @param const RMmfIpcMessage& aMessage A reference to message object sl@0: containing request attributes. sl@0: @return ETrue if the request is serviced completely else EFalse. sl@0: */ sl@0: TBool DoPlayDTMFStringL(const RMmfIpcMessage& aMessage); sl@0: sl@0: /** sl@0: Method to service signal DevSound to play DTMFString operation sl@0: request that has already completed, but not finished due to a sl@0: pre-emption clash during its commit cycle(s). sl@0: Leaves on failure. sl@0: @return void sl@0: */ sl@0: void DoAlreadyCompletedPlayDTMFStringL(); sl@0: sl@0: /** sl@0: Method to service signal DevSound to play tone sequence operation sl@0: request. sl@0: Leaves on failure. sl@0: @since sl@0: @param const RMmfIpcMessage& aMessage A reference to message object sl@0: containing request attributes. sl@0: @return ETrue if the request is serviced completely else EFalse. sl@0: */ sl@0: TBool DoPlayToneSequenceL(const RMmfIpcMessage& aMessage); sl@0: sl@0: /** sl@0: Method to service signal DevSound to play tone sequence operation sl@0: request that has already completed, but not finished due to a sl@0: pre-emption clash during its commit cycle(s). sl@0: Leaves on failure. sl@0: @return void sl@0: */ sl@0: void DoAlreadyCompletedPlayToneSequenceL(); sl@0: sl@0: /** sl@0: Method to service signal DevSound to play fixed sequence operation sl@0: request. sl@0: Leaves on failure. sl@0: @since sl@0: @param const RMmfIpcMessage& aMessage A reference to message object sl@0: containing request attributes. sl@0: @return ETrue if the request is serviced completely else EFalse. sl@0: */ sl@0: TBool DoPlayFixedSequenceL(const RMmfIpcMessage& aMessage); sl@0: sl@0: /** sl@0: Method to service signal DevSound to play fixed sequence operation sl@0: request that has already completed, but not finished due to a sl@0: pre-emption clash during its commit cycle(s). sl@0: Leaves on failure. sl@0: @return void sl@0: */ sl@0: void DoAlreadyCompletedPlayFixedSequenceL(); sl@0: sl@0: /** sl@0: Method to service signal DevSound to initilize DTMF String operation sl@0: request. sl@0: Leaves on failure. sl@0: @since sl@0: @param const RMmfIpcMessage& aMessage A reference to message object sl@0: containing request attributes. sl@0: @return ETrue if the request is serviced completely else EFalse. sl@0: */ sl@0: TBool DoSetDTMFLengthsL(const RMmfIpcMessage& aMessage); sl@0: sl@0: /** sl@0: Method to service signal DevSound to set volume ramp operation sl@0: request. sl@0: Leaves on failure. sl@0: @since sl@0: @param const RMmfIpcMessage& aMessage A reference to message object sl@0: containing request attributes. sl@0: @return ETrue if the request is serviced completely else EFalse. sl@0: */ sl@0: TBool DoSetVolumeRampL(const RMmfIpcMessage& aMessage); sl@0: sl@0: /** sl@0: Method to service query DevSound to return supported input data types sl@0: operation request. sl@0: Leaves on failure. sl@0: @since sl@0: @param const RMmfIpcMessage& aMessage A reference to message object sl@0: containing request attributes. sl@0: @return ETrue if the request is serviced completely else EFalse. sl@0: */ sl@0: TBool DoGetSupportedInputDataTypesL(const RMmfIpcMessage& aMessage); sl@0: sl@0: /** sl@0: Method to service query DevSound to copy FourCC array data sl@0: operation request. sl@0: Leaves on failure. sl@0: @since sl@0: @param const RMmfIpcMessage& aMessage A reference to message object sl@0: containing request attributes. sl@0: @return ETrue if the request is serviced completely else EFalse. sl@0: */ sl@0: TBool DoCopyFourCCArrayDataL(const RMmfIpcMessage& aMessage); sl@0: sl@0: /** sl@0: Method to service the request querying samples recorded so far. sl@0: Leaves on failure. sl@0: @since sl@0: @param const RMmfIpcMessage& aMessage A reference to message object sl@0: containing request attributes. sl@0: @return ETrue if the request is serviced completely else EFalse. sl@0: */ sl@0: TBool DoSamplesRecordedL(const RMmfIpcMessage& aMessage); sl@0: sl@0: /** sl@0: Method to service the request querying samples played so far. sl@0: Leaves on failure. sl@0: @since sl@0: @param const RMmfIpcMessage& aMessage A reference to message object sl@0: containing request attributes. sl@0: @return ETrue if the request is serviced completely else EFalse. sl@0: */ sl@0: TBool DoSamplesPlayedL(const RMmfIpcMessage& aMessage); sl@0: sl@0: /** sl@0: Method to service the request to set tone repeats. sl@0: Leaves on failure. sl@0: @since sl@0: @param const RMmfIpcMessage& aMessage A reference to message object sl@0: containing request attributes. sl@0: @return ETrue if the request is serviced completely else EFalse. sl@0: */ sl@0: TBool DoSetToneRepeatsL(const RMmfIpcMessage& aMessage); sl@0: sl@0: /** sl@0: Method to service the request to set priority settings. sl@0: Leaves on failure. sl@0: @since sl@0: @param const RMmfIpcMessage& aMessage A reference to message object sl@0: containing request attributes. sl@0: @return ETrue if the request is serviced completely else EFalse. sl@0: */ sl@0: TBool DoSetPrioritySettingsL(const RMmfIpcMessage& aMessage); sl@0: sl@0: /** sl@0: Method to service the request querrying fixed sequence name. sl@0: Leaves on failure. sl@0: @since sl@0: @param const RMmfIpcMessage& aMessage A reference to message object sl@0: containing request attributes. sl@0: @return ETrue if the request is serviced completely else EFalse. sl@0: */ sl@0: TBool DoFixedSequenceNameL(const RMmfIpcMessage& aMessage); sl@0: sl@0: /** sl@0: Method to service the request querrying fixed sequence count. sl@0: Leaves on failure. sl@0: @since sl@0: @param const RMmfIpcMessage& aMessage A reference to message object sl@0: containing request attributes. sl@0: @return ETrue if the request is serviced completely else EFalse. sl@0: */ sl@0: TBool DoFixedSequenceCountL(const RMmfIpcMessage& aMessage); sl@0: sl@0: /** sl@0: Method to service the request querrying supported output data types. sl@0: Leaves on failure. sl@0: @since sl@0: @param const RMmfIpcMessage& aMessage A reference to message object sl@0: containing request attributes. sl@0: @return ETrue if the request is serviced completely else EFalse. sl@0: */ sl@0: TBool DoGetSupportedOutputDataTypesL(const RMmfIpcMessage& aMessage); sl@0: sl@0: /** sl@0: Method to service the request querrying specifics of the TBF data sl@0: buffer. sl@0: Leaves on failure. sl@0: @since sl@0: @param const RMmfIpcMessage& aMessage A reference to message object sl@0: containing request attributes. sl@0: @return ETrue if the request is serviced completely else EFalse. sl@0: */ sl@0: TBool DoBufferToBeFilledDataL(const RMmfIpcMessage& aMessage); sl@0: sl@0: /** sl@0: Method to service the request querrying specifics of the TBE data sl@0: buffer. sl@0: Leaves on failure. sl@0: @since sl@0: @param const RMmfIpcMessage& aMessage A reference to message object sl@0: containing request attributes. sl@0: @return ETrue if the request is serviced completely else EFalse. sl@0: */ sl@0: TBool DoBufferToBeEmptiedDataL(const RMmfIpcMessage& aMessage); sl@0: sl@0: /** sl@0: sl@0: Leaves on failure. sl@0: @since sl@0: @param const RMmfIpcMessage& aMessage A reference to message object sl@0: containing request attributes. sl@0: @return ETrue if the request is serviced completely else EFalse. sl@0: */ sl@0: TBool DoEmptyBuffersL(const RMmfIpcMessage& aMessage); sl@0: sl@0: /** sl@0: Method to service the request querrying preparation for close session sl@0: Leaves on failure. sl@0: @since sl@0: @param const RMmfIpcMessage& aMessage A reference to message object sl@0: containing request attributes. sl@0: @return ETrue if the request is serviced completely else EFalse. sl@0: */ sl@0: TBool DoPrepareCloseL(const RMmfIpcMessage& aMessage); sl@0: sl@0: sl@0: TBool DoRegisterAsClientL(const RMmfIpcMessage& aMessage); sl@0: TBool DoCancelRegisterAsClientL(const RMmfIpcMessage& aMessage); sl@0: TBool DoGetResourceNotificationDataL(const RMmfIpcMessage& aMessage); sl@0: TBool DoWillResumePlayL(const RMmfIpcMessage& aMessage); sl@0: TBool DoSetClientThreadInfoL(const RMmfIpcMessage& aMessage); sl@0: sl@0: sl@0: /** sl@0: Method to get the current play time from the audio renderer sl@0: @since sl@0: @param const RMmfIpcMessage& aMessage A reference to message object sl@0: containing request attributes. sl@0: @return ETrue if the request is serviced completely else EFalse. sl@0: */ sl@0: TBool DoGetTimePlayedL(const RMmfIpcMessage& aMessage); sl@0: sl@0: /** sl@0: Method to query if True Pause is supported by current codec format sl@0: @since sl@0: @param const RMmfIpcMessage& aMessage A reference to message object sl@0: containing request attributes. sl@0: @return ETrue if the request is serviced completely else EFalse. sl@0: */ sl@0: TBool DoQueryResumeSupportedL(const RMmfIpcMessage& aMessage); sl@0: sl@0: /** sl@0: Method to service signal DevSound to resume playback, recording or tone playing sl@0: request. sl@0: Leaves on failure. sl@0: @since sl@0: @param const RMmfIpcMessage& aMessage A reference to message object sl@0: containing request attributes. sl@0: @return ETrue if the request is serviced completely else EFalse. sl@0: */ sl@0: TBool DoResumeL(const RMmfIpcMessage& aMessage); sl@0: sl@0: /** sl@0: Initializes to raw audio data PCM16 and Sampling Rate of 8 KHz. sl@0: On completion of Initialization, calls InitializeComplete() on sl@0: aDevSoundObserver. sl@0: Leaves on failure. sl@0: @since sl@0: @param MDevSoundAdaptationObserver& aDevSoundObserver A reference to DevSound sl@0: Observer instance. sl@0: @param TMMFState aMode Mode for which this object will be used. sl@0: @return void sl@0: */ sl@0: void InitializeL(MDevSoundAdaptationObserver& aDevSoundObserver, sl@0: TMMFState aMode); sl@0: sl@0: /** sl@0: Initializes DevSound object for the mode aMode for processing audio sl@0: data with hardware device aHWDev. sl@0: On completion of Initialization, calls InitializeComplete() on sl@0: aDevSoundObserver. sl@0: Leaves on failure. sl@0: @since sl@0: @param MDevSoundAdaptationObserver& aDevSoundObserver A reference to DevSound sl@0: Observer instance. sl@0: @param TUid aHWDev The CMMFHwDevice implementation identifier. sl@0: @param TMMFState aMode The mode for which this object will be used sl@0: @return void sl@0: */ sl@0: void InitializeL(MDevSoundAdaptationObserver& aDevSoundObserver, sl@0: TUid aHWDev, sl@0: TMMFState aMode); sl@0: sl@0: /** sl@0: Initializes DevSound object for the mode aMode for processing audio sl@0: data with hardware device supporting FourCC aDesiredFourCC. sl@0: Leaves on failure. sl@0: @since sl@0: @param MDevSoundAdaptationObserver& aDevSoundObserver A reference to sl@0: the DevSound adaptation observer instance. sl@0: @param TFourCC aDesiredFourCC The CMMFHwDevice implementation FourCC sl@0: code. sl@0: @param TMMFState aMode The mode for which this object will be used sl@0: @return KErrNone if successfull, else corresponding error code sl@0: @return void sl@0: */ sl@0: void InitializeL(MDevSoundAdaptationObserver& aDevSoundObserver, sl@0: TFourCC aDesiredFourCC, sl@0: TMMFState aMode); sl@0: sl@0: /** sl@0: Returns the supported Audio settings ie. encoding, sample rates, sl@0: mono/stereo operation, buffer size etc.. sl@0: @since sl@0: @return TMMFCapabilities The device settings. sl@0: */ sl@0: TMMFCapabilities Capabilities(); sl@0: sl@0: /** sl@0: Returns the current device configuration. sl@0: @since sl@0: @return TMMFCapabilities The device settings. sl@0: */ sl@0: TMMFCapabilities Config() const; sl@0: sl@0: /** sl@0: Configure CMMFDevSound object with the settings in aConfig. Use this sl@0: to set sampling rate, encoding and mono/stereo. sl@0: Leaves on failure. sl@0: @since sl@0: @param const TMMFCapabilities& aConfig The attribute values to which sl@0: CMMFDevSound object will be configured to. sl@0: @return void sl@0: */ sl@0: void SetConfigL(const TMMFCapabilities& aCaps); sl@0: sl@0: /** sl@0: Returns an integer representing the maximum volume device supports. sl@0: This is the maximum value which can be passed to sl@0: CMMFDevSound::SetVolume. sl@0: @since sl@0: @return TInt The maximum volume. This value is platform dependent but sl@0: is always greater than or equal to one. sl@0: */ sl@0: TInt MaxVolume(); sl@0: sl@0: /** sl@0: Returns an integer representing the current volume. sl@0: @since sl@0: @return TInt The current volume level. sl@0: */ sl@0: TInt Volume(); sl@0: sl@0: /** sl@0: Changes the current playback volume to a specified value. The volume sl@0: can be changed before or during playback and is effective immediately. sl@0: @since sl@0: @param TInt aVolume The volume setting. This can be any value from 0 sl@0: to the value returned by a call to sl@0: CMMFDevSound::MaxVolume(). If the volume is not sl@0: within this range, the volume is automatically set sl@0: to minimum or maximum value based on the value sl@0: that is being passed. Setting a zero value mutes sl@0: the sound. Setting the maximum value results in sl@0: the loudest possible sound. sl@0: @return void sl@0: */ sl@0: void SetVolume(TInt aVolume); sl@0: sl@0: /** sl@0: Returns an integer representing the maximum gain the device supports. sl@0: This is the maximum value which can be passed to CMMFDevSound::SetGain sl@0: @since sl@0: @return TInt The maximum gain. This value is platform dependent but is sl@0: always greater than or equal to one. sl@0: */ sl@0: TInt MaxGain(); sl@0: sl@0: /** sl@0: Returns an integer representing the current gain. sl@0: @since sl@0: @return TInt The current gain level. sl@0: */ sl@0: TInt Gain(); sl@0: sl@0: /** sl@0: Changes the current recording gain to a specified value. The gain can sl@0: be changed before or during recording and is effective immediately. sl@0: @since sl@0: @param TInt aGain The gain setting. This can be any value from zero to sl@0: the value returned by a call to sl@0: CMMFDevSound::MaxGain(). If the volume sl@0: is not within this range, the gain is automatically sl@0: set to minimum or maximum value based on the value sl@0: that is being passed. Setting a zero value mutes the sl@0: sound. Setting the maximum value results in the sl@0: loudest possible sound. sl@0: @return void sl@0: */ sl@0: void SetGain(TInt aGain); sl@0: sl@0: /** sl@0: Returns the speaker balance set for playing. sl@0: Leaves on failure. sl@0: @since sl@0: @param TInt &aLeftPercentage On return contains the left speaker sl@0: volume percentage. sl@0: @param TInt &aRightPercentage On return contains the right speaker sl@0: volume percentage. sl@0: @return void sl@0: */ sl@0: void GetPlayBalanceL(TInt& aLeftPercentage, TInt& aRightPercentage); sl@0: sl@0: /** sl@0: Sets the speaker balance for playing. The speaker balance can be sl@0: changed before or during playback and is effective immediately. sl@0: Leaves on failure. sl@0: @since sl@0: @param TInt aLeftPercentage The left speaker volume percentage. This sl@0: can be any value from zero to 100. Setting sl@0: a zero value mutes the sound on left sl@0: speaker. sl@0: @param TInt aRightPercentage The right speaker volume percentage. sl@0: This can be any value from zero to 100. sl@0: Setting a zero value mutes the sound on sl@0: right speaker. sl@0: @return void sl@0: */ sl@0: void SetPlayBalanceL(TInt aLeftPercentage, TInt aRightPercentage); sl@0: sl@0: /** sl@0: Returns the microphone gain balance set for recording. sl@0: Leaves on failure. sl@0: @since sl@0: @param TInt &aLeftPercentage On return contains the left microphone sl@0: gain percentage. sl@0: @param TInt &aRightPercentage On return contains the right microphone sl@0: gain percentage. sl@0: @return void sl@0: */ sl@0: void GetRecordBalanceL(TInt& aLeftPercentage, TInt& aRightPercentage); sl@0: /** sl@0: Sets the microphone balance for recording. The microphone balance can sl@0: be changed before or during recording and is effective immediately. sl@0: Leaves on failure. sl@0: @since sl@0: @param TInt aLeftPercentage The left microphone gain percentage. This sl@0: can be any value from zero to 100. Setting sl@0: a zero value mutes the sound from left sl@0: microphone. sl@0: @param TInt aRightPercentage The right microphone gain percentage. sl@0: This can be any value from zero to 100. sl@0: Setting a zero value mutes the sound from sl@0: right microphone. sl@0: @return void sl@0: */ sl@0: void SetRecordBalanceL(TInt aLeftPercentage, TInt aRightPercentage); sl@0: sl@0: /** sl@0: Initializes the audio device and starts the play process. This sl@0: function queries and acquires the audio policy before initializing sl@0: audio device. If there was an error during policy initialization, sl@0: PlayError() function will be called on the observer with error code sl@0: KErrAccessDenied, otherwise BufferToBeFilled() function will be called sl@0: with a buffer reference. After reading data into the buffer reference sl@0: passed, the client should call PlayData() to play data. sl@0: The amount of data that can be played is specified in sl@0: CMMFBuffer::RequestSize(). Any data that is read into buffer beyond sl@0: this size will be ignored. sl@0: Leaves on failure. sl@0: @since sl@0: @return void sl@0: */ sl@0: void PlayInitL(); sl@0: sl@0: /** sl@0: Initializes the audio device and starts the record process. This sl@0: function queries and acquires the audio policy before initializing sl@0: audio device. If there was an error during policy initialization, sl@0: RecordError() function will be called on the observer with error code sl@0: KErrAccessDenied, otherwise BufferToBeEmptied() function will be called sl@0: with a buffer reference. This buffer contains recorded or encoded sl@0: data. After processing data in the buffer reference passed, the client sl@0: should call RecordData() to continue recording process. sl@0: The amount of data that is available is specified in sl@0: CMMFBuffer::RequestSize(). sl@0: Leaves on failure. sl@0: @since sl@0: @return void sl@0: */ sl@0: void RecordInitL(); sl@0: sl@0: /** sl@0: Plays data in the buffer at the current volume. sl@0: The client should fill the buffer with audio data before calling this sl@0: function. The observer gets a reference to the buffer along with the sl@0: callback function BufferToBeFilled(). When playing of the audio sample sl@0: is complete, successfully or otherwise, the function PlayError() on sl@0: the observer is called. sl@0: The last buffer of the audio stream being played should have the last sl@0: buffer flag set using CMMFBuffer::SetLastBuffer(TBool). If a sl@0: subsequent attempt to play the clip is made, this flag will need sl@0: resetting by the client. sl@0: @return void sl@0: */ sl@0: void PlayData(); sl@0: sl@0: /** sl@0: Contine the process of recording. sl@0: Once the buffer is filled with recorded data, the Observer gets a sl@0: reference to the buffer along with the callback function sl@0: BufferToBeEmptied(). After processing the buffer (copying over to a sl@0: different buffer or writing to file) the client should call this sl@0: function to continue the recording process. sl@0: @return void sl@0: */ sl@0: void RecordData(); sl@0: sl@0: /** sl@0: Stops the ongoing operation (Play, Record, TonePlay). sl@0: @since sl@0: @return void sl@0: */ sl@0: void Stop(); sl@0: sl@0: /** sl@0: Temporarily Stops the ongoing operation (Play, Record, TonePlay). sl@0: @since sl@0: @return void sl@0: */ sl@0: void Pause(); sl@0: sl@0: /** sl@0: Returns the Sample recorded so far sl@0: @since sl@0: @return TInt Returns the samples recorded. sl@0: */ sl@0: TInt SamplesRecorded(); sl@0: sl@0: /** sl@0: Returns the Sample played so far sl@0: @since sl@0: @return TInt Returns the samples played. sl@0: */ sl@0: TInt SamplesPlayed(); sl@0: sl@0: /** sl@0: Initializes the audio device and starts playing a tone. The tone is sl@0: played with the frequency and duration specified. sl@0: Leaves on failure. sl@0: @since sl@0: @param TInt aFrequency The frequency at which the tone will be played. sl@0: @param const TTimeIntervalMicroSeconds &aDuration The period over sl@0: which the tone will be played. A zero value causes the no tone sl@0: to be played. sl@0: @return void sl@0: */ sl@0: void PlayToneL(TInt aFrequency, sl@0: const TTimeIntervalMicroSeconds& aDuration); sl@0: sl@0: /** sl@0: Initializes audio device and starts playing a dual tone. Dual Tone is sl@0: played with the specified frequencies and for the specified duration. sl@0: Leaves on failure. sl@0: @since sl@0: @param TInt aFrequencyOne The first frequency of dual tone. sl@0: @param TInt aFrequencyTwo The second frequency of dual tone. sl@0: @param const TTimeIntervalMicroSeconds &aDuration The period over sl@0: which the tone will be played. A zero value causes the no tone sl@0: to be played. sl@0: @return void sl@0: */ sl@0: void PlayDualToneL(TInt aFrequencyOne, sl@0: TInt aFrequencyTwo, sl@0: const TTimeIntervalMicroSeconds& aDuration); sl@0: sl@0: /** sl@0: Initializes the audio device and starts playing the DTMF string sl@0: aDTMFString. sl@0: Leaves on failure. sl@0: @since sl@0: @param const TDesC &aDTMFString The DTMF sequence in a descriptor. sl@0: @return void sl@0: */ sl@0: void PlayDTMFStringL(const TDesC& aDTMFString); sl@0: sl@0: /** sl@0: Initializes the audio device and starts playing a tone sequence. sl@0: Leaves on failure. sl@0: @since sl@0: @param const TDesC8 &aData The tone sequence in a descriptor. sl@0: @return void sl@0: */ sl@0: void PlayToneSequenceL(const TDesC8& aData); sl@0: sl@0: /** sl@0: Initializes the audio device and starts playing the specified sl@0: pre-defined tone sequence. sl@0: Leaves on failure. sl@0: @since sl@0: @param TInt aSequenceNumber The index identifying the specific sl@0: pre-defined tone sequence. Index values are relative to zero. sl@0: This can be any value from zero to the value returned by a call sl@0: to FixedSequenceCount() - 1. The function raises a panic if the sl@0: sequence number is not within this range. sl@0: @return void sl@0: */ sl@0: void PlayFixedSequenceL(TInt aSequenceNumber); sl@0: sl@0: /** sl@0: Defines the number of times the audio is to be repeated during the sl@0: tone playback operation. A period of silence can follow each playing sl@0: of a tone. The tone playing can be repeated indefinitely sl@0: @since sl@0: @param TInt aRepeatCount The number of times the tone, together with sl@0: the trailing silence, is to be repeated. If this is set to sl@0: KMdaRepeatForever, then the tone, together with the trailing sl@0: silence, is repeated indefinitely or until Stop() is called. sl@0: If this is set to zero, then the tone is not repeated. sl@0: @param const TTimeIntervalMicroSeconds &aRepeatTrailingSilence An sl@0: interval of silence which will be played after each tone. sl@0: Supported only during tone playing. sl@0: @return void sl@0: */ sl@0: void SetToneRepeats( sl@0: TInt aRepeatCount, sl@0: const TTimeIntervalMicroSeconds& aRepeatTrailingSilence); sl@0: sl@0: /** sl@0: Defines the duration of tone on, tone off and tone pause to be used sl@0: during the DTMF tone playback operation. sl@0: Supported only during tone playing. sl@0: @since sl@0: @param TTimeIntervalMicroSeconds32 &aToneOnLength The period over sl@0: which the tone will be played. If this is set to zero, then the sl@0: tone is not played. sl@0: @param TTimeIntervalMicroSeconds32 &aToneOffLength The period over sl@0: which the no tone will be played. sl@0: @param TTimeIntervalMicroSeconds32 &aPauseLength The period over which sl@0: the tone playing will be paused. sl@0: @return void sl@0: */ sl@0: void SetDTMFLengths(TTimeIntervalMicroSeconds32& aToneOnLength, sl@0: TTimeIntervalMicroSeconds32& aToneOffLength, sl@0: TTimeIntervalMicroSeconds32& aPauseLength); sl@0: sl@0: /** sl@0: Defines the period over which the volume level is to rise smoothly sl@0: from nothing to the normal volume level. sl@0: The function is only available before playing. sl@0: @since sl@0: @param const TTimeIntervalMicroSeconds &aRampDuration The period over sl@0: which the volume is to rise. A zero value causes the tone sl@0: sample to be played at the normal level for the full duration sl@0: of the playback. A value, which is longer than the duration of sl@0: the tone sample means that the sample never reaches its normal sl@0: volume level. sl@0: @return void sl@0: */ sl@0: void SetVolumeRamp(const TTimeIntervalMicroSeconds& aRampDuration); sl@0: sl@0: /** sl@0: Defines the priority settings that should be used for this instance. sl@0: @since sl@0: @param const TMMFPrioritySettings &aPrioritySettings A class type sl@0: representing the client's priority, priority preference and sl@0: state sl@0: @return void sl@0: */ sl@0: void SetPrioritySettings(TMMFPrioritySettings& aPrioritySettings); sl@0: sl@0: /** sl@0: Returns a pointer reference to custom interface implementation. sl@0: Note: Implementation from MCustomInterface. sl@0: @since sl@0: @return "TAny" sl@0: Custom interface implementation. The exact type of pointer is sl@0: dependent on the custom interface implemenation. sl@0: */ sl@0: virtual TAny* CustomInterface(TUid aInterfaceId); sl@0: sl@0: /** sl@0: Returns the number of available pre-defined tone sequences. sl@0: This is the number of fixed sequence supported by DevSound by default. sl@0: @since sl@0: @return TInt The fixed sequence count. This value is implementation sl@0: dependent. sl@0: */ sl@0: TInt FixedSequenceCount(); sl@0: sl@0: /** sl@0: Returns the name assigned to a specific pre-defined tone sequence. sl@0: This is the number of the fixed sequence supported by DevSound by sl@0: default. sl@0: The function raises a panic if sequence number specified is invalid. sl@0: @since sl@0: @param TInt aSequenceNumber The index identifying the specific sl@0: pre-defined tone sequence. Index values are relative to zero. sl@0: This can be any value from zero to the value returned by a call sl@0: to CMdaAudioPlayerUtility::FixedSequenceCount() - 1. The sl@0: function raises a panic if sequence number is not within this sl@0: range. sl@0: @return const TDesC & A reference to a Descriptor containing the fixed sl@0: sequence name indexed by aSequenceNumber. sl@0: */ sl@0: const TDesC& FixedSequenceName(TInt aSequenceNumber); sl@0: sl@0: /** sl@0: Returns a list of the supported input datatypes that can be sent to sl@0: DevSound for playing audio. The datatypes returned are those that the sl@0: DevSound supports given the priority settings passed in sl@0: aPrioritySettings. Note that if no supported data types are found this sl@0: does not constitute failure, the function will return normally with no sl@0: entries in aSupportedDataTypes. sl@0: @since sl@0: @param RArray< TFourCC > &aSupportedDataTypes The array of supported sl@0: data types that will be filled in by this function. The sl@0: supported data types of the DevSound are in the form of an sl@0: array of TFourCC codes. Any existing entries in the array will sl@0: be overwritten on calling this function. If no supported data sl@0: types are found given the priority settings, then the sl@0: aSupportedDatatypes array will have zero entries. sl@0: @param const TMMFPrioritySettings &aPrioritySettings The priority sl@0: settings used to determine the supported datatypes. Note this sl@0: does not set the priority settings. For input datatypes the sl@0: iState member of the priority settings would be expected to be sl@0: either EMMFStatePlaying or EMMFStatePlayingRecording. The sl@0: priority settings may effect the supported datatypes depending sl@0: on the audio routing. sl@0: @return void sl@0: */ sl@0: void GetSupportedInputDataTypesL( sl@0: RArray& aSupportedDataTypes, sl@0: const TMMFPrioritySettings& aPrioritySettings) const; sl@0: sl@0: /** sl@0: Returns a list of the supported output dataypes that can be received sl@0: from DevSound for recording audio. The datatypes returned are those sl@0: that the DevSound supports given the priority settings passed in sl@0: aPrioritySettings. Note that if no supported data types are found this sl@0: does not constitute failure, the function will return normally with no sl@0: entries in aSupportedDataTypes. sl@0: @since sl@0: @param RArray< TFourCC > &aSupportedDataTypes The array of supported sl@0: data types that will be filled in by this function. The sl@0: supported datatypes of the DevSound are in the form of an array sl@0: of TFourCC codes. Any existing entries in the array will be sl@0: overwritten on calling this function. If no supported datatypes sl@0: are found given the priority settings, then the sl@0: aSupportedDatatypes array will have zero entries. sl@0: @param const TMMFPrioritySettings &aPrioritySettings The priority sl@0: settings used to determine the supported data types. Note this sl@0: does not set the priority settings. For output data types the sl@0: iState member of the priority settings would expected to be sl@0: either EMMFStateRecording or EMMFStatePlayingRecording. The sl@0: priority settings may effect the supported datatypes depending sl@0: on the audio routing. sl@0: @return void sl@0: */ sl@0: void GetSupportedOutputDataTypesL( sl@0: RArray& aSupportedDataTypes, sl@0: const TMMFPrioritySettings& aPrioritySettings) const; sl@0: sl@0: /** sl@0: MDevSoundAdaptationObserver callback. sl@0: This is called when DevSound initialization is complete. sl@0: @since sl@0: @param TInt aError KErrNone if successfull, else corresponding error sl@0: code sl@0: @return void sl@0: */ sl@0: void InitializeComplete(TInt aError); sl@0: sl@0: /** sl@0: MDevSoundAdaptationObserver callback. sl@0: This is called when tone play back is complete. sl@0: @since sl@0: @param TInt aError KErrNone if successfull, else corresponding error sl@0: code sl@0: @return void sl@0: */ sl@0: void ToneFinished(TInt aError); sl@0: sl@0: /** sl@0: MDevSoundAdaptationObserver callback. sl@0: This is called when more data is needed during digital audio playback. sl@0: @since sl@0: @param CMMFBuffer* aBuffer A pointer to buffer where data is needed. sl@0: @return void sl@0: */ sl@0: void BufferToBeFilled(CMMFBuffer* aBuffer); sl@0: sl@0: /** sl@0: MDevSoundAdaptationObserver callback. sl@0: This is called when there is error during playback. sl@0: @since sl@0: @param TInt aError KErrUnderflow if last buffer is played back, else sl@0: corresponding error code sl@0: @return void sl@0: */ sl@0: void PlayError(TInt aError); sl@0: sl@0: /** sl@0: MDevSoundAdaptationObserver callback. sl@0: This is called when data is available during digital audio recording. sl@0: @since sl@0: @param CMMFBuffer* aBuffer A pointer to buffer where recorded data is sl@0: available. sl@0: @return void sl@0: */ sl@0: void BufferToBeEmptied(CMMFBuffer* aBuffer); sl@0: sl@0: /** sl@0: MDevSoundAdaptationObserver callback. sl@0: This is called when there is error during recording. sl@0: @since sl@0: @param TInt aError Corresponding error code sl@0: @return void sl@0: */ sl@0: void RecordError(TInt aError); sl@0: sl@0: /** sl@0: MDevSoundAdaptationObserver callback. sl@0: This is called when there is a message from audio device. sl@0: @since sl@0: @param TUid aMessageType A Uid identifying message type. sl@0: @param const TDesC8& aMsg A reference to constant descriptor sl@0: containing packed message. sl@0: @return void sl@0: */ sl@0: void DeviceMessage(TUid aMessageType, const TDesC8& aMsg); sl@0: sl@0: sl@0: // from MMMFDevSoundCustomInterfaceDeMuxPlugin sl@0: /** sl@0: MDevSoundAdaptationObserver callback. sl@0: Underlying interface has been (or is about to be) deleted. sl@0: Implementations will generally cancel outstanding messages sl@0: sl@0: @param aInterfaceId Uid of the Interface which has been deleted sl@0: */ sl@0: sl@0: void InterfaceDeleted(TUid aInterfaceId); sl@0: sl@0: /** sl@0: MDevSoundAdaptationObserver callback. sl@0: Not used. sl@0: @since sl@0: @param const TMMFEvent& aEvent Not used sl@0: @return void sl@0: */ sl@0: void SendEventToClient(const TMMFEvent& aEvent); sl@0: sl@0: void DoProcessingFinished(); sl@0: void DoProcessingError(); sl@0: sl@0: /** sl@0: MDevSoundAdaptationObserver callback. sl@0: Underlying physical adaptation has sent a callback that will result either on a commit sl@0: and need to scheduled or in the case of RecordPauseComplete, completes the message. sl@0: @since sl@0: @param aType the callback type sl@0: @param aError KErrNone if successful, else corresponding error sl@0: code sl@0: */ sl@0: void CallbackFromAdaptorReceived(TInt aType, TInt aError); sl@0: sl@0: sl@0: /** sl@0: MDevSoundAdaptationObserver callback. sl@0: Underlying physical adaptation has sent a callback indicating that a preemption process sl@0: has started, any incomming commands will be queued during the preemption. sl@0: sl@0: @since sl@0: */ sl@0: void PreemptionStartedCallbackReceived(); sl@0: sl@0: sl@0: /** sl@0: MDevSoundAdaptationObserver callback. sl@0: Underlying physical adaptation has sent a callback indicating that a preemption process sl@0: has finished. Queued commands during preemption can now be processed. sl@0: @since sl@0: @param aCanStartNewOperation If EFalse indicates that the operation has more than a cycle sl@0: */ sl@0: void PreemptionFinishedCallbackReceived(TBool aCanStartNewOperation); sl@0: sl@0: // from MDevSoundAdaptationObserver sl@0: TBool AdaptorControlsContext() const; sl@0: void PreemptionClash(); sl@0: void PreemptionClashWithStateChange(); sl@0: void NotifyError(TInt aError); sl@0: sl@0: /** sl@0: MDevSoundAdaptationObserver callback. sl@0: Indicates that a low layer operation completion sl@0: @since sl@0: @param aError The status of operation in progress sl@0: @param aCanStartNewOperation If EFalse indicates that the operation has more than a cycle sl@0: */ sl@0: void AsynchronousOperationComplete(TInt aError, TBool aCanStartNewOperation); sl@0: sl@0: sl@0: // from MMMFDevSoundCustomInterfaceDeMuxInterface sl@0: TInt DoOpenSlaveL(TUid aInterface, const TDesC8& aPackageBuf); sl@0: void DoCloseSlaveL(TInt aHandle); sl@0: TInt DoSendSlaveSyncCommandL(const RMmfIpcMessage& aMessage); sl@0: TInt DoSendSlaveSyncCommandResultL(const RMmfIpcMessage& aMessage); sl@0: void DoSendSlaveAsyncCommandL(const RMmfIpcMessage& aMessage); sl@0: void DoSendSlaveAsyncCommandResultL(const RMmfIpcMessage& aMessage); sl@0: sl@0: sl@0: private: // Functions sl@0: sl@0: /** sl@0: Returns a object reference to CMMFObjectContainer. sl@0: @since sl@0: @return CMMFObjectContainer& A reference to CMMFObjectContainer sl@0: implemenation. sl@0: */ sl@0: CMMFObjectContainer& MMFObjectContainerL(); sl@0: sl@0: /** sl@0: Returns a object reference to CMMFObjectContainer. sl@0: @since sl@0: @return CMMFCustomCommandParserBase& aParser A reference to sl@0: Custom command parser implemenation. sl@0: @return void sl@0: */ sl@0: void AddCustomCommandParserL(CMMFCustomCommandParserBase& aParser); sl@0: sl@0: /** sl@0: Method to set client configuration information to DevSound Adaptation. sl@0: Leaves on failure. sl@0: @since sl@0: @return void sl@0: */ sl@0: void DoSetClientConfigL(); sl@0: sl@0: /** sl@0: Equivalent of DoSetClientConfigL() that returns error sl@0: @return system-wide error sl@0: */ sl@0: TInt DoSetClientConfig(); sl@0: sl@0: /** sl@0: Method to create global chunk sl@0: @since sl@0: @param TMMFDevSoundProxyHwBufPckg& - buffer information container sl@0: @param CMMFDataBuffer* - data buffer pointer sl@0: @return void sl@0: */ sl@0: TInt CreateChunk(TMMFDevSoundProxyHwBufPckg& aBufPckg, TInt aRequestedSize); sl@0: sl@0: sl@0: // New internal methods sl@0: /* sl@0: Services the first request at the FIFO sl@0: */ sl@0: void DoServiceRequestL(const RMmfIpcMessage& aMessage); sl@0: sl@0: /* sl@0: Services the first request of queue for a pseudo asynchronous function that has already completed, sl@0: but needs to be re-applied again due to pre-emption clash. sl@0: */ sl@0: void DoServiceAlreadyCompletedRequestL(const TInt aFunction); sl@0: sl@0: /* sl@0: Handles the first request of queue for a pseudo asynchronous function that has already completed, sl@0: but needs to be re-applied again due to pre-emption clash. sl@0: */ sl@0: void HandleAlreadyCompletedRequest(); sl@0: sl@0: /* sl@0: Services the first request at the FIFO sl@0: */ sl@0: void DoServiceNextRequestL(); sl@0: sl@0: /* sl@0: Completes the message sl@0: @param aReason the error to complete message sl@0: @param aOperationComplete if is true also this message will be removed from the queue sl@0: if is false just the message will be completed but will be keeped at the queue sl@0: */ sl@0: void CompleteRequest(TInt aReason); sl@0: sl@0: /* sl@0: Adds a message to the FIFO sl@0: */ sl@0: void EnqueueRequest(const RMmfIpcMessage& aMessage); sl@0: sl@0: /* sl@0: Removes the message from the FIFO sl@0: */ sl@0: void DequeueRequest(); sl@0: sl@0: sl@0: sl@0: /* sl@0: Flush event queue - called as part of Stop() sequence sl@0: */ sl@0: void FlushEventQueue(); sl@0: sl@0: /* sl@0: Filter certain events from message queue sl@0: */ sl@0: void FilterQueueEvent(TMMFDevSoundProxyRequest aRequest); sl@0: sl@0: /* sl@0: Called by a server when it receives a disconnect message for the session. sl@0: Overrided in order to perform asynchronous cleanup actions sl@0: these actions must end with a call to the base class implementation of this method sl@0: which will delete the session object and complete the disconnect message sl@0: */ sl@0: void Disconnect(const RMessage2& aMessage); sl@0: sl@0: //panic function sl@0: void Panic(TMMFDevSoundSessionPanicCodes aCode); sl@0: sl@0: /* sl@0: Used to send a stop call when error in buffer sl@0: */ sl@0: void BufferErrorEvent(); sl@0: sl@0: /* sl@0: Removes all entries from iQueuedRequests except for sl@0: disconnect requests. sl@0: */ sl@0: void FlushQueuedRequests(); sl@0: sl@0: /* sl@0: Helper functions, used to guard against accessing the equivalent sl@0: functions on bad message handles during a disconnection. These sl@0: methods should be used whenever a Read or Write is made outside the sl@0: context of DoServiceRequestL(). sl@0: */ sl@0: TInt MessageRead(const RMmfIpcMessage& aMessage, TInt aParam, TDes8& aResult); sl@0: TInt MessageRead(const RMmfIpcMessage& aMessage, TInt aParam, TDes16& aResult); sl@0: TInt MessageWrite(const RMmfIpcMessage& aMessage, TInt aParam, const TDesC8& aValue); sl@0: sl@0: protected: sl@0: sl@0: /** sl@0: C++ default constructor. sl@0: */ sl@0: CMMFDevSoundSession(); sl@0: /** sl@0: By default Symbian 2nd phase constructor is private. sl@0: */ sl@0: void ConstructL(MGlobalProperties& aGlobalProperties); sl@0: sl@0: private: sl@0: TBool DoCustomCommandL(const RMmfIpcMessage& aMessage); sl@0: MMMFDevSoundCustomInterfaceDeMuxPlugin* InterfaceFromUid(TUid aUid); sl@0: sl@0: static TInt AsyncQueueStartCallback(TAny* aPtr); sl@0: void AsyncQueueStartCallback(); sl@0: sl@0: void ResetNotifiedError(); sl@0: TInt NotifiedError() const; sl@0: sl@0: TBool NeedToQueue() const; sl@0: sl@0: protected: // Data sl@0: CMMFDevSoundAdaptation* iAdapter; sl@0: sl@0: private: // Data sl@0: // A number representing the session id sl@0: TInt iDevSoundSessionId; sl@0: // Reference to play buffer sl@0: CMMFDataBuffer* iBufferPlay; sl@0: // Reference to record buffer sl@0: CMMFDataBuffer* iBufferRecord; sl@0: // Array to hold supported input/output data types sl@0: RArray iArray; sl@0: // Buffer to hold DTMFString to be played sl@0: HBufC* iDtmfString; sl@0: // Buffer to hold tone sequence to be played sl@0: HBufC8* iToneSeqBuf; sl@0: sl@0: sl@0: // Replaces the messages / AO handlers sl@0: RMsgQueue iMsgQueue; sl@0: // data store for 2-stage asynch message passing sl@0: TMMFDevSoundProxyHwBufPckg iHwBufPckgFill; sl@0: // data store for 2-stage asynch message passing sl@0: TMMFDevSoundProxyHwBufPckg iHwBufPckgEmpty; sl@0: sl@0: // Array of custom interface pairs sl@0: RArray iCustomInterfaceArray; sl@0: sl@0: //Capabilities from DevSoundAdaptor sl@0: TMMFCapabilities iDevSoundCapabilities; sl@0: // sl@0: CMMFDevSoundCIDeMuxUtility* iDeMuxUtility; sl@0: // CI Extension sl@0: MDevSoundCIServerExtension* iCIExtension; sl@0: sl@0: // Handling async requests sl@0: RArray iQueuedRequests; sl@0: TMMFDevSoundRequest iRequestBeingServiced; sl@0: TBool iOperationCompletePending; sl@0: TBool iHandlingExtdCI; sl@0: TBool iPlayErrorOccured; sl@0: sl@0: //Check if the call of SetClientConfigL was alredy made sl@0: TBool iSetClientConfigApplied; sl@0: sl@0: // Chunk for use between DevSound client and server sl@0: RChunk iChunk; sl@0: TBool iForceSendOfChunkHandle; sl@0: sl@0: CActiveSchedulerWait* iClosingWait; sl@0: CAsyncCallBack* iAsyncQueueStart; sl@0: sl@0: TInt iRedoFunction; sl@0: TMMFDevSoundProxySettingsPckg iCachedClientData; sl@0: TInt iSeqNum; sl@0: TBool iPreemptionClash; sl@0: TInt iNotifiedError; sl@0: TBool iDisconnecting; sl@0: sl@0: }; sl@0: sl@0: #endif // MMFDEVSOUNDSESSION_H sl@0: sl@0: // End of File