mmfenh/enhancedmediaclient/Client/src/Components/AudioEffects/SourceDopplerEffectImpl.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 SOURCEDOPPLEREFFECTIMPL_H
       
    20 #define SOURCEDOPPLEREFFECTIMPL_H
       
    21 
       
    22 #include <e32base.h>
       
    23 #include <SourceDopplerControl.h>
       
    24 #include "EffectControlBase.h"
       
    25 #include <SourceDopplerProxy.h>
       
    26 #include <MAudioEffectObserver.h>
       
    27 
       
    28 namespace multimedia
       
    29     {
       
    30 	class MControlObserver;
       
    31     class CSourceDopplerEffect : public CBase,
       
    32                           public MSourceDopplerControl,
       
    33                           public MAudioEffectObserver,
       
    34                           public CEffectControlBase
       
    35         {
       
    36     public:
       
    37         CSourceDopplerEffect();
       
    38         ~CSourceDopplerEffect();
       
    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 MSourceDopplerEffect begins
       
    53 		/**
       
    54         * Get the velocity's cartesian settings
       
    55         * @since 5.0
       
    56         * @param aX Velocity in X direction (mm/s)
       
    57         * @param aY Velocity in Y direction (mm/s)
       
    58         * @param aZ Velocity in Z direction (mm/s)
       
    59         */
       
    60 		TInt CartesianVelocity( TInt& aX, TInt& aY, TInt& aZ );
       
    61 
       
    62 		/**
       
    63         * Get the current multiplier factor
       
    64         * @since 5.0
       
    65         * @return multiplier factor
       
    66         */
       
    67 		TInt Factor(TUint& aFactor);
       
    68 
       
    69 		/**
       
    70         * Get the maximum multiplier factor
       
    71         * @since 5.0
       
    72         * @return multiplier factor
       
    73         */
       
    74 		TInt FactorMax(TUint& aFactorMax);
       
    75 
       
    76 		/**
       
    77         * Sets the velocity in Cartesian coordinates of the sound source with respect to the listener.
       
    78         * @since 5.0
       
    79         * @param aX Velocity in X direction (mm/s)
       
    80         * @param aY Velocity in Y direction (mm/s)
       
    81         * @param aZ Velocity in Z direction (mm/s)
       
    82         * @return -
       
    83         */
       
    84 		TInt SetCartesianVelocity( TInt aX, TInt aY, TInt aZ );
       
    85 
       
    86 		/**
       
    87         * Sets the multiplier factor.
       
    88         * @since 5.0
       
    89         * @param aFactor Factor value in hundredths that ranges from 0 to FactorMax(),
       
    90         *                where 100 corresponds to 1.00, 200 corresponds to 2.00, etc.
       
    91         * @return -
       
    92         */
       
    93 		TInt SetFactor( TUint aFactor );
       
    94 
       
    95 		/**
       
    96         * Sets the velocity in spherical coordinates of the sound source with respect to the listener.
       
    97         * @since 5.0
       
    98         * @param aAzimuth the Azimuth (thousandths of radians)
       
    99         * @param aElevation the elevation (thousandths of radians)
       
   100         * @param aRadius the radius (thousandths of radians)
       
   101         * @return -
       
   102         */
       
   103 		TInt SetSphericalVelocity( TInt aAzimuth, TInt aElevation, TInt aRadius );
       
   104 
       
   105 		/**
       
   106         * Gets the velocity's spherical coordinates settings.
       
   107         * @since 5.0
       
   108         * @param aAzimuth the Azimuth (thousandths of radians)
       
   109         * @param aElevation the elevation (thousandths of radians)
       
   110         * @param aRadius the radius (thousandths of radians)
       
   111         * @return -
       
   112         */
       
   113 		TInt SphericalVelocity( TInt& aAzimuth, TInt& aElevation, TInt& aRadius );
       
   114 
       
   115        // From MSourceDopplerEffect ends
       
   116 
       
   117 		// From MAudioEffectControl
       
   118 		/**
       
   119         * Disable the effect
       
   120         * @since 5.0
       
   121         */
       
   122 		TInt Disable();
       
   123 
       
   124 		/**
       
   125         * Enable the effect
       
   126         * @since 5.0
       
   127         */
       
   128 		TInt Enable();
       
   129 
       
   130 		/**
       
   131         * Enforce the effect.
       
   132         * @since 5.0
       
   133         * @param aEnforced Indicate the effect is to be enforced or not. ETrue = Enforced.
       
   134         */
       
   135 		TInt Enforce( TBool &aEnforced );
       
   136 
       
   137 		/**
       
   138         * Check if this effect object currently has update rights.
       
   139         * A client can lose update rights in some hardware platforms where there are a limited
       
   140         * number of instances of an effect that can exist at the same time. When an effect instance
       
   141         * has lost update rights the user can still change settings, but any calls to Apply the
       
   142         * settings will be deferred until update rights are regained.
       
   143         * @since 5.0
       
   144         * @return ETrue if this object currently has rights to update the settings of this effect,
       
   145         *         EFalse otherwise.
       
   146         */
       
   147 		TInt HaveUpdateRights(TBool &aHaveUpdateRights);
       
   148 
       
   149 		/**
       
   150         * Check if the effect is enabled
       
   151         * @since 5.0
       
   152         * @return ETrue if the effect is enabled, EFalse if the effect is disabled.
       
   153         */
       
   154 		TInt IsEnabled(TBool &aEnabled);
       
   155 
       
   156 		/**
       
   157         * Check if the effect is enforced.
       
   158         * @since 5.0
       
   159         * @return ETrue if the effect is enforced, EFalse if the effect isn ot enforced.
       
   160         */
       
   161 		TInt IsEnforced(TBool &aEnforced);
       
   162 
       
   163 		/*
       
   164         * Get the unique identifier of the audio effect
       
   165         * @since 5.0
       
   166         * @return Unique identifier of the audio effect object.
       
   167         */
       
   168 		TInt Uid(TUid &aUid);
       
   169 		// From MAudioEffectControl Ends
       
   170 
       
   171         // MAudioEffectObserver begins
       
   172         void EffectChanged( const CAudioEffect* aObservedEffect, TUint8 aEvent );
       
   173         // MAudioEffectObserver ends
       
   174         
       
   175         // From CEffectControlBase begins
       
   176         void Event( TEffectControlEvent aEvent );
       
   177         // From CEffectControlBase ends
       
   178     
       
   179     private:
       
   180         TInt DoApply();        
       
   181         TInt CreateEffectProxy();
       
   182         TInt DeleteEffectProxy();    
       
   183         TInt SavePreviousSettings();   
       
   184     
       
   185     private:
       
   186         CSourceDopplerProxy* iSourceDopplerProxy;
       
   187         CSourceDopplerProxy* iPrevSourceDopplerProxy;
       
   188         TMMFMessageDestinationPckg iMsgHndlrHandlePckg;
       
   189         MCustomCommand* iCustomCommand;        
       
   190         RPointerArray<MControlObserver> iObservers;    
       
   191         };
       
   192     } // namespace multimedia
       
   193 
       
   194 #endif // SOURCEDOPPLEREFFECTIMPL_H
       
   195 
       
   196 // End of file