os/mm/devsound/devsoundpluginsupport/src/CustomInterfaces/cmmfdevsoundcibitrate.h
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/mm/devsound/devsoundpluginsupport/src/CustomInterfaces/cmmfdevsoundcibitrate.h	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,235 @@
     1.4 +// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
     1.5 +// All rights reserved.
     1.6 +// This component and the accompanying materials are made available
     1.7 +// under the terms of "Eclipse Public License v1.0"
     1.8 +// which accompanies this distribution, and is available
     1.9 +// at the URL "http://www.eclipse.org/legal/epl-v10.html".
    1.10 +//
    1.11 +// Initial Contributors:
    1.12 +// Nokia Corporation - initial contribution.
    1.13 +//
    1.14 +// Contributors:
    1.15 +//
    1.16 +// Description:
    1.17 +//
    1.18 +
    1.19 +#ifndef CMMFDEVSOUNDCIBITRATE_H
    1.20 +#define CMMFDEVSOUNDCIBITRATE_H
    1.21 +
    1.22 +#include <e32base.h>
    1.23 +#include <mmf/common/mmfipc.h>
    1.24 +#ifdef SYMBIAN_ENABLE_SPLIT_HEADERS
    1.25 +#include <mmf/common/mmfipcserver.h>
    1.26 +#endif
    1.27 +#include <mmf/server/mmfdevsoundcustominterface.h>
    1.28 +#include <mmf/server/mmfdevsoundcustomcommands.h>
    1.29 +#include <mmf/server/devsoundstandardcustominterfaces.h>
    1.30 +
    1.31 +/**
    1.32 + @internalComponent
    1.33 + @prototype
    1.34 + @file
    1.35 + */
    1.36 +
    1.37 +enum TMMFDevSoundCIBitRateCommands
    1.38 +	{
    1.39 +	EMMFDevSoundCIBitRateBitRate = 0,
    1.40 +	EMMFDevSoundCIBitRateSetBitRate,
    1.41 +	EMMFDevSoundCIBitRateGetSupportedBitRates,
    1.42 +	EMMFDevSoundCIBitRateGetSupportedBitRatesArray
    1.43 +	};
    1.44 +
    1.45 +/**
    1.46 + * CMMFDevSoundCIBitRate
    1.47 + *
    1.48 + * implementation of the BitRate custom interface pair
    1.49 + */
    1.50 +class CMMFDevSoundCIBitRateMux : public CBase,
    1.51 +			      	 			 public MMMFDevSoundCustomInterfaceMuxPlugin,
    1.52 +			      	 			 public MMMFDevSoundCustomInterfaceBitRate
    1.53 +	{
    1.54 +public:
    1.55 +	/**
    1.56 +	Attempt to open the interface.
    1.57 +	@param aInterfaceId
    1.58 +		   The UID of the interface to open.
    1.59 +	@return one of the system wide error codes
    1.60 +	*/
    1.61 +	virtual TInt OpenInterface(TUid aInterfaceId);
    1.62 +
    1.63 +	/**
    1.64 +	Equivalent to destructor.  Called to destroy plugin.
    1.65 +	*/
    1.66 +	virtual void Release();
    1.67 +	/**
    1.68 +	Pass destructor key.
    1.69 +	Called on construction so plugin takes responsibility to call REComSession::DestroyedImplementation()
    1.70 +	@param aDestructorKey
    1.71 +	       The Uid returned by REComSession::CreateImplementationL() or similar
    1.72 +	*/
    1.73 +	virtual void PassDestructorKey(TUid aDestructorKey);
    1.74 +	
    1.75 +	/**
    1.76 +	Complete construction.
    1.77 +	Pass additional values from the construction phase, used subsequently by the plugin.
    1.78 +	@param aCustomUtility
    1.79 +	       The custom interface utility used by the plugin to communicate with the remote
    1.80 +		   server side DeMux plugin
    1.81 +	*/
    1.82 +	virtual void CompleteConstructL(MMMFDevSoundCustomInterfaceMuxUtility* aCustomUtility);
    1.83 +
    1.84 +	/** 
    1.85 +	Return the custom interface
    1.86 +	@param aInterfaceId
    1.87 +		   The UID of the required custom interface
    1.88 +	@return the custom interface supported by this plugin
    1.89 +	*/
    1.90 +	virtual TAny* CustomInterface(TUid aInterfaceId);
    1.91 +
    1.92 +	/**
    1.93 +	Instantiate a CMMFDevSoundCIBitRateMux class
    1.94 +	@return the pointer to the new class, cast to the Mux plugin mixin
    1.95 +	*/
    1.96 +	static MMMFDevSoundCustomInterfaceMuxPlugin* NewL();
    1.97 +
    1.98 +protected:
    1.99 +	// from MMMFDevSoundCustomInterfaceBitRate
   1.100 +	virtual void GetSupportedBitRatesL(RArray<TInt>& aSupportedBitRates);
   1.101 +	virtual TInt BitRateL();
   1.102 +	virtual void SetBitRateL(TInt aBitRate);
   1.103 +
   1.104 +	CMMFDevSoundCIBitRateMux();
   1.105 +	~CMMFDevSoundCIBitRateMux();
   1.106 +
   1.107 +protected:
   1.108 +	TUid iKey;
   1.109 +	TInt iRemoteHandle;
   1.110 +	MMMFDevSoundCustomInterfaceMuxUtility* iUtility;
   1.111 +	};
   1.112 +
   1.113 +
   1.114 +/**
   1.115 + * DeMux side of pair
   1.116 + */
   1.117 +
   1.118 +class CMMFDevSoundCIBitRateDeMux : public CBase,
   1.119 +			      	   			   public MMMFDevSoundCustomInterfaceDeMuxPlugin
   1.120 +	{
   1.121 +public:
   1.122 +	/**
   1.123 +	Instantiate a CMMFDevSoundCIBitRateDeMux class
   1.124 +	@return a pointer to the new class cast to the DeMux plugin mixin
   1.125 +	*/
   1.126 +	static MMMFDevSoundCustomInterfaceDeMuxPlugin* NewL();
   1.127 +		
   1.128 +	/**
   1.129 +	Attempt to open the interface.
   1.130 +	@param aInterfaceId
   1.131 +		   The UID of the interface to open.
   1.132 +	@return a handle to the remote plugin
   1.133 +	*/
   1.134 +	virtual TInt OpenInterface(TUid aInterfaceId);
   1.135 +
   1.136 +	/**
   1.137 +	Equivalent to destructor.  Called to destroy plugin.
   1.138 +	*/
   1.139 +	virtual void Release();
   1.140 +	/**
   1.141 +	Pass destructor key.
   1.142 +	Called on construction so plugin takes responsibility to call REComSession::DestroyedImplementation()
   1.143 +	@param aDestructorKey
   1.144 +	       The Uid returned by REComSession::CreateImplementationL() or similar
   1.145 +	*/
   1.146 +	virtual void PassDestructorKey(TUid aDestructorKey);
   1.147 +	
   1.148 +	/**
   1.149 +	Set the target of the custom interface call
   1.150 +	@param aTarget
   1.151 +	       The DevSound to call the custom interface on.
   1.152 +	*/
   1.153 +	virtual void SetInterfaceTarget(MMMFDevSoundCustomInterfaceTarget* aTarget);
   1.154 +	
   1.155 +	/**
   1.156 +	Complete construction.
   1.157 +	@param aUtility
   1.158 +	       The DeMux utility to use
   1.159 +	*/
   1.160 +	virtual void CompleteConstructL(MMMFDevSoundCustomInterfaceDeMuxUtility* aUtility);
   1.161 +
   1.162 +	/**
   1.163 +	Refresh the current custom interface connections
   1.164 +	*/
   1.165 +	virtual void RefreshL();
   1.166 +
   1.167 +	// from MMMFDeMuxInterface
   1.168 +	/**
   1.169 +	Open the slave
   1.170 +	@param aInterface
   1.171 +		   The UID of the requested interface
   1.172 +	@param aPackageBuf
   1.173 +		   A package of data that can be supplied for initialisation
   1.174 +	@return the result of the operation
   1.175 +	 */
   1.176 +	virtual TInt DoOpenSlaveL(TUid aInterface, const TDesC8& aPackageBuf);
   1.177 +
   1.178 +	/** 
   1.179 +	Close the slave
   1.180 +	@param aHandle
   1.181 +		   The handle of the slave plugin
   1.182 +	 */
   1.183 +	virtual void DoCloseSlaveL(TInt aHandle);
   1.184 +
   1.185 +	// original RMessage is supplied so that remote demux plugin can extract necessary details
   1.186 +	// using DeMux utility
   1.187 +
   1.188 +	/**
   1.189 +	Relay the synchronous custom command onto the slave
   1.190 +	@param aMessage
   1.191 +		   The IPC message to be sent to the slave
   1.192 +	@return the result of the operation
   1.193 +	 */
   1.194 +	virtual TInt DoSendSlaveSyncCommandL(const RMmfIpcMessage& aMessage);
   1.195 +
   1.196 +	/**
   1.197 +	Relay the synchronous custom command onto the slave and obtain a result
   1.198 +	@param aMessage
   1.199 +		   The IPC message to be sent to the slave
   1.200 +	@return the result of the operation
   1.201 +	 */
   1.202 +	virtual TInt DoSendSlaveSyncCommandResultL(const RMmfIpcMessage& aMessage);
   1.203 +
   1.204 +	/**
   1.205 +	Relay an asynchronous command onto the slave
   1.206 +	@param aMessage
   1.207 +		   The IPC message to be sent to the slave
   1.208 +	 */
   1.209 +	virtual void DoSendSlaveAsyncCommandL(const RMmfIpcMessage& aMessage);
   1.210 +
   1.211 +	/**
   1.212 +	Relay an asynchronous command onto the slave and obtain a result
   1.213 +	@param aMessage
   1.214 +		   The IPC message to be sent to the slave@param aMessage
   1.215 +	 */
   1.216 +	virtual void DoSendSlaveAsyncCommandResultL(const RMmfIpcMessage& aMessage);
   1.217 +
   1.218 +protected:
   1.219 +	~CMMFDevSoundCIBitRateDeMux();
   1.220 +	CMMFDevSoundCIBitRateDeMux();
   1.221 +
   1.222 +	// implementation of bitrate custom interface
   1.223 +	void DoGetSupportedBitRatesL(RArray<TInt>& aSupportedBitRates);
   1.224 +	void DoCopyBitRateBufferToClientL(const RMmfIpcMessage& aMessage);
   1.225 +	TInt DoBitRateL();
   1.226 +	void DoSetBitRateL(TInt aBitRate);
   1.227 +	
   1.228 +protected:
   1.229 +	MMMFDevSoundCustomInterfaceDeMuxUtility* iUtility;
   1.230 +	MMMFDevSoundCustomInterfaceTarget* iTarget;
   1.231 +	MMMFDevSoundCustomInterfaceBitRate* iBitRateInterface;
   1.232 +	TUid iKey;
   1.233 +	
   1.234 +	// array for bitrates
   1.235 +	RArray<TInt> iBitRateArray;
   1.236 +	};
   1.237 +
   1.238 +#endif