devsound/devsoundpluginsupport/src/CustomInterfaces/ilbcdecoderconfigci.h
changeset 0 79dd3e2336a0
equal deleted inserted replaced
-1:000000000000 0:79dd3e2336a0
       
     1 // Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 // Implementation of Ilbc decoder config custom interface pair
       
    15 // 
       
    16 //
       
    17 
       
    18 #ifndef ILBCDECODERCONFIGCI_H
       
    19 #define ILBCDECODERCONFIGCI_H
       
    20 
       
    21 #include <e32base.h>
       
    22 #include <mmf/common/mmfipc.h>
       
    23 #ifdef SYMBIAN_ENABLE_SPLIT_HEADERS
       
    24 #include <mmf/common/mmfipcserver.h>
       
    25 #endif
       
    26 #include <mmf/server/mmfdevsoundcustominterface.h>
       
    27 #include <mmf/server/mmfdevsoundcustomcommands.h>
       
    28 #include <mmf/server/devsoundstandardcustominterfaces.h>
       
    29 #include <mmf/plugin/mmfdevsoundcustominterface.hrh>
       
    30 
       
    31 /**
       
    32 Enum to represent the method called by this custom interface
       
    33 @internalComponent
       
    34 @prototype
       
    35 @file
       
    36 */
       
    37 enum TMMFDevSoundCIIlbcDecoderIntfcCommands
       
    38 	{
       
    39 	EMMFDevSoundCIIlbcDecoderIntfcSetDecoderMode,
       
    40 	EMMFDevSoundCIIlbcDecoderIntfcSetComfortNoiseGeneration,
       
    41 	EMMFDevSoundCIIlbcDecoderIntfcGetComfortNoiseGeneration
       
    42 	};
       
    43 
       
    44 
       
    45 /**
       
    46 Implementation of the Ilbc decoder config custom interface Mux
       
    47 @internalComponent
       
    48 @prototype
       
    49 @file
       
    50 */
       
    51 class CMMFIlbcDecoderIntfcMux : public CBase,
       
    52 								public MMMFDevSoundCustomInterfaceMuxPlugin,
       
    53 								public MIlbcDecoderIntfc
       
    54 	{
       
    55 public:
       
    56 
       
    57 	// from MMMFDevSoundCustomInterfaceMuxPlugin
       
    58 	/**
       
    59 	Attempt to open the interface.
       
    60 	@param  aInterfaceId
       
    61 		    The UID of the interface to open.
       
    62 	@return one of the system wide error codes
       
    63 	*/
       
    64 	virtual TInt OpenInterface(TUid aInterfaceId);
       
    65 
       
    66 	/**
       
    67 	Equivalent to destructor.  Called to destroy plugin.
       
    68 	*/
       
    69 	virtual void Release();
       
    70 
       
    71 	/**
       
    72 	Pass destructor key.
       
    73 	Called on construction so plugin takes responsibility to call REComSession::DestroyedImplementation()
       
    74 	@param aDestructorKey
       
    75 	       The Uid returned by REComSession::CreateImplementationL() or similar
       
    76 	*/
       
    77 	virtual void PassDestructorKey(TUid aDestructorKey);
       
    78 
       
    79 	/**
       
    80 	Complete construction.
       
    81 	Pass additional values from the construction phase, used subsequently by the plugin.
       
    82 	@param aCustomUtility
       
    83 	       The custom interface utility used by the plugin to communicate with the remote
       
    84 		   server side DeMux plugin
       
    85 	*/
       
    86 	virtual void CompleteConstructL(MMMFDevSoundCustomInterfaceMuxUtility* aCustomUtility);
       
    87 
       
    88 	/** 
       
    89 	Return the custom interface
       
    90 	@param aInterfaceId
       
    91 		   The UID of the required custom interface
       
    92 	@return the custom interface supported by this plugin
       
    93 	*/
       
    94 	virtual TAny* CustomInterface(TUid aInterfaceId);
       
    95 
       
    96 	/**
       
    97 	Instantiate a CI Mux class
       
    98 	@return the pointer to the new class, cast to the Mux plugin mixin
       
    99 	*/
       
   100 	static MMMFDevSoundCustomInterfaceMuxPlugin* NewL();
       
   101 
       
   102 	// from MIlbcDecoderIntfc
       
   103 	//@see MIlbcDecoderIntfc
       
   104 	virtual TInt SetDecoderMode(TDecodeMode aDecodeMode);
       
   105 	//@see MIlbcDecoderIntfc
       
   106 	virtual TInt SetComfortNoiseGeneration(TBool aCng);
       
   107 	//@see MIlbcDecoderIntfc
       
   108 	virtual TInt GetComfortNoiseGeneration(TBool& aCng);
       
   109 
       
   110 protected:
       
   111 	CMMFIlbcDecoderIntfcMux();
       
   112 	~CMMFIlbcDecoderIntfcMux();
       
   113 
       
   114 protected:
       
   115 	TUid iKey;
       
   116 	TInt iRemoteHandle;
       
   117 	MMMFDevSoundCustomInterfaceMuxUtility* iUtility;
       
   118 	};
       
   119 
       
   120 
       
   121 /**
       
   122 Implementation of the Ilbc Decoder config custom interface DeMux
       
   123 @internalComponent
       
   124 @prototype
       
   125 @file
       
   126 */
       
   127 class CMMFIlbcDecoderIntfcDeMux : public CBase,
       
   128 								  public MMMFDevSoundCustomInterfaceDeMuxPlugin
       
   129 	{
       
   130 public:
       
   131 	/**
       
   132 	Instantiate a CMMFIlbcDecoderIntfcDeMux class
       
   133 	@return A pointer to the new class cast to the DeMux plugin mixin
       
   134 	@leave  This method may leave with one of the system-wide error codes.
       
   135 	*/
       
   136 	static MMMFDevSoundCustomInterfaceDeMuxPlugin* NewL();
       
   137 
       
   138 	/**
       
   139 	Attempt to open the interface.
       
   140 	@param  aInterfaceId
       
   141 		    The UID of the interface to open.
       
   142 	@return A handle to the remote plugin
       
   143 	*/
       
   144 	virtual TInt OpenInterface(TUid aInterfaceId);
       
   145 
       
   146 	/**
       
   147 	Equivalent to destructor.  Called to destroy plugin.
       
   148 	*/
       
   149 	virtual void Release();
       
   150 
       
   151 	/**
       
   152 	Pass destructor key.
       
   153 	Called on construction so plugin takes responsibility to call REComSession::DestroyedImplementation()
       
   154 	@param aDestructorKey
       
   155 		   The Uid returned by REComSession::CreateImplementationL() or similar
       
   156 	*/
       
   157 	virtual void PassDestructorKey(TUid aDestructorKey);
       
   158 
       
   159 	/**
       
   160 	Set the target of the custom interface call
       
   161 	@param aTarget
       
   162 		   The DevSound to call the custom interface on.
       
   163 	*/
       
   164 	virtual void SetInterfaceTarget(MMMFDevSoundCustomInterfaceTarget* aTarget);
       
   165 
       
   166 	/**
       
   167 	Complete construction.
       
   168 	@param aUtility
       
   169 		   The DeMux utility to use
       
   170 	@leave This method may leave with one of the system-wide error codes.
       
   171 	*/
       
   172 	virtual void CompleteConstructL(MMMFDevSoundCustomInterfaceDeMuxUtility* aUtility);
       
   173 
       
   174 	/**
       
   175 	Refresh the current custom interface connections
       
   176 	@leave This method may leave with one of the system-wide error codes.
       
   177 	*/
       
   178 	virtual void RefreshL();
       
   179 
       
   180 	// from MMMFDevSoundCustomInterfaceDeMuxPlugin
       
   181 	/**
       
   182 	Open the slave
       
   183 	@param  aInterface
       
   184 		    The UID of the requested interface
       
   185 	@param  aPackageBuf
       
   186 		    A package of data that can be supplied for initialisation
       
   187 	@return The result of the operation
       
   188 	@leave  This method may leave with one of the system-wide error codes.
       
   189 	*/
       
   190 	virtual TInt DoOpenSlaveL(TUid aInterface, const TDesC8& aPackageBuf);
       
   191 
       
   192 	/**
       
   193 	Close the slave
       
   194 	@param aHandle
       
   195 		   The handle of the slave plugin
       
   196 	@leave This method may leave with one of the system-wide error codes.
       
   197 	*/
       
   198 	virtual void DoCloseSlaveL(TInt aHandle);
       
   199 
       
   200 	/**
       
   201 	Relay the synchronous custom command onto the slave
       
   202 	@param  aMessage
       
   203 		    The IPC message to be sent to the slave
       
   204 	@return the result of the operation
       
   205 	@leave  This method may leave with one of the system-wide error codes.
       
   206 	*/
       
   207 	virtual TInt DoSendSlaveSyncCommandL(const RMmfIpcMessage& aMessage);
       
   208 
       
   209 	/**
       
   210 	Relay the synchronous custom command onto the slave and obtain a result
       
   211 	@param  aMessage
       
   212 		    The IPC message to be sent to the slave
       
   213 	@return the result of the operation
       
   214 	@leave  This method may leave with one of the system-wide error codes.
       
   215 	*/
       
   216 	virtual TInt DoSendSlaveSyncCommandResultL(const RMmfIpcMessage& aMessage);
       
   217 
       
   218 	/**
       
   219 	Relay an asynchronous command onto the slave
       
   220 	@param aMessage
       
   221 		   The IPC message to be sent to the slave
       
   222 	@leave This method may leave with one of the system-wide error codes.
       
   223 	*/
       
   224 	virtual void DoSendSlaveAsyncCommandL(const RMmfIpcMessage& aMessage);
       
   225 
       
   226 	/**
       
   227 	Relay an asynchronous command onto the slave and obtain a result
       
   228 	@param aMessage
       
   229 		   The IPC message to be sent to the slave@param aMessage
       
   230 	@leave This method may leave with one of the system-wide error codes.
       
   231 	*/
       
   232 	virtual void DoSendSlaveAsyncCommandResultL(const RMmfIpcMessage& aMessage);
       
   233 
       
   234 protected:
       
   235 	~CMMFIlbcDecoderIntfcDeMux();
       
   236 	CMMFIlbcDecoderIntfcDeMux();
       
   237 
       
   238 	// from mirror MIlbcDecoderIntfc method.
       
   239 	TInt DoSetDecoderMode (MIlbcDecoderIntfc::TDecodeMode aDecodeMode);
       
   240 	TInt DoSetComfortNoiseGenerationL(TBool aCng);
       
   241 	TInt DoGetComfortNoiseGenerationL(TBool& aCng);
       
   242 
       
   243 protected:
       
   244 	MMMFDevSoundCustomInterfaceDeMuxUtility* iUtility;
       
   245 	MMMFDevSoundCustomInterfaceTarget*		 iTarget;
       
   246 	TUid				iKey;
       
   247 	MIlbcDecoderIntfc*	iInterfaceIlbcDecoderIntfc;
       
   248 	};
       
   249 
       
   250 #endif