os/mm/mm_pub/audio_effects_api/inc/AudioEffectBase.h
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/mm/mm_pub/audio_effects_api/inc/AudioEffectBase.h	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,161 @@
     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:  This is the definition of the audio effects base class.
    1.18 +*
    1.19 +*
    1.20 +*/
    1.21 +
    1.22 +
    1.23 +#ifndef CAUDIOEFFECT_H
    1.24 +#define CAUDIOEFFECT_H
    1.25 +
    1.26 +// INCLUDES
    1.27 +#include <e32base.h>
    1.28 +
    1.29 +// FORWARD DECLARATION
    1.30 +class MAudioEffectObserver;
    1.31 +
    1.32 +// CLASS DECLARATION
    1.33 +
    1.34 +/**
    1.35 +*  This is the base class for audio effects.
    1.36 +*
    1.37 +*  @lib AudioEffectBase.lib
    1.38 +*  @since 3.0
    1.39 +*/
    1.40 +
    1.41 +class CAudioEffect : public CBase
    1.42 +	{
    1.43 +
    1.44 +	public: // Constructors and destructor
    1.45 +
    1.46 +		/**
    1.47 +        *	Destructor
    1.48 +        */
    1.49 +		IMPORT_C virtual ~CAudioEffect();
    1.50 +
    1.51 +    public: // New functions
    1.52 +
    1.53 +		/**
    1.54 +        * Apply effect settings
    1.55 +        * @since 3.0
    1.56 +        */
    1.57 +		virtual void ApplyL() = 0;
    1.58 +
    1.59 +		/**
    1.60 +        * Disable the effect
    1.61 +        * @since 3.0
    1.62 +        */
    1.63 +		IMPORT_C virtual void DisableL();
    1.64 +
    1.65 +		/**
    1.66 +        * Enable the effect
    1.67 +        * @since 3.0
    1.68 +        */
    1.69 +		IMPORT_C virtual void EnableL();
    1.70 +
    1.71 +		/**
    1.72 +        * Enforce the effect.
    1.73 +        * @since 3.0
    1.74 +        * @param aEnforced Indicate the effect is to be enforced or not. ETrue = Enforced.
    1.75 +        */
    1.76 +		IMPORT_C virtual void EnforceL( TBool aEnforced );
    1.77 +
    1.78 +		/**
    1.79 +        * Check if this effect object currently has update rights.
    1.80 +        * A client can lose update rights in some hardware platforms where there are a limited
    1.81 +        * number of instances of an effect that can exist at the same time. When an effect instance
    1.82 +        * has lost update rights the user can still change settings, but any calls to Apply the
    1.83 +        * settings will be deferred until update rights are regained.
    1.84 +        * @since 3.0
    1.85 +        * @return ETrue if this object currently has rights to update the settings of this effect,
    1.86 +        *         EFalse otherwise.
    1.87 +        */
    1.88 +		IMPORT_C virtual TBool HaveUpdateRights() const;
    1.89 +
    1.90 +		/**
    1.91 +        * Check if the effect is enabled
    1.92 +        * @since 3.0
    1.93 +        * @return ETrue if the effect is enabled, EFalse if the effect is disabled.
    1.94 +        */
    1.95 +		IMPORT_C virtual TBool IsEnabled() const;
    1.96 +
    1.97 +		/**
    1.98 +        * Check if the effect is enforced.
    1.99 +        * @since 3.0
   1.100 +        * @return ETrue if the effect is enforced, EFalse if the effect isn ot enforced.
   1.101 +        */
   1.102 +		IMPORT_C virtual TBool IsEnforced() const;
   1.103 +
   1.104 +		/**
   1.105 +        * Adds the specified observer to the list of observers to be notified when
   1.106 +        * the effect object changes state.
   1.107 +        * @since 3.0
   1.108 +        * @param aObserver Object to be added to notifier list.
   1.109 +        */
   1.110 +		IMPORT_C void RegisterObserverL( MAudioEffectObserver& aObserver );
   1.111 +
   1.112 +		/*
   1.113 +        * Get the unique identifier of the audio effect
   1.114 +        * @since 3.0
   1.115 +        * @return Unique identifier of the audio effect object.
   1.116 +        */
   1.117 +		virtual TUid Uid() const = 0 ;
   1.118 +
   1.119 +		/**
   1.120 +        * Removes the specified observer from the list of observers.
   1.121 +        * @since 3.0
   1.122 +        * @param aObserver object to be removed.
   1.123 +        */
   1.124 +		IMPORT_C void UnRegisterObserver( MAudioEffectObserver& aObserver );
   1.125 +
   1.126 +	protected:
   1.127 +
   1.128 +		/**
   1.129 +		* Private C++ constructor for this class.
   1.130 +        * @since 3.0
   1.131 +        * @param aEffectObserver	reference to event observer object
   1.132 +        * @return -
   1.133 +        */
   1.134 +		IMPORT_C CAudioEffect();
   1.135 +
   1.136 +		/**
   1.137 +		* Internal function to package data into a descriptor.
   1.138 +        * @since 3.0
   1.139 +        * @return A descriptor containing the effect data.
   1.140 +        */
   1.141 +		virtual const TDesC8& DoEffectData() = 0 ;
   1.142 +
   1.143 +		/**
   1.144 +		* Internal function to unpack effect data
   1.145 +        * @since 3.0
   1.146 +        * @param aEffectDataBuffer Descriptor containing packed effect data
   1.147 +        */
   1.148 +        virtual void SetEffectData( const TDesC8& aEffectDataBuffer ) = 0;
   1.149 +
   1.150 +	protected: // Data
   1.151 +
   1.152 +		// Flag to indicate whether the effect is enabled or not
   1.153 +		TBool iEnabled;
   1.154 +		// Flag to indicate wheter the effect is enforced
   1.155 +		TBool iEnforced;
   1.156 +		// Flag to indicate wheter the effect current has update rights
   1.157 +		TBool iHaveUpdateRights;
   1.158 +		// Pointer to Observers
   1.159 +		RPointerArray<MAudioEffectObserver> iObservers;
   1.160 +	};
   1.161 +
   1.162 +#endif	// of CAUDIOEFFECT_H
   1.163 +
   1.164 +// End of File