os/mm/devsoundextensions/effects/EffectBase/src/AudioEffectBase.cpp
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/mm/devsoundextensions/effects/EffectBase/src/AudioEffectBase.cpp	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,134 @@
     1.4 +/*
     1.5 +* Copyright (c) 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:   Implementation of the base class for effects.
    1.18 +*
    1.19 +*/
    1.20 +
    1.21 +
    1.22 +
    1.23 +// INCLUDE FILES
    1.24 +
    1.25 +#ifdef _DEBUG
    1.26 +#include <e32svr.h>
    1.27 +#endif
    1.28 +#include <AudioEffectBase.h>
    1.29 +#include <MAudioEffectObserver.h>
    1.30 +
    1.31 +// ============================ MEMBER FUNCTIONS ===============================
    1.32 +
    1.33 +// -----------------------------------------------------------------------------
    1.34 +// CAudioEffect::CAudioEffect
    1.35 +// C++ default constructor can NOT contain any code, that
    1.36 +// might leave.
    1.37 +// -----------------------------------------------------------------------------
    1.38 +//
    1.39 +EXPORT_C CAudioEffect::CAudioEffect()
    1.40 +    : 	iEnabled(EFalse),
    1.41 +    	iEnforced(EFalse),
    1.42 +    	iHaveUpdateRights(ETrue)
    1.43 +    {
    1.44 +    }
    1.45 +
    1.46 +
    1.47 +// Destructor
    1.48 +EXPORT_C CAudioEffect::~CAudioEffect()
    1.49 +    {
    1.50 +	iObservers.Close();
    1.51 +    }
    1.52 +
    1.53 +// -----------------------------------------------------------------------------
    1.54 +// CAudioEffect::IsEnable
    1.55 +// -----------------------------------------------------------------------------
    1.56 +//
    1.57 +EXPORT_C TBool CAudioEffect::IsEnabled() const
    1.58 +    {
    1.59 +	return iEnabled;
    1.60 +    }
    1.61 +
    1.62 +// -----------------------------------------------------------------------------
    1.63 +// CAudioEffect::Enable
    1.64 +// -----------------------------------------------------------------------------
    1.65 +//
    1.66 +EXPORT_C void CAudioEffect::EnableL()
    1.67 +    {
    1.68 +	iEnabled = ETrue;
    1.69 +	ApplyL();
    1.70 +    }
    1.71 +
    1.72 +// -----------------------------------------------------------------------------
    1.73 +// CAudioEffect::Disable
    1.74 +// -----------------------------------------------------------------------------
    1.75 +//
    1.76 +EXPORT_C void CAudioEffect::DisableL()
    1.77 +    {
    1.78 +	iEnabled = EFalse;
    1.79 +	ApplyL();
    1.80 +    }
    1.81 +
    1.82 +// -----------------------------------------------------------------------------
    1.83 +// CAudioEffect::Enforce
    1.84 +// -----------------------------------------------------------------------------
    1.85 +//
    1.86 +EXPORT_C void CAudioEffect::EnforceL(
    1.87 +	TBool aEnforced )
    1.88 +    {
    1.89 +	iEnforced = aEnforced;
    1.90 +	ApplyL();
    1.91 +    }
    1.92 +
    1.93 +// -----------------------------------------------------------------------------
    1.94 +// CAudioEffect::HaveUpdateRights
    1.95 +// -----------------------------------------------------------------------------
    1.96 +//
    1.97 +EXPORT_C TBool CAudioEffect::HaveUpdateRights() const
    1.98 +    {
    1.99 +	return iHaveUpdateRights;
   1.100 +    }
   1.101 +
   1.102 +// -----------------------------------------------------------------------------
   1.103 +// CAudioEffect::IsEnforced
   1.104 +// -----------------------------------------------------------------------------
   1.105 +//
   1.106 +EXPORT_C TBool CAudioEffect::IsEnforced() const
   1.107 +    {
   1.108 +	return iEnforced;
   1.109 +    }
   1.110 +
   1.111 +// -----------------------------------------------------------------------------
   1.112 +// CVolume::RegisterObserverL
   1.113 +// -----------------------------------------------------------------------------
   1.114 +//
   1.115 +EXPORT_C void CAudioEffect::RegisterObserverL(
   1.116 +	MAudioEffectObserver& aObserver )
   1.117 +	{
   1.118 +	User::LeaveIfError(iObservers.Append(&aObserver));
   1.119 +	}
   1.120 +
   1.121 +// -----------------------------------------------------------------------------
   1.122 +// CVolume::UnRegisterObserver
   1.123 +// -----------------------------------------------------------------------------
   1.124 +//
   1.125 +EXPORT_C void CAudioEffect::UnRegisterObserver(
   1.126 +	MAudioEffectObserver& aObserver )
   1.127 +	{
   1.128 +	TInt index = iObservers.Find(&aObserver);
   1.129 +	if( index != KErrNotFound )
   1.130 +		{
   1.131 +		iObservers.Remove(index);
   1.132 +		}
   1.133 +	}
   1.134 +
   1.135 +// ========================== OTHER EXPORTED FUNCTIONS =========================
   1.136 +
   1.137 +// End of File