1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/mm/mm_pub/audio_effects_api/inc/DistanceAttenuationBase.h Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,263 @@
1.4 +/*
1.5 +* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies).
1.6 +* All rights reserved.
1.7 +* This component and the accompanying materials are made available
1.8 +* under the terms of "Eclipse Public License v1.0"
1.9 +* which accompanies this distribution, and is available
1.10 +* at the URL "http://www.eclipse.org/legal/epl-v10.html".
1.11 +*
1.12 +* Initial Contributors:
1.13 +* Nokia Corporation - initial contribution.
1.14 +*
1.15 +* Contributors:
1.16 +*
1.17 +* Description: This is the definition of the Distance Attenuation effect class.
1.18 +*
1.19 +*/
1.20 +
1.21 +
1.22 +#ifndef CDISTANCEATTENUATION_H
1.23 +#define CDISTANCEATTENUATION_H
1.24 +
1.25 +// INCLUDES
1.26 +
1.27 +#include <e32base.h>
1.28 +#include <AudioEffectBase.h>
1.29 +#include <DistanceAttenuationData.h>
1.30 +#include <MCustomInterface.h>
1.31 +
1.32 +
1.33 +const TUid KUidDistanceAttenuationEffect = {0x1020382C};
1.34 +
1.35 +// FORWARD DELCARATION
1.36 +class CMdaAudioConvertUtility;
1.37 +class CMdaAudioPlayerUtility;
1.38 +class CMdaAudioRecorderUtility;
1.39 +class CMdaAudioInputStream;
1.40 +class CMdaAudioOutputStream;
1.41 +class CMdaAudioToneUtility;
1.42 +class CCustomCommandUtility;
1.43 +class CCustomInterfaceUtility;
1.44 +class CMMFDevSound;
1.45 +class CMidiClientUtility;
1.46 +class CDrmPlayerUtility;
1.47 +class CVideoPlayerUtility;
1.48 +
1.49 +// CLASS DECLARATION
1.50 +
1.51 +/**
1.52 +* This is the Distance Attenuation effect class for managing audio Distance Attenuation settings.
1.53 +*
1.54 +* @lib DistanceAttenuationEffect.lib
1.55 +* @since 3.0
1.56 +*/
1.57 +
1.58 +class CDistanceAttenuation : public CAudioEffect
1.59 + {
1.60 +
1.61 + public: //New Functions
1.62 +
1.63 + /**
1.64 + * Factory function for creating the distance attenuation object.
1.65 + * @since 3.0
1.66 + * @param aUtility A reference to a convert utility
1.67 + * @return pointer to CDistanceAttenuation object
1.68 + */
1.69 + IMPORT_C static CDistanceAttenuation* NewL( CMdaAudioConvertUtility& aUtility );
1.70 +
1.71 + /**
1.72 + * Factory function for creating the distance attenuation object.
1.73 + * @since 3.0
1.74 + * @param aUtility A reference to an audio input stream utility
1.75 + * @return pointer to CDistanceAttenuation object
1.76 + */
1.77 + IMPORT_C static CDistanceAttenuation* NewL( CMdaAudioInputStream& aUtility );
1.78 +
1.79 + /**
1.80 + * Factory function for creating the distance attenuation object.
1.81 + * @since 3.0
1.82 + * @param aUtility A reference to an audio output stream utility
1.83 + * @return pointer to CDistanceAttenuation object
1.84 + */
1.85 + IMPORT_C static CDistanceAttenuation* NewL( CMdaAudioOutputStream& aUtility );
1.86 +
1.87 + /**
1.88 + * Factory function for creating the distance attenuation object.
1.89 + * @since 3.0
1.90 + * @param aUtility A reference to an audio player utility
1.91 + * @return pointer to CDistanceAttenuation object
1.92 + */
1.93 + IMPORT_C static CDistanceAttenuation* NewL( CMdaAudioPlayerUtility& aUtility );
1.94 +
1.95 + /**
1.96 + * Factory function for creating the distance attenuation object.
1.97 + * @since 3.0
1.98 + * @param aUtility A reference to an audio record utility
1.99 + * @param aRecordStream ETrue if the effect is to be applied to the recording,
1.100 + * EFalse if the effect is to be applied only to the playback
1.101 + * @return pointer to CDistanceAttenuation object
1.102 + */
1.103 + IMPORT_C static CDistanceAttenuation* NewL( CMdaAudioRecorderUtility& aUtility, TBool aRecordStream );
1.104 +
1.105 + /**
1.106 + * Factory function for creating the distance attenuation object.
1.107 + * @since 3.0
1.108 + * @param aDevSound A reference to a DevSound instance
1.109 + * @return pointer to CDistanceAttenuation object
1.110 + */
1.111 + IMPORT_C static CDistanceAttenuation* NewL( CMMFDevSound& aDevSound );
1.112 +
1.113 + /**
1.114 + * Factory function for creating the distance attenuation object.
1.115 + * @since 3.0
1.116 + * @param aUtility A reference to an audio tone utility
1.117 + * @return pointer to CDistanceAttenuation object
1.118 + */
1.119 + IMPORT_C static CDistanceAttenuation* NewL( CMdaAudioToneUtility& aUtility );
1.120 +
1.121 + /**
1.122 + * Factory function for creating the distance attenuation object.
1.123 + * @since 3.0
1.124 + * @param aUtility A reference to a custom command utility
1.125 + * @return pointer to CDistanceAttenuation object
1.126 + */
1.127 + IMPORT_C static CDistanceAttenuation* NewL( CCustomCommandUtility* aUtility );
1.128 +
1.129 + /**
1.130 + * Factory function for creating the distance attenuation object.
1.131 + * @since 3.0
1.132 + * @param aCustomInterface A reference to a custom interface
1.133 + * @return pointer to CDistanceAttenuation object
1.134 + */
1.135 + IMPORT_C static CDistanceAttenuation* NewL( MCustomInterface& aCustomInterface );
1.136 +
1.137 + /**
1.138 + * Factory function for creating the distance attenuation object.
1.139 + * @since 3.0
1.140 + * @param aUtility A reference to a CMidiClientUtility
1.141 + * @return pointer to CDistanceAttenuation object
1.142 + */
1.143 + IMPORT_C static CDistanceAttenuation* NewL( CMidiClientUtility& aUtility );
1.144 +
1.145 +
1.146 + /**
1.147 + * Factory function for creating the distance attenuation object.
1.148 + * @since 3.0
1.149 + * @param CDrmPlayerUtility A reference to a CDrmPlayerUtility object
1.150 + * @return pointer to CDistanceAttenuation object
1.151 + */
1.152 + IMPORT_C static CDistanceAttenuation* NewL( CDrmPlayerUtility& aUtility );
1.153 +
1.154 + /**
1.155 + * Factory function for creating the distance attenuation object.
1.156 + * @since 3.2
1.157 + * @param CVideoPlayerUtility A reference to a CVideoPlayerUtility object
1.158 + * @return pointer to CDistanceAttenuation object
1.159 + */
1.160 + IMPORT_C static CDistanceAttenuation* NewL( CVideoPlayerUtility& aUtility );
1.161 +
1.162 + /**
1.163 + *
1.164 + * Destructor
1.165 + */
1.166 + IMPORT_C virtual ~CDistanceAttenuation();
1.167 +
1.168 + /**
1.169 + * Gets the Distance Attenuation of the listener.
1.170 + * @since 3.0
1.171 + * @param aRMin The source-to-listener distance below which the sound level is constant
1.172 + * @param aRMax The source-to-listener distance above which the sound level is constant or zero
1.173 + * @param aMuteAfterMax Indicate if the sound is muted beyond RMax
1.174 + * @param aRollOffFactor Multiplier factor to source-to-listener distance
1.175 + * @param aRoomRollOffFactor Multiplier factor to source-to-listener distance for Room effect.
1.176 + * @return -
1.177 + */
1.178 + IMPORT_C void DistanceAttenuation( TInt32& aRMin, TInt32& aRMax, TBool& aMuteAfterMax,
1.179 + TUint32& aRollOffFactor, TUint32& aRoomRollOffFactor );
1.180 +
1.181 + /**
1.182 + * Get roll off factor maximum value.
1.183 + * @since 3.0
1.184 + * @param aRollOffFactor The maximum multiplier factor to source-to-listener distance for Room effect.
1.185 + * @return -
1.186 + */
1.187 + IMPORT_C void RollOffFactorMax( TUint32& aRollOfFactorMax );
1.188 +
1.189 + /**
1.190 + * Get room roll off factor maximum value.
1.191 + * @since 3.0
1.192 + * @param aRollOffFactor The maximum multiplier factor to source-to-listener distance for Room effect.
1.193 + * @return -
1.194 + */
1.195 + IMPORT_C void RoomRollOffFactorMax( TUint32& aRoomRollOfFactorMax );
1.196 +
1.197 + /**
1.198 + * Sets the Distance Attenuation
1.199 + * @since 3.0
1.200 + * @param aRMin The source-to-listener distance below which the sound level is constant
1.201 + * @param aRMax The source-to-listener distance above which the sound level is constant or zero
1.202 + * @param aMuteAfterMax Indicate if the sound is muted beyond RMax
1.203 + * @param aRollOffFactor Multiplier factor to source-to-listener distance
1.204 + * @param aRoomRollOffFactor Multiplier factor to source-to-listener distance for Room effect.
1.205 + * @return -
1.206 + */
1.207 + IMPORT_C void SetDistanceAttenuationL( TInt32 aRMin, TInt32 aRMax, TBool aMuteAfterMax,
1.208 + TUint32 aRollOffFactor, TUint32 aRoomRollOffFactor );
1.209 +
1.210 + public: // functions from base class
1.211 +
1.212 + /*
1.213 + * From CAudioEffect
1.214 + * Get the unique identifier of the audio effect
1.215 + * @since 3.0
1.216 + * @return Unique identifier
1.217 + */
1.218 + IMPORT_C TUid Uid() const;
1.219 +
1.220 + protected: // Functions from base classes
1.221 +
1.222 + /**
1.223 + * From CAudioEffect
1.224 + * Create a package of the effect data
1.225 + * @since 3.0
1.226 + * @return A descriptor containing the effect data.
1.227 + */
1.228 + IMPORT_C const TDesC8& DoEffectData();
1.229 +
1.230 + /**
1.231 + * From CAudioEffect
1.232 + * Internal function to unpack effect data
1.233 + * @since 3.0
1.234 + * @param aEffectDataBuffer Descriptor containing packed effect data
1.235 + * @return -
1.236 + */
1.237 + IMPORT_C void SetEffectData( const TDesC8& aEffectDataBuffer );
1.238 +
1.239 + protected:
1.240 +
1.241 + /**
1.242 + * Private C++ constructor for this class.
1.243 + * @since 3.0
1.244 + * @param aEffectObserver reference to event observer object
1.245 + * @return -
1.246 + */
1.247 + IMPORT_C CDistanceAttenuation();
1.248 +
1.249 + protected:
1.250 +
1.251 + // Distance Attenuation data structure
1.252 + TEfDistanceAttenuation iDistanceAttenuationData;
1.253 + // Data package sent to server
1.254 + TEfDistanceAttenuationDataPckg iDataPckgTo;
1.255 + // Data package received from server
1.256 + TEfDistanceAttenuationDataPckg iDataPckgFrom;
1.257 +
1.258 + protected: // Friend classes
1.259 +
1.260 + friend class CDistanceAttenuationMessageHandler;
1.261 +
1.262 + };
1.263 +
1.264 +#endif // of CDISTANCEATTENUATION_H
1.265 +
1.266 +// End of File