sl@0: /* sl@0: * Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). sl@0: * All rights reserved. sl@0: * This component and the accompanying materials are made available sl@0: * under the terms of "Eclipse Public License v1.0" sl@0: * which accompanies this distribution, and is available sl@0: * at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: * sl@0: * Initial Contributors: sl@0: * Nokia Corporation - initial contribution. sl@0: * sl@0: * Contributors: sl@0: * sl@0: * Description: This is the definition of the audio equalizer utility class. sl@0: * sl@0: */ sl@0: sl@0: sl@0: sl@0: #ifndef CAUDIOEQUALIZERUTILITY_H sl@0: #define CAUDIOEQUALIZERUTILITY_H sl@0: sl@0: // INCLUDES sl@0: #include sl@0: #include sl@0: #include sl@0: #include sl@0: #include sl@0: #include sl@0: sl@0: // FORWARD DECLARATIONS sl@0: class TEfAudioEqualizerUtilityPreset; sl@0: class CAudioEqualizer; sl@0: class CBassBoost; sl@0: class CMdaAudioConvertUtility; sl@0: class CMdaAudioPlayerUtility; sl@0: class CMdaAudioRecorderUtility; sl@0: class CMdaAudioInputStream; sl@0: class CMdaAudioOutputStream; sl@0: class CMdaAudioToneUtility; sl@0: class CCustomCommandUtility; sl@0: class CCustomInterfaceUtility; sl@0: class CMMFDevSound; sl@0: class CRepository; sl@0: class CMidiClientUtility; sl@0: class CDrmPlayerUtility; sl@0: class CVideoPlayerUtility; sl@0: sl@0: // CLASS DECLARATION sl@0: sl@0: /** sl@0: * This is the Equalizer Utility class for managing audio equalizer presets. sl@0: * sl@0: * @lib AudioEqualizerUtility.lib sl@0: * @since 3.0 sl@0: */ sl@0: sl@0: class CAudioEqualizerUtility : public CBase sl@0: { sl@0: public: // Constructors and destructor sl@0: sl@0: sl@0: /** sl@0: * Factory function for creating the audio equalizer utility object. sl@0: * @since 3.0 sl@0: * @param aUtility A reference to a Devsound Instance sl@0: * @return pointer to CAudioEqualizerUtility object sl@0: */ sl@0: IMPORT_C static CAudioEqualizerUtility* NewL(CMMFDevSound& aDevSound); sl@0: sl@0: /** sl@0: * Factory function for creating the audio equalizer utility object. sl@0: * @since 3.0 sl@0: * @param aUtility A reference to a convert utility sl@0: * @return pointer to CAudioEqualizerUtility object sl@0: */ sl@0: IMPORT_C static CAudioEqualizerUtility* NewL(CMdaAudioConvertUtility& aUtility); sl@0: sl@0: /** sl@0: * Factory function for creating the audio equalizer utility object. sl@0: * @since 3.0 sl@0: * @param aUtility A reference to a audio input stream utility sl@0: * @return pointer to CAudioEqualizerUtility object sl@0: */ sl@0: IMPORT_C static CAudioEqualizerUtility* NewL(CMdaAudioInputStream& aUtility); sl@0: sl@0: /** sl@0: * Factory function for creating the audio equalizer utility object. sl@0: * @since 3.0 sl@0: * @param aUtility A reference to a audio output stream utility sl@0: * @return pointer to CAudioEqualizerUtility object sl@0: */ sl@0: IMPORT_C static CAudioEqualizerUtility* NewL(CMdaAudioOutputStream& aUtility); sl@0: sl@0: /** sl@0: * Factory function for creating the audio equalizer utility object. sl@0: * @since 3.0 sl@0: * @param aUtility A reference to a audio player utility sl@0: * @return pointer to CAudioEqualizerUtility object sl@0: */ sl@0: IMPORT_C static CAudioEqualizerUtility* NewL(CMdaAudioPlayerUtility& aUtility); sl@0: sl@0: /** sl@0: * Factory function for creating the audio equalizer utility object. sl@0: * @since 3.0 sl@0: * @param aUtility A reference to a audio recorder utility sl@0: * @return pointer to CAudioEqualizerUtility object sl@0: */ sl@0: IMPORT_C static CAudioEqualizerUtility* NewL(CMdaAudioRecorderUtility& aUtility); sl@0: sl@0: /** sl@0: * Factory function for creating the audio equalizer utility object. sl@0: * @since 3.0 sl@0: * @param aUtility A reference to a audio tone utility sl@0: * @return pointer to CAudioEqualizerUtility object sl@0: */ sl@0: IMPORT_C static CAudioEqualizerUtility* NewL(CMdaAudioToneUtility& aUtility); sl@0: sl@0: /** sl@0: * Factory function for creating the audio equalizer utility object. sl@0: * @since 3.0 sl@0: * @param aUtility A reference to custom command utility sl@0: * @return pointer to CAudioEqualizerUtility object sl@0: */ sl@0: IMPORT_C static CAudioEqualizerUtility* NewL(CCustomCommandUtility* aUtility); sl@0: sl@0: /** sl@0: * Factory function for creating the audio equalizer utility object. sl@0: * @since 3.0 sl@0: * @param aUtility A reference to custom interface utility sl@0: * @return pointer to CAudioEqualizerUtility object sl@0: */ sl@0: IMPORT_C static CAudioEqualizerUtility* NewL(MCustomInterface& aCustomInterface); sl@0: sl@0: /** sl@0: * Factory function for creating the audio equalizer utility object. sl@0: * @since 3.0 sl@0: * @param aUtility A reference to CMidiClientUtility sl@0: * @return pointer to CAudioEqualizerUtility object sl@0: */ sl@0: IMPORT_C static CAudioEqualizerUtility* NewL(CMidiClientUtility& aUtility); sl@0: sl@0: /** sl@0: * Factory function for creating the audio equalizer object. sl@0: * @since 3.0 sl@0: * @param CDrmPlayerUtility A reference to a CDrmPlayerUtility object sl@0: * @return pointer to CAudioEqualizer object sl@0: */ sl@0: IMPORT_C static CAudioEqualizerUtility* NewL( CDrmPlayerUtility& aUtility ); sl@0: sl@0: /** sl@0: * Factory function for creating the audio equalizer object. sl@0: * @since 3.2 sl@0: * @param CVideoPlayerUtility A reference to a CVideoPlayerUtility object sl@0: * @return pointer to CAudioEqualizer object sl@0: */ sl@0: IMPORT_C static CAudioEqualizerUtility* NewL( CVideoPlayerUtility& aUtility ); sl@0: sl@0: /** sl@0: * Destructor. sl@0: */ sl@0: virtual ~CAudioEqualizerUtility(); sl@0: sl@0: /** sl@0: * Apply the Preset Index value sl@0: * @since 3.0 sl@0: * @param aPreset Preset Value sl@0: */ sl@0: IMPORT_C void ApplyPresetL(TInt aPreset); sl@0: sl@0: /** sl@0: * Disable the Equalizer sl@0: * @since 3.0 sl@0: */ sl@0: IMPORT_C void DisableEqualizerL(); sl@0: sl@0: /** sl@0: * Create a Preset with the given Name and Equalizer Settings sl@0: * @since 3.0 sl@0: * @param aName Name of the Preset sl@0: * @param aAudioEqualizer Equalizer Settings for the Preset sl@0: */ sl@0: IMPORT_C void CreatePresetL(TDesC& aName, CAudioEqualizer& aAudioEqualizerUI); sl@0: sl@0: /** sl@0: * Delete a Preset with the given index in the Central Repository sl@0: * @since 3.0 sl@0: * @param aPresetIndex Index of the Preset in the Array sl@0: */ sl@0: IMPORT_C void DeletePresetL(TInt aPresetIndex); sl@0: sl@0: /** sl@0: * Retrieves a Preset with the given index from the Central Repository sl@0: * @since 3.0 sl@0: * @param aPresetIndex Index of the Preset in the Array sl@0: */ sl@0: IMPORT_C const TDesC& GetPresetL(TInt aPresetIndex); sl@0: sl@0: /** sl@0: * Get the reference to the Equalizer Object sl@0: * @since 3.0 sl@0: * @return Reference to the Equalizer Object. sl@0: */ sl@0: IMPORT_C CAudioEqualizer& Equalizer(); sl@0: sl@0: /** sl@0: * Get the reference to the BassBoost Object sl@0: * @since 3.0 sl@0: * @return Reference to the CBassBoost Object. sl@0: */ sl@0: IMPORT_C CBassBoost& BassBoost(); sl@0: sl@0: /** sl@0: * Modify a Preset with the given Name and Equalizer Settings sl@0: * @since 3.0 sl@0: * @param aPresetIndex Array Index of the Preset sl@0: * @param aName Name of the Preset sl@0: * @param aAudioEqualizer Equalizer Settings for the Preset sl@0: */ sl@0: IMPORT_C void ModifyPresetL(TInt aPresetIndex, TDesC& aName, CAudioEqualizer& aAudioEqualizerUI); sl@0: sl@0: /** sl@0: * Get the number of Pre Defined Presets sl@0: * @since 3.0 sl@0: * @return Number of Pre Defined Presets sl@0: */ sl@0: IMPORT_C TUint32 NumberOfPreDefinedPresets() const; sl@0: sl@0: /** sl@0: * Get all the Presets defined in the Central Repository sl@0: * @since 3.0 sl@0: * @return Array of all Presets. sl@0: */ sl@0: IMPORT_C TArray Presets(); sl@0: sl@0: /** sl@0: * Reset a System Defined Preset with the given index in the Array returned from Presets() sl@0: * @since 3.0 sl@0: * @param aPresetIndex Index of the Preset in the Array sl@0: */ sl@0: IMPORT_C void ResetPresetL(TInt aPresetIndex); sl@0: sl@0: private: sl@0: sl@0: /** sl@0: * C++ default constructor. sl@0: */ sl@0: CAudioEqualizerUtility(); sl@0: sl@0: /** sl@0: * By default Symbian 2nd phase constructor is private. sl@0: */ sl@0: sl@0: /** sl@0: * Second Phase Costructor for DevSound Instance sl@0: * @since 3.0 sl@0: * @param aDevSound DevSound Referece sl@0: */ sl@0: void ConstructL(CMMFDevSound& aDevSound); sl@0: sl@0: /** sl@0: * Second Phase Costructor for Audio Convert Utility sl@0: * @since 3.0 sl@0: * @param aUtility CMdaAudioConvertUtility Referece sl@0: */ sl@0: void ConstructL(CMdaAudioConvertUtility& aUtility); sl@0: sl@0: /** sl@0: * Second Phase Costructor for CMdaAudioInputStream sl@0: * @since 3.0 sl@0: * @param aUtility CMdaAudioInputStream Referece sl@0: */ sl@0: void ConstructL(CMdaAudioInputStream& aUtility); sl@0: sl@0: /** sl@0: * Second Phase Costructor for CMdaAudioOutputStream sl@0: * @since 3.0 sl@0: * @param aUtilityCMdaAudioOutputStream Referece sl@0: */ sl@0: void ConstructL(CMdaAudioOutputStream& aUtility); sl@0: sl@0: /** sl@0: * Second Phase Costructor for CMdaAudioPlayerUtility sl@0: * @since 3.0 sl@0: * @param aUtility CMdaAudioPlayerUtility Referece sl@0: */ sl@0: void ConstructL(CMdaAudioPlayerUtility& aUtility); sl@0: sl@0: /** sl@0: * Second Phase Costructor for CMdaAudioRecordUtility sl@0: * @since 3.0 sl@0: * @param aUtility CMdaAudioRecordUtility Referece sl@0: */ sl@0: void ConstructL(CMdaAudioRecorderUtility& aUtility); sl@0: sl@0: /** sl@0: * Second Phase Costructor for CMdaAudioToneUtility sl@0: * @since 3.0 sl@0: * @param aUtility CMdaAudioToneUtility Referece sl@0: */ sl@0: void ConstructL(CMdaAudioToneUtility& aUtility); sl@0: sl@0: /** sl@0: * Second Phase Costructor for MCustomCommand sl@0: * @since 3.0 sl@0: * @param aUtility MCustomCommand Referece sl@0: */ sl@0: void ConstructL(CCustomCommandUtility* aUtility); sl@0: sl@0: /** sl@0: * Second Phase Costructor for MCustomInterface sl@0: * @since 3.0 sl@0: * @param aUtility MCustomInterface Referece sl@0: */ sl@0: void ConstructL(MCustomInterface& aCustomInterface); sl@0: sl@0: /** sl@0: * Second Phase Costructor for CMidiClientUtility sl@0: * @since 3.0 sl@0: * @param aUtility CMidiClientUtility Referece sl@0: */ sl@0: void ConstructL(CMidiClientUtility& aUtility); sl@0: sl@0: /** sl@0: * Second Phase Costructor for CDrmPlayerUtility sl@0: * @since 3.0 sl@0: * @param aUtility CDrmPlayerUtility Referece sl@0: */ sl@0: void ConstructL(CDrmPlayerUtility& aUtility); sl@0: sl@0: /** sl@0: * Second Phase Costructor for CVideoPlayerUtility sl@0: * @since 3.2 sl@0: * @param aUtility CVideoPlayerUtility Referece sl@0: */ sl@0: void ConstructL(CVideoPlayerUtility& aUtility); sl@0: sl@0: /** sl@0: * Function for Updating the Array from the Central Repository sl@0: * @since 3.0 sl@0: * @param aUtility MCustomInterface Referece sl@0: */ sl@0: void UpdateFullPresetArrayFromCenRep(RArray &aFullPresetArray); sl@0: sl@0: /** sl@0: * Function of Updating the Preset Array for the User sl@0: * @since 3.0 sl@0: * @param aUtility MCustomInterface Referece sl@0: */ sl@0: void UpdatePresetArray(RArray& aPresetArray,const RArray &aFullPresetArray); sl@0: sl@0: sl@0: private: // Data sl@0: sl@0: // Array for Storing the Current State of the Repository sl@0: // which has been compacted after the transaction sl@0: // with the Central Repository sl@0: RArray iPresetArray; sl@0: sl@0: // Array Which contains the full information from the sl@0: // Central Repository except the Description Values sl@0: RArray iFullPresetArray; sl@0: sl@0: // Pointer to the Equalizer Object sl@0: CAudioEqualizer* iAudioEqualizer; sl@0: sl@0: // Pointer to the Equalizer Object sl@0: // which is returned to the UI for Manipulation sl@0: CAudioEqualizer* iTransAudioEqualizer; sl@0: sl@0: // Pointer to the Bass Boost Ojbect sl@0: CBassBoost* iBassBoost; sl@0: sl@0: // Pointer to the Preset Repository sl@0: CRepository* iPresetRepository; sl@0: }; sl@0: sl@0: #endif // CAUDIOEQUALIZERUTILITY_H sl@0: sl@0: // End of File