sl@0: // Copyright (c) 2005-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 CMMFDEVSOUNDCIBITRATE_H sl@0: #define CMMFDEVSOUNDCIBITRATE_H sl@0: 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 sl@0: sl@0: /** sl@0: @internalComponent sl@0: @prototype sl@0: @file sl@0: */ sl@0: sl@0: enum TMMFDevSoundCIBitRateCommands sl@0: { sl@0: EMMFDevSoundCIBitRateBitRate = 0, sl@0: EMMFDevSoundCIBitRateSetBitRate, sl@0: EMMFDevSoundCIBitRateGetSupportedBitRates, sl@0: EMMFDevSoundCIBitRateGetSupportedBitRatesArray sl@0: }; sl@0: sl@0: /** sl@0: * CMMFDevSoundCIBitRate sl@0: * sl@0: * implementation of the BitRate custom interface pair sl@0: */ sl@0: class CMMFDevSoundCIBitRateMux : public CBase, sl@0: public MMMFDevSoundCustomInterfaceMuxPlugin, sl@0: public MMMFDevSoundCustomInterfaceBitRate sl@0: { sl@0: public: sl@0: /** sl@0: Attempt to open the interface. sl@0: @param aInterfaceId sl@0: The UID of the interface to open. sl@0: @return one of the system wide error codes sl@0: */ sl@0: virtual TInt OpenInterface(TUid aInterfaceId); sl@0: sl@0: /** sl@0: Equivalent to destructor. Called to destroy plugin. sl@0: */ sl@0: virtual void Release(); sl@0: /** sl@0: Pass destructor key. sl@0: Called on construction so plugin takes responsibility to call REComSession::DestroyedImplementation() sl@0: @param aDestructorKey sl@0: The Uid returned by REComSession::CreateImplementationL() or similar sl@0: */ sl@0: virtual void PassDestructorKey(TUid aDestructorKey); sl@0: sl@0: /** sl@0: Complete construction. sl@0: Pass additional values from the construction phase, used subsequently by the plugin. sl@0: @param aCustomUtility sl@0: The custom interface utility used by the plugin to communicate with the remote sl@0: server side DeMux plugin sl@0: */ sl@0: virtual void CompleteConstructL(MMMFDevSoundCustomInterfaceMuxUtility* aCustomUtility); sl@0: sl@0: /** sl@0: Return the custom interface sl@0: @param aInterfaceId sl@0: The UID of the required custom interface sl@0: @return the custom interface supported by this plugin sl@0: */ sl@0: virtual TAny* CustomInterface(TUid aInterfaceId); sl@0: sl@0: /** sl@0: Instantiate a CMMFDevSoundCIBitRateMux class sl@0: @return the pointer to the new class, cast to the Mux plugin mixin sl@0: */ sl@0: static MMMFDevSoundCustomInterfaceMuxPlugin* NewL(); sl@0: sl@0: protected: sl@0: // from MMMFDevSoundCustomInterfaceBitRate sl@0: virtual void GetSupportedBitRatesL(RArray& aSupportedBitRates); sl@0: virtual TInt BitRateL(); sl@0: virtual void SetBitRateL(TInt aBitRate); sl@0: sl@0: CMMFDevSoundCIBitRateMux(); sl@0: ~CMMFDevSoundCIBitRateMux(); sl@0: sl@0: protected: sl@0: TUid iKey; sl@0: TInt iRemoteHandle; sl@0: MMMFDevSoundCustomInterfaceMuxUtility* iUtility; sl@0: }; sl@0: sl@0: sl@0: /** sl@0: * DeMux side of pair sl@0: */ sl@0: sl@0: class CMMFDevSoundCIBitRateDeMux : public CBase, sl@0: public MMMFDevSoundCustomInterfaceDeMuxPlugin sl@0: { sl@0: public: sl@0: /** sl@0: Instantiate a CMMFDevSoundCIBitRateDeMux class sl@0: @return a pointer to the new class cast to the DeMux plugin mixin sl@0: */ sl@0: static MMMFDevSoundCustomInterfaceDeMuxPlugin* NewL(); sl@0: sl@0: /** sl@0: Attempt to open the interface. sl@0: @param aInterfaceId sl@0: The UID of the interface to open. sl@0: @return a handle to the remote plugin sl@0: */ sl@0: virtual TInt OpenInterface(TUid aInterfaceId); sl@0: sl@0: /** sl@0: Equivalent to destructor. Called to destroy plugin. sl@0: */ sl@0: virtual void Release(); sl@0: /** sl@0: Pass destructor key. sl@0: Called on construction so plugin takes responsibility to call REComSession::DestroyedImplementation() sl@0: @param aDestructorKey sl@0: The Uid returned by REComSession::CreateImplementationL() or similar sl@0: */ sl@0: virtual void PassDestructorKey(TUid aDestructorKey); sl@0: sl@0: /** sl@0: Set the target of the custom interface call sl@0: @param aTarget sl@0: The DevSound to call the custom interface on. sl@0: */ sl@0: virtual void SetInterfaceTarget(MMMFDevSoundCustomInterfaceTarget* aTarget); sl@0: sl@0: /** sl@0: Complete construction. sl@0: @param aUtility sl@0: The DeMux utility to use sl@0: */ sl@0: virtual void CompleteConstructL(MMMFDevSoundCustomInterfaceDeMuxUtility* aUtility); sl@0: sl@0: /** sl@0: Refresh the current custom interface connections sl@0: */ sl@0: virtual void RefreshL(); sl@0: sl@0: // from MMMFDeMuxInterface sl@0: /** sl@0: Open the slave sl@0: @param aInterface sl@0: The UID of the requested interface sl@0: @param aPackageBuf sl@0: A package of data that can be supplied for initialisation sl@0: @return the result of the operation sl@0: */ sl@0: virtual TInt DoOpenSlaveL(TUid aInterface, const TDesC8& aPackageBuf); sl@0: sl@0: /** sl@0: Close the slave sl@0: @param aHandle sl@0: The handle of the slave plugin sl@0: */ sl@0: virtual void DoCloseSlaveL(TInt aHandle); sl@0: sl@0: // original RMessage is supplied so that remote demux plugin can extract necessary details sl@0: // using DeMux utility sl@0: sl@0: /** sl@0: Relay the synchronous custom command onto the slave sl@0: @param aMessage sl@0: The IPC message to be sent to the slave sl@0: @return the result of the operation sl@0: */ sl@0: virtual TInt DoSendSlaveSyncCommandL(const RMmfIpcMessage& aMessage); sl@0: sl@0: /** sl@0: Relay the synchronous custom command onto the slave and obtain a result sl@0: @param aMessage sl@0: The IPC message to be sent to the slave sl@0: @return the result of the operation sl@0: */ sl@0: virtual TInt DoSendSlaveSyncCommandResultL(const RMmfIpcMessage& aMessage); sl@0: sl@0: /** sl@0: Relay an asynchronous command onto the slave sl@0: @param aMessage sl@0: The IPC message to be sent to the slave sl@0: */ sl@0: virtual void DoSendSlaveAsyncCommandL(const RMmfIpcMessage& aMessage); sl@0: sl@0: /** sl@0: Relay an asynchronous command onto the slave and obtain a result sl@0: @param aMessage sl@0: The IPC message to be sent to the slave@param aMessage sl@0: */ sl@0: virtual void DoSendSlaveAsyncCommandResultL(const RMmfIpcMessage& aMessage); sl@0: sl@0: protected: sl@0: ~CMMFDevSoundCIBitRateDeMux(); sl@0: CMMFDevSoundCIBitRateDeMux(); sl@0: sl@0: // implementation of bitrate custom interface sl@0: void DoGetSupportedBitRatesL(RArray& aSupportedBitRates); sl@0: void DoCopyBitRateBufferToClientL(const RMmfIpcMessage& aMessage); sl@0: TInt DoBitRateL(); sl@0: void DoSetBitRateL(TInt aBitRate); sl@0: sl@0: protected: sl@0: MMMFDevSoundCustomInterfaceDeMuxUtility* iUtility; sl@0: MMMFDevSoundCustomInterfaceTarget* iTarget; sl@0: MMMFDevSoundCustomInterfaceBitRate* iBitRateInterface; sl@0: TUid iKey; sl@0: sl@0: // array for bitrates sl@0: RArray iBitRateArray; sl@0: }; sl@0: sl@0: #endif