1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/mm/mm_pub/audio_effects_presets_api/inc/AudioEqualizerUtility.h Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,380 @@
1.4 +/*
1.5 +* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies).
1.6 +* All rights reserved.
1.7 +* This component and the accompanying materials are made available
1.8 +* under the terms of "Eclipse Public License v1.0"
1.9 +* which accompanies this distribution, and is available
1.10 +* at the URL "http://www.eclipse.org/legal/epl-v10.html".
1.11 +*
1.12 +* Initial Contributors:
1.13 +* Nokia Corporation - initial contribution.
1.14 +*
1.15 +* Contributors:
1.16 +*
1.17 +* Description: This is the definition of the audio equalizer utility class.
1.18 +*
1.19 +*/
1.20 +
1.21 +
1.22 +
1.23 +#ifndef CAUDIOEQUALIZERUTILITY_H
1.24 +#define CAUDIOEQUALIZERUTILITY_H
1.25 +
1.26 +// INCLUDES
1.27 +#include <e32base.h>
1.28 +#include <e32svr.h>
1.29 +#include <AudioEqualizerBase.h>
1.30 +#include <BassBoostBase.h>
1.31 +#include <centralrepository.h>
1.32 +#include <AudioEqualizerUtilityData.h>
1.33 +
1.34 +// FORWARD DECLARATIONS
1.35 +class TEfAudioEqualizerUtilityPreset;
1.36 +class CAudioEqualizer;
1.37 +class CBassBoost;
1.38 +class CMdaAudioConvertUtility;
1.39 +class CMdaAudioPlayerUtility;
1.40 +class CMdaAudioRecorderUtility;
1.41 +class CMdaAudioInputStream;
1.42 +class CMdaAudioOutputStream;
1.43 +class CMdaAudioToneUtility;
1.44 +class CCustomCommandUtility;
1.45 +class CCustomInterfaceUtility;
1.46 +class CMMFDevSound;
1.47 +class CRepository;
1.48 +class CMidiClientUtility;
1.49 +class CDrmPlayerUtility;
1.50 +class CVideoPlayerUtility;
1.51 +
1.52 +// CLASS DECLARATION
1.53 +
1.54 +/**
1.55 +* This is the Equalizer Utility class for managing audio equalizer presets.
1.56 +*
1.57 +* @lib AudioEqualizerUtility.lib
1.58 +* @since 3.0
1.59 +*/
1.60 +
1.61 +class CAudioEqualizerUtility : public CBase
1.62 + {
1.63 + public: // Constructors and destructor
1.64 +
1.65 +
1.66 + /**
1.67 + * Factory function for creating the audio equalizer utility object.
1.68 + * @since 3.0
1.69 + * @param aUtility A reference to a Devsound Instance
1.70 + * @return pointer to CAudioEqualizerUtility object
1.71 + */
1.72 + IMPORT_C static CAudioEqualizerUtility* NewL(CMMFDevSound& aDevSound);
1.73 +
1.74 + /**
1.75 + * Factory function for creating the audio equalizer utility object.
1.76 + * @since 3.0
1.77 + * @param aUtility A reference to a convert utility
1.78 + * @return pointer to CAudioEqualizerUtility object
1.79 + */
1.80 + IMPORT_C static CAudioEqualizerUtility* NewL(CMdaAudioConvertUtility& aUtility);
1.81 +
1.82 + /**
1.83 + * Factory function for creating the audio equalizer utility object.
1.84 + * @since 3.0
1.85 + * @param aUtility A reference to a audio input stream utility
1.86 + * @return pointer to CAudioEqualizerUtility object
1.87 + */
1.88 + IMPORT_C static CAudioEqualizerUtility* NewL(CMdaAudioInputStream& aUtility);
1.89 +
1.90 + /**
1.91 + * Factory function for creating the audio equalizer utility object.
1.92 + * @since 3.0
1.93 + * @param aUtility A reference to a audio output stream utility
1.94 + * @return pointer to CAudioEqualizerUtility object
1.95 + */
1.96 + IMPORT_C static CAudioEqualizerUtility* NewL(CMdaAudioOutputStream& aUtility);
1.97 +
1.98 + /**
1.99 + * Factory function for creating the audio equalizer utility object.
1.100 + * @since 3.0
1.101 + * @param aUtility A reference to a audio player utility
1.102 + * @return pointer to CAudioEqualizerUtility object
1.103 + */
1.104 + IMPORT_C static CAudioEqualizerUtility* NewL(CMdaAudioPlayerUtility& aUtility);
1.105 +
1.106 + /**
1.107 + * Factory function for creating the audio equalizer utility object.
1.108 + * @since 3.0
1.109 + * @param aUtility A reference to a audio recorder utility
1.110 + * @return pointer to CAudioEqualizerUtility object
1.111 + */
1.112 + IMPORT_C static CAudioEqualizerUtility* NewL(CMdaAudioRecorderUtility& aUtility);
1.113 +
1.114 + /**
1.115 + * Factory function for creating the audio equalizer utility object.
1.116 + * @since 3.0
1.117 + * @param aUtility A reference to a audio tone utility
1.118 + * @return pointer to CAudioEqualizerUtility object
1.119 + */
1.120 + IMPORT_C static CAudioEqualizerUtility* NewL(CMdaAudioToneUtility& aUtility);
1.121 +
1.122 + /**
1.123 + * Factory function for creating the audio equalizer utility object.
1.124 + * @since 3.0
1.125 + * @param aUtility A reference to custom command utility
1.126 + * @return pointer to CAudioEqualizerUtility object
1.127 + */
1.128 + IMPORT_C static CAudioEqualizerUtility* NewL(CCustomCommandUtility* aUtility);
1.129 +
1.130 + /**
1.131 + * Factory function for creating the audio equalizer utility object.
1.132 + * @since 3.0
1.133 + * @param aUtility A reference to custom interface utility
1.134 + * @return pointer to CAudioEqualizerUtility object
1.135 + */
1.136 + IMPORT_C static CAudioEqualizerUtility* NewL(MCustomInterface& aCustomInterface);
1.137 +
1.138 + /**
1.139 + * Factory function for creating the audio equalizer utility object.
1.140 + * @since 3.0
1.141 + * @param aUtility A reference to CMidiClientUtility
1.142 + * @return pointer to CAudioEqualizerUtility object
1.143 + */
1.144 + IMPORT_C static CAudioEqualizerUtility* NewL(CMidiClientUtility& aUtility);
1.145 +
1.146 + /**
1.147 + * Factory function for creating the audio equalizer object.
1.148 + * @since 3.0
1.149 + * @param CDrmPlayerUtility A reference to a CDrmPlayerUtility object
1.150 + * @return pointer to CAudioEqualizer object
1.151 + */
1.152 + IMPORT_C static CAudioEqualizerUtility* NewL( CDrmPlayerUtility& aUtility );
1.153 +
1.154 + /**
1.155 + * Factory function for creating the audio equalizer object.
1.156 + * @since 3.2
1.157 + * @param CVideoPlayerUtility A reference to a CVideoPlayerUtility object
1.158 + * @return pointer to CAudioEqualizer object
1.159 + */
1.160 + IMPORT_C static CAudioEqualizerUtility* NewL( CVideoPlayerUtility& aUtility );
1.161 +
1.162 + /**
1.163 + * Destructor.
1.164 + */
1.165 + virtual ~CAudioEqualizerUtility();
1.166 +
1.167 + /**
1.168 + * Apply the Preset Index value
1.169 + * @since 3.0
1.170 + * @param aPreset Preset Value
1.171 + */
1.172 + IMPORT_C void ApplyPresetL(TInt aPreset);
1.173 +
1.174 + /**
1.175 + * Disable the Equalizer
1.176 + * @since 3.0
1.177 + */
1.178 + IMPORT_C void DisableEqualizerL();
1.179 +
1.180 + /**
1.181 + * Create a Preset with the given Name and Equalizer Settings
1.182 + * @since 3.0
1.183 + * @param aName Name of the Preset
1.184 + * @param aAudioEqualizer Equalizer Settings for the Preset
1.185 + */
1.186 + IMPORT_C void CreatePresetL(TDesC& aName, CAudioEqualizer& aAudioEqualizerUI);
1.187 +
1.188 + /**
1.189 + * Delete a Preset with the given index in the Central Repository
1.190 + * @since 3.0
1.191 + * @param aPresetIndex Index of the Preset in the Array
1.192 + */
1.193 + IMPORT_C void DeletePresetL(TInt aPresetIndex);
1.194 +
1.195 + /**
1.196 + * Retrieves a Preset with the given index from the Central Repository
1.197 + * @since 3.0
1.198 + * @param aPresetIndex Index of the Preset in the Array
1.199 + */
1.200 + IMPORT_C const TDesC& GetPresetL(TInt aPresetIndex);
1.201 +
1.202 + /**
1.203 + * Get the reference to the Equalizer Object
1.204 + * @since 3.0
1.205 + * @return Reference to the Equalizer Object.
1.206 + */
1.207 + IMPORT_C CAudioEqualizer& Equalizer();
1.208 +
1.209 + /**
1.210 + * Get the reference to the BassBoost Object
1.211 + * @since 3.0
1.212 + * @return Reference to the CBassBoost Object.
1.213 + */
1.214 + IMPORT_C CBassBoost& BassBoost();
1.215 +
1.216 + /**
1.217 + * Modify a Preset with the given Name and Equalizer Settings
1.218 + * @since 3.0
1.219 + * @param aPresetIndex Array Index of the Preset
1.220 + * @param aName Name of the Preset
1.221 + * @param aAudioEqualizer Equalizer Settings for the Preset
1.222 + */
1.223 + IMPORT_C void ModifyPresetL(TInt aPresetIndex, TDesC& aName, CAudioEqualizer& aAudioEqualizerUI);
1.224 +
1.225 + /**
1.226 + * Get the number of Pre Defined Presets
1.227 + * @since 3.0
1.228 + * @return Number of Pre Defined Presets
1.229 + */
1.230 + IMPORT_C TUint32 NumberOfPreDefinedPresets() const;
1.231 +
1.232 + /**
1.233 + * Get all the Presets defined in the Central Repository
1.234 + * @since 3.0
1.235 + * @return Array of all Presets.
1.236 + */
1.237 + IMPORT_C TArray<TEfAudioEqualizerUtilityPreset> Presets();
1.238 +
1.239 + /**
1.240 + * Reset a System Defined Preset with the given index in the Array returned from Presets()
1.241 + * @since 3.0
1.242 + * @param aPresetIndex Index of the Preset in the Array
1.243 + */
1.244 + IMPORT_C void ResetPresetL(TInt aPresetIndex);
1.245 +
1.246 + private:
1.247 +
1.248 + /**
1.249 + * C++ default constructor.
1.250 + */
1.251 + CAudioEqualizerUtility();
1.252 +
1.253 + /**
1.254 + * By default Symbian 2nd phase constructor is private.
1.255 + */
1.256 +
1.257 + /**
1.258 + * Second Phase Costructor for DevSound Instance
1.259 + * @since 3.0
1.260 + * @param aDevSound DevSound Referece
1.261 + */
1.262 + void ConstructL(CMMFDevSound& aDevSound);
1.263 +
1.264 + /**
1.265 + * Second Phase Costructor for Audio Convert Utility
1.266 + * @since 3.0
1.267 + * @param aUtility CMdaAudioConvertUtility Referece
1.268 + */
1.269 + void ConstructL(CMdaAudioConvertUtility& aUtility);
1.270 +
1.271 + /**
1.272 + * Second Phase Costructor for CMdaAudioInputStream
1.273 + * @since 3.0
1.274 + * @param aUtility CMdaAudioInputStream Referece
1.275 + */
1.276 + void ConstructL(CMdaAudioInputStream& aUtility);
1.277 +
1.278 + /**
1.279 + * Second Phase Costructor for CMdaAudioOutputStream
1.280 + * @since 3.0
1.281 + * @param aUtilityCMdaAudioOutputStream Referece
1.282 + */
1.283 + void ConstructL(CMdaAudioOutputStream& aUtility);
1.284 +
1.285 + /**
1.286 + * Second Phase Costructor for CMdaAudioPlayerUtility
1.287 + * @since 3.0
1.288 + * @param aUtility CMdaAudioPlayerUtility Referece
1.289 + */
1.290 + void ConstructL(CMdaAudioPlayerUtility& aUtility);
1.291 +
1.292 + /**
1.293 + * Second Phase Costructor for CMdaAudioRecordUtility
1.294 + * @since 3.0
1.295 + * @param aUtility CMdaAudioRecordUtility Referece
1.296 + */
1.297 + void ConstructL(CMdaAudioRecorderUtility& aUtility);
1.298 +
1.299 + /**
1.300 + * Second Phase Costructor for CMdaAudioToneUtility
1.301 + * @since 3.0
1.302 + * @param aUtility CMdaAudioToneUtility Referece
1.303 + */
1.304 + void ConstructL(CMdaAudioToneUtility& aUtility);
1.305 +
1.306 + /**
1.307 + * Second Phase Costructor for MCustomCommand
1.308 + * @since 3.0
1.309 + * @param aUtility MCustomCommand Referece
1.310 + */
1.311 + void ConstructL(CCustomCommandUtility* aUtility);
1.312 +
1.313 + /**
1.314 + * Second Phase Costructor for MCustomInterface
1.315 + * @since 3.0
1.316 + * @param aUtility MCustomInterface Referece
1.317 + */
1.318 + void ConstructL(MCustomInterface& aCustomInterface);
1.319 +
1.320 + /**
1.321 + * Second Phase Costructor for CMidiClientUtility
1.322 + * @since 3.0
1.323 + * @param aUtility CMidiClientUtility Referece
1.324 + */
1.325 + void ConstructL(CMidiClientUtility& aUtility);
1.326 +
1.327 + /**
1.328 + * Second Phase Costructor for CDrmPlayerUtility
1.329 + * @since 3.0
1.330 + * @param aUtility CDrmPlayerUtility Referece
1.331 + */
1.332 + void ConstructL(CDrmPlayerUtility& aUtility);
1.333 +
1.334 + /**
1.335 + * Second Phase Costructor for CVideoPlayerUtility
1.336 + * @since 3.2
1.337 + * @param aUtility CVideoPlayerUtility Referece
1.338 + */
1.339 + void ConstructL(CVideoPlayerUtility& aUtility);
1.340 +
1.341 + /**
1.342 + * Function for Updating the Array from the Central Repository
1.343 + * @since 3.0
1.344 + * @param aUtility MCustomInterface Referece
1.345 + */
1.346 + void UpdateFullPresetArrayFromCenRep(RArray<TEfAudioEqualizerUtilityPreset> &aFullPresetArray);
1.347 +
1.348 + /**
1.349 + * Function of Updating the Preset Array for the User
1.350 + * @since 3.0
1.351 + * @param aUtility MCustomInterface Referece
1.352 + */
1.353 + void UpdatePresetArray(RArray<TEfAudioEqualizerUtilityPreset>& aPresetArray,const RArray<TEfAudioEqualizerUtilityPreset> &aFullPresetArray);
1.354 +
1.355 +
1.356 + private: // Data
1.357 +
1.358 + // Array for Storing the Current State of the Repository
1.359 + // which has been compacted after the transaction
1.360 + // with the Central Repository
1.361 + RArray<TEfAudioEqualizerUtilityPreset> iPresetArray;
1.362 +
1.363 + // Array Which contains the full information from the
1.364 + // Central Repository except the Description Values
1.365 + RArray<TEfAudioEqualizerUtilityPreset> iFullPresetArray;
1.366 +
1.367 + // Pointer to the Equalizer Object
1.368 + CAudioEqualizer* iAudioEqualizer;
1.369 +
1.370 + // Pointer to the Equalizer Object
1.371 + // which is returned to the UI for Manipulation
1.372 + CAudioEqualizer* iTransAudioEqualizer;
1.373 +
1.374 + // Pointer to the Bass Boost Ojbect
1.375 + CBassBoost* iBassBoost;
1.376 +
1.377 + // Pointer to the Preset Repository
1.378 + CRepository* iPresetRepository;
1.379 + };
1.380 +
1.381 +#endif // CAUDIOEQUALIZERUTILITY_H
1.382 +
1.383 +// End of File