mmfenh/enhancedmediaclient/Client/src/Components/AudioEffects/EqualizerEffectImpl.h
changeset 0 71ca22bcf22a
equal deleted inserted replaced
-1:000000000000 0:71ca22bcf22a
       
     1 /*
       
     2 * Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
       
     3 * All rights reserved.
       
     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".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:  Project file for EnhancedMediaClient Utility
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef EQUALIZEREFFECTIMPL_H
       
    20 #define EQUALIZEREFFECTIMPL_H
       
    21 
       
    22 #include <e32base.h>
       
    23 #include <EqualizerControl.h>
       
    24 #include "EffectControlBase.h"
       
    25 #include <AudioEqualizerProxy.h>
       
    26 #include <MAudioEffectObserver.h>
       
    27 
       
    28 namespace multimedia
       
    29     {
       
    30 	class MControlObserver;
       
    31     class CEqualizerEffect : public CBase,
       
    32                           public MEqualizerControl,
       
    33                           public MAudioEffectObserver,
       
    34                           public CEffectControlBase
       
    35         {
       
    36     public:
       
    37         CEqualizerEffect();
       
    38         ~CEqualizerEffect();
       
    39         TInt PostConstructor();
       
    40 
       
    41         // From MControl begins
       
    42         TInt AddObserver( MControlObserver& aObserver );
       
    43         TInt RemoveObserver( MControlObserver& aObserver );
       
    44         TUid Type();
       
    45         TControlType ControlType();  
       
    46         // From MControl ends
       
    47 
       
    48         // From MEffectControl begins
       
    49         TInt Apply();
       
    50         // From MEffectControl ends
       
    51         
       
    52         // From MEqualizerEffect begins
       
    53 		/**
       
    54         * Get the band level in mB for the specified band
       
    55         * @since 3.0
       
    56         * @param aBand Frequency Band
       
    57         * @return Returns the band level in mB for the specified band
       
    58         */
       
    59 		TInt BandLevel( TInt& aBand, TInt& aBandLevel );
       
    60 
       
    61 		/**
       
    62         * Get the band width in Hz for the specified band.
       
    63         * @since 3.0
       
    64         * @param aBand Frequency Band
       
    65         * @return The band width in Hz for the specified band
       
    66         */
       
    67 		TInt BandWidth( TInt& aBand, TInt& aBandWidth );
       
    68 
       
    69 		/**
       
    70         * Get the center frequency in Hz for a given band
       
    71         * @since 3.0
       
    72         * @param aBand Frequency Band
       
    73         * @return The center frequency in Hz for a given band.
       
    74         */
       
    75 		TInt CenterFrequency( TInt& aBand, TInt& aCenterFrequency );
       
    76 
       
    77 		/**
       
    78         * Get the cross-over frequency between the given frequency band (aBand) and the next band
       
    79         * @since 3.0
       
    80         * @param aBand Frequency Band
       
    81         * @return Crossover frequency.
       
    82         */
       
    83 		TInt CrossoverFrequency( TInt& aBand, TInt& aCrossoverFreq );
       
    84 
       
    85 		/**
       
    86         * Get the dB range in mB for the equalizer
       
    87         * @since 3.0
       
    88         * @param aMin Minimum level in dB
       
    89         * @param aMin Maximum level in dB
       
    90         */
       
    91 		TInt DbLevelLimits( TInt& aMin, TInt& aMax );
       
    92 
       
    93 		/**
       
    94         * Get number of equalizer bands.
       
    95         * @since 3.0
       
    96         * @param -
       
    97         * @return The number of equalizer bands.
       
    98         */
       
    99 		TInt NumberOfBands(TInt& aNumberofBands);
       
   100 
       
   101 		/**
       
   102         * Sets the equalizer band level value in mB, ranging from Min to Max
       
   103         * @since 3.0
       
   104         * @param aBand Frequency Band
       
   105         * @param aLevel band level in dB, ranges from DbLevelLimits()
       
   106         * @return -
       
   107         */
       
   108 		TInt SetBandLevel( TInt& aBand, TInt& aLevel );
       
   109 
       
   110        // From MEqualizerEffect ends
       
   111 
       
   112 		// From MAudioEffectControl
       
   113 		/**
       
   114         * Disable the effect
       
   115         * @since 5.0
       
   116         */
       
   117 		TInt Disable();
       
   118 
       
   119 		/**
       
   120         * Enable the effect
       
   121         * @since 5.0
       
   122         */
       
   123 		TInt Enable();
       
   124 
       
   125 		/**
       
   126         * Enforce the effect.
       
   127         * @since 5.0
       
   128         * @param aEnforced Indicate the effect is to be enforced or not. ETrue = Enforced.
       
   129         */
       
   130 		TInt Enforce( TBool &aEnforced );
       
   131 
       
   132 		/**
       
   133         * Check if this effect object currently has update rights.
       
   134         * A client can lose update rights in some hardware platforms where there are a limited
       
   135         * number of instances of an effect that can exist at the same time. When an effect instance
       
   136         * has lost update rights the user can still change settings, but any calls to Apply the
       
   137         * settings will be deferred until update rights are regained.
       
   138         * @since 5.0
       
   139         * @return ETrue if this object currently has rights to update the settings of this effect,
       
   140         *         EFalse otherwise.
       
   141         */
       
   142 		TInt HaveUpdateRights(TBool &aHaveUpdateRights);
       
   143 
       
   144 		/**
       
   145         * Check if the effect is enabled
       
   146         * @since 5.0
       
   147         * @return ETrue if the effect is enabled, EFalse if the effect is disabled.
       
   148         */
       
   149 		TInt IsEnabled(TBool &aEnabled);
       
   150 
       
   151 		/**
       
   152         * Check if the effect is enforced.
       
   153         * @since 5.0
       
   154         * @return ETrue if the effect is enforced, EFalse if the effect isn ot enforced.
       
   155         */
       
   156 		TInt IsEnforced(TBool &aEnforced);
       
   157 
       
   158 		/*
       
   159         * Get the unique identifier of the audio effect
       
   160         * @since 5.0
       
   161         * @return Unique identifier of the audio effect object.
       
   162         */
       
   163 		TInt Uid(TUid &aUid);
       
   164 		// From MAudioEffectControl Ends
       
   165         // MAudioEffectObserver begins
       
   166         void EffectChanged( const CAudioEffect* aObservedEffect, TUint8 aEvent );
       
   167         // MAudioEffectObserver ends
       
   168         
       
   169         // From CEffectControlBase begins
       
   170         void Event( TEffectControlEvent aEvent );
       
   171         // From CEffectControlBase ends
       
   172     
       
   173     private:
       
   174         TInt DoApply();        
       
   175         TInt CreateEffectProxy();
       
   176         TInt DeleteEffectProxy();    
       
   177         TInt SavePreviousSettings();   
       
   178     
       
   179     private:
       
   180         CAudioEqualizerProxy* iEqualizerProxy;
       
   181         CAudioEqualizerProxy* iPrevEqualizerProxy;
       
   182         TMMFMessageDestinationPckg iMsgHndlrHandlePckg;
       
   183         MCustomCommand* iCustomCommand;        
       
   184         RPointerArray<MControlObserver> iObservers;    
       
   185         };
       
   186     } // namespace multimedia
       
   187 
       
   188 #endif // EQUALIZEREFFECTIMPL_H
       
   189 
       
   190 // End of file