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 StereoWidening utility class.
20 #ifndef STEREOWIDENINGUTILITY_H
21 #define STEREOWIDENINGUTILITY_H
26 #include <StereoWideningBase.h>
27 #include <centralrepository.h>
28 #include <StereoWideningUtilityData.h>
30 // FORWARD DECLARATIONS
31 class TEfStereoWideningUtilityPreset;
32 class CStereoWidening;
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 StereoWidening Utility class for managing audio StereoWidening presets.
52 * @lib StereoWideningUtility.lib
56 class CStereoWideningUtility : public CBase
58 public: // Constructors and destructor
62 * Factory function for creating the audio StereoWidening utility object.
64 * @param aUtility A reference to a Devsound Instance
65 * @return pointer to CStereoWideningUtility object
67 IMPORT_C static CStereoWideningUtility* NewL(CMMFDevSound& aDevSound);
70 * Factory function for creating the audio StereoWidening utility object.
72 * @param aUtility A reference to a convert utility
73 * @return pointer to CStereoWideningUtility object
75 IMPORT_C static CStereoWideningUtility* NewL(CMdaAudioConvertUtility& aUtility);
78 * Factory function for creating the audio StereoWidening utility object.
80 * @param aUtility A reference to a audio input stream utility
81 * @return pointer to CStereoWideningUtility object
83 IMPORT_C static CStereoWideningUtility* NewL(CMdaAudioInputStream& aUtility);
86 * Factory function for creating the audio StereoWidening utility object.
88 * @param aUtility A reference to a audio output stream utility
89 * @return pointer to CStereoWideningUtility object
91 IMPORT_C static CStereoWideningUtility* NewL(CMdaAudioOutputStream& aUtility);
94 * Factory function for creating the audio StereoWidening utility object.
96 * @param aUtility A reference to a audio player utility
97 * @return pointer to CStereoWideningUtility object
99 IMPORT_C static CStereoWideningUtility* NewL(CMdaAudioPlayerUtility& aUtility);
102 * Factory function for creating the audio StereoWidening utility object.
104 * @param aUtility A reference to a audio recorder utility
105 * @return pointer to CStereoWideningUtility object
107 IMPORT_C static CStereoWideningUtility* NewL(CMdaAudioRecorderUtility& aUtility);
110 * Factory function for creating the audio StereoWidening utility object.
112 * @param aUtility A reference to a audio tone utility
113 * @return pointer to CStereoWideningUtility object
115 IMPORT_C static CStereoWideningUtility* NewL(CMdaAudioToneUtility& aUtility);
118 * Factory function for creating the audio StereoWidening utility object.
120 * @param aUtility A reference to custom command utility
121 * @return pointer to CStereoWideningUtility object
123 IMPORT_C static CStereoWideningUtility* NewL(CCustomCommandUtility* aUtility);
126 * Factory function for creating the audio StereoWidening utility object.
128 * @param aUtility A reference to custom interface utility
129 * @return pointer to CStereoWideningUtility object
131 IMPORT_C static CStereoWideningUtility* NewL(MCustomInterface& aCustomInterface);
134 * Factory function for creating the audio StereoWidening utility object.
136 * @param aUtility A reference to CMidiClientUtility
137 * @return pointer to CStereoWideningUtility object
139 IMPORT_C static CStereoWideningUtility* NewL(CMidiClientUtility& aUtility);
142 * Factory function for creating the audio StereoWidening utility object.
144 * @param CDrmPlayerUtility A reference to a CDrmPlayerUtility object
145 * @return pointer to CStereoWideningUtility object
147 IMPORT_C static CStereoWideningUtility* NewL( CDrmPlayerUtility& aUtility );
150 * Factory function for creating the audio StereoWidening utility object.
152 * @param CVideoPlayerUtility A reference to a CVideoPlayerUtility object
153 * @return pointer to CStereoWideningUtility object
155 IMPORT_C static CStereoWideningUtility* NewL( CVideoPlayerUtility& aUtility );
160 virtual ~CStereoWideningUtility();
163 * Apply the Preset Index value
165 * @param aPreset Preset Value
167 IMPORT_C void ApplyPresetL(TInt aPreset);
170 * Disable the StereoWidening
173 IMPORT_C void DisableStereoWideningL();
176 * Create a Preset with the given Name and StereoWidening Settings
178 * @param aName Name of the Preset
179 * @param aStereoWidening StereoWidening Settings for the Preset
181 IMPORT_C void CreatePresetL(TDesC& aName, CStereoWidening& aStereoWideningUI);
184 * Delete a Preset with the given index in the Central Repository
186 * @param aPresetIndex Index of the Preset in the Array
188 IMPORT_C void DeletePresetL(TInt aPresetIndex);
191 * Retrieves a Preset with the given index from the Central Repository
193 * @param aPresetIndex Index of the Preset in the Array
195 IMPORT_C const TDesC& GetPresetL(TInt aPresetIndex);
198 * Get the reference to the StereoWidening Object
200 * @return Reference to the StereoWidening Object.
202 IMPORT_C CStereoWidening& StereoWidening();
205 * Modify a Preset with the given Name and StereoWidening Settings
207 * @param aPresetIndex Array Index of the Preset
208 * @param aName Name of the Preset
209 * @param aStereoWidening StereoWidening Settings for the Preset
211 IMPORT_C void ModifyPresetL(TInt aPresetIndex, TDesC& aName, CStereoWidening& aStereoWideningUI);
214 * Get the number of Pre Defined Presets
216 * @return Number of Pre Defined Presets
218 IMPORT_C TUint32 NumberOfPreDefinedPresets() const;
221 * Get all the Presets defined in the Central Repository
223 * @return Array of all Presets.
225 IMPORT_C TArray<TEfStereoWideningUtilityPreset> Presets();
228 * Reset a System Defined Preset with the given index in the Array returned from Presets()
230 * @param aPresetIndex Index of the Preset in the Array
232 IMPORT_C void ResetPresetL(TInt aPresetIndex);
237 * C++ default constructor.
239 CStereoWideningUtility();
242 * By default Symbian 2nd phase constructor is private.
246 * Second Phase Costructor for DevSound Instance
248 * @param aDevSound DevSound Referece
250 void ConstructL(CMMFDevSound& aDevSound);
253 * Second Phase Costructor for Audio Convert Utility
255 * @param aUtility CMdaAudioConvertUtility Referece
257 void ConstructL(CMdaAudioConvertUtility& aUtility);
260 * Second Phase Costructor for CMdaAudioInputStream
262 * @param aUtility CMdaAudioInputStream Referece
264 void ConstructL(CMdaAudioInputStream& aUtility);
267 * Second Phase Costructor for CMdaAudioOutputStream
269 * @param aUtilityCMdaAudioOutputStream Referece
271 void ConstructL(CMdaAudioOutputStream& aUtility);
274 * Second Phase Costructor for CMdaAudioPlayerUtility
276 * @param aUtility CMdaAudioPlayerUtility Referece
278 void ConstructL(CMdaAudioPlayerUtility& aUtility);
281 * Second Phase Costructor for CMdaAudioRecordUtility
283 * @param aUtility CMdaAudioRecordUtility Referece
285 void ConstructL(CMdaAudioRecorderUtility& aUtility);
288 * Second Phase Costructor for CMdaAudioToneUtility
290 * @param aUtility CMdaAudioToneUtility Referece
292 void ConstructL(CMdaAudioToneUtility& aUtility);
295 * Second Phase Costructor for MCustomCommand
297 * @param aUtility MCustomCommand Referece
299 void ConstructL(CCustomCommandUtility* aUtility);
302 * Second Phase Costructor for MCustomInterface
304 * @param aUtility MCustomInterface Referece
306 void ConstructL(MCustomInterface& aCustomInterface);
309 * Second Phase Costructor for CMidiClientUtility
311 * @param aUtility CMidiClientUtility Referece
313 void ConstructL(CMidiClientUtility& aUtility);
316 * Second Phase Costructor for CDrmPlayerUtility
318 * @param aUtility CDrmPlayerUtility Referece
320 void ConstructL(CDrmPlayerUtility& aUtility);
323 * Second Phase Costructor for CVideoPlayerUtility
325 * @param aUtility CVideoPlayerUtility Referece
327 void ConstructL(CVideoPlayerUtility& aUtility);
330 * Function for Updating the Array from the Central Repository
332 * @param aUtility MCustomInterface Referece
334 void UpdateFullPresetArrayFromCenRep(RArray<TEfStereoWideningUtilityPreset> &aFullPresetArray);
337 * Function of Updating the Preset Array for the User
339 * @param aUtility MCustomInterface Referece
341 void UpdatePresetArray(RArray<TEfStereoWideningUtilityPreset>& aPresetArray,const RArray<TEfStereoWideningUtilityPreset> &aFullPresetArray);
346 // Array for Storing the Current State of the Repository
347 // which has been compacted after the transaction
348 // with the Central Repository
349 RArray<TEfStereoWideningUtilityPreset> iPresetArray;
351 // Array Which contains the full information from the
352 // Central Repository except the Description Values
353 RArray<TEfStereoWideningUtilityPreset> iFullPresetArray;
355 // Pointer to the StereoWidening Object
356 CStereoWidening* iStereoWidening;
358 // Pointer to the StereoWidening Object
359 // which is returned to the UI for Manipulation
360 CStereoWidening* iTransStereoWidening;
362 // Pointer to the Preset Repository
363 CRepository* iPresetRepository;
366 #endif // CStereoWideningUTILITY_H