sl@0
|
1 |
/*
|
sl@0
|
2 |
* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies).
|
sl@0
|
3 |
* All rights reserved.
|
sl@0
|
4 |
* This component and the accompanying materials are made available
|
sl@0
|
5 |
* under the terms of "Eclipse Public License v1.0"
|
sl@0
|
6 |
* which accompanies this distribution, and is available
|
sl@0
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
sl@0
|
8 |
*
|
sl@0
|
9 |
* Initial Contributors:
|
sl@0
|
10 |
* Nokia Corporation - initial contribution.
|
sl@0
|
11 |
*
|
sl@0
|
12 |
* Contributors:
|
sl@0
|
13 |
*
|
sl@0
|
14 |
* Description: This is the definition of the audio equalizer utility class.
|
sl@0
|
15 |
*
|
sl@0
|
16 |
*/
|
sl@0
|
17 |
|
sl@0
|
18 |
|
sl@0
|
19 |
|
sl@0
|
20 |
#ifndef CAUDIOEQUALIZERUTILITY_H
|
sl@0
|
21 |
#define CAUDIOEQUALIZERUTILITY_H
|
sl@0
|
22 |
|
sl@0
|
23 |
// INCLUDES
|
sl@0
|
24 |
#include <e32base.h>
|
sl@0
|
25 |
#include <e32svr.h>
|
sl@0
|
26 |
#include <AudioEqualizerBase.h>
|
sl@0
|
27 |
#include <BassBoostBase.h>
|
sl@0
|
28 |
#include <centralrepository.h>
|
sl@0
|
29 |
#include <AudioEqualizerUtilityData.h>
|
sl@0
|
30 |
|
sl@0
|
31 |
// FORWARD DECLARATIONS
|
sl@0
|
32 |
class TEfAudioEqualizerUtilityPreset;
|
sl@0
|
33 |
class CAudioEqualizer;
|
sl@0
|
34 |
class CBassBoost;
|
sl@0
|
35 |
class CMdaAudioConvertUtility;
|
sl@0
|
36 |
class CMdaAudioPlayerUtility;
|
sl@0
|
37 |
class CMdaAudioRecorderUtility;
|
sl@0
|
38 |
class CMdaAudioInputStream;
|
sl@0
|
39 |
class CMdaAudioOutputStream;
|
sl@0
|
40 |
class CMdaAudioToneUtility;
|
sl@0
|
41 |
class CCustomCommandUtility;
|
sl@0
|
42 |
class CCustomInterfaceUtility;
|
sl@0
|
43 |
class CMMFDevSound;
|
sl@0
|
44 |
class CRepository;
|
sl@0
|
45 |
class CMidiClientUtility;
|
sl@0
|
46 |
class CDrmPlayerUtility;
|
sl@0
|
47 |
class CVideoPlayerUtility;
|
sl@0
|
48 |
|
sl@0
|
49 |
// CLASS DECLARATION
|
sl@0
|
50 |
|
sl@0
|
51 |
/**
|
sl@0
|
52 |
* This is the Equalizer Utility class for managing audio equalizer presets.
|
sl@0
|
53 |
*
|
sl@0
|
54 |
* @lib AudioEqualizerUtility.lib
|
sl@0
|
55 |
* @since 3.0
|
sl@0
|
56 |
*/
|
sl@0
|
57 |
|
sl@0
|
58 |
class CAudioEqualizerUtility : public CBase
|
sl@0
|
59 |
{
|
sl@0
|
60 |
public: // Constructors and destructor
|
sl@0
|
61 |
|
sl@0
|
62 |
|
sl@0
|
63 |
/**
|
sl@0
|
64 |
* Factory function for creating the audio equalizer utility object.
|
sl@0
|
65 |
* @since 3.0
|
sl@0
|
66 |
* @param aUtility A reference to a Devsound Instance
|
sl@0
|
67 |
* @return pointer to CAudioEqualizerUtility object
|
sl@0
|
68 |
*/
|
sl@0
|
69 |
IMPORT_C static CAudioEqualizerUtility* NewL(CMMFDevSound& aDevSound);
|
sl@0
|
70 |
|
sl@0
|
71 |
/**
|
sl@0
|
72 |
* Factory function for creating the audio equalizer utility object.
|
sl@0
|
73 |
* @since 3.0
|
sl@0
|
74 |
* @param aUtility A reference to a convert utility
|
sl@0
|
75 |
* @return pointer to CAudioEqualizerUtility object
|
sl@0
|
76 |
*/
|
sl@0
|
77 |
IMPORT_C static CAudioEqualizerUtility* NewL(CMdaAudioConvertUtility& aUtility);
|
sl@0
|
78 |
|
sl@0
|
79 |
/**
|
sl@0
|
80 |
* Factory function for creating the audio equalizer utility object.
|
sl@0
|
81 |
* @since 3.0
|
sl@0
|
82 |
* @param aUtility A reference to a audio input stream utility
|
sl@0
|
83 |
* @return pointer to CAudioEqualizerUtility object
|
sl@0
|
84 |
*/
|
sl@0
|
85 |
IMPORT_C static CAudioEqualizerUtility* NewL(CMdaAudioInputStream& aUtility);
|
sl@0
|
86 |
|
sl@0
|
87 |
/**
|
sl@0
|
88 |
* Factory function for creating the audio equalizer utility object.
|
sl@0
|
89 |
* @since 3.0
|
sl@0
|
90 |
* @param aUtility A reference to a audio output stream utility
|
sl@0
|
91 |
* @return pointer to CAudioEqualizerUtility object
|
sl@0
|
92 |
*/
|
sl@0
|
93 |
IMPORT_C static CAudioEqualizerUtility* NewL(CMdaAudioOutputStream& aUtility);
|
sl@0
|
94 |
|
sl@0
|
95 |
/**
|
sl@0
|
96 |
* Factory function for creating the audio equalizer utility object.
|
sl@0
|
97 |
* @since 3.0
|
sl@0
|
98 |
* @param aUtility A reference to a audio player utility
|
sl@0
|
99 |
* @return pointer to CAudioEqualizerUtility object
|
sl@0
|
100 |
*/
|
sl@0
|
101 |
IMPORT_C static CAudioEqualizerUtility* NewL(CMdaAudioPlayerUtility& aUtility);
|
sl@0
|
102 |
|
sl@0
|
103 |
/**
|
sl@0
|
104 |
* Factory function for creating the audio equalizer utility object.
|
sl@0
|
105 |
* @since 3.0
|
sl@0
|
106 |
* @param aUtility A reference to a audio recorder utility
|
sl@0
|
107 |
* @return pointer to CAudioEqualizerUtility object
|
sl@0
|
108 |
*/
|
sl@0
|
109 |
IMPORT_C static CAudioEqualizerUtility* NewL(CMdaAudioRecorderUtility& aUtility);
|
sl@0
|
110 |
|
sl@0
|
111 |
/**
|
sl@0
|
112 |
* Factory function for creating the audio equalizer utility object.
|
sl@0
|
113 |
* @since 3.0
|
sl@0
|
114 |
* @param aUtility A reference to a audio tone utility
|
sl@0
|
115 |
* @return pointer to CAudioEqualizerUtility object
|
sl@0
|
116 |
*/
|
sl@0
|
117 |
IMPORT_C static CAudioEqualizerUtility* NewL(CMdaAudioToneUtility& aUtility);
|
sl@0
|
118 |
|
sl@0
|
119 |
/**
|
sl@0
|
120 |
* Factory function for creating the audio equalizer utility object.
|
sl@0
|
121 |
* @since 3.0
|
sl@0
|
122 |
* @param aUtility A reference to custom command utility
|
sl@0
|
123 |
* @return pointer to CAudioEqualizerUtility object
|
sl@0
|
124 |
*/
|
sl@0
|
125 |
IMPORT_C static CAudioEqualizerUtility* NewL(CCustomCommandUtility* aUtility);
|
sl@0
|
126 |
|
sl@0
|
127 |
/**
|
sl@0
|
128 |
* Factory function for creating the audio equalizer utility object.
|
sl@0
|
129 |
* @since 3.0
|
sl@0
|
130 |
* @param aUtility A reference to custom interface utility
|
sl@0
|
131 |
* @return pointer to CAudioEqualizerUtility object
|
sl@0
|
132 |
*/
|
sl@0
|
133 |
IMPORT_C static CAudioEqualizerUtility* NewL(MCustomInterface& aCustomInterface);
|
sl@0
|
134 |
|
sl@0
|
135 |
/**
|
sl@0
|
136 |
* Factory function for creating the audio equalizer utility object.
|
sl@0
|
137 |
* @since 3.0
|
sl@0
|
138 |
* @param aUtility A reference to CMidiClientUtility
|
sl@0
|
139 |
* @return pointer to CAudioEqualizerUtility object
|
sl@0
|
140 |
*/
|
sl@0
|
141 |
IMPORT_C static CAudioEqualizerUtility* NewL(CMidiClientUtility& aUtility);
|
sl@0
|
142 |
|
sl@0
|
143 |
/**
|
sl@0
|
144 |
* Factory function for creating the audio equalizer object.
|
sl@0
|
145 |
* @since 3.0
|
sl@0
|
146 |
* @param CDrmPlayerUtility A reference to a CDrmPlayerUtility object
|
sl@0
|
147 |
* @return pointer to CAudioEqualizer object
|
sl@0
|
148 |
*/
|
sl@0
|
149 |
IMPORT_C static CAudioEqualizerUtility* NewL( CDrmPlayerUtility& aUtility );
|
sl@0
|
150 |
|
sl@0
|
151 |
/**
|
sl@0
|
152 |
* Factory function for creating the audio equalizer object.
|
sl@0
|
153 |
* @since 3.2
|
sl@0
|
154 |
* @param CVideoPlayerUtility A reference to a CVideoPlayerUtility object
|
sl@0
|
155 |
* @return pointer to CAudioEqualizer object
|
sl@0
|
156 |
*/
|
sl@0
|
157 |
IMPORT_C static CAudioEqualizerUtility* NewL( CVideoPlayerUtility& aUtility );
|
sl@0
|
158 |
|
sl@0
|
159 |
/**
|
sl@0
|
160 |
* Destructor.
|
sl@0
|
161 |
*/
|
sl@0
|
162 |
virtual ~CAudioEqualizerUtility();
|
sl@0
|
163 |
|
sl@0
|
164 |
/**
|
sl@0
|
165 |
* Apply the Preset Index value
|
sl@0
|
166 |
* @since 3.0
|
sl@0
|
167 |
* @param aPreset Preset Value
|
sl@0
|
168 |
*/
|
sl@0
|
169 |
IMPORT_C void ApplyPresetL(TInt aPreset);
|
sl@0
|
170 |
|
sl@0
|
171 |
/**
|
sl@0
|
172 |
* Disable the Equalizer
|
sl@0
|
173 |
* @since 3.0
|
sl@0
|
174 |
*/
|
sl@0
|
175 |
IMPORT_C void DisableEqualizerL();
|
sl@0
|
176 |
|
sl@0
|
177 |
/**
|
sl@0
|
178 |
* Create a Preset with the given Name and Equalizer Settings
|
sl@0
|
179 |
* @since 3.0
|
sl@0
|
180 |
* @param aName Name of the Preset
|
sl@0
|
181 |
* @param aAudioEqualizer Equalizer Settings for the Preset
|
sl@0
|
182 |
*/
|
sl@0
|
183 |
IMPORT_C void CreatePresetL(TDesC& aName, CAudioEqualizer& aAudioEqualizerUI);
|
sl@0
|
184 |
|
sl@0
|
185 |
/**
|
sl@0
|
186 |
* Delete a Preset with the given index in the Central Repository
|
sl@0
|
187 |
* @since 3.0
|
sl@0
|
188 |
* @param aPresetIndex Index of the Preset in the Array
|
sl@0
|
189 |
*/
|
sl@0
|
190 |
IMPORT_C void DeletePresetL(TInt aPresetIndex);
|
sl@0
|
191 |
|
sl@0
|
192 |
/**
|
sl@0
|
193 |
* Retrieves a Preset with the given index from the Central Repository
|
sl@0
|
194 |
* @since 3.0
|
sl@0
|
195 |
* @param aPresetIndex Index of the Preset in the Array
|
sl@0
|
196 |
*/
|
sl@0
|
197 |
IMPORT_C const TDesC& GetPresetL(TInt aPresetIndex);
|
sl@0
|
198 |
|
sl@0
|
199 |
/**
|
sl@0
|
200 |
* Get the reference to the Equalizer Object
|
sl@0
|
201 |
* @since 3.0
|
sl@0
|
202 |
* @return Reference to the Equalizer Object.
|
sl@0
|
203 |
*/
|
sl@0
|
204 |
IMPORT_C CAudioEqualizer& Equalizer();
|
sl@0
|
205 |
|
sl@0
|
206 |
/**
|
sl@0
|
207 |
* Get the reference to the BassBoost Object
|
sl@0
|
208 |
* @since 3.0
|
sl@0
|
209 |
* @return Reference to the CBassBoost Object.
|
sl@0
|
210 |
*/
|
sl@0
|
211 |
IMPORT_C CBassBoost& BassBoost();
|
sl@0
|
212 |
|
sl@0
|
213 |
/**
|
sl@0
|
214 |
* Modify a Preset with the given Name and Equalizer Settings
|
sl@0
|
215 |
* @since 3.0
|
sl@0
|
216 |
* @param aPresetIndex Array Index of the Preset
|
sl@0
|
217 |
* @param aName Name of the Preset
|
sl@0
|
218 |
* @param aAudioEqualizer Equalizer Settings for the Preset
|
sl@0
|
219 |
*/
|
sl@0
|
220 |
IMPORT_C void ModifyPresetL(TInt aPresetIndex, TDesC& aName, CAudioEqualizer& aAudioEqualizerUI);
|
sl@0
|
221 |
|
sl@0
|
222 |
/**
|
sl@0
|
223 |
* Get the number of Pre Defined Presets
|
sl@0
|
224 |
* @since 3.0
|
sl@0
|
225 |
* @return Number of Pre Defined Presets
|
sl@0
|
226 |
*/
|
sl@0
|
227 |
IMPORT_C TUint32 NumberOfPreDefinedPresets() const;
|
sl@0
|
228 |
|
sl@0
|
229 |
/**
|
sl@0
|
230 |
* Get all the Presets defined in the Central Repository
|
sl@0
|
231 |
* @since 3.0
|
sl@0
|
232 |
* @return Array of all Presets.
|
sl@0
|
233 |
*/
|
sl@0
|
234 |
IMPORT_C TArray<TEfAudioEqualizerUtilityPreset> Presets();
|
sl@0
|
235 |
|
sl@0
|
236 |
/**
|
sl@0
|
237 |
* Reset a System Defined Preset with the given index in the Array returned from Presets()
|
sl@0
|
238 |
* @since 3.0
|
sl@0
|
239 |
* @param aPresetIndex Index of the Preset in the Array
|
sl@0
|
240 |
*/
|
sl@0
|
241 |
IMPORT_C void ResetPresetL(TInt aPresetIndex);
|
sl@0
|
242 |
|
sl@0
|
243 |
private:
|
sl@0
|
244 |
|
sl@0
|
245 |
/**
|
sl@0
|
246 |
* C++ default constructor.
|
sl@0
|
247 |
*/
|
sl@0
|
248 |
CAudioEqualizerUtility();
|
sl@0
|
249 |
|
sl@0
|
250 |
/**
|
sl@0
|
251 |
* By default Symbian 2nd phase constructor is private.
|
sl@0
|
252 |
*/
|
sl@0
|
253 |
|
sl@0
|
254 |
/**
|
sl@0
|
255 |
* Second Phase Costructor for DevSound Instance
|
sl@0
|
256 |
* @since 3.0
|
sl@0
|
257 |
* @param aDevSound DevSound Referece
|
sl@0
|
258 |
*/
|
sl@0
|
259 |
void ConstructL(CMMFDevSound& aDevSound);
|
sl@0
|
260 |
|
sl@0
|
261 |
/**
|
sl@0
|
262 |
* Second Phase Costructor for Audio Convert Utility
|
sl@0
|
263 |
* @since 3.0
|
sl@0
|
264 |
* @param aUtility CMdaAudioConvertUtility Referece
|
sl@0
|
265 |
*/
|
sl@0
|
266 |
void ConstructL(CMdaAudioConvertUtility& aUtility);
|
sl@0
|
267 |
|
sl@0
|
268 |
/**
|
sl@0
|
269 |
* Second Phase Costructor for CMdaAudioInputStream
|
sl@0
|
270 |
* @since 3.0
|
sl@0
|
271 |
* @param aUtility CMdaAudioInputStream Referece
|
sl@0
|
272 |
*/
|
sl@0
|
273 |
void ConstructL(CMdaAudioInputStream& aUtility);
|
sl@0
|
274 |
|
sl@0
|
275 |
/**
|
sl@0
|
276 |
* Second Phase Costructor for CMdaAudioOutputStream
|
sl@0
|
277 |
* @since 3.0
|
sl@0
|
278 |
* @param aUtilityCMdaAudioOutputStream Referece
|
sl@0
|
279 |
*/
|
sl@0
|
280 |
void ConstructL(CMdaAudioOutputStream& aUtility);
|
sl@0
|
281 |
|
sl@0
|
282 |
/**
|
sl@0
|
283 |
* Second Phase Costructor for CMdaAudioPlayerUtility
|
sl@0
|
284 |
* @since 3.0
|
sl@0
|
285 |
* @param aUtility CMdaAudioPlayerUtility Referece
|
sl@0
|
286 |
*/
|
sl@0
|
287 |
void ConstructL(CMdaAudioPlayerUtility& aUtility);
|
sl@0
|
288 |
|
sl@0
|
289 |
/**
|
sl@0
|
290 |
* Second Phase Costructor for CMdaAudioRecordUtility
|
sl@0
|
291 |
* @since 3.0
|
sl@0
|
292 |
* @param aUtility CMdaAudioRecordUtility Referece
|
sl@0
|
293 |
*/
|
sl@0
|
294 |
void ConstructL(CMdaAudioRecorderUtility& aUtility);
|
sl@0
|
295 |
|
sl@0
|
296 |
/**
|
sl@0
|
297 |
* Second Phase Costructor for CMdaAudioToneUtility
|
sl@0
|
298 |
* @since 3.0
|
sl@0
|
299 |
* @param aUtility CMdaAudioToneUtility Referece
|
sl@0
|
300 |
*/
|
sl@0
|
301 |
void ConstructL(CMdaAudioToneUtility& aUtility);
|
sl@0
|
302 |
|
sl@0
|
303 |
/**
|
sl@0
|
304 |
* Second Phase Costructor for MCustomCommand
|
sl@0
|
305 |
* @since 3.0
|
sl@0
|
306 |
* @param aUtility MCustomCommand Referece
|
sl@0
|
307 |
*/
|
sl@0
|
308 |
void ConstructL(CCustomCommandUtility* aUtility);
|
sl@0
|
309 |
|
sl@0
|
310 |
/**
|
sl@0
|
311 |
* Second Phase Costructor for MCustomInterface
|
sl@0
|
312 |
* @since 3.0
|
sl@0
|
313 |
* @param aUtility MCustomInterface Referece
|
sl@0
|
314 |
*/
|
sl@0
|
315 |
void ConstructL(MCustomInterface& aCustomInterface);
|
sl@0
|
316 |
|
sl@0
|
317 |
/**
|
sl@0
|
318 |
* Second Phase Costructor for CMidiClientUtility
|
sl@0
|
319 |
* @since 3.0
|
sl@0
|
320 |
* @param aUtility CMidiClientUtility Referece
|
sl@0
|
321 |
*/
|
sl@0
|
322 |
void ConstructL(CMidiClientUtility& aUtility);
|
sl@0
|
323 |
|
sl@0
|
324 |
/**
|
sl@0
|
325 |
* Second Phase Costructor for CDrmPlayerUtility
|
sl@0
|
326 |
* @since 3.0
|
sl@0
|
327 |
* @param aUtility CDrmPlayerUtility Referece
|
sl@0
|
328 |
*/
|
sl@0
|
329 |
void ConstructL(CDrmPlayerUtility& aUtility);
|
sl@0
|
330 |
|
sl@0
|
331 |
/**
|
sl@0
|
332 |
* Second Phase Costructor for CVideoPlayerUtility
|
sl@0
|
333 |
* @since 3.2
|
sl@0
|
334 |
* @param aUtility CVideoPlayerUtility Referece
|
sl@0
|
335 |
*/
|
sl@0
|
336 |
void ConstructL(CVideoPlayerUtility& aUtility);
|
sl@0
|
337 |
|
sl@0
|
338 |
/**
|
sl@0
|
339 |
* Function for Updating the Array from the Central Repository
|
sl@0
|
340 |
* @since 3.0
|
sl@0
|
341 |
* @param aUtility MCustomInterface Referece
|
sl@0
|
342 |
*/
|
sl@0
|
343 |
void UpdateFullPresetArrayFromCenRep(RArray<TEfAudioEqualizerUtilityPreset> &aFullPresetArray);
|
sl@0
|
344 |
|
sl@0
|
345 |
/**
|
sl@0
|
346 |
* Function of Updating the Preset Array for the User
|
sl@0
|
347 |
* @since 3.0
|
sl@0
|
348 |
* @param aUtility MCustomInterface Referece
|
sl@0
|
349 |
*/
|
sl@0
|
350 |
void UpdatePresetArray(RArray<TEfAudioEqualizerUtilityPreset>& aPresetArray,const RArray<TEfAudioEqualizerUtilityPreset> &aFullPresetArray);
|
sl@0
|
351 |
|
sl@0
|
352 |
|
sl@0
|
353 |
private: // Data
|
sl@0
|
354 |
|
sl@0
|
355 |
// Array for Storing the Current State of the Repository
|
sl@0
|
356 |
// which has been compacted after the transaction
|
sl@0
|
357 |
// with the Central Repository
|
sl@0
|
358 |
RArray<TEfAudioEqualizerUtilityPreset> iPresetArray;
|
sl@0
|
359 |
|
sl@0
|
360 |
// Array Which contains the full information from the
|
sl@0
|
361 |
// Central Repository except the Description Values
|
sl@0
|
362 |
RArray<TEfAudioEqualizerUtilityPreset> iFullPresetArray;
|
sl@0
|
363 |
|
sl@0
|
364 |
// Pointer to the Equalizer Object
|
sl@0
|
365 |
CAudioEqualizer* iAudioEqualizer;
|
sl@0
|
366 |
|
sl@0
|
367 |
// Pointer to the Equalizer Object
|
sl@0
|
368 |
// which is returned to the UI for Manipulation
|
sl@0
|
369 |
CAudioEqualizer* iTransAudioEqualizer;
|
sl@0
|
370 |
|
sl@0
|
371 |
// Pointer to the Bass Boost Ojbect
|
sl@0
|
372 |
CBassBoost* iBassBoost;
|
sl@0
|
373 |
|
sl@0
|
374 |
// Pointer to the Preset Repository
|
sl@0
|
375 |
CRepository* iPresetRepository;
|
sl@0
|
376 |
};
|
sl@0
|
377 |
|
sl@0
|
378 |
#endif // CAUDIOEQUALIZERUTILITY_H
|
sl@0
|
379 |
|
sl@0
|
380 |
// End of File
|