os/mm/devsoundextensions/addeddevsoundcontrol/AddedDevSoundControlProxy/src/AddedDevSoundControlProxy.cpp
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/mm/devsoundextensions/addeddevsoundcontrol/AddedDevSoundControlProxy/src/AddedDevSoundControlProxy.cpp	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,118 @@
     1.4 +/*
     1.5 +* Copyright (c) 2006 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 AddedDevSoundControl CI.
    1.18 +*
    1.19 +*/
    1.20 +
    1.21 +
    1.22 +
    1.23 +// INCLUDE FILES
    1.24 +#include <CustomCommandUtility.h>
    1.25 +#include <CustomInterfaceUtility.h>
    1.26 +#include "AddedDevSoundControlMsgs.h"
    1.27 +#include <AddedDevSoundControlProxy.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 + * CAddedDevSoundControlProxy::CAddedDevSoundControlProxy
    1.51 + * C++ default constructor can NOT contain any code, that
    1.52 + * might leave.
    1.53 + */
    1.54 +CAddedDevSoundControlProxy::CAddedDevSoundControlProxy(
    1.55 +                            TMMFMessageDestinationPckg aMessageHandler,
    1.56 +                            MCustomCommand& aCustomCommand,
    1.57 +                            CCustomInterfaceUtility* aCustomInterfaceUtility) :
    1.58 +    iCustomCommand(aCustomCommand),
    1.59 +    iMessageHandler(aMessageHandler),
    1.60 +    iCustomInterfaceUtility(aCustomInterfaceUtility)
    1.61 +    {
    1.62 +    }
    1.63 +
    1.64 +/**
    1.65 + * CAddedDevSoundControlProxy::NewL
    1.66 + * Two-phased constructor.
    1.67 + */
    1.68 +EXPORT_C CAddedDevSoundControlProxy* CAddedDevSoundControlProxy::NewL(
    1.69 +                            TMMFMessageDestinationPckg aMessageHandler,
    1.70 +                            MCustomCommand& aCustomCommand,
    1.71 +                            CCustomInterfaceUtility* aCustomInterfaceUtility)
    1.72 +    {
    1.73 +    CAddedDevSoundControlProxy* self =
    1.74 +            new(ELeave) CAddedDevSoundControlProxy(aMessageHandler,
    1.75 +                                                   aCustomCommand,
    1.76 +                                                   aCustomInterfaceUtility);
    1.77 +    return self;                                                   
    1.78 +    }
    1.79 +
    1.80 +/**
    1.81 + * Destructor
    1.82 + */
    1.83 +CAddedDevSoundControlProxy::~CAddedDevSoundControlProxy()
    1.84 +    {
    1.85 +    if(iCustomInterfaceUtility)
    1.86 +     { 
    1.87 +        iCustomInterfaceUtility->RemoveCustomInterface(iMessageHandler);
    1.88 +        delete iCustomInterfaceUtility;
    1.89 +        iCustomInterfaceUtility = NULL;
    1.90 +     }
    1.91 +    }
    1.92 +
    1.93 +
    1.94 +// From MAddedDevSoundControl
    1.95 +
    1.96 +/**
    1.97 + * Handles client request to alter DevSound's behavior for Pause.
    1.98 + * (other items defined in the header)
    1.99 + */
   1.100 +TInt CAddedDevSoundControlProxy::SetHwAwareness(TBool aHwAware)
   1.101 +    {
   1.102 +	TPckgBuf<TBool> hwAwarePckgBuf(aHwAware);
   1.103 +	return iCustomCommand.CustomCommandSync(iMessageHandler,
   1.104 +                                            EAddedDSControlSetHwAwareness,
   1.105 +                                            hwAwarePckgBuf,
   1.106 +                                            KNullDesC8);
   1.107 +    }
   1.108 +
   1.109 +/**
   1.110 + * Handles client request to pause the audio resources and flush.
   1.111 + * (other items defined in the header)
   1.112 + */
   1.113 +TInt CAddedDevSoundControlProxy::PauseAndFlush()
   1.114 +    {
   1.115 +	return iCustomCommand.CustomCommandSync(iMessageHandler,
   1.116 +                                            EAddedDSControlPauseAndFlush,
   1.117 +                                            KNullDesC8,
   1.118 +                                            KNullDesC8);
   1.119 +    }
   1.120 +
   1.121 +// End of File