2 * Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies).
4 * This component and the accompanying materials are made available
5 * under the terms of the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
6 * which accompanies this distribution, and is available
7 * at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
9 * Initial Contributors:
10 * Nokia Corporation - initial contribution.
14 * Description: This is the definition of the Environmental Reverb effect class.
19 #ifndef CENVIRONMENTALREVERB_H
20 #define CENVIRONMENTALREVERB_H
25 #include <AudioEffectBase.h>
26 #include <EnvironmentalReverbData.h>
27 #include <MCustomInterface.h>
29 const TUid KUidEnvironmentalReverbEffect = {0x10203837};
31 // FORWARD DELCARATION
32 class CMdaAudioConvertUtility;
33 class CMdaAudioPlayerUtility;
34 class CMdaAudioRecorderUtility;
35 class CMdaAudioInputStream;
36 class CMdaAudioOutputStream;
37 class CMdaAudioToneUtility;
38 class CCustomCommandUtility;
39 class CCustomInterfaceUtility;
41 class CMidiClientUtility;
42 class CDrmPlayerUtility;
43 class CVideoPlayerUtility;
48 * This is the Environmental Reverb effect class for managing reverb settings.
50 * @lib EnvironmentalReverbEffect.lib
54 class CEnvironmentalReverb : public CAudioEffect
57 public: //New Functions
60 * Factory function for creating the audio reverb object.
62 * @return pointer to CEnvironmentalReverb object
64 IMPORT_C static CEnvironmentalReverb* NewL();
67 * Factory function for creating the audio reverb object.
69 * @param aUtility A reference to a convert utility
70 * @return pointer to CEnvironmentalReverb object
72 IMPORT_C static CEnvironmentalReverb* NewL( CMdaAudioConvertUtility& aUtility );
75 * Factory function for creating the audio reverb object.
77 * @param aUtility A reference to an audio input stream utility
78 * @return pointer to CEnvironmentalReverb object
80 IMPORT_C static CEnvironmentalReverb* NewL( CMdaAudioInputStream& aUtility );
83 * Factory function for creating the audio reverb object.
85 * @param aUtility A reference to an audio output stream utility
86 * @return pointer to CEnvironmentalReverb object
88 IMPORT_C static CEnvironmentalReverb* NewL( CMdaAudioOutputStream& aUtility );
91 * Factory function for creating the audio reverb object.
93 * @param aUtility A reference to an audio player utility
94 * @return pointer to CEnvironmentalReverb object
96 IMPORT_C static CEnvironmentalReverb* NewL( CMdaAudioPlayerUtility& aUtility );
99 * Factory function for creating the audio reverb object.
101 * @param aUtility A reference to an audio record utility
102 * @param aRecordStream ETrue if the effect is to be applied to the recording,
103 * EFalse if the effect is to be applied only to the playback
104 * @return pointer to CEnvironmentalReverb object
106 IMPORT_C static CEnvironmentalReverb* NewL( CMdaAudioRecorderUtility& aUtility, TBool aRecordStream );
109 * Factory function for creating the audio reverb object.
111 * @param aUtility A reference to an audio tone utility
112 * @return pointer to CEnvironmentalReverb object
114 IMPORT_C static CEnvironmentalReverb* NewL( CMdaAudioToneUtility& aUtility );
117 * Factory function for creating the audio reverb object.
119 * @param aDevSound A reference to a DevSound instance
120 * @return pointer to CEnvironmentalReverb object
122 IMPORT_C static CEnvironmentalReverb* NewL( CMMFDevSound& aDevSound );
125 * Factory function for creating the audio reverb object.
127 * @param aUtility A reference to a custom command utility
128 * @return pointer to CEnvironmentalReverb object
130 IMPORT_C static CEnvironmentalReverb* NewL( CCustomCommandUtility* aUtility );
133 * Factory function for creating the audio reverb object.
135 * @param aCustomInterface A reference to a custom interface
136 * @return pointer to CEnvironmentalReverb object
138 IMPORT_C static CEnvironmentalReverb* NewL( MCustomInterface& aCustomInterface );
141 * Factory function for creating the audio reverb object.
143 * @param aUtility A reference to a CMidiClientUtility object
144 * @return pointer to CEnvironmentalReverb object
146 IMPORT_C static CEnvironmentalReverb* NewL( CMidiClientUtility& aUtility );
149 * Factory function for creating the audio equalizer object.
151 * @param CDrmPlayerUtility A reference to a CDrmPlayerUtility object
152 * @return pointer to CAudioEqualizer object
154 IMPORT_C static CEnvironmentalReverb* NewL( CDrmPlayerUtility& aUtility );
157 * Factory function for creating the audio equalizer object.
159 * @param CVideoPlayerUtility A reference to a CVideoPlayerUtility object
160 * @return pointer to CAudioEqualizer object
162 IMPORT_C static CEnvironmentalReverb* NewL( CVideoPlayerUtility& aUtility );
168 IMPORT_C virtual ~CEnvironmentalReverb();
171 * Gets the decay HF Ratio in hundredths
173 * @return decay HF Ratio
175 IMPORT_C TUint32 DecayHFRatio() const;
178 * Gets the reverb decay HF Ratio minimum and maximum in hundredths.
180 * @param aMin Minimum decay HF Ratio
181 * @param aMax Maximum decay HF Ratio
183 IMPORT_C void DecayHFRatioRange(TUint32& aMin, TUint32& aMax);
186 * Gets the decay time in milliseconds
190 IMPORT_C TUint32 DecayTime() const;
193 * Gets the allowable reverb decay time range in milliseconds.
195 * @param aMin Minimum decay time in milliseconds
196 * @param aMax Maximum decay time in milliseconds
198 IMPORT_C void DecayTimeRange(TUint32& aMin, TUint32& aMax);
201 * Gets the density current value as a percentage in hundredths
203 * @return density value
205 IMPORT_C TUint32 Density() const;
208 * Gets the diffusion current value as a percentage in hundredths.
210 * @return diffusion value
212 IMPORT_C TUint32 Diffusion() const;
215 * Gets the reverb reflections delay in ms.
217 * @return reverb reflections delay
219 IMPORT_C TUint32 ReflectionsDelay() const;
222 * Gets the reverb reflections delay maximum in milliseconds.
224 * @return reverb reflections delay maximum
226 IMPORT_C TUint32 ReflectionsDelayMax() const;
229 * Gets the reverb reflections level in mB
231 * @return Reverb reflections level
233 IMPORT_C TInt32 ReflectionsLevel() const;
236 * Gets the reverb reflections level maximum and minimum in mB
238 * @param aMin Minimum reflections level
239 * @param aMax Maximum reflections level
241 IMPORT_C void ReflectionLevelRange( TInt32& aMin, TInt32& aMax );
244 * Gets the reverb delay in milliseconds
246 * @return reverb delay
248 IMPORT_C TUint32 ReverbDelay() const;
251 * Gets the reverb delay maximum in milliseconds
253 * @return reverb delay maximum
255 IMPORT_C TUint32 ReverbDelayMax() const;
258 * Gets the reverb current level in mB
260 * @return reverb current level
262 IMPORT_C TInt32 ReverbLevel() const;
265 * Gets the reverb current level maximum and minimum in mB
267 * @param aMin Minimum current level
268 * @param aMax Maximum current level
271 IMPORT_C void ReverbLevelRange( TInt32& aMin, TInt32& aMax );
274 * Gets the room HF level current ratio
276 * @return room HF level ratio
278 IMPORT_C TInt32 RoomHFLevel() const;
281 * Gets the room HF level maximum and minimum ratios
283 * @param aMin Minimum current room HF level
284 * @param aMax Maximum current room HF level
287 IMPORT_C void RoomHFLevelRange( TInt32& aMin, TInt32& aMax );
290 * Gets the room level current value in mB
292 * @return room level value
294 IMPORT_C TInt32 RoomLevel() const;
297 * Gets the room level maximum and minimum in mB
299 * @param aMin Minimum current room level
300 * @param aMax Maximum current room level
303 IMPORT_C void RoomLevelRange( TInt32& aMin, TInt32& aMax );
306 * Sets the decay HF Ratio in hundredths
308 * @param aDecayHFRatio The decay high frequence ratio in hundredths
311 IMPORT_C void SetDecayHFRatioL( TUint32 aDecayHFRatio );
314 * Sets the decay time in millisecond
316 * @param aDecayTime Decay time in ms
318 IMPORT_C void SetDecayTimeL( TUint32 aDecayTime );
321 * Sets the density value as percentage in hundredths
323 * @param aDensity The density.
325 IMPORT_C void SetDensityL( TUint32 aDensity );
328 * Sets the diffusion value as a percentage in hundredths
330 * @param aDiffusion The diffusion.
332 IMPORT_C void SetDiffusionL( TUint32 aDiffusion );
335 * Sets the reverb reflections delay
337 * @param aRefectionsDelay The reflection delay in ms.
339 IMPORT_C void SetReflectionsDelayL( TUint32 aReflectionsDelay );
342 * Sets the reverb reflections level in milli-dB
344 * @param aRefectionsLevel The reflection level in mB
346 IMPORT_C void SetReflectionsLevelL( TInt32 aReflectionsLevel );
349 * Sets the reverb delay
351 * @param aReverbDelay The reverb delay in ms
353 IMPORT_C void SetReverbDelayL( TUint32 aReverbDelay );
356 * Sets the reverb level
358 * @param aReverbLevel The reverb level in mB
360 IMPORT_C void SetReverbLevelL( TInt32 aReverbLevel );
363 * Sets the room HF level ratio
365 * @param aRoomHFLevel The room high frequency ratio
367 IMPORT_C void SetRoomHFLevelL( TInt32 aRoomHFLevel );
370 * Sets the room level value in milli-dB
372 * @param aRoomLevel The room level
374 IMPORT_C void SetRoomLevelL( TInt32 aRoomLevel );
377 * Gets the total delay maximum in milliseconds
379 * @return reverb delay maximum
381 IMPORT_C TUint32 DelayMax() const;
383 public: // functions from base class
387 * Get the unique identifier of the audio effect
389 * @return Unique identifier
391 IMPORT_C TUid Uid() const;
393 protected: // Functions from base classes
397 * Create a package of the effect data
399 * @return A descriptor containing the effect data.
401 IMPORT_C const TDesC8& DoEffectData();
405 * Internal function to unpack effect data
407 * @param aEffectDataBuffer Descriptor containing packed effect data
410 IMPORT_C void SetEffectData( const TDesC8& aEffectDataBuffer );
415 * Private C++ constructor for this class.
419 IMPORT_C CEnvironmentalReverb();
423 // Reverb data structure
424 TEfEnvironmentalReverb iReverbData;
425 // Data package sent to server
426 TEfEnvReverbDataPckg iDataPckgTo;
427 // Data package received from server
428 TEfEnvReverbDataPckg iDataPckgFrom;
430 protected: // Friend classes
432 friend class CEnvironmentalReverbMessageHandler;
433 friend class CEnvironmentalReverbUtility;
437 #endif // of CENVIRONMENTALREVERB_H