Update contrib.
1 // Copyright (c) 2005-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".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
16 #ifndef MMFDEVSOUNDCIMUXUTILITY_H
17 #define MMFDEVSOUNDCIMUXUTILITY_H
22 #include "mmfaudioclientserver.h"
23 #include <mmf/server/mmfdevsoundcustominterface.h>
31 class CMMFDevSoundCIMuxUtility;
32 class TA3FCustomInterfaceCommand;
33 NONSHARABLE_CLASS( CMMFDevSoundCIMuxUtility ) : public CBase,
34 public MMMFDevSoundCustomInterfaceMuxUtility
37 enum TMMFDevSoundCustomCommand
39 EMMFDevSoundCustomCommandCIOpenSlave,
40 EMMFDevSoundCustomCommandCICloseSlave,
41 EMMFDevSoundCustomCommandCISendSlaveSyncCommand,
42 EMMFDevSoundCustomCommandCISendSlaveSyncCommandResult,
43 EMMFDevSoundCustomCommandCISendSlaveAsyncCommand,
44 EMMFDevSoundCustomCommandCISendSlaveAsyncCommandResult
48 * internal class used for Asynchronous Custom Command message passing from CI Mux to Demux.
51 NONSHARABLE_CLASS(CAsyncCommandCleanup): public CActive
56 static CAsyncCommandCleanup* NewL(CMMFDevSoundCIMuxUtility* aMuxUtility,MMMFDevSoundCustomInterfaceChannel* aCustomChannel);
57 ~CAsyncCommandCleanup();
58 void AsyncCustomCommand(CMMFDevSoundCIMuxUtility::TMMFDevSoundCustomCommand aType,TMMFDevSoundCustomInterfaceCommandPackage& aComPackage, TRequestStatus& aStatus, const TDesC8& aPackageBuf, TDes8* aResultBuf);
64 CAsyncCommandCleanup(CMMFDevSoundCIMuxUtility* aMuxUtility,MMMFDevSoundCustomInterfaceChannel* aCustomChannel);
67 TPckgBuf<TA3FCustomInterfaceCommand>* iCommandBuffer;
71 CMMFDevSoundCIMuxUtility* iMuxUtility;
72 MMMFDevSoundCustomInterfaceChannel* iCustomChannel;
73 TRequestStatus* iClientRequestStatus;
77 static CMMFDevSoundCIMuxUtility* NewL(MMMFDevSoundCustomInterfaceChannel* aCustomChannel);
78 virtual ~CMMFDevSoundCIMuxUtility();
81 // create a custom interface Mux implementation.
82 MMMFDevSoundCustomInterfaceMuxPlugin* CreateCustomInterfaceMuxL(TUid aInterfaceId);
84 // from MMMFDevSoundCustomInterfaceMux interface.
85 virtual TInt OpenSlave(TUid, const TDesC8& aPackageBuf);
86 virtual void CloseSlave(TInt aHandle);
87 virtual TInt SendSlaveSyncCommand(TInt aHandle, TInt aCommand, const TDesC8& aPackageBuf);
88 virtual TInt SendSlaveSyncCommandResult(TInt aHandle, TInt aCommand, const TDesC8& aPackageBuf, TDes8& aResultBuf);
89 virtual void SendSlaveAsyncCommand(TMMFDevSoundCustomInterfaceCommandPackage& aComPackage, TRequestStatus& aStatus, const TDesC8& aPackageBuf);
90 virtual void SendSlaveAsyncCommandResult(TMMFDevSoundCustomInterfaceCommandPackage& aComPackage, TRequestStatus& aStatus, const TDesC8& aPackageBuf, TDes8& aResultBuf);
92 void RemoveAsyncCommand(CAsyncCommandCleanup* aAsyncCustomCommandCleanup);
94 CMMFDevSoundCIMuxUtility(MMMFDevSoundCustomInterfaceChannel* aCustomChannel);
96 MMMFDevSoundCustomInterfaceChannel* iCustomChannel;
97 RPointerArray <CAsyncCommandCleanup> iAsyncCustomCommandCleanup;
102 * internal class used to pass custom command & custom command type from CI Mux to DeMux.
104 class TA3FCustomInterfaceCommand
107 // Custom Interface command (meaning depends on CI in use)
109 // Internal slave command type.
110 CMMFDevSoundCIMuxUtility::TMMFDevSoundCustomCommand iType;
111 // CI handle (equates to an offset into array of open CIs for most command types)