2 * Copyright (c) 2004 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: This is the definition of the audio effects base class.
20 #ifndef CAUDIOEFFECT_H
21 #define CAUDIOEFFECT_H
26 // FORWARD DECLARATION
27 class MAudioEffectObserver;
32 * This is the base class for audio effects.
34 * @lib AudioEffectBase.lib
38 class CAudioEffect : public CBase
41 public: // Constructors and destructor
46 IMPORT_C virtual ~CAudioEffect();
48 public: // New functions
51 * Apply effect settings
54 virtual void ApplyL() = 0;
60 IMPORT_C virtual void DisableL();
66 IMPORT_C virtual void EnableL();
71 * @param aEnforced Indicate the effect is to be enforced or not. ETrue = Enforced.
73 IMPORT_C virtual void EnforceL( TBool aEnforced );
76 * Check if this effect object currently has update rights.
77 * A client can lose update rights in some hardware platforms where there are a limited
78 * number of instances of an effect that can exist at the same time. When an effect instance
79 * has lost update rights the user can still change settings, but any calls to Apply the
80 * settings will be deferred until update rights are regained.
82 * @return ETrue if this object currently has rights to update the settings of this effect,
85 IMPORT_C virtual TBool HaveUpdateRights() const;
88 * Check if the effect is enabled
90 * @return ETrue if the effect is enabled, EFalse if the effect is disabled.
92 IMPORT_C virtual TBool IsEnabled() const;
95 * Check if the effect is enforced.
97 * @return ETrue if the effect is enforced, EFalse if the effect isn ot enforced.
99 IMPORT_C virtual TBool IsEnforced() const;
102 * Adds the specified observer to the list of observers to be notified when
103 * the effect object changes state.
105 * @param aObserver Object to be added to notifier list.
107 IMPORT_C void RegisterObserverL( MAudioEffectObserver& aObserver );
110 * Get the unique identifier of the audio effect
112 * @return Unique identifier of the audio effect object.
114 virtual TUid Uid() const = 0 ;
117 * Removes the specified observer from the list of observers.
119 * @param aObserver object to be removed.
121 IMPORT_C void UnRegisterObserver( MAudioEffectObserver& aObserver );
126 * Private C++ constructor for this class.
128 * @param aEffectObserver reference to event observer object
131 IMPORT_C CAudioEffect();
134 * Internal function to package data into a descriptor.
136 * @return A descriptor containing the effect data.
138 virtual const TDesC8& DoEffectData() = 0 ;
141 * Internal function to unpack effect data
143 * @param aEffectDataBuffer Descriptor containing packed effect data
145 virtual void SetEffectData( const TDesC8& aEffectDataBuffer ) = 0;
149 // Flag to indicate whether the effect is enabled or not
151 // Flag to indicate wheter the effect is enforced
153 // Flag to indicate wheter the effect current has update rights
154 TBool iHaveUpdateRights;
155 // Pointer to Observers
156 RPointerArray<MAudioEffectObserver> iObservers;
159 #endif // of CAUDIOEFFECT_H