devsound/devsoundpluginsupport/src/CustomInterfaces/speechencoderconfigci.h
changeset 0 40261b775718
equal deleted inserted replaced
-1:000000000000 0:40261b775718
       
     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 speech encoder config custom interface pair
       
    15 // 
       
    16 //
       
    17 
       
    18 #ifndef SPEECHENCODERCONFIGCI_H
       
    19 #define SPEECHENCODERCONFIGCI_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 TMMFDevSoundCISpeechEncoderConfigCommands
       
    38 	{
       
    39 	EMMFDevSoundCISpeechEncoderConfigSetVadMode,
       
    40 	EMMFDevSoundCISpeechEncoderConfigGetVadMode
       
    41 	};
       
    42 
       
    43 
       
    44 /**
       
    45 Implementation of the Speech encoder config custom interface Mux
       
    46 @internalComponent
       
    47 @prototype
       
    48 @file
       
    49  */
       
    50 class CMMFSpeechEncoderConfigMux : public CBase,
       
    51 								   public MMMFDevSoundCustomInterfaceMuxPlugin,
       
    52 								   public MSpeechEncoderConfig
       
    53 	{
       
    54 public:
       
    55 
       
    56 	// from MMMFDevSoundCustomInterfaceMuxPlugin
       
    57 	/**
       
    58 	Attempt to open the interface.
       
    59 	@param  aInterfaceId
       
    60 		    The UID of the interface to open.
       
    61 	@return one of the system wide error codes
       
    62 	*/
       
    63 	virtual TInt OpenInterface(TUid aInterfaceId);
       
    64 
       
    65 	/**
       
    66 	Equivalent to destructor.  Called to destroy plugin.
       
    67 	*/
       
    68 	virtual void Release();
       
    69 
       
    70 	/**
       
    71 	Pass destructor key.
       
    72 	Called on construction so plugin takes responsibility to call REComSession::DestroyedImplementation()
       
    73 	@param aDestructorKey
       
    74 		   The Uid returned by REComSession::CreateImplementationL() or similar
       
    75 	*/
       
    76 	virtual void PassDestructorKey(TUid aDestructorKey);
       
    77 
       
    78 	/**
       
    79 	Complete construction.
       
    80 	Pass additional values from the construction phase, used subsequently by the plugin.
       
    81 	@param aCustomUtility
       
    82 		   The custom interface utility used by the plugin to communicate with the remote
       
    83 		   server side DeMux plugin
       
    84 	@leave This method may leave with one of the system-wide error codes.
       
    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 	@leave  This method may leave with one of the system-wide error codes.
       
   100 	*/
       
   101 	static MMMFDevSoundCustomInterfaceMuxPlugin* NewL();
       
   102 
       
   103 	// from MSpeechEncoderConfig
       
   104 	//@see MSpeechEncoderConfig
       
   105 	virtual TInt SetVadMode (TBool aVadModeOn);
       
   106 	//@see MSpeechEncoderConfig
       
   107 	virtual TInt GetVadMode (TBool& aVadModeOn);
       
   108 
       
   109 protected:
       
   110 	CMMFSpeechEncoderConfigMux();
       
   111 	~CMMFSpeechEncoderConfigMux();
       
   112 
       
   113 protected:
       
   114 	TUid iKey;
       
   115 	TInt iRemoteHandle;
       
   116 	MMMFDevSoundCustomInterfaceMuxUtility* iUtility;
       
   117 	};
       
   118 
       
   119 
       
   120 /**
       
   121 Implementation of the Speech encoder config custom interface DeMux
       
   122 @internalComponent
       
   123 @prototype
       
   124 @file
       
   125 */
       
   126 class CMMFSpeechEncoderConfigDeMux : public CBase,
       
   127 									 public MMMFDevSoundCustomInterfaceDeMuxPlugin
       
   128 	{
       
   129 public:
       
   130 	/**
       
   131 	Instantiate a CMMFSpeechEncoderConfigDeMux class
       
   132 	@return a pointer to the new class cast to the DeMux plugin mixin
       
   133 	@leave  This method may leave with one of the system-wide error codes.
       
   134 	*/
       
   135 	static MMMFDevSoundCustomInterfaceDeMuxPlugin* NewL();
       
   136 
       
   137 	/**
       
   138 	Attempt to open the interface.
       
   139 	@param  aInterfaceId
       
   140 		    The UID of the interface to open.
       
   141 	@return a handle to the remote plugin
       
   142 	*/
       
   143 	virtual TInt OpenInterface(TUid aInterfaceId);
       
   144 
       
   145 	/**
       
   146 	Equivalent to destructor.  Called to destroy plugin.
       
   147 	*/
       
   148 	virtual void Release();
       
   149 
       
   150 	/**
       
   151 	Pass destructor key.
       
   152 	Called on construction so plugin takes responsibility to call REComSession::DestroyedImplementation()
       
   153 	@param aDestructorKey
       
   154 		   The Uid returned by REComSession::CreateImplementationL() or similar
       
   155 	*/
       
   156 	virtual void PassDestructorKey(TUid aDestructorKey);
       
   157 
       
   158 	/**
       
   159 	Set the target of the custom interface call
       
   160 	@param aTarget
       
   161 		   The DevSound to call the custom interface on.
       
   162 	*/
       
   163 	virtual void SetInterfaceTarget(MMMFDevSoundCustomInterfaceTarget* aTarget);
       
   164 
       
   165 	/**
       
   166 	Complete construction.
       
   167 	@param aUtility
       
   168 		   The DeMux utility to use
       
   169 	@leave This method may leave with one of the system-wide error codes.
       
   170 	*/
       
   171 	virtual void CompleteConstructL(MMMFDevSoundCustomInterfaceDeMuxUtility* aUtility);
       
   172 
       
   173 	/**
       
   174 	Refresh the current custom interface connections
       
   175 	@leave This method may leave with one of the system-wide error codes.
       
   176 	*/
       
   177 	virtual void RefreshL();
       
   178 
       
   179 	// from MMMFDevSoundCustomInterfaceDeMuxPlugin
       
   180 	/**
       
   181 	Open the slave
       
   182 	@param  aInterface
       
   183 		    The UID of the requested interface
       
   184 	@param  aPackageBuf
       
   185 		    A package of data that can be supplied for initialisation
       
   186 	@return the result of the operation
       
   187 	@leave  This method may leave with one of the system-wide error codes.
       
   188 	*/
       
   189 	virtual TInt DoOpenSlaveL(TUid aInterface, const TDesC8& aPackageBuf);
       
   190 
       
   191 	/**
       
   192 	Close the slave
       
   193 	@param aHandle
       
   194 		   The handle of the slave plugin
       
   195 	@leave This method may leave with one of the system-wide error codes.
       
   196 	*/
       
   197 	virtual void DoCloseSlaveL(TInt aHandle);
       
   198 
       
   199 	// original RMessage is supplied so that remote DeMux plugin can extract necessary details
       
   200 	// using DeMux utility
       
   201 
       
   202 	/**
       
   203 	Relay the synchronous custom command onto the slave
       
   204 	@param  aMessage
       
   205 		    The IPC message to be sent to the slave
       
   206 	@return the result of the operation
       
   207 	@leave  This method may leave with one of the system-wide error codes.
       
   208 	*/
       
   209 	virtual TInt DoSendSlaveSyncCommandL(const RMmfIpcMessage& aMessage);
       
   210 
       
   211 	/**
       
   212 	Relay the synchronous custom command onto the slave and obtain a result
       
   213 	@param  aMessage
       
   214 		    The IPC message to be sent to the slave
       
   215 	@return the result of the operation
       
   216 	@leave  This method may leave with one of the system-wide error codes.
       
   217 	*/
       
   218 	virtual TInt DoSendSlaveSyncCommandResultL(const RMmfIpcMessage& aMessage);
       
   219 
       
   220 	/**
       
   221 	Relay an asynchronous command onto the slave
       
   222 	@param aMessage
       
   223 		   The IPC message to be sent to the slave
       
   224 	@leave This method may leave with one of the system-wide error codes.
       
   225 	*/
       
   226 	virtual void DoSendSlaveAsyncCommandL(const RMmfIpcMessage& aMessage);
       
   227 
       
   228 	/**
       
   229 	Relay an asynchronous command onto the slave and obtain a result
       
   230 	@param aMessage
       
   231 		   The IPC message to be sent to the slave@param aMessage
       
   232 	@leave This method may leave with one of the system-wide error codes.
       
   233 	*/
       
   234 	virtual void DoSendSlaveAsyncCommandResultL(const RMmfIpcMessage& aMessage);
       
   235 
       
   236 protected:
       
   237 	~CMMFSpeechEncoderConfigDeMux();
       
   238 	CMMFSpeechEncoderConfigDeMux();
       
   239 
       
   240 	// from mirror MSpeechEncoderConfig method.
       
   241 	TInt DoSetVadModeL(TBool aVadModeOn);
       
   242 	TInt DoGetVadModeL(TBool& aVadModeOn);
       
   243 	
       
   244 protected:
       
   245 	MMMFDevSoundCustomInterfaceDeMuxUtility* iUtility;
       
   246 	MMMFDevSoundCustomInterfaceTarget*		 iTarget;
       
   247 	TUid					iKey;
       
   248 	MSpeechEncoderConfig*	iInterfaceSpeechEncoderConfig; 
       
   249 	};
       
   250 
       
   251 #endif