1.1 --- a/epoc32/include/audioeffectbase.h Tue Nov 24 13:55:44 2009 +0000
1.2 +++ b/epoc32/include/audioeffectbase.h Tue Mar 16 16:12:26 2010 +0000
1.3 @@ -1,1 +1,161 @@
1.4 -audioeffectbase.h
1.5 +/*
1.6 +* Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies).
1.7 +* All rights reserved.
1.8 +* This component and the accompanying materials are made available
1.9 +* under the terms of the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
1.10 +* which accompanies this distribution, and is available
1.11 +* at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
1.12 +*
1.13 +* Initial Contributors:
1.14 +* Nokia Corporation - initial contribution.
1.15 +*
1.16 +* Contributors:
1.17 +*
1.18 +* Description: This is the definition of the audio effects base class.
1.19 +*
1.20 +*
1.21 +*/
1.22 +
1.23 +
1.24 +#ifndef CAUDIOEFFECT_H
1.25 +#define CAUDIOEFFECT_H
1.26 +
1.27 +// INCLUDES
1.28 +#include <e32base.h>
1.29 +
1.30 +// FORWARD DECLARATION
1.31 +class MAudioEffectObserver;
1.32 +
1.33 +// CLASS DECLARATION
1.34 +
1.35 +/**
1.36 +* This is the base class for audio effects.
1.37 +*
1.38 +* @lib AudioEffectBase.lib
1.39 +* @since 3.0
1.40 +*/
1.41 +
1.42 +class CAudioEffect : public CBase
1.43 + {
1.44 +
1.45 + public: // Constructors and destructor
1.46 +
1.47 + /**
1.48 + * Destructor
1.49 + */
1.50 + IMPORT_C virtual ~CAudioEffect();
1.51 +
1.52 + public: // New functions
1.53 +
1.54 + /**
1.55 + * Apply effect settings
1.56 + * @since 3.0
1.57 + */
1.58 + virtual void ApplyL() = 0;
1.59 +
1.60 + /**
1.61 + * Disable the effect
1.62 + * @since 3.0
1.63 + */
1.64 + IMPORT_C virtual void DisableL();
1.65 +
1.66 + /**
1.67 + * Enable the effect
1.68 + * @since 3.0
1.69 + */
1.70 + IMPORT_C virtual void EnableL();
1.71 +
1.72 + /**
1.73 + * Enforce the effect.
1.74 + * @since 3.0
1.75 + * @param aEnforced Indicate the effect is to be enforced or not. ETrue = Enforced.
1.76 + */
1.77 + IMPORT_C virtual void EnforceL( TBool aEnforced );
1.78 +
1.79 + /**
1.80 + * Check if this effect object currently has update rights.
1.81 + * A client can lose update rights in some hardware platforms where there are a limited
1.82 + * number of instances of an effect that can exist at the same time. When an effect instance
1.83 + * has lost update rights the user can still change settings, but any calls to Apply the
1.84 + * settings will be deferred until update rights are regained.
1.85 + * @since 3.0
1.86 + * @return ETrue if this object currently has rights to update the settings of this effect,
1.87 + * EFalse otherwise.
1.88 + */
1.89 + IMPORT_C virtual TBool HaveUpdateRights() const;
1.90 +
1.91 + /**
1.92 + * Check if the effect is enabled
1.93 + * @since 3.0
1.94 + * @return ETrue if the effect is enabled, EFalse if the effect is disabled.
1.95 + */
1.96 + IMPORT_C virtual TBool IsEnabled() const;
1.97 +
1.98 + /**
1.99 + * Check if the effect is enforced.
1.100 + * @since 3.0
1.101 + * @return ETrue if the effect is enforced, EFalse if the effect isn ot enforced.
1.102 + */
1.103 + IMPORT_C virtual TBool IsEnforced() const;
1.104 +
1.105 + /**
1.106 + * Adds the specified observer to the list of observers to be notified when
1.107 + * the effect object changes state.
1.108 + * @since 3.0
1.109 + * @param aObserver Object to be added to notifier list.
1.110 + */
1.111 + IMPORT_C void RegisterObserverL( MAudioEffectObserver& aObserver );
1.112 +
1.113 + /*
1.114 + * Get the unique identifier of the audio effect
1.115 + * @since 3.0
1.116 + * @return Unique identifier of the audio effect object.
1.117 + */
1.118 + virtual TUid Uid() const = 0 ;
1.119 +
1.120 + /**
1.121 + * Removes the specified observer from the list of observers.
1.122 + * @since 3.0
1.123 + * @param aObserver object to be removed.
1.124 + */
1.125 + IMPORT_C void UnRegisterObserver( MAudioEffectObserver& aObserver );
1.126 +
1.127 + protected:
1.128 +
1.129 + /**
1.130 + * Private C++ constructor for this class.
1.131 + * @since 3.0
1.132 + * @param aEffectObserver reference to event observer object
1.133 + * @return -
1.134 + */
1.135 + IMPORT_C CAudioEffect();
1.136 +
1.137 + /**
1.138 + * Internal function to package data into a descriptor.
1.139 + * @since 3.0
1.140 + * @return A descriptor containing the effect data.
1.141 + */
1.142 + virtual const TDesC8& DoEffectData() = 0 ;
1.143 +
1.144 + /**
1.145 + * Internal function to unpack effect data
1.146 + * @since 3.0
1.147 + * @param aEffectDataBuffer Descriptor containing packed effect data
1.148 + */
1.149 + virtual void SetEffectData( const TDesC8& aEffectDataBuffer ) = 0;
1.150 +
1.151 + protected: // Data
1.152 +
1.153 + // Flag to indicate whether the effect is enabled or not
1.154 + TBool iEnabled;
1.155 + // Flag to indicate wheter the effect is enforced
1.156 + TBool iEnforced;
1.157 + // Flag to indicate wheter the effect current has update rights
1.158 + TBool iHaveUpdateRights;
1.159 + // Pointer to Observers
1.160 + RPointerArray<MAudioEffectObserver> iObservers;
1.161 + };
1.162 +
1.163 +#endif // of CAUDIOEFFECT_H
1.164 +
1.165 +// End of File