1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/mm/mm_pub/audio_effects_api/inc/EnvironmentalReverbBase.h Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,439 @@
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 Environmental Reverb effect class.
1.18 +*
1.19 +*/
1.20 +
1.21 +
1.22 +#ifndef CENVIRONMENTALREVERB_H
1.23 +#define CENVIRONMENTALREVERB_H
1.24 +
1.25 +// INCLUDES
1.26 +
1.27 +#include <e32base.h>
1.28 +#include <AudioEffectBase.h>
1.29 +#include <EnvironmentalReverbData.h>
1.30 +#include <MCustomInterface.h>
1.31 +
1.32 +const TUid KUidEnvironmentalReverbEffect = {0x10203837};
1.33 +
1.34 +// FORWARD DELCARATION
1.35 +class CMdaAudioConvertUtility;
1.36 +class CMdaAudioPlayerUtility;
1.37 +class CMdaAudioRecorderUtility;
1.38 +class CMdaAudioInputStream;
1.39 +class CMdaAudioOutputStream;
1.40 +class CMdaAudioToneUtility;
1.41 +class CCustomCommandUtility;
1.42 +class CCustomInterfaceUtility;
1.43 +class CMMFDevSound;
1.44 +class CMidiClientUtility;
1.45 +class CDrmPlayerUtility;
1.46 +class CVideoPlayerUtility;
1.47 +
1.48 +// CLASS DECLARATION
1.49 +
1.50 +/**
1.51 +* This is the Environmental Reverb effect class for managing reverb settings.
1.52 +*
1.53 +* @lib EnvironmentalReverbEffect.lib
1.54 +* @since 3.0
1.55 +*/
1.56 +
1.57 +class CEnvironmentalReverb : public CAudioEffect
1.58 + {
1.59 +
1.60 + public: //New Functions
1.61 +
1.62 + /**
1.63 + * Factory function for creating the audio reverb object.
1.64 + * @since 3.0
1.65 + * @return pointer to CEnvironmentalReverb object
1.66 + */
1.67 + IMPORT_C static CEnvironmentalReverb* NewL();
1.68 +
1.69 + /**
1.70 + * Factory function for creating the audio reverb object.
1.71 + * @since 3.0
1.72 + * @param aUtility A reference to a convert utility
1.73 + * @return pointer to CEnvironmentalReverb object
1.74 + */
1.75 + IMPORT_C static CEnvironmentalReverb* NewL( CMdaAudioConvertUtility& aUtility );
1.76 +
1.77 + /**
1.78 + * Factory function for creating the audio reverb object.
1.79 + * @since 3.0
1.80 + * @param aUtility A reference to an audio input stream utility
1.81 + * @return pointer to CEnvironmentalReverb object
1.82 + */
1.83 + IMPORT_C static CEnvironmentalReverb* NewL( CMdaAudioInputStream& aUtility );
1.84 +
1.85 + /**
1.86 + * Factory function for creating the audio reverb object.
1.87 + * @since 3.0
1.88 + * @param aUtility A reference to an audio output stream utility
1.89 + * @return pointer to CEnvironmentalReverb object
1.90 + */
1.91 + IMPORT_C static CEnvironmentalReverb* NewL( CMdaAudioOutputStream& aUtility );
1.92 +
1.93 + /**
1.94 + * Factory function for creating the audio reverb object.
1.95 + * @since 3.0
1.96 + * @param aUtility A reference to an audio player utility
1.97 + * @return pointer to CEnvironmentalReverb object
1.98 + */
1.99 + IMPORT_C static CEnvironmentalReverb* NewL( CMdaAudioPlayerUtility& aUtility );
1.100 +
1.101 + /**
1.102 + * Factory function for creating the audio reverb object.
1.103 + * @since 3.0
1.104 + * @param aUtility A reference to an audio record utility
1.105 + * @param aRecordStream ETrue if the effect is to be applied to the recording,
1.106 + * EFalse if the effect is to be applied only to the playback
1.107 + * @return pointer to CEnvironmentalReverb object
1.108 + */
1.109 + IMPORT_C static CEnvironmentalReverb* NewL( CMdaAudioRecorderUtility& aUtility, TBool aRecordStream );
1.110 +
1.111 + /**
1.112 + * Factory function for creating the audio reverb object.
1.113 + * @since 3.0
1.114 + * @param aUtility A reference to an audio tone utility
1.115 + * @return pointer to CEnvironmentalReverb object
1.116 + */
1.117 + IMPORT_C static CEnvironmentalReverb* NewL( CMdaAudioToneUtility& aUtility );
1.118 +
1.119 + /**
1.120 + * Factory function for creating the audio reverb object.
1.121 + * @since 3.0
1.122 + * @param aDevSound A reference to a DevSound instance
1.123 + * @return pointer to CEnvironmentalReverb object
1.124 + */
1.125 + IMPORT_C static CEnvironmentalReverb* NewL( CMMFDevSound& aDevSound );
1.126 +
1.127 + /**
1.128 + * Factory function for creating the audio reverb object.
1.129 + * @since 3.0
1.130 + * @param aUtility A reference to a custom command utility
1.131 + * @return pointer to CEnvironmentalReverb object
1.132 + */
1.133 + IMPORT_C static CEnvironmentalReverb* NewL( CCustomCommandUtility* aUtility );
1.134 +
1.135 + /**
1.136 + * Factory function for creating the audio reverb object.
1.137 + * @since 3.0
1.138 + * @param aCustomInterface A reference to a custom interface
1.139 + * @return pointer to CEnvironmentalReverb object
1.140 + */
1.141 + IMPORT_C static CEnvironmentalReverb* NewL( MCustomInterface& aCustomInterface );
1.142 +
1.143 + /**
1.144 + * Factory function for creating the audio reverb object.
1.145 + * @since 3.0
1.146 + * @param aUtility A reference to a CMidiClientUtility object
1.147 + * @return pointer to CEnvironmentalReverb object
1.148 + */
1.149 + IMPORT_C static CEnvironmentalReverb* NewL( CMidiClientUtility& aUtility );
1.150 +
1.151 + /**
1.152 + * Factory function for creating the audio equalizer object.
1.153 + * @since 3.0
1.154 + * @param CDrmPlayerUtility A reference to a CDrmPlayerUtility object
1.155 + * @return pointer to CAudioEqualizer object
1.156 + */
1.157 + IMPORT_C static CEnvironmentalReverb* NewL( CDrmPlayerUtility& aUtility );
1.158 +
1.159 + /**
1.160 + * Factory function for creating the audio equalizer object.
1.161 + * @since 3.2
1.162 + * @param CVideoPlayerUtility A reference to a CVideoPlayerUtility object
1.163 + * @return pointer to CAudioEqualizer object
1.164 + */
1.165 + IMPORT_C static CEnvironmentalReverb* NewL( CVideoPlayerUtility& aUtility );
1.166 +
1.167 + /**
1.168 + *
1.169 + * Destructor
1.170 + */
1.171 + IMPORT_C virtual ~CEnvironmentalReverb();
1.172 +
1.173 + /**
1.174 + * Gets the decay HF Ratio in hundredths
1.175 + * @since 3.0
1.176 + * @return decay HF Ratio
1.177 + */
1.178 + IMPORT_C TUint32 DecayHFRatio() const;
1.179 +
1.180 + /**
1.181 + * Gets the reverb decay HF Ratio minimum and maximum in hundredths.
1.182 + * @since 3.0
1.183 + * @param aMin Minimum decay HF Ratio
1.184 + * @param aMax Maximum decay HF Ratio
1.185 + */
1.186 + IMPORT_C void DecayHFRatioRange(TUint32& aMin, TUint32& aMax);
1.187 +
1.188 + /**
1.189 + * Gets the decay time in milliseconds
1.190 + * @since 3.0
1.191 + * @return decay time
1.192 + */
1.193 + IMPORT_C TUint32 DecayTime() const;
1.194 +
1.195 + /**
1.196 + * Gets the allowable reverb decay time range in milliseconds.
1.197 + * @since 3.0
1.198 + * @param aMin Minimum decay time in milliseconds
1.199 + * @param aMax Maximum decay time in milliseconds
1.200 + */
1.201 + IMPORT_C void DecayTimeRange(TUint32& aMin, TUint32& aMax);
1.202 +
1.203 + /**
1.204 + * Gets the density current value as a percentage in hundredths
1.205 + * @since 3.0
1.206 + * @return density value
1.207 + */
1.208 + IMPORT_C TUint32 Density() const;
1.209 +
1.210 + /**
1.211 + * Gets the diffusion current value as a percentage in hundredths.
1.212 + * @since 3.0
1.213 + * @return diffusion value
1.214 + */
1.215 + IMPORT_C TUint32 Diffusion() const;
1.216 +
1.217 + /**
1.218 + * Gets the reverb reflections delay in ms.
1.219 + * @since 3.0
1.220 + * @return reverb reflections delay
1.221 + */
1.222 + IMPORT_C TUint32 ReflectionsDelay() const;
1.223 +
1.224 + /**
1.225 + * Gets the reverb reflections delay maximum in milliseconds.
1.226 + * @since 3.0
1.227 + * @return reverb reflections delay maximum
1.228 + */
1.229 + IMPORT_C TUint32 ReflectionsDelayMax() const;
1.230 +
1.231 + /**
1.232 + * Gets the reverb reflections level in mB
1.233 + * @since 3.0
1.234 + * @return Reverb reflections level
1.235 + */
1.236 + IMPORT_C TInt32 ReflectionsLevel() const;
1.237 +
1.238 + /**
1.239 + * Gets the reverb reflections level maximum and minimum in mB
1.240 + * @since 3.0
1.241 + * @param aMin Minimum reflections level
1.242 + * @param aMax Maximum reflections level
1.243 + */
1.244 + IMPORT_C void ReflectionLevelRange( TInt32& aMin, TInt32& aMax );
1.245 +
1.246 + /**
1.247 + * Gets the reverb delay in milliseconds
1.248 + * @since 3.0
1.249 + * @return reverb delay
1.250 + */
1.251 + IMPORT_C TUint32 ReverbDelay() const;
1.252 +
1.253 + /**
1.254 + * Gets the reverb delay maximum in milliseconds
1.255 + * @since 3.0
1.256 + * @return reverb delay maximum
1.257 + */
1.258 + IMPORT_C TUint32 ReverbDelayMax() const;
1.259 +
1.260 + /**
1.261 + * Gets the reverb current level in mB
1.262 + * @since 3.0
1.263 + * @return reverb current level
1.264 + */
1.265 + IMPORT_C TInt32 ReverbLevel() const;
1.266 +
1.267 + /**
1.268 + * Gets the reverb current level maximum and minimum in mB
1.269 + * @since 3.0
1.270 + * @param aMin Minimum current level
1.271 + * @param aMax Maximum current level
1.272 + * @return -
1.273 + */
1.274 + IMPORT_C void ReverbLevelRange( TInt32& aMin, TInt32& aMax );
1.275 +
1.276 + /**
1.277 + * Gets the room HF level current ratio
1.278 + * @since 3.0
1.279 + * @return room HF level ratio
1.280 + */
1.281 + IMPORT_C TInt32 RoomHFLevel() const;
1.282 +
1.283 + /**
1.284 + * Gets the room HF level maximum and minimum ratios
1.285 + * @since 3.0
1.286 + * @param aMin Minimum current room HF level
1.287 + * @param aMax Maximum current room HF level
1.288 + * @return -
1.289 + */
1.290 + IMPORT_C void RoomHFLevelRange( TInt32& aMin, TInt32& aMax );
1.291 +
1.292 + /**
1.293 + * Gets the room level current value in mB
1.294 + * @since 3.0
1.295 + * @return room level value
1.296 + */
1.297 + IMPORT_C TInt32 RoomLevel() const;
1.298 +
1.299 + /**
1.300 + * Gets the room level maximum and minimum in mB
1.301 + * @since 3.0
1.302 + * @param aMin Minimum current room level
1.303 + * @param aMax Maximum current room level
1.304 + * @return -
1.305 + */
1.306 + IMPORT_C void RoomLevelRange( TInt32& aMin, TInt32& aMax );
1.307 +
1.308 + /**
1.309 + * Sets the decay HF Ratio in hundredths
1.310 + * @since 3.0
1.311 + * @param aDecayHFRatio The decay high frequence ratio in hundredths
1.312 + * @return -
1.313 + */
1.314 + IMPORT_C void SetDecayHFRatioL( TUint32 aDecayHFRatio );
1.315 +
1.316 + /**
1.317 + * Sets the decay time in millisecond
1.318 + * @since 3.0
1.319 + * @param aDecayTime Decay time in ms
1.320 + */
1.321 + IMPORT_C void SetDecayTimeL( TUint32 aDecayTime );
1.322 +
1.323 + /**
1.324 + * Sets the density value as percentage in hundredths
1.325 + * @since 3.0
1.326 + * @param aDensity The density.
1.327 + */
1.328 + IMPORT_C void SetDensityL( TUint32 aDensity );
1.329 +
1.330 + /**
1.331 + * Sets the diffusion value as a percentage in hundredths
1.332 + * @since 3.0
1.333 + * @param aDiffusion The diffusion.
1.334 + */
1.335 + IMPORT_C void SetDiffusionL( TUint32 aDiffusion );
1.336 +
1.337 + /**
1.338 + * Sets the reverb reflections delay
1.339 + * @since 3.0
1.340 + * @param aRefectionsDelay The reflection delay in ms.
1.341 + */
1.342 + IMPORT_C void SetReflectionsDelayL( TUint32 aReflectionsDelay );
1.343 +
1.344 + /**
1.345 + * Sets the reverb reflections level in milli-dB
1.346 + * @since 3.0
1.347 + * @param aRefectionsLevel The reflection level in mB
1.348 + */
1.349 + IMPORT_C void SetReflectionsLevelL( TInt32 aReflectionsLevel );
1.350 +
1.351 + /**
1.352 + * Sets the reverb delay
1.353 + * @since 3.0
1.354 + * @param aReverbDelay The reverb delay in ms
1.355 + */
1.356 + IMPORT_C void SetReverbDelayL( TUint32 aReverbDelay );
1.357 +
1.358 + /**
1.359 + * Sets the reverb level
1.360 + * @since 3.0
1.361 + * @param aReverbLevel The reverb level in mB
1.362 + */
1.363 + IMPORT_C void SetReverbLevelL( TInt32 aReverbLevel );
1.364 +
1.365 + /**
1.366 + * Sets the room HF level ratio
1.367 + * @since 3.0
1.368 + * @param aRoomHFLevel The room high frequency ratio
1.369 + */
1.370 + IMPORT_C void SetRoomHFLevelL( TInt32 aRoomHFLevel );
1.371 +
1.372 + /**
1.373 + * Sets the room level value in milli-dB
1.374 + * @since 3.0
1.375 + * @param aRoomLevel The room level
1.376 + */
1.377 + IMPORT_C void SetRoomLevelL( TInt32 aRoomLevel );
1.378 +
1.379 + /**
1.380 + * Gets the total delay maximum in milliseconds
1.381 + * @since 3.0
1.382 + * @return reverb delay maximum
1.383 + */
1.384 + IMPORT_C TUint32 DelayMax() const;
1.385 +
1.386 + public: // functions from base class
1.387 +
1.388 + /*
1.389 + * From CAudioEffect
1.390 + * Get the unique identifier of the audio effect
1.391 + * @since 3.0
1.392 + * @return Unique identifier
1.393 + */
1.394 + IMPORT_C TUid Uid() const;
1.395 +
1.396 + protected: // Functions from base classes
1.397 +
1.398 + /**
1.399 + * From CAudioEffect
1.400 + * Create a package of the effect data
1.401 + * @since 3.0
1.402 + * @return A descriptor containing the effect data.
1.403 + */
1.404 + IMPORT_C const TDesC8& DoEffectData();
1.405 +
1.406 + /**
1.407 + * From CAudioEffect
1.408 + * Internal function to unpack effect data
1.409 + * @since 3.0
1.410 + * @param aEffectDataBuffer Descriptor containing packed effect data
1.411 + * @return -
1.412 + */
1.413 + IMPORT_C void SetEffectData( const TDesC8& aEffectDataBuffer );
1.414 +
1.415 + protected:
1.416 +
1.417 + /**
1.418 + * Private C++ constructor for this class.
1.419 + * @since 3.0
1.420 + * @return -
1.421 + */
1.422 + IMPORT_C CEnvironmentalReverb();
1.423 +
1.424 + protected:
1.425 +
1.426 + // Reverb data structure
1.427 + TEfEnvironmentalReverb iReverbData;
1.428 + // Data package sent to server
1.429 + TEfEnvReverbDataPckg iDataPckgTo;
1.430 + // Data package received from server
1.431 + TEfEnvReverbDataPckg iDataPckgFrom;
1.432 +
1.433 + protected: // Friend classes
1.434 +
1.435 + friend class CEnvironmentalReverbMessageHandler;
1.436 + friend class CEnvironmentalReverbUtility;
1.437 +
1.438 + };
1.439 +
1.440 +#endif // of CENVIRONMENTALREVERB_H
1.441 +
1.442 +// End of File