First public contribution.
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 "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".
9 * Initial Contributors:
10 * Nokia Corporation - initial contribution.
14 * Description: This is the definition of the audio EnvironmentalReverb utility class.
20 #ifndef CENVIRONMENTALREVERBUTILITY_H
21 #define CENVIRONMENTALREVERBUTILITY_H
26 #include <EnvironmentalReverbBase.h>
27 #include <centralrepository.h>
28 #include "EnvironmentalReverbUtilityData.h"
30 // FORWARD DECLARATIONS
31 class TEfEnvironmentalReverbUtilityPreset;
32 class CEnvironmentalReverb;
33 class CMdaAudioConvertUtility;
34 class CMdaAudioPlayerUtility;
35 class CMdaAudioRecorderUtility;
36 class CMdaAudioInputStream;
37 class CMdaAudioOutputStream;
38 class CMdaAudioToneUtility;
39 class CCustomCommandUtility;
40 class CCustomInterfaceUtility;
43 class CMidiClientUtility;
44 class CDrmPlayerUtility;
45 class CVideoPlayerUtility;
50 * This is the EnvironmentalReverb Utility class for managing audio EnvironmentalReverb presets.
52 * @lib EnvironmentalReverbUtility.lib
56 class CEnvironmentalReverbUtility : public CBase
58 public: // Constructors and destructor
62 * Factory function for creating the audio EnvironmentalReverb utility object.
64 * @param aUtility A reference to a Devsound Instance
65 * @return pointer to CEnvironmentalReverbUtility object
67 IMPORT_C static CEnvironmentalReverbUtility* NewL(CMMFDevSound& aDevSound);
70 * Factory function for creating the audio EnvironmentalReverb utility object.
72 * @param aUtility A reference to a convert utility
73 * @return pointer to CEnvironmentalReverbUtility object
75 IMPORT_C static CEnvironmentalReverbUtility* NewL(CMdaAudioConvertUtility& aUtility);
78 * Factory function for creating the audio EnvironmentalReverb utility object.
80 * @param aUtility A reference to a audio input stream utility
81 * @return pointer to CEnvironmentalReverbUtility object
83 IMPORT_C static CEnvironmentalReverbUtility* NewL(CMdaAudioInputStream& aUtility);
86 * Factory function for creating the audio EnvironmentalReverb utility object.
88 * @param aUtility A reference to a audio output stream utility
89 * @return pointer to CEnvironmentalReverbUtility object
91 IMPORT_C static CEnvironmentalReverbUtility* NewL(CMdaAudioOutputStream& aUtility);
94 * Factory function for creating the audio EnvironmentalReverb utility object.
96 * @param aUtility A reference to a audio player utility
97 * @return pointer to CEnvironmentalReverbUtility object
99 IMPORT_C static CEnvironmentalReverbUtility* NewL(CMdaAudioPlayerUtility& aUtility);
102 * Factory function for creating the audio EnvironmentalReverb utility object.
104 * @param aUtility A reference to a audio recorder utility
105 * @return pointer to CEnvironmentalReverbUtility object
107 IMPORT_C static CEnvironmentalReverbUtility* NewL(CMdaAudioRecorderUtility& aUtility);
110 * Factory function for creating the audio EnvironmentalReverb utility object.
112 * @param aUtility A reference to a audio tone utility
113 * @return pointer to CEnvironmentalReverbUtility object
115 IMPORT_C static CEnvironmentalReverbUtility* NewL(CMdaAudioToneUtility& aUtility);
118 * Factory function for creating the audio EnvironmentalReverb utility object.
120 * @param aUtility A reference to custom command utility
121 * @return pointer to CEnvironmentalReverbUtility object
123 IMPORT_C static CEnvironmentalReverbUtility* NewL(CCustomCommandUtility* aUtility);
126 * Factory function for creating the audio EnvironmentalReverb utility object.
128 * @param aUtility A reference to custom interface utility
129 * @return pointer to CEnvironmentalReverbUtility object
131 IMPORT_C static CEnvironmentalReverbUtility* NewL(MCustomInterface& aCustomInterface);
135 * Factory function for creating the audio EnvironmentalReverb utility object.
137 * @param aUtility A reference to CMidiClientUtility
138 * @return pointer to CEnvironmentalReverbUtility object
140 IMPORT_C static CEnvironmentalReverbUtility* NewL(CMidiClientUtility& aUtility);
144 * Factory function for creating the audio equalizer object.
146 * @param CDrmPlayerUtility A reference to a CDrmPlayerUtility object
147 * @return pointer to CAudioEqualizer object
149 IMPORT_C static CEnvironmentalReverbUtility* NewL(CDrmPlayerUtility& aUtility);
152 * Factory function for creating the audio equalizer object.
154 * @param CVideoPlayerUtility A reference to a CVideoPlayerUtility object
155 * @return pointer to CAudioEqualizer object
157 IMPORT_C static CEnvironmentalReverbUtility* NewL(CVideoPlayerUtility& aUtility);
162 virtual ~CEnvironmentalReverbUtility();
165 * Apply the Preset Index value
167 * @param aPreset Preset Value
169 IMPORT_C void ApplyPresetL(TInt aPreset);
172 * Disable the EnvironmentalReverb
175 IMPORT_C void DisableEnvironmentalReverbL();
178 * Create a Preset with the given Name and EnvironmentalReverb Settings
180 * @param aName Name of the Preset
181 * @param aEnvironmentalReverb EnvironmentalReverb Settings for the Preset
183 IMPORT_C void CreatePresetL(TDesC& aName, CEnvironmentalReverb& aEnvironmentalReverbUI);
186 * Delete a Preset with the given index in the Central Repository
188 * @param aPresetIndex Index of the Preset in the Array
190 IMPORT_C void DeletePresetL(TInt aPresetIndex);
193 * Retrieves a Preset with the given index from the Central Repository
195 * @param aPresetIndex Index of the Preset in the Array
197 IMPORT_C const TDesC& GetPresetL(TInt aPresetIndex);
200 * Get the reference to the EnvironmentalReverb Object
202 * @return Reference to the EnvironmentalReverb Object.
204 IMPORT_C CEnvironmentalReverb& EnvironmentalReverb();
207 * Modify a Preset with the given Name and EnvironmentalReverb Settings
209 * @param aPresetIndex Array Index of the Preset
210 * @param aName Name of the Preset
211 * @param aEnvironmentalReverb EnvironmentalReverb Settings for the Preset
213 IMPORT_C void ModifyPresetL(TInt aPresetIndex, TDesC& aName, CEnvironmentalReverb& aEnvironmentalReverbUI);
216 * Get the number of Pre Defined Presets
218 * @return Number of Pre Defined Presets
220 IMPORT_C TUint32 NumberOfPreDefinedPresets() const;
223 * Get all the Presets defined in the Central Repository
225 * @return Array of all Presets.
227 IMPORT_C TArray<TEfEnvironmentalReverbUtilityPreset> Presets();
230 * Reset a System Defined Preset with the given index in the Array returned from Presets()
232 * @param aPresetIndex Index of the Preset in the Array
234 IMPORT_C void ResetPresetL(TInt aPresetIndex);
239 * C++ default constructor.
241 CEnvironmentalReverbUtility();
244 * By default Symbian 2nd phase constructor is private.
248 * Second Phase Costructor for DevSound Instance
250 * @param aDevSound DevSound Referece
252 void ConstructL(CMMFDevSound& aDevSound);
255 * Second Phase Costructor for Audio Convert Utility
257 * @param aUtility CMdaAudioConvertUtility Referece
259 void ConstructL(CMdaAudioConvertUtility& aUtility);
262 * Second Phase Costructor for CMdaAudioInputStream
264 * @param aUtility CMdaAudioInputStream Referece
266 void ConstructL(CMdaAudioInputStream& aUtility);
269 * Second Phase Costructor for CMdaAudioOutputStream
271 * @param aUtilityCMdaAudioOutputStream Referece
273 void ConstructL(CMdaAudioOutputStream& aUtility);
276 * Second Phase Costructor for CMdaAudioPlayerUtility
278 * @param aUtility CMdaAudioPlayerUtility Referece
280 void ConstructL(CMdaAudioPlayerUtility& aUtility);
283 * Second Phase Costructor for CMdaAudioRecordUtility
285 * @param aUtility CMdaAudioRecordUtility Referece
287 void ConstructL(CMdaAudioRecorderUtility& aUtility);
290 * Second Phase Costructor for CMdaAudioToneUtility
292 * @param aUtility CMdaAudioToneUtility Referece
294 void ConstructL(CMdaAudioToneUtility& aUtility);
297 * Second Phase Costructor for MCustomCommand
299 * @param aUtility MCustomCommand Referece
301 void ConstructL(CCustomCommandUtility* aUtility);
304 * Second Phase Costructor for MCustomInterface
306 * @param aUtility MCustomInterface Referece
308 void ConstructL(MCustomInterface& aCustomInterface);
311 * Second Phase Costructor for CMidiClientUtility
313 * @param aUtility CMidiClientUtility Referece
315 void ConstructL(CMidiClientUtility& aUtility);
318 * Second Phase Costructor for CDrmPlayerUtility
320 * @param aUtility CDrmPlayerUtility Referece
322 void ConstructL(CDrmPlayerUtility& aUtility);
325 * Second Phase Costructor for CVideoPlayerUtility
327 * @param aUtility CVideoPlayerUtility Referece
329 void ConstructL(CVideoPlayerUtility& aUtility);
332 * Function for Updating the Array from the Central Repository
334 * @param aUtility MCustomInterface Referece
336 void UpdateFullPresetArrayFromCenRep(RArray<TEfEnvironmentalReverbUtilityPreset> &aFullPresetArray);
339 * Function of Updating the Preset Array for the User
341 * @param aUtility MCustomInterface Referece
343 void UpdatePresetArray(RArray<TEfEnvironmentalReverbUtilityPreset>& aPresetArray,const RArray<TEfEnvironmentalReverbUtilityPreset> &aFullPresetArray);
348 // Array for Storing the Current State of the Repository
349 // which has been compacted after the transaction
350 // with the Central Repository
351 RArray<TEfEnvironmentalReverbUtilityPreset> iPresetArray;
353 // Array Which contains the full information from the
354 // Central Repository except the Description Values
355 RArray<TEfEnvironmentalReverbUtilityPreset> iFullPresetArray;
357 // Pointer to the EnvironmentalReverb Object
358 CEnvironmentalReverb* iEnvironmentalReverb;
360 // Pointer to the EnvironmentalReverb Object
361 // which is returned to the UI for Manipulation
362 CEnvironmentalReverb* iTransEnvironmentalReverb;
364 // Pointer to the Preset Repository
365 CRepository* iPresetRepository;
368 #endif // CENVIRONMENTALREVERBUTILITY_H