os/mm/devsoundextensions/addeddevsoundcontrol/AddedDevSoundControlProxy/src/AddedDevSoundControlProxy.cpp
Update contrib.
2 * Copyright (c) 2006 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 AddedDevSoundControl CI.
21 #include <CustomCommandUtility.h>
22 #include <CustomInterfaceUtility.h>
23 #include "AddedDevSoundControlMsgs.h"
24 #include <AddedDevSoundControlProxy.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 ==============================
47 * CAddedDevSoundControlProxy::CAddedDevSoundControlProxy
48 * C++ default constructor can NOT contain any code, that
51 CAddedDevSoundControlProxy::CAddedDevSoundControlProxy(
52 TMMFMessageDestinationPckg aMessageHandler,
53 MCustomCommand& aCustomCommand,
54 CCustomInterfaceUtility* aCustomInterfaceUtility) :
55 iCustomCommand(aCustomCommand),
56 iMessageHandler(aMessageHandler),
57 iCustomInterfaceUtility(aCustomInterfaceUtility)
62 * CAddedDevSoundControlProxy::NewL
63 * Two-phased constructor.
65 EXPORT_C CAddedDevSoundControlProxy* CAddedDevSoundControlProxy::NewL(
66 TMMFMessageDestinationPckg aMessageHandler,
67 MCustomCommand& aCustomCommand,
68 CCustomInterfaceUtility* aCustomInterfaceUtility)
70 CAddedDevSoundControlProxy* self =
71 new(ELeave) CAddedDevSoundControlProxy(aMessageHandler,
73 aCustomInterfaceUtility);
80 CAddedDevSoundControlProxy::~CAddedDevSoundControlProxy()
82 if(iCustomInterfaceUtility)
84 iCustomInterfaceUtility->RemoveCustomInterface(iMessageHandler);
85 delete iCustomInterfaceUtility;
86 iCustomInterfaceUtility = NULL;
91 // From MAddedDevSoundControl
94 * Handles client request to alter DevSound's behavior for Pause.
95 * (other items defined in the header)
97 TInt CAddedDevSoundControlProxy::SetHwAwareness(TBool aHwAware)
99 TPckgBuf<TBool> hwAwarePckgBuf(aHwAware);
100 return iCustomCommand.CustomCommandSync(iMessageHandler,
101 EAddedDSControlSetHwAwareness,
107 * Handles client request to pause the audio resources and flush.
108 * (other items defined in the header)
110 TInt CAddedDevSoundControlProxy::PauseAndFlush()
112 return iCustomCommand.CustomCommandSync(iMessageHandler,
113 EAddedDSControlPauseAndFlush,