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 equalizer utility class.
20 #ifndef CAUDIOEQUALIZERUTILITY_H
21 #define CAUDIOEQUALIZERUTILITY_H
26 #include <AudioEqualizerBase.h>
27 #include <BassBoostBase.h>
28 #include <centralrepository.h>
29 #include <AudioEqualizerUtilityData.h>
31 // FORWARD DECLARATIONS
32 class TEfAudioEqualizerUtilityPreset;
33 class CAudioEqualizer;
35 class CMdaAudioConvertUtility;
36 class CMdaAudioPlayerUtility;
37 class CMdaAudioRecorderUtility;
38 class CMdaAudioInputStream;
39 class CMdaAudioOutputStream;
40 class CMdaAudioToneUtility;
41 class CCustomCommandUtility;
42 class CCustomInterfaceUtility;
45 class CMidiClientUtility;
46 class CDrmPlayerUtility;
47 class CVideoPlayerUtility;
52 * This is the Equalizer Utility class for managing audio equalizer presets.
54 * @lib AudioEqualizerUtility.lib
58 class CAudioEqualizerUtility : public CBase
60 public: // Constructors and destructor
64 * Factory function for creating the audio equalizer utility object.
66 * @param aUtility A reference to a Devsound Instance
67 * @return pointer to CAudioEqualizerUtility object
69 IMPORT_C static CAudioEqualizerUtility* NewL(CMMFDevSound& aDevSound);
72 * Factory function for creating the audio equalizer utility object.
74 * @param aUtility A reference to a convert utility
75 * @return pointer to CAudioEqualizerUtility object
77 IMPORT_C static CAudioEqualizerUtility* NewL(CMdaAudioConvertUtility& aUtility);
80 * Factory function for creating the audio equalizer utility object.
82 * @param aUtility A reference to a audio input stream utility
83 * @return pointer to CAudioEqualizerUtility object
85 IMPORT_C static CAudioEqualizerUtility* NewL(CMdaAudioInputStream& aUtility);
88 * Factory function for creating the audio equalizer utility object.
90 * @param aUtility A reference to a audio output stream utility
91 * @return pointer to CAudioEqualizerUtility object
93 IMPORT_C static CAudioEqualizerUtility* NewL(CMdaAudioOutputStream& aUtility);
96 * Factory function for creating the audio equalizer utility object.
98 * @param aUtility A reference to a audio player utility
99 * @return pointer to CAudioEqualizerUtility object
101 IMPORT_C static CAudioEqualizerUtility* NewL(CMdaAudioPlayerUtility& aUtility);
104 * Factory function for creating the audio equalizer utility object.
106 * @param aUtility A reference to a audio recorder utility
107 * @return pointer to CAudioEqualizerUtility object
109 IMPORT_C static CAudioEqualizerUtility* NewL(CMdaAudioRecorderUtility& aUtility);
112 * Factory function for creating the audio equalizer utility object.
114 * @param aUtility A reference to a audio tone utility
115 * @return pointer to CAudioEqualizerUtility object
117 IMPORT_C static CAudioEqualizerUtility* NewL(CMdaAudioToneUtility& aUtility);
120 * Factory function for creating the audio equalizer utility object.
122 * @param aUtility A reference to custom command utility
123 * @return pointer to CAudioEqualizerUtility object
125 IMPORT_C static CAudioEqualizerUtility* NewL(CCustomCommandUtility* aUtility);
128 * Factory function for creating the audio equalizer utility object.
130 * @param aUtility A reference to custom interface utility
131 * @return pointer to CAudioEqualizerUtility object
133 IMPORT_C static CAudioEqualizerUtility* NewL(MCustomInterface& aCustomInterface);
136 * Factory function for creating the audio equalizer utility object.
138 * @param aUtility A reference to CMidiClientUtility
139 * @return pointer to CAudioEqualizerUtility object
141 IMPORT_C static CAudioEqualizerUtility* 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 CAudioEqualizerUtility* 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 CAudioEqualizerUtility* NewL( CVideoPlayerUtility& aUtility );
162 virtual ~CAudioEqualizerUtility();
165 * Apply the Preset Index value
167 * @param aPreset Preset Value
169 IMPORT_C void ApplyPresetL(TInt aPreset);
172 * Disable the Equalizer
175 IMPORT_C void DisableEqualizerL();
178 * Create a Preset with the given Name and Equalizer Settings
180 * @param aName Name of the Preset
181 * @param aAudioEqualizer Equalizer Settings for the Preset
183 IMPORT_C void CreatePresetL(TDesC& aName, CAudioEqualizer& aAudioEqualizerUI);
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 Equalizer Object
202 * @return Reference to the Equalizer Object.
204 IMPORT_C CAudioEqualizer& Equalizer();
207 * Get the reference to the BassBoost Object
209 * @return Reference to the CBassBoost Object.
211 IMPORT_C CBassBoost& BassBoost();
214 * Modify a Preset with the given Name and Equalizer Settings
216 * @param aPresetIndex Array Index of the Preset
217 * @param aName Name of the Preset
218 * @param aAudioEqualizer Equalizer Settings for the Preset
220 IMPORT_C void ModifyPresetL(TInt aPresetIndex, TDesC& aName, CAudioEqualizer& aAudioEqualizerUI);
223 * Get the number of Pre Defined Presets
225 * @return Number of Pre Defined Presets
227 IMPORT_C TUint32 NumberOfPreDefinedPresets() const;
230 * Get all the Presets defined in the Central Repository
232 * @return Array of all Presets.
234 IMPORT_C TArray<TEfAudioEqualizerUtilityPreset> Presets();
237 * Reset a System Defined Preset with the given index in the Array returned from Presets()
239 * @param aPresetIndex Index of the Preset in the Array
241 IMPORT_C void ResetPresetL(TInt aPresetIndex);
246 * C++ default constructor.
248 CAudioEqualizerUtility();
251 * By default Symbian 2nd phase constructor is private.
255 * Second Phase Costructor for DevSound Instance
257 * @param aDevSound DevSound Referece
259 void ConstructL(CMMFDevSound& aDevSound);
262 * Second Phase Costructor for Audio Convert Utility
264 * @param aUtility CMdaAudioConvertUtility Referece
266 void ConstructL(CMdaAudioConvertUtility& aUtility);
269 * Second Phase Costructor for CMdaAudioInputStream
271 * @param aUtility CMdaAudioInputStream Referece
273 void ConstructL(CMdaAudioInputStream& aUtility);
276 * Second Phase Costructor for CMdaAudioOutputStream
278 * @param aUtilityCMdaAudioOutputStream Referece
280 void ConstructL(CMdaAudioOutputStream& aUtility);
283 * Second Phase Costructor for CMdaAudioPlayerUtility
285 * @param aUtility CMdaAudioPlayerUtility Referece
287 void ConstructL(CMdaAudioPlayerUtility& aUtility);
290 * Second Phase Costructor for CMdaAudioRecordUtility
292 * @param aUtility CMdaAudioRecordUtility Referece
294 void ConstructL(CMdaAudioRecorderUtility& aUtility);
297 * Second Phase Costructor for CMdaAudioToneUtility
299 * @param aUtility CMdaAudioToneUtility Referece
301 void ConstructL(CMdaAudioToneUtility& aUtility);
304 * Second Phase Costructor for MCustomCommand
306 * @param aUtility MCustomCommand Referece
308 void ConstructL(CCustomCommandUtility* aUtility);
311 * Second Phase Costructor for MCustomInterface
313 * @param aUtility MCustomInterface Referece
315 void ConstructL(MCustomInterface& aCustomInterface);
318 * Second Phase Costructor for CMidiClientUtility
320 * @param aUtility CMidiClientUtility Referece
322 void ConstructL(CMidiClientUtility& aUtility);
325 * Second Phase Costructor for CDrmPlayerUtility
327 * @param aUtility CDrmPlayerUtility Referece
329 void ConstructL(CDrmPlayerUtility& aUtility);
332 * Second Phase Costructor for CVideoPlayerUtility
334 * @param aUtility CVideoPlayerUtility Referece
336 void ConstructL(CVideoPlayerUtility& aUtility);
339 * Function for Updating the Array from the Central Repository
341 * @param aUtility MCustomInterface Referece
343 void UpdateFullPresetArrayFromCenRep(RArray<TEfAudioEqualizerUtilityPreset> &aFullPresetArray);
346 * Function of Updating the Preset Array for the User
348 * @param aUtility MCustomInterface Referece
350 void UpdatePresetArray(RArray<TEfAudioEqualizerUtilityPreset>& aPresetArray,const RArray<TEfAudioEqualizerUtilityPreset> &aFullPresetArray);
355 // Array for Storing the Current State of the Repository
356 // which has been compacted after the transaction
357 // with the Central Repository
358 RArray<TEfAudioEqualizerUtilityPreset> iPresetArray;
360 // Array Which contains the full information from the
361 // Central Repository except the Description Values
362 RArray<TEfAudioEqualizerUtilityPreset> iFullPresetArray;
364 // Pointer to the Equalizer Object
365 CAudioEqualizer* iAudioEqualizer;
367 // Pointer to the Equalizer Object
368 // which is returned to the UI for Manipulation
369 CAudioEqualizer* iTransAudioEqualizer;
371 // Pointer to the Bass Boost Ojbect
372 CBassBoost* iBassBoost;
374 // Pointer to the Preset Repository
375 CRepository* iPresetRepository;
378 #endif // CAUDIOEQUALIZERUTILITY_H