sl@0: /*
sl@0: * Copyright (c) 2002-2004 Nokia Corporation and/or its subsidiary(-ies). 
sl@0: * All rights reserved.
sl@0: * This component and the accompanying materials are made available
sl@0: * under the terms of "Eclipse Public License v1.0"
sl@0: * which accompanies this distribution, and is available
sl@0: * at the URL "http://www.eclipse.org/legal/epl-v10.html".
sl@0: *
sl@0: * Initial Contributors:
sl@0: * Nokia Corporation - initial contribution.
sl@0: *
sl@0: * Contributors:
sl@0: *
sl@0: * Description:   Interface proxy for G729 encoder.
sl@0: *
sl@0: */
sl@0: 
sl@0: 
sl@0: 
sl@0: // INCLUDE FILES
sl@0: #include "G729EncoderIntfcProxy.h"
sl@0: #include "G729EncoderIntfcMsgs.h"
sl@0: #include <CustomCommandUtility.h>
sl@0: #include <CustomInterfaceUtility.h>
sl@0: 
sl@0: // EXTERNAL DATA STRUCTURES
sl@0: 
sl@0: // EXTERNAL FUNCTION PROTOTYPES  
sl@0: 
sl@0: // CONSTANTS
sl@0: 
sl@0: // MACROS
sl@0: 
sl@0: // LOCAL CONSTANTS AND MACROS
sl@0: 
sl@0: // MODULE DATA STRUCTURES
sl@0: 
sl@0: // LOCAL FUNCTION PROTOTYPES
sl@0: 
sl@0: // FORWARD DECLARATIONS
sl@0: 
sl@0: // ============================= LOCAL FUNCTIONS ===============================
sl@0: 
sl@0: // ================= MEMBER FUNCTIONS =======================
sl@0: 
sl@0: // -----------------------------------------------------------------------------
sl@0: // CG729EncoderIntfcProxy::CG729EncoderIntfcProxy
sl@0: // C++ default constructor can NOT contain any code, that
sl@0: // might leave.
sl@0: // -----------------------------------------------------------------------------
sl@0: //
sl@0: CG729EncoderIntfcProxy::CG729EncoderIntfcProxy(
sl@0:                              TMMFMessageDestinationPckg aMessageHandler, 
sl@0:                              MCustomCommand& aCustomCommand,
sl@0:                              CCustomInterfaceUtility* aCustomInterfaceUtility) :
sl@0: 	iCustomCommand(aCustomCommand),
sl@0: 	iMessageHandler(aMessageHandler),
sl@0: 	iCustomInterfaceUtility(aCustomInterfaceUtility)
sl@0:     {
sl@0:     }
sl@0: 
sl@0: 
sl@0: // -----------------------------------------------------------------------------
sl@0: // CG729EncoderIntfcProxy::ConstructL
sl@0: // Symbian 2nd phase constructor can leave.
sl@0: // -----------------------------------------------------------------------------
sl@0: //
sl@0: void CG729EncoderIntfcProxy::ConstructL()
sl@0:     {
sl@0:     }
sl@0: 
sl@0: // -----------------------------------------------------------------------------
sl@0: // CG729EncoderIntfcProxy::NewL
sl@0: // Two-phased constructor.
sl@0: // -----------------------------------------------------------------------------
sl@0: //
sl@0: EXPORT_C CG729EncoderIntfcProxy* CG729EncoderIntfcProxy::NewL(
sl@0:                               TMMFMessageDestinationPckg aMessageHandler, 
sl@0:                               MCustomCommand& aCustomCommand,
sl@0:                               CCustomInterfaceUtility* aCustomInterfaceUtility)
sl@0:     {
sl@0:     CG729EncoderIntfcProxy* self = new(ELeave) CG729EncoderIntfcProxy(
sl@0:                                                         aMessageHandler,
sl@0:                                                         aCustomCommand,
sl@0:                                                         aCustomInterfaceUtility);
sl@0:     CleanupStack::PushL( self );
sl@0:     self->ConstructL();
sl@0:     CleanupStack::Pop( self );
sl@0:     return self;
sl@0:     }
sl@0:     
sl@0: // Destructor
sl@0: EXPORT_C CG729EncoderIntfcProxy::~CG729EncoderIntfcProxy()
sl@0:     {
sl@0:     iCustomInterfaceUtility->RemoveCustomInterface(iMessageHandler);
sl@0:     delete iCustomInterfaceUtility;
sl@0:     }
sl@0: 
sl@0: // ---------------------------------------------------------
sl@0: // CG729EncoderIntfcProxy::SetVadMode
sl@0: // Sends the custom command for this function to its message handler.
sl@0: // (other items were commented in a header).
sl@0: // ---------------------------------------------------------
sl@0: //
sl@0: EXPORT_C TInt CG729EncoderIntfcProxy::SetVadMode(TBool aVadMode)
sl@0: 	{
sl@0: 	TPckgBuf<TBool> pckgBuf(aVadMode);
sl@0: 	TInt status = iCustomCommand.CustomCommandSync(iMessageHandler,
sl@0: 	                                               EG729eimSetVadMode,
sl@0: 	                                               pckgBuf,
sl@0: 	                                               KNullDesC8);
sl@0: 	return status;
sl@0: 	}
sl@0: 
sl@0: // ---------------------------------------------------------
sl@0: // CG729EncoderIntfcProxy::GetVadMode
sl@0: // Sends the custom command for this function to its message handler.
sl@0: // (other items were commented in a header).
sl@0: // ---------------------------------------------------------
sl@0: //
sl@0: EXPORT_C TInt CG729EncoderIntfcProxy::GetVadMode(TBool& aVadMode)
sl@0: 	{
sl@0: 	TInt vadMode = EFalse;
sl@0: 	TPckgBuf<TBool> pckgBuf(vadMode);
sl@0: 	TInt status = iCustomCommand.CustomCommandSync(iMessageHandler,
sl@0: 	                                               EG729eimGetVadMode,
sl@0: 	                                               KNullDesC8,
sl@0: 	                                               KNullDesC8,
sl@0: 	                                               pckgBuf);
sl@0: 	if (status == KErrNone)
sl@0: 	    aVadMode = pckgBuf();
sl@0: 	return status;
sl@0: 	}
sl@0: 
sl@0:     
sl@0: 
sl@0: 
sl@0: // End of File