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: This is the definition of the audio effects base class. sl@0: * sl@0: * sl@0: */ sl@0: sl@0: sl@0: #ifndef CAUDIOEFFECT_H sl@0: #define CAUDIOEFFECT_H sl@0: sl@0: // INCLUDES sl@0: #include sl@0: sl@0: // FORWARD DECLARATION sl@0: class MAudioEffectObserver; sl@0: sl@0: // CLASS DECLARATION sl@0: sl@0: /** sl@0: * This is the base class for audio effects. sl@0: * sl@0: * @lib AudioEffectBase.lib sl@0: * @since 3.0 sl@0: */ sl@0: sl@0: class CAudioEffect : public CBase sl@0: { sl@0: sl@0: public: // Constructors and destructor sl@0: sl@0: /** sl@0: * Destructor sl@0: */ sl@0: IMPORT_C virtual ~CAudioEffect(); sl@0: sl@0: public: // New functions sl@0: sl@0: /** sl@0: * Apply effect settings sl@0: * @since 3.0 sl@0: */ sl@0: virtual void ApplyL() = 0; sl@0: sl@0: /** sl@0: * Disable the effect sl@0: * @since 3.0 sl@0: */ sl@0: IMPORT_C virtual void DisableL(); sl@0: sl@0: /** sl@0: * Enable the effect sl@0: * @since 3.0 sl@0: */ sl@0: IMPORT_C virtual void EnableL(); sl@0: sl@0: /** sl@0: * Enforce the effect. sl@0: * @since 3.0 sl@0: * @param aEnforced Indicate the effect is to be enforced or not. ETrue = Enforced. sl@0: */ sl@0: IMPORT_C virtual void EnforceL( TBool aEnforced ); sl@0: sl@0: /** sl@0: * Check if this effect object currently has update rights. sl@0: * A client can lose update rights in some hardware platforms where there are a limited sl@0: * number of instances of an effect that can exist at the same time. When an effect instance sl@0: * has lost update rights the user can still change settings, but any calls to Apply the sl@0: * settings will be deferred until update rights are regained. sl@0: * @since 3.0 sl@0: * @return ETrue if this object currently has rights to update the settings of this effect, sl@0: * EFalse otherwise. sl@0: */ sl@0: IMPORT_C virtual TBool HaveUpdateRights() const; sl@0: sl@0: /** sl@0: * Check if the effect is enabled sl@0: * @since 3.0 sl@0: * @return ETrue if the effect is enabled, EFalse if the effect is disabled. sl@0: */ sl@0: IMPORT_C virtual TBool IsEnabled() const; sl@0: sl@0: /** sl@0: * Check if the effect is enforced. sl@0: * @since 3.0 sl@0: * @return ETrue if the effect is enforced, EFalse if the effect isn ot enforced. sl@0: */ sl@0: IMPORT_C virtual TBool IsEnforced() const; sl@0: sl@0: /** sl@0: * Adds the specified observer to the list of observers to be notified when sl@0: * the effect object changes state. sl@0: * @since 3.0 sl@0: * @param aObserver Object to be added to notifier list. sl@0: */ sl@0: IMPORT_C void RegisterObserverL( MAudioEffectObserver& aObserver ); sl@0: sl@0: /* sl@0: * Get the unique identifier of the audio effect sl@0: * @since 3.0 sl@0: * @return Unique identifier of the audio effect object. sl@0: */ sl@0: virtual TUid Uid() const = 0 ; sl@0: sl@0: /** sl@0: * Removes the specified observer from the list of observers. sl@0: * @since 3.0 sl@0: * @param aObserver object to be removed. sl@0: */ sl@0: IMPORT_C void UnRegisterObserver( MAudioEffectObserver& aObserver ); sl@0: sl@0: protected: sl@0: sl@0: /** sl@0: * Private C++ constructor for this class. sl@0: * @since 3.0 sl@0: * @param aEffectObserver reference to event observer object sl@0: * @return - sl@0: */ sl@0: IMPORT_C CAudioEffect(); sl@0: sl@0: /** sl@0: * Internal function to package data into a descriptor. sl@0: * @since 3.0 sl@0: * @return A descriptor containing the effect data. sl@0: */ sl@0: virtual const TDesC8& DoEffectData() = 0 ; sl@0: sl@0: /** sl@0: * Internal function to unpack effect data sl@0: * @since 3.0 sl@0: * @param aEffectDataBuffer Descriptor containing packed effect data sl@0: */ sl@0: virtual void SetEffectData( const TDesC8& aEffectDataBuffer ) = 0; sl@0: sl@0: protected: // Data sl@0: sl@0: // Flag to indicate whether the effect is enabled or not sl@0: TBool iEnabled; sl@0: // Flag to indicate wheter the effect is enforced sl@0: TBool iEnforced; sl@0: // Flag to indicate wheter the effect current has update rights sl@0: TBool iHaveUpdateRights; sl@0: // Pointer to Observers sl@0: RPointerArray iObservers; sl@0: }; sl@0: sl@0: #endif // of CAUDIOEFFECT_H sl@0: sl@0: // End of File