sl@0: /* sl@0: * Copyright (c) 2004 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: Implementation of the base class for effects. sl@0: * sl@0: */ sl@0: sl@0: sl@0: sl@0: // INCLUDE FILES sl@0: sl@0: #ifdef _DEBUG sl@0: #include sl@0: #endif sl@0: #include sl@0: #include sl@0: sl@0: // ============================ MEMBER FUNCTIONS =============================== sl@0: sl@0: // ----------------------------------------------------------------------------- sl@0: // CAudioEffect::CAudioEffect sl@0: // C++ default constructor can NOT contain any code, that sl@0: // might leave. sl@0: // ----------------------------------------------------------------------------- sl@0: // sl@0: EXPORT_C CAudioEffect::CAudioEffect() sl@0: : iEnabled(EFalse), sl@0: iEnforced(EFalse), sl@0: iHaveUpdateRights(ETrue) sl@0: { sl@0: } sl@0: sl@0: sl@0: // Destructor sl@0: EXPORT_C CAudioEffect::~CAudioEffect() sl@0: { sl@0: iObservers.Close(); sl@0: } sl@0: sl@0: // ----------------------------------------------------------------------------- sl@0: // CAudioEffect::IsEnable sl@0: // ----------------------------------------------------------------------------- sl@0: // sl@0: EXPORT_C TBool CAudioEffect::IsEnabled() const sl@0: { sl@0: return iEnabled; sl@0: } sl@0: sl@0: // ----------------------------------------------------------------------------- sl@0: // CAudioEffect::Enable sl@0: // ----------------------------------------------------------------------------- sl@0: // sl@0: EXPORT_C void CAudioEffect::EnableL() sl@0: { sl@0: iEnabled = ETrue; sl@0: ApplyL(); sl@0: } sl@0: sl@0: // ----------------------------------------------------------------------------- sl@0: // CAudioEffect::Disable sl@0: // ----------------------------------------------------------------------------- sl@0: // sl@0: EXPORT_C void CAudioEffect::DisableL() sl@0: { sl@0: iEnabled = EFalse; sl@0: ApplyL(); sl@0: } sl@0: sl@0: // ----------------------------------------------------------------------------- sl@0: // CAudioEffect::Enforce sl@0: // ----------------------------------------------------------------------------- sl@0: // sl@0: EXPORT_C void CAudioEffect::EnforceL( sl@0: TBool aEnforced ) sl@0: { sl@0: iEnforced = aEnforced; sl@0: ApplyL(); sl@0: } sl@0: sl@0: // ----------------------------------------------------------------------------- sl@0: // CAudioEffect::HaveUpdateRights sl@0: // ----------------------------------------------------------------------------- sl@0: // sl@0: EXPORT_C TBool CAudioEffect::HaveUpdateRights() const sl@0: { sl@0: return iHaveUpdateRights; sl@0: } sl@0: sl@0: // ----------------------------------------------------------------------------- sl@0: // CAudioEffect::IsEnforced sl@0: // ----------------------------------------------------------------------------- sl@0: // sl@0: EXPORT_C TBool CAudioEffect::IsEnforced() const sl@0: { sl@0: return iEnforced; sl@0: } sl@0: sl@0: // ----------------------------------------------------------------------------- sl@0: // CVolume::RegisterObserverL sl@0: // ----------------------------------------------------------------------------- sl@0: // sl@0: EXPORT_C void CAudioEffect::RegisterObserverL( sl@0: MAudioEffectObserver& aObserver ) sl@0: { sl@0: User::LeaveIfError(iObservers.Append(&aObserver)); sl@0: } sl@0: sl@0: // ----------------------------------------------------------------------------- sl@0: // CVolume::UnRegisterObserver sl@0: // ----------------------------------------------------------------------------- sl@0: // sl@0: EXPORT_C void CAudioEffect::UnRegisterObserver( sl@0: MAudioEffectObserver& aObserver ) sl@0: { sl@0: TInt index = iObservers.Find(&aObserver); sl@0: if( index != KErrNotFound ) sl@0: { sl@0: iObservers.Remove(index); sl@0: } sl@0: } sl@0: sl@0: // ========================== OTHER EXPORTED FUNCTIONS ========================= sl@0: sl@0: // End of File