mmfenh/enhancedmediaclient/Client/src/Components/AudioEffects/DistanceAttenuationEffectImpl.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 DistanceAttenuationEFFECTIMPL_H
       
    20 #define DistanceAttenuationEFFECTIMPL_H
       
    21 
       
    22 #include <e32base.h>
       
    23 #include <DistanceAttenuationControl.h>
       
    24 #include "EffectControlBase.h"
       
    25 #include <DistanceAttenuationProxy.h>
       
    26 #include <MAudioEffectObserver.h>
       
    27 
       
    28 namespace multimedia
       
    29     {
       
    30 	class MControlObserver;
       
    31     class CDistanceAttenuationEffect : public CBase,
       
    32                           public MDistanceAttenuationControl,
       
    33                           public MAudioEffectObserver,
       
    34                           public CEffectControlBase
       
    35         {
       
    36     public:
       
    37         CDistanceAttenuationEffect();
       
    38         ~CDistanceAttenuationEffect();
       
    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         * Gets the Distance Attenuation of the listener.
       
    53         * @since 3.0
       
    54         * @param aRMin The source-to-listener distance below which the sound level is constant
       
    55         * @param aRMax The source-to-listener distance above which the sound level is constant or zero
       
    56         * @param aMuteAfterMax Indicate if the sound is muted beyond RMax
       
    57         * @param aRollOffFactor Multiplier factor to source-to-listener distance
       
    58         * @param aRoomRollOffFactor Multiplier factor to source-to-listener distance for Room effect.
       
    59         * @return -
       
    60         */
       
    61         TInt DistanceAttenuation( TInt& aRMin, TInt& aRMax, TBool& aMuteAfterMax,
       
    62                                            TUint& aRollOffFactor, TUint& aRoomRollOffFactor );
       
    63 
       
    64         /**
       
    65         * Get roll off factor maximum value.
       
    66         * @since 3.0
       
    67         * @param aRollOffFactor The maximum multiplier factor to source-to-listener distance for Room effect.
       
    68         * @return -
       
    69         */
       
    70         TInt RollOffFactorMax( TUint& aRollOfFactorMax );
       
    71 
       
    72         /**
       
    73         * Get room roll off factor maximum value.
       
    74         * @since 3.0
       
    75         * @param aRollOffFactor The maximum multiplier factor to source-to-listener distance for Room effect.
       
    76         * @return -
       
    77         */
       
    78         TInt RoomRollOffFactorMax( TUint& aRoomRollOfFactorMax );
       
    79 
       
    80         /**
       
    81         * Sets the Distance Attenuation
       
    82         * @since 3.0
       
    83         * @param aRMin The source-to-listener distance below which the sound level is constant
       
    84         * @param aRMax The source-to-listener distance above which the sound level is constant or zero
       
    85         * @param aMuteAfterMax Indicate if the sound is muted beyond RMax
       
    86         * @param aRollOffFactor Multiplier factor to source-to-listener distance
       
    87         * @param aRoomRollOffFactor Multiplier factor to source-to-listener distance for Room effect.
       
    88         * @return -
       
    89         */
       
    90         TInt SetDistanceAttenuation( TInt aRMin, TInt aRMax, TBool aMuteAfterMax,
       
    91                                                TUint aRollOffFactor, TUint aRoomRollOffFactor );
       
    92         
       
    93         // From MDistanceAttenuationEffect begins
       
    94 
       
    95        // From MDistanceAttenuationEffect ends
       
    96 
       
    97 		// From MAudioEffectControl
       
    98 		/**
       
    99         * Disable the effect
       
   100         * @since 5.0
       
   101         */
       
   102 		TInt Disable();
       
   103 
       
   104 		/**
       
   105         * Enable the effect
       
   106         * @since 5.0
       
   107         */
       
   108 		TInt Enable();
       
   109 
       
   110 		/**
       
   111         * Enforce the effect.
       
   112         * @since 5.0
       
   113         * @param aEnforced Indicate the effect is to be enforced or not. ETrue = Enforced.
       
   114         */
       
   115 		TInt Enforce( TBool &aEnforced );
       
   116 
       
   117 		/**
       
   118         * Check if this effect object currently has update rights.
       
   119         * A client can lose update rights in some hardware platforms where there are a limited
       
   120         * number of instances of an effect that can exist at the same time. When an effect instance
       
   121         * has lost update rights the user can still change settings, but any calls to Apply the
       
   122         * settings will be deferred until update rights are regained.
       
   123         * @since 5.0
       
   124         * @return ETrue if this object currently has rights to update the settings of this effect,
       
   125         *         EFalse otherwise.
       
   126         */
       
   127 		TInt HaveUpdateRights(TBool &aHaveUpdateRights);
       
   128 
       
   129 		/**
       
   130         * Check if the effect is enabled
       
   131         * @since 5.0
       
   132         * @return ETrue if the effect is enabled, EFalse if the effect is disabled.
       
   133         */
       
   134 		TInt IsEnabled(TBool &aEnabled);
       
   135 
       
   136 		/**
       
   137         * Check if the effect is enforced.
       
   138         * @since 5.0
       
   139         * @return ETrue if the effect is enforced, EFalse if the effect isn ot enforced.
       
   140         */
       
   141 		TInt IsEnforced(TBool &aEnforced);
       
   142 
       
   143 		/*
       
   144         * Get the unique identifier of the audio effect
       
   145         * @since 5.0
       
   146         * @return Unique identifier of the audio effect object.
       
   147         */
       
   148 		TInt Uid(TUid &aUid);
       
   149 		// From MAudioEffectControl Ends
       
   150 
       
   151         // MAudioEffectObserver begins
       
   152         void EffectChanged( const CAudioEffect* aObservedEffect, TUint8 aEvent );
       
   153         // MAudioEffectObserver ends
       
   154         
       
   155         // From CEffectControlBase begins
       
   156         void Event( TEffectControlEvent aEvent );
       
   157         // From CEffectControlBase ends
       
   158     
       
   159     private:
       
   160         TInt DoApply();        
       
   161         TInt CreateEffectProxy();
       
   162         TInt DeleteEffectProxy();    
       
   163         TInt SavePreviousSettings();   
       
   164     
       
   165     private:
       
   166         CDistanceAttenuationProxy* iDistanceAttenuationProxy;
       
   167         CDistanceAttenuationProxy* iPrevDistanceAttenuationProxy;
       
   168         TMMFMessageDestinationPckg iMsgHndlrHandlePckg;
       
   169         MCustomCommand* iCustomCommand;        
       
   170         RPointerArray<MControlObserver> iObservers;    
       
   171         };
       
   172     } // namespace multimedia
       
   173 
       
   174 #endif // DistanceAttenuationEFFECTIMPL_H
       
   175 
       
   176 // End of file