sl@0: /* sl@0: * Copyright (c) 2006 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 AddedDevSoundControl CI. sl@0: * sl@0: */ sl@0: sl@0: sl@0: sl@0: // INCLUDE FILES sl@0: #include sl@0: #include sl@0: #include "AddedDevSoundControlMsgs.h" sl@0: #include 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: * CAddedDevSoundControlProxy::CAddedDevSoundControlProxy sl@0: * C++ default constructor can NOT contain any code, that sl@0: * might leave. sl@0: */ sl@0: CAddedDevSoundControlProxy::CAddedDevSoundControlProxy( 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: * CAddedDevSoundControlProxy::NewL sl@0: * Two-phased constructor. sl@0: */ sl@0: EXPORT_C CAddedDevSoundControlProxy* CAddedDevSoundControlProxy::NewL( sl@0: TMMFMessageDestinationPckg aMessageHandler, sl@0: MCustomCommand& aCustomCommand, sl@0: CCustomInterfaceUtility* aCustomInterfaceUtility) sl@0: { sl@0: CAddedDevSoundControlProxy* self = sl@0: new(ELeave) CAddedDevSoundControlProxy(aMessageHandler, sl@0: aCustomCommand, sl@0: aCustomInterfaceUtility); sl@0: return self; sl@0: } sl@0: sl@0: /** sl@0: * Destructor sl@0: */ sl@0: CAddedDevSoundControlProxy::~CAddedDevSoundControlProxy() sl@0: { sl@0: if(iCustomInterfaceUtility) sl@0: { sl@0: iCustomInterfaceUtility->RemoveCustomInterface(iMessageHandler); sl@0: delete iCustomInterfaceUtility; sl@0: iCustomInterfaceUtility = NULL; sl@0: } sl@0: } sl@0: sl@0: sl@0: // From MAddedDevSoundControl sl@0: sl@0: /** sl@0: * Handles client request to alter DevSound's behavior for Pause. sl@0: * (other items defined in the header) sl@0: */ sl@0: TInt CAddedDevSoundControlProxy::SetHwAwareness(TBool aHwAware) sl@0: { sl@0: TPckgBuf hwAwarePckgBuf(aHwAware); sl@0: return iCustomCommand.CustomCommandSync(iMessageHandler, sl@0: EAddedDSControlSetHwAwareness, sl@0: hwAwarePckgBuf, sl@0: KNullDesC8); sl@0: } sl@0: sl@0: /** sl@0: * Handles client request to pause the audio resources and flush. sl@0: * (other items defined in the header) sl@0: */ sl@0: TInt CAddedDevSoundControlProxy::PauseAndFlush() sl@0: { sl@0: return iCustomCommand.CustomCommandSync(iMessageHandler, sl@0: EAddedDSControlPauseAndFlush, sl@0: KNullDesC8, sl@0: KNullDesC8); sl@0: } sl@0: sl@0: // End of File