os/mm/devsoundextensions/mmfcustominterfaces/G711DecoderIntfc/G711DecoderIntfcProxy/src/G711DecoderIntfcProxy.cpp
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/mm/devsoundextensions/mmfcustominterfaces/G711DecoderIntfc/G711DecoderIntfcProxy/src/G711DecoderIntfcProxy.cpp Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,170 @@
1.4 +/*
1.5 +* Copyright (c) 2002-2004 Nokia Corporation and/or its subsidiary(-ies).
1.6 +* All rights reserved.
1.7 +* This component and the accompanying materials are made available
1.8 +* under the terms of "Eclipse Public License v1.0"
1.9 +* which accompanies this distribution, and is available
1.10 +* at the URL "http://www.eclipse.org/legal/epl-v10.html".
1.11 +*
1.12 +* Initial Contributors:
1.13 +* Nokia Corporation - initial contribution.
1.14 +*
1.15 +* Contributors:
1.16 +*
1.17 +* Description: Interface proxy for G711 decoder.
1.18 +*
1.19 +*/
1.20 +
1.21 +
1.22 +
1.23 +// INCLUDE FILES
1.24 +#include "G711DecoderIntfcProxy.h"
1.25 +#include "G711DecoderIntfcMsgs.h"
1.26 +#include <CustomCommandUtility.h>
1.27 +#include <CustomInterfaceUtility.h>
1.28 +
1.29 +// EXTERNAL DATA STRUCTURES
1.30 +
1.31 +// EXTERNAL FUNCTION PROTOTYPES
1.32 +
1.33 +// CONSTANTS
1.34 +
1.35 +// MACROS
1.36 +
1.37 +// LOCAL CONSTANTS AND MACROS
1.38 +
1.39 +// MODULE DATA STRUCTURES
1.40 +
1.41 +// LOCAL FUNCTION PROTOTYPES
1.42 +
1.43 +// FORWARD DECLARATIONS
1.44 +
1.45 +// ============================= LOCAL FUNCTIONS ===============================
1.46 +
1.47 +// ================= MEMBER FUNCTIONS =======================
1.48 +
1.49 +// -----------------------------------------------------------------------------
1.50 +// CG711DecoderIntfcProxy::CG711DecoderIntfcProxy
1.51 +// C++ default constructor can NOT contain any code, that
1.52 +// might leave.
1.53 +// -----------------------------------------------------------------------------
1.54 +//
1.55 +CG711DecoderIntfcProxy::CG711DecoderIntfcProxy(
1.56 + TMMFMessageDestinationPckg aMessageHandler,
1.57 + MCustomCommand& aCustomCommand,
1.58 + CCustomInterfaceUtility* aCustomInterfaceUtility) :
1.59 + iCustomCommand(aCustomCommand),
1.60 + iMessageHandler(aMessageHandler),
1.61 + iCustomInterfaceUtility(aCustomInterfaceUtility)
1.62 + {
1.63 + }
1.64 +
1.65 +
1.66 +// -----------------------------------------------------------------------------
1.67 +// CG711DecoderIntfcProxy::ConstructL
1.68 +// Symbian 2nd phase constructor can leave.
1.69 +// -----------------------------------------------------------------------------
1.70 +//
1.71 +void CG711DecoderIntfcProxy::ConstructL()
1.72 + {
1.73 + }
1.74 +
1.75 +// -----------------------------------------------------------------------------
1.76 +// CG711DecoderIntfcProxy::NewL
1.77 +// Two-phased constructor.
1.78 +// -----------------------------------------------------------------------------
1.79 +//
1.80 +EXPORT_C CG711DecoderIntfcProxy* CG711DecoderIntfcProxy::NewL(
1.81 + TMMFMessageDestinationPckg aMessageHandler,
1.82 + MCustomCommand& aCustomCommand,
1.83 + CCustomInterfaceUtility* aCustomInterfaceUtility)
1.84 + {
1.85 + CG711DecoderIntfcProxy* self = new(ELeave) CG711DecoderIntfcProxy(
1.86 + aMessageHandler,
1.87 + aCustomCommand,
1.88 + aCustomInterfaceUtility);
1.89 + CleanupStack::PushL( self );
1.90 + self->ConstructL();
1.91 + CleanupStack::Pop( self );
1.92 + return self;
1.93 + }
1.94 +
1.95 +// Destructor
1.96 +EXPORT_C CG711DecoderIntfcProxy::~CG711DecoderIntfcProxy()
1.97 + {
1.98 + iCustomInterfaceUtility->RemoveCustomInterface(iMessageHandler);
1.99 + delete iCustomInterfaceUtility;
1.100 + }
1.101 +
1.102 +// ---------------------------------------------------------
1.103 +// CG711DecoderIntfcProxy::SetDecoderMode
1.104 +// Sends the custom command for this function to its message handler.
1.105 +// (other items were commented in a header).
1.106 +// ---------------------------------------------------------
1.107 +//
1.108 +EXPORT_C TInt CG711DecoderIntfcProxy::SetDecoderMode(TDecodeMode aDecodeMode)
1.109 + {
1.110 + TPckgBuf<TDecodeMode> pckgBuf(aDecodeMode);
1.111 + TInt status = iCustomCommand.CustomCommandSync(iMessageHandler,
1.112 + EG711dimSetDecoderMode,
1.113 + pckgBuf,
1.114 + KNullDesC8);
1.115 + return status;
1.116 +
1.117 + }
1.118 +
1.119 +// ---------------------------------------------------------
1.120 +// CG711DecoderIntfcProxy::SetCng
1.121 +// Sends the custom command for this function to its message handler.
1.122 +// (other items were commented in a header).
1.123 +// ---------------------------------------------------------
1.124 +//
1.125 +EXPORT_C TInt CG711DecoderIntfcProxy::SetCng(TBool aCng)
1.126 + {
1.127 + TPckgBuf<TBool> pckgBuf(aCng);
1.128 + TInt status = iCustomCommand.CustomCommandSync(iMessageHandler,
1.129 + EG711dimSetCng,
1.130 + pckgBuf,
1.131 + KNullDesC8);
1.132 + return status;
1.133 +
1.134 + }
1.135 +
1.136 +// ---------------------------------------------------------
1.137 +// CG711DecoderIntfcProxy::GetCng
1.138 +// Sends the custom command for this function to its message handler.
1.139 +// (other items were commented in a header).
1.140 +// ---------------------------------------------------------
1.141 +//
1.142 +EXPORT_C TInt CG711DecoderIntfcProxy::GetCng(TBool& aCng)
1.143 + {
1.144 + TBool cng = EFalse;
1.145 + TPckgBuf<TBool> pckgBuf(cng);
1.146 + TInt status = iCustomCommand.CustomCommandSync(iMessageHandler,
1.147 + EG711dimGetCng,
1.148 + KNullDesC8,
1.149 + KNullDesC8,
1.150 + pckgBuf);
1.151 + aCng = pckgBuf();
1.152 + return status;
1.153 + }
1.154 +
1.155 +// ---------------------------------------------------------
1.156 +// CG711DecoderIntfcProxy::SetPlc
1.157 +// Sends the custom command for this function to its message handler.
1.158 +// (other items were commented in a header).
1.159 +// ---------------------------------------------------------
1.160 +//
1.161 +EXPORT_C TInt CG711DecoderIntfcProxy::SetPlc(TBool aPlc)
1.162 + {
1.163 + TPckgBuf<TBool> pckgBuf(aPlc);
1.164 + TInt status = iCustomCommand.CustomCommandSync(iMessageHandler,
1.165 + EG711dimSetPlc,
1.166 + pckgBuf,
1.167 + KNullDesC8);
1.168 + return status;
1.169 +
1.170 + }
1.171 +
1.172 +
1.173 +// End of File