mmfenh/enhancedmediaclient/Client/src/Components/AudioEffects/ReverbEffectImpl.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 REVERBEFFECTIMPL_H
       
    20 #define REVERBEFFECTIMPL_H
       
    21 
       
    22 #include <e32base.h>
       
    23 #include <ReverbControl.h>
       
    24 #include "EffectControlBase.h"
       
    25 #include <EnvironmentalReverbProxy.h>
       
    26 #include <MAudioEffectObserver.h>
       
    27 
       
    28 namespace multimedia
       
    29     {
       
    30 	class MControlObserver;
       
    31     class CReverbEffect : public CBase,
       
    32                           public MReverbControl,
       
    33                           public MAudioEffectObserver,
       
    34                           public CEffectControlBase
       
    35         {
       
    36     public:
       
    37         CReverbEffect();
       
    38         ~CReverbEffect();
       
    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 MAudioEffectControl
       
    53 		/**
       
    54         * Disable the effect
       
    55         * @since 5.0
       
    56         */
       
    57 		TInt Disable();
       
    58 
       
    59 		/**
       
    60         * Enable the effect
       
    61         * @since 5.0
       
    62         */
       
    63 		TInt Enable();
       
    64 
       
    65 		/**
       
    66         * Enforce the effect.
       
    67         * @since 5.0
       
    68         * @param aEnforced Indicate the effect is to be enforced or not. ETrue = Enforced.
       
    69         */
       
    70 		TInt Enforce( TBool &aEnforced );
       
    71 
       
    72 		/**
       
    73         * Check if this effect object currently has update rights.
       
    74         * A client can lose update rights in some hardware platforms where there are a limited
       
    75         * number of instances of an effect that can exist at the same time. When an effect instance
       
    76         * has lost update rights the user can still change settings, but any calls to Apply the
       
    77         * settings will be deferred until update rights are regained.
       
    78         * @since 5.0
       
    79         * @return ETrue if this object currently has rights to update the settings of this effect,
       
    80         *         EFalse otherwise.
       
    81         */
       
    82 		TInt HaveUpdateRights(TBool &aHaveUpdateRights);
       
    83 
       
    84 		/**
       
    85         * Check if the effect is enabled
       
    86         * @since 5.0
       
    87         * @return ETrue if the effect is enabled, EFalse if the effect is disabled.
       
    88         */
       
    89 		TInt IsEnabled(TBool &aEnabled);
       
    90 
       
    91 		/**
       
    92         * Check if the effect is enforced.
       
    93         * @since 5.0
       
    94         * @return ETrue if the effect is enforced, EFalse if the effect isn ot enforced.
       
    95         */
       
    96 		TInt IsEnforced(TBool &aEnforced);
       
    97 
       
    98 		/*
       
    99         * Get the unique identifier of the audio effect
       
   100         * @since 5.0
       
   101         * @return Unique identifier of the audio effect object.
       
   102         */
       
   103 		TInt Uid(TUid &aUid);
       
   104 		// From MAudioEffectControl Ends
       
   105 
       
   106 		// MReverbControl Begins
       
   107 		
       
   108         /**
       
   109         * Gets the decay HF Ratio in hundredths
       
   110         * @since 5.0
       
   111         * @return decay HF Ratio
       
   112         */
       
   113         TInt DecayHFRatio(TUint &aRatio);
       
   114 
       
   115         /**
       
   116         * Gets the reverb decay HF Ratio minimum and maximum in hundredths.
       
   117         * @since 5.0
       
   118         * @param aMin Minimum decay HF Ratio
       
   119         * @param aMax Maximum decay HF Ratio
       
   120         */
       
   121         TInt DecayHFRatioRange(TUint& aMin, TUint& aMax);
       
   122 
       
   123         /**
       
   124         * Gets the decay time in milliseconds
       
   125         * @since 5.0
       
   126         * @return decay time
       
   127         */
       
   128         TInt DecayTime(TUint &aDecayTime);
       
   129 
       
   130         /**
       
   131         * Gets the allowable reverb decay time range in milliseconds.
       
   132         * @since 5.0
       
   133         * @param aMin Minimum decay time in milliseconds
       
   134         * @param aMax Maximum decay time in milliseconds
       
   135         */
       
   136         TInt DecayTimeRange(TUint& aMin, TUint& aMax);
       
   137 
       
   138         /**
       
   139         * Gets the density current value as a percentage in hundredths
       
   140         * @since 5.0
       
   141         * @return density value
       
   142         */
       
   143         TInt Density(TUint &aDensity);
       
   144 
       
   145         /**
       
   146         * Gets the diffusion current value as a percentage in hundredths.
       
   147         * @since 5.0
       
   148         * @return diffusion value
       
   149         */
       
   150         TInt Diffusion(TUint &aDiffusion);
       
   151 
       
   152         /**
       
   153         * Gets the reverb reflections delay in ms.
       
   154         * @since 5.0
       
   155         * @return reverb reflections delay
       
   156         */
       
   157         TInt ReflectionsDelay(TUint &aDelay);
       
   158 
       
   159         /**
       
   160         * Gets the reverb reflections delay maximum in milliseconds.
       
   161         * @since 5.0
       
   162         * @return reverb reflections delay maximum
       
   163         */
       
   164         TInt ReflectionsDelayMax(TUint &aDelayMax);
       
   165 
       
   166         /**
       
   167         * Gets the reverb reflections level in mB
       
   168         * @since 5.0
       
   169         * @return Reverb reflections level
       
   170         */
       
   171         TInt ReflectionsLevel(TInt &aLevel);
       
   172 
       
   173         /**
       
   174         * Gets the reverb reflections level maximum and minimum in mB
       
   175         * @since 5.0
       
   176         * @param aMin Minimum reflections level
       
   177         * @param aMax Maximum reflections level
       
   178         */
       
   179         TInt ReflectionLevelRange( TInt& aMin, TInt& aMax );
       
   180 
       
   181         /**
       
   182         * Gets the reverb delay in milliseconds
       
   183         * @since 5.0
       
   184         * @return reverb delay
       
   185         */
       
   186         TInt ReverbDelay(TUint &aDelay);
       
   187 
       
   188         /**
       
   189         * Gets the reverb delay maximum in milliseconds
       
   190         * @since 5.0
       
   191         * @return reverb delay maximum
       
   192         */
       
   193         TInt ReverbDelayMax(TUint &aDelayMax);
       
   194 
       
   195         /**
       
   196         * Gets the reverb current level in mB
       
   197         * @since 5.0
       
   198         * @return reverb current level
       
   199         */
       
   200         TInt ReverbLevel(TInt &aLevel);
       
   201 
       
   202         /**
       
   203         * Gets the reverb current level maximum and minimum in mB
       
   204         * @since 5.0
       
   205         * @param aMin Minimum current level
       
   206         * @param aMax Maximum current level
       
   207         * @return -
       
   208         */
       
   209         TInt ReverbLevelRange( TInt& aMin, TInt& aMax );
       
   210 
       
   211         /**
       
   212         * Gets the room HF level current ratio
       
   213         * @since 5.0
       
   214         * @return room HF level ratio
       
   215         */
       
   216         TInt RoomHFLevel(TInt &aLevel);
       
   217 
       
   218         /**
       
   219         * Gets the room HF level maximum and minimum ratios
       
   220         * @since 5.0
       
   221         * @param aMin Minimum current room HF level
       
   222         * @param aMax Maximum current room HF level
       
   223         * @return -
       
   224         */
       
   225         TInt RoomHFLevelRange( TInt& aMin, TInt& aMax );
       
   226 
       
   227         /**
       
   228         * Gets the room level current value in mB
       
   229         * @since 5.0
       
   230         * @return room level value
       
   231         */
       
   232         TInt RoomLevel(TInt &aLevel);
       
   233 
       
   234         /**
       
   235         * Gets the room level maximum and minimum in mB
       
   236         * @since 5.0
       
   237         * @param aMin Minimum current room level
       
   238         * @param aMax Maximum current room level
       
   239         * @return -
       
   240         */
       
   241         TInt RoomLevelRange( TInt& aMin, TInt& aMax );
       
   242 
       
   243         /**
       
   244         * Sets the decay HF Ratio in hundredths
       
   245         * @since 5.0
       
   246         * @param aDecayHFRatio The decay high frequence ratio in hundredths
       
   247         * @return -
       
   248         */
       
   249         TInt SetDecayHFRatio( TUint aDecayHFRatio );
       
   250 
       
   251         /**
       
   252         * Sets the decay time in millisecond
       
   253         * @since 5.0
       
   254         * @param aDecayTime Decay time in ms
       
   255         */
       
   256         TInt SetDecayTime( TUint aDecayTime );
       
   257 
       
   258         /**
       
   259         * Sets the density value as percentage in hundredths
       
   260         * @since 5.0
       
   261         * @param aDensity The density.
       
   262         */
       
   263         TInt SetDensity( TUint aDensity );
       
   264 
       
   265         /**
       
   266         * Sets the diffusion value as a percentage in hundredths
       
   267         * @since 5.0
       
   268         * @param aDiffusion The diffusion.
       
   269         */
       
   270         TInt SetDiffusion( TUint aDiffusion );
       
   271 
       
   272         /**
       
   273         * Sets the reverb reflections delay
       
   274         * @since 5.0
       
   275         * @param aRefectionsDelay The reflection delay in ms.
       
   276         */
       
   277         TInt SetReflectionsDelay( TUint aReflectionsDelay );
       
   278 
       
   279         /**
       
   280         * Sets the reverb reflections level in milli-dB
       
   281         * @since 5.0
       
   282         * @param aRefectionsLevel The reflection level in mB
       
   283         */
       
   284         TInt SetReflectionsLevel( TInt aReflectionsLevel );
       
   285 
       
   286         /**
       
   287         * Sets the reverb delay
       
   288         * @since 5.0
       
   289         * @param aReverbDelay The reverb delay in ms
       
   290         */
       
   291         TInt SetReverbDelay( TUint aReverbDelay );
       
   292 
       
   293         /**
       
   294         * Sets the reverb level
       
   295         * @since 5.0
       
   296         * @param aReverbLevel The reverb level in mB
       
   297         */
       
   298         TInt SetReverbLevel( TInt aReverbLevel );
       
   299 
       
   300         /**
       
   301         * Sets the room HF level ratio
       
   302         * @since 5.0
       
   303         * @param aRoomHFLevel The room high frequency ratio
       
   304         */
       
   305         TInt SetRoomHFLevel( TInt aRoomHFLevel );
       
   306 
       
   307         /**
       
   308         * Sets the room level value in milli-dB
       
   309         * @since 5.0
       
   310         * @param aRoomLevel The room level
       
   311         */
       
   312         TInt SetRoomLevel( TInt aRoomLevel );
       
   313 
       
   314         /**
       
   315         * Gets the total delay maximum in milliseconds
       
   316         * @since 5.0
       
   317         * @return reverb delay maximum
       
   318         */
       
   319         TInt DelayMax(TUint &aDelayMax);
       
   320 		
       
   321 		// MReverbControl Ends
       
   322 		
       
   323         // MAudioEffectObserver begins
       
   324         void EffectChanged( const CAudioEffect* aObservedEffect, TUint8 aEvent );
       
   325         // MAudioEffectObserver ends
       
   326         
       
   327         // From CEffectControlBase begins
       
   328         void Event( TEffectControlEvent aEvent );
       
   329         // From CEffectControlBase ends
       
   330         
       
   331         TInt GetCEnvironmentalReverb( CEnvironmentalReverb*& aOutEnvRev );
       
   332     
       
   333     private:
       
   334         TInt DoApply(); 
       
   335         TInt CreateEffectProxy();
       
   336         TInt DeleteEffectProxy();       
       
   337         TInt SavePreviousSettings();   
       
   338     
       
   339     private:
       
   340         CEnvironmentalReverbProxy* iReverbProxy;
       
   341         CEnvironmentalReverbProxy* iPrevReverbProxy;
       
   342         TMMFMessageDestinationPckg iMsgHndlrHandlePckg;
       
   343         MCustomCommand* iCustomCommand;    
       
   344         RPointerArray<MControlObserver> iObservers;    
       
   345         };
       
   346     } // namespace multimedia
       
   347 
       
   348 #endif // REVERBEFFECTIMPL_H
       
   349 
       
   350 // End of file