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