|
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: This is the definition of the Environmental Reverb effect class. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef CENVIRONMENTALREVERB_H |
|
20 #define CENVIRONMENTALREVERB_H |
|
21 |
|
22 // INCLUDES |
|
23 |
|
24 #include <e32base.h> |
|
25 #include <AudioEffectBase.h> |
|
26 #include <EnvironmentalReverbData.h> |
|
27 #include <MCustomInterface.h> |
|
28 |
|
29 const TUid KUidEnvironmentalReverbEffect = {0x10203837}; |
|
30 |
|
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; |
|
40 class CMMFDevSound; |
|
41 class CMidiClientUtility; |
|
42 class CDrmPlayerUtility; |
|
43 class CVideoPlayerUtility; |
|
44 |
|
45 // CLASS DECLARATION |
|
46 |
|
47 /** |
|
48 * This is the Environmental Reverb effect class for managing reverb settings. |
|
49 * |
|
50 * @lib EnvironmentalReverbEffect.lib |
|
51 * @since 3.0 |
|
52 */ |
|
53 |
|
54 class CEnvironmentalReverb : public CAudioEffect |
|
55 { |
|
56 |
|
57 public: //New Functions |
|
58 |
|
59 /** |
|
60 * Factory function for creating the audio reverb object. |
|
61 * @since 3.0 |
|
62 * @return pointer to CEnvironmentalReverb object |
|
63 */ |
|
64 IMPORT_C static CEnvironmentalReverb* NewL(); |
|
65 |
|
66 /** |
|
67 * Factory function for creating the audio reverb object. |
|
68 * @since 3.0 |
|
69 * @param aUtility A reference to a convert utility |
|
70 * @return pointer to CEnvironmentalReverb object |
|
71 */ |
|
72 IMPORT_C static CEnvironmentalReverb* NewL( CMdaAudioConvertUtility& aUtility ); |
|
73 |
|
74 /** |
|
75 * Factory function for creating the audio reverb object. |
|
76 * @since 3.0 |
|
77 * @param aUtility A reference to an audio input stream utility |
|
78 * @return pointer to CEnvironmentalReverb object |
|
79 */ |
|
80 IMPORT_C static CEnvironmentalReverb* NewL( CMdaAudioInputStream& aUtility ); |
|
81 |
|
82 /** |
|
83 * Factory function for creating the audio reverb object. |
|
84 * @since 3.0 |
|
85 * @param aUtility A reference to an audio output stream utility |
|
86 * @return pointer to CEnvironmentalReverb object |
|
87 */ |
|
88 IMPORT_C static CEnvironmentalReverb* NewL( CMdaAudioOutputStream& aUtility ); |
|
89 |
|
90 /** |
|
91 * Factory function for creating the audio reverb object. |
|
92 * @since 3.0 |
|
93 * @param aUtility A reference to an audio player utility |
|
94 * @return pointer to CEnvironmentalReverb object |
|
95 */ |
|
96 IMPORT_C static CEnvironmentalReverb* NewL( CMdaAudioPlayerUtility& aUtility ); |
|
97 |
|
98 /** |
|
99 * Factory function for creating the audio reverb object. |
|
100 * @since 3.0 |
|
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 |
|
105 */ |
|
106 IMPORT_C static CEnvironmentalReverb* NewL( CMdaAudioRecorderUtility& aUtility, TBool aRecordStream ); |
|
107 |
|
108 /** |
|
109 * Factory function for creating the audio reverb object. |
|
110 * @since 3.0 |
|
111 * @param aUtility A reference to an audio tone utility |
|
112 * @return pointer to CEnvironmentalReverb object |
|
113 */ |
|
114 IMPORT_C static CEnvironmentalReverb* NewL( CMdaAudioToneUtility& aUtility ); |
|
115 |
|
116 /** |
|
117 * Factory function for creating the audio reverb object. |
|
118 * @since 3.0 |
|
119 * @param aDevSound A reference to a DevSound instance |
|
120 * @return pointer to CEnvironmentalReverb object |
|
121 */ |
|
122 IMPORT_C static CEnvironmentalReverb* NewL( CMMFDevSound& aDevSound ); |
|
123 |
|
124 /** |
|
125 * Factory function for creating the audio reverb object. |
|
126 * @since 3.0 |
|
127 * @param aUtility A reference to a custom command utility |
|
128 * @return pointer to CEnvironmentalReverb object |
|
129 */ |
|
130 IMPORT_C static CEnvironmentalReverb* NewL( CCustomCommandUtility* aUtility ); |
|
131 |
|
132 /** |
|
133 * Factory function for creating the audio reverb object. |
|
134 * @since 3.0 |
|
135 * @param aCustomInterface A reference to a custom interface |
|
136 * @return pointer to CEnvironmentalReverb object |
|
137 */ |
|
138 IMPORT_C static CEnvironmentalReverb* NewL( MCustomInterface& aCustomInterface ); |
|
139 |
|
140 /** |
|
141 * Factory function for creating the audio reverb object. |
|
142 * @since 3.0 |
|
143 * @param aUtility A reference to a CMidiClientUtility object |
|
144 * @return pointer to CEnvironmentalReverb object |
|
145 */ |
|
146 IMPORT_C static CEnvironmentalReverb* NewL( CMidiClientUtility& aUtility ); |
|
147 |
|
148 /** |
|
149 * Factory function for creating the audio equalizer object. |
|
150 * @since 3.0 |
|
151 * @param CDrmPlayerUtility A reference to a CDrmPlayerUtility object |
|
152 * @return pointer to CAudioEqualizer object |
|
153 */ |
|
154 IMPORT_C static CEnvironmentalReverb* NewL( CDrmPlayerUtility& aUtility ); |
|
155 |
|
156 /** |
|
157 * Factory function for creating the audio equalizer object. |
|
158 * @since 3.2 |
|
159 * @param CVideoPlayerUtility A reference to a CVideoPlayerUtility object |
|
160 * @return pointer to CAudioEqualizer object |
|
161 */ |
|
162 IMPORT_C static CEnvironmentalReverb* NewL( CVideoPlayerUtility& aUtility ); |
|
163 |
|
164 /** |
|
165 * |
|
166 * Destructor |
|
167 */ |
|
168 IMPORT_C virtual ~CEnvironmentalReverb(); |
|
169 |
|
170 /** |
|
171 * Gets the decay HF Ratio in hundredths |
|
172 * @since 3.0 |
|
173 * @return decay HF Ratio |
|
174 */ |
|
175 IMPORT_C TUint32 DecayHFRatio() const; |
|
176 |
|
177 /** |
|
178 * Gets the reverb decay HF Ratio minimum and maximum in hundredths. |
|
179 * @since 3.0 |
|
180 * @param aMin Minimum decay HF Ratio |
|
181 * @param aMax Maximum decay HF Ratio |
|
182 */ |
|
183 IMPORT_C void DecayHFRatioRange(TUint32& aMin, TUint32& aMax); |
|
184 |
|
185 /** |
|
186 * Gets the decay time in milliseconds |
|
187 * @since 3.0 |
|
188 * @return decay time |
|
189 */ |
|
190 IMPORT_C TUint32 DecayTime() const; |
|
191 |
|
192 /** |
|
193 * Gets the allowable reverb decay time range in milliseconds. |
|
194 * @since 3.0 |
|
195 * @param aMin Minimum decay time in milliseconds |
|
196 * @param aMax Maximum decay time in milliseconds |
|
197 */ |
|
198 IMPORT_C void DecayTimeRange(TUint32& aMin, TUint32& aMax); |
|
199 |
|
200 /** |
|
201 * Gets the density current value as a percentage in hundredths |
|
202 * @since 3.0 |
|
203 * @return density value |
|
204 */ |
|
205 IMPORT_C TUint32 Density() const; |
|
206 |
|
207 /** |
|
208 * Gets the diffusion current value as a percentage in hundredths. |
|
209 * @since 3.0 |
|
210 * @return diffusion value |
|
211 */ |
|
212 IMPORT_C TUint32 Diffusion() const; |
|
213 |
|
214 /** |
|
215 * Gets the reverb reflections delay in ms. |
|
216 * @since 3.0 |
|
217 * @return reverb reflections delay |
|
218 */ |
|
219 IMPORT_C TUint32 ReflectionsDelay() const; |
|
220 |
|
221 /** |
|
222 * Gets the reverb reflections delay maximum in milliseconds. |
|
223 * @since 3.0 |
|
224 * @return reverb reflections delay maximum |
|
225 */ |
|
226 IMPORT_C TUint32 ReflectionsDelayMax() const; |
|
227 |
|
228 /** |
|
229 * Gets the reverb reflections level in mB |
|
230 * @since 3.0 |
|
231 * @return Reverb reflections level |
|
232 */ |
|
233 IMPORT_C TInt32 ReflectionsLevel() const; |
|
234 |
|
235 /** |
|
236 * Gets the reverb reflections level maximum and minimum in mB |
|
237 * @since 3.0 |
|
238 * @param aMin Minimum reflections level |
|
239 * @param aMax Maximum reflections level |
|
240 */ |
|
241 IMPORT_C void ReflectionLevelRange( TInt32& aMin, TInt32& aMax ); |
|
242 |
|
243 /** |
|
244 * Gets the reverb delay in milliseconds |
|
245 * @since 3.0 |
|
246 * @return reverb delay |
|
247 */ |
|
248 IMPORT_C TUint32 ReverbDelay() const; |
|
249 |
|
250 /** |
|
251 * Gets the reverb delay maximum in milliseconds |
|
252 * @since 3.0 |
|
253 * @return reverb delay maximum |
|
254 */ |
|
255 IMPORT_C TUint32 ReverbDelayMax() const; |
|
256 |
|
257 /** |
|
258 * Gets the reverb current level in mB |
|
259 * @since 3.0 |
|
260 * @return reverb current level |
|
261 */ |
|
262 IMPORT_C TInt32 ReverbLevel() const; |
|
263 |
|
264 /** |
|
265 * Gets the reverb current level maximum and minimum in mB |
|
266 * @since 3.0 |
|
267 * @param aMin Minimum current level |
|
268 * @param aMax Maximum current level |
|
269 * @return - |
|
270 */ |
|
271 IMPORT_C void ReverbLevelRange( TInt32& aMin, TInt32& aMax ); |
|
272 |
|
273 /** |
|
274 * Gets the room HF level current ratio |
|
275 * @since 3.0 |
|
276 * @return room HF level ratio |
|
277 */ |
|
278 IMPORT_C TInt32 RoomHFLevel() const; |
|
279 |
|
280 /** |
|
281 * Gets the room HF level maximum and minimum ratios |
|
282 * @since 3.0 |
|
283 * @param aMin Minimum current room HF level |
|
284 * @param aMax Maximum current room HF level |
|
285 * @return - |
|
286 */ |
|
287 IMPORT_C void RoomHFLevelRange( TInt32& aMin, TInt32& aMax ); |
|
288 |
|
289 /** |
|
290 * Gets the room level current value in mB |
|
291 * @since 3.0 |
|
292 * @return room level value |
|
293 */ |
|
294 IMPORT_C TInt32 RoomLevel() const; |
|
295 |
|
296 /** |
|
297 * Gets the room level maximum and minimum in mB |
|
298 * @since 3.0 |
|
299 * @param aMin Minimum current room level |
|
300 * @param aMax Maximum current room level |
|
301 * @return - |
|
302 */ |
|
303 IMPORT_C void RoomLevelRange( TInt32& aMin, TInt32& aMax ); |
|
304 |
|
305 /** |
|
306 * Sets the decay HF Ratio in hundredths |
|
307 * @since 3.0 |
|
308 * @param aDecayHFRatio The decay high frequence ratio in hundredths |
|
309 * @return - |
|
310 */ |
|
311 IMPORT_C void SetDecayHFRatioL( TUint32 aDecayHFRatio ); |
|
312 |
|
313 /** |
|
314 * Sets the decay time in millisecond |
|
315 * @since 3.0 |
|
316 * @param aDecayTime Decay time in ms |
|
317 */ |
|
318 IMPORT_C void SetDecayTimeL( TUint32 aDecayTime ); |
|
319 |
|
320 /** |
|
321 * Sets the density value as percentage in hundredths |
|
322 * @since 3.0 |
|
323 * @param aDensity The density. |
|
324 */ |
|
325 IMPORT_C void SetDensityL( TUint32 aDensity ); |
|
326 |
|
327 /** |
|
328 * Sets the diffusion value as a percentage in hundredths |
|
329 * @since 3.0 |
|
330 * @param aDiffusion The diffusion. |
|
331 */ |
|
332 IMPORT_C void SetDiffusionL( TUint32 aDiffusion ); |
|
333 |
|
334 /** |
|
335 * Sets the reverb reflections delay |
|
336 * @since 3.0 |
|
337 * @param aRefectionsDelay The reflection delay in ms. |
|
338 */ |
|
339 IMPORT_C void SetReflectionsDelayL( TUint32 aReflectionsDelay ); |
|
340 |
|
341 /** |
|
342 * Sets the reverb reflections level in milli-dB |
|
343 * @since 3.0 |
|
344 * @param aRefectionsLevel The reflection level in mB |
|
345 */ |
|
346 IMPORT_C void SetReflectionsLevelL( TInt32 aReflectionsLevel ); |
|
347 |
|
348 /** |
|
349 * Sets the reverb delay |
|
350 * @since 3.0 |
|
351 * @param aReverbDelay The reverb delay in ms |
|
352 */ |
|
353 IMPORT_C void SetReverbDelayL( TUint32 aReverbDelay ); |
|
354 |
|
355 /** |
|
356 * Sets the reverb level |
|
357 * @since 3.0 |
|
358 * @param aReverbLevel The reverb level in mB |
|
359 */ |
|
360 IMPORT_C void SetReverbLevelL( TInt32 aReverbLevel ); |
|
361 |
|
362 /** |
|
363 * Sets the room HF level ratio |
|
364 * @since 3.0 |
|
365 * @param aRoomHFLevel The room high frequency ratio |
|
366 */ |
|
367 IMPORT_C void SetRoomHFLevelL( TInt32 aRoomHFLevel ); |
|
368 |
|
369 /** |
|
370 * Sets the room level value in milli-dB |
|
371 * @since 3.0 |
|
372 * @param aRoomLevel The room level |
|
373 */ |
|
374 IMPORT_C void SetRoomLevelL( TInt32 aRoomLevel ); |
|
375 |
|
376 /** |
|
377 * Gets the total delay maximum in milliseconds |
|
378 * @since 3.0 |
|
379 * @return reverb delay maximum |
|
380 */ |
|
381 IMPORT_C TUint32 DelayMax() const; |
|
382 |
|
383 public: // functions from base class |
|
384 |
|
385 /* |
|
386 * From CAudioEffect |
|
387 * Get the unique identifier of the audio effect |
|
388 * @since 3.0 |
|
389 * @return Unique identifier |
|
390 */ |
|
391 IMPORT_C TUid Uid() const; |
|
392 |
|
393 protected: // Functions from base classes |
|
394 |
|
395 /** |
|
396 * From CAudioEffect |
|
397 * Create a package of the effect data |
|
398 * @since 3.0 |
|
399 * @return A descriptor containing the effect data. |
|
400 */ |
|
401 IMPORT_C const TDesC8& DoEffectData(); |
|
402 |
|
403 /** |
|
404 * From CAudioEffect |
|
405 * Internal function to unpack effect data |
|
406 * @since 3.0 |
|
407 * @param aEffectDataBuffer Descriptor containing packed effect data |
|
408 * @return - |
|
409 */ |
|
410 IMPORT_C void SetEffectData( const TDesC8& aEffectDataBuffer ); |
|
411 |
|
412 protected: |
|
413 |
|
414 /** |
|
415 * Private C++ constructor for this class. |
|
416 * @since 3.0 |
|
417 * @return - |
|
418 */ |
|
419 IMPORT_C CEnvironmentalReverb(); |
|
420 |
|
421 protected: |
|
422 |
|
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; |
|
429 |
|
430 protected: // Friend classes |
|
431 |
|
432 friend class CEnvironmentalReverbMessageHandler; |
|
433 friend class CEnvironmentalReverbUtility; |
|
434 |
|
435 }; |
|
436 |
|
437 #endif // of CENVIRONMENTALREVERB_H |
|
438 |
|
439 // End of File |