os/mm/devsoundextensions/mmfcustominterfaces/G711DecoderIntfc/G711DecoderIntfcProxy/src/G711DecoderIntfcProxy.cpp
First public contribution.
2 * Copyright (c) 2002-2004 Nokia Corporation and/or its subsidiary(-ies).
4 * This component and the accompanying materials are made available
5 * under the terms of "Eclipse Public License v1.0"
6 * which accompanies this distribution, and is available
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
9 * Initial Contributors:
10 * Nokia Corporation - initial contribution.
14 * Description: Interface proxy for G711 decoder.
21 #include "G711DecoderIntfcProxy.h"
22 #include "G711DecoderIntfcMsgs.h"
23 #include <CustomCommandUtility.h>
24 #include <CustomInterfaceUtility.h>
26 // EXTERNAL DATA STRUCTURES
28 // EXTERNAL FUNCTION PROTOTYPES
34 // LOCAL CONSTANTS AND MACROS
36 // MODULE DATA STRUCTURES
38 // LOCAL FUNCTION PROTOTYPES
40 // FORWARD DECLARATIONS
42 // ============================= LOCAL FUNCTIONS ===============================
44 // ================= MEMBER FUNCTIONS =======================
46 // -----------------------------------------------------------------------------
47 // CG711DecoderIntfcProxy::CG711DecoderIntfcProxy
48 // C++ default constructor can NOT contain any code, that
50 // -----------------------------------------------------------------------------
52 CG711DecoderIntfcProxy::CG711DecoderIntfcProxy(
53 TMMFMessageDestinationPckg aMessageHandler,
54 MCustomCommand& aCustomCommand,
55 CCustomInterfaceUtility* aCustomInterfaceUtility) :
56 iCustomCommand(aCustomCommand),
57 iMessageHandler(aMessageHandler),
58 iCustomInterfaceUtility(aCustomInterfaceUtility)
63 // -----------------------------------------------------------------------------
64 // CG711DecoderIntfcProxy::ConstructL
65 // Symbian 2nd phase constructor can leave.
66 // -----------------------------------------------------------------------------
68 void CG711DecoderIntfcProxy::ConstructL()
72 // -----------------------------------------------------------------------------
73 // CG711DecoderIntfcProxy::NewL
74 // Two-phased constructor.
75 // -----------------------------------------------------------------------------
77 EXPORT_C CG711DecoderIntfcProxy* CG711DecoderIntfcProxy::NewL(
78 TMMFMessageDestinationPckg aMessageHandler,
79 MCustomCommand& aCustomCommand,
80 CCustomInterfaceUtility* aCustomInterfaceUtility)
82 CG711DecoderIntfcProxy* self = new(ELeave) CG711DecoderIntfcProxy(
85 aCustomInterfaceUtility);
86 CleanupStack::PushL( self );
88 CleanupStack::Pop( self );
93 EXPORT_C CG711DecoderIntfcProxy::~CG711DecoderIntfcProxy()
95 iCustomInterfaceUtility->RemoveCustomInterface(iMessageHandler);
96 delete iCustomInterfaceUtility;
99 // ---------------------------------------------------------
100 // CG711DecoderIntfcProxy::SetDecoderMode
101 // Sends the custom command for this function to its message handler.
102 // (other items were commented in a header).
103 // ---------------------------------------------------------
105 EXPORT_C TInt CG711DecoderIntfcProxy::SetDecoderMode(TDecodeMode aDecodeMode)
107 TPckgBuf<TDecodeMode> pckgBuf(aDecodeMode);
108 TInt status = iCustomCommand.CustomCommandSync(iMessageHandler,
109 EG711dimSetDecoderMode,
116 // ---------------------------------------------------------
117 // CG711DecoderIntfcProxy::SetCng
118 // Sends the custom command for this function to its message handler.
119 // (other items were commented in a header).
120 // ---------------------------------------------------------
122 EXPORT_C TInt CG711DecoderIntfcProxy::SetCng(TBool aCng)
124 TPckgBuf<TBool> pckgBuf(aCng);
125 TInt status = iCustomCommand.CustomCommandSync(iMessageHandler,
133 // ---------------------------------------------------------
134 // CG711DecoderIntfcProxy::GetCng
135 // Sends the custom command for this function to its message handler.
136 // (other items were commented in a header).
137 // ---------------------------------------------------------
139 EXPORT_C TInt CG711DecoderIntfcProxy::GetCng(TBool& aCng)
142 TPckgBuf<TBool> pckgBuf(cng);
143 TInt status = iCustomCommand.CustomCommandSync(iMessageHandler,
152 // ---------------------------------------------------------
153 // CG711DecoderIntfcProxy::SetPlc
154 // Sends the custom command for this function to its message handler.
155 // (other items were commented in a header).
156 // ---------------------------------------------------------
158 EXPORT_C TInt CG711DecoderIntfcProxy::SetPlc(TBool aPlc)
160 TPckgBuf<TBool> pckgBuf(aPlc);
161 TInt status = iCustomCommand.CustomCommandSync(iMessageHandler,