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 Environmental Reverb effect class. sl@0: * sl@0: */ sl@0: sl@0: sl@0: #ifndef CENVIRONMENTALREVERB_H sl@0: #define CENVIRONMENTALREVERB_H sl@0: sl@0: // INCLUDES sl@0: sl@0: #include sl@0: #include sl@0: #include sl@0: #include sl@0: sl@0: const TUid KUidEnvironmentalReverbEffect = {0x10203837}; sl@0: sl@0: // FORWARD DELCARATION 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 CMidiClientUtility; sl@0: class CDrmPlayerUtility; sl@0: class CVideoPlayerUtility; sl@0: sl@0: // CLASS DECLARATION sl@0: sl@0: /** sl@0: * This is the Environmental Reverb effect class for managing reverb settings. sl@0: * sl@0: * @lib EnvironmentalReverbEffect.lib sl@0: * @since 3.0 sl@0: */ sl@0: sl@0: class CEnvironmentalReverb : public CAudioEffect sl@0: { sl@0: sl@0: public: //New Functions sl@0: sl@0: /** sl@0: * Factory function for creating the audio reverb object. sl@0: * @since 3.0 sl@0: * @return pointer to CEnvironmentalReverb object sl@0: */ sl@0: IMPORT_C static CEnvironmentalReverb* NewL(); sl@0: sl@0: /** sl@0: * Factory function for creating the audio reverb object. sl@0: * @since 3.0 sl@0: * @param aUtility A reference to a convert utility sl@0: * @return pointer to CEnvironmentalReverb object sl@0: */ sl@0: IMPORT_C static CEnvironmentalReverb* NewL( CMdaAudioConvertUtility& aUtility ); sl@0: sl@0: /** sl@0: * Factory function for creating the audio reverb object. sl@0: * @since 3.0 sl@0: * @param aUtility A reference to an audio input stream utility sl@0: * @return pointer to CEnvironmentalReverb object sl@0: */ sl@0: IMPORT_C static CEnvironmentalReverb* NewL( CMdaAudioInputStream& aUtility ); sl@0: sl@0: /** sl@0: * Factory function for creating the audio reverb object. sl@0: * @since 3.0 sl@0: * @param aUtility A reference to an audio output stream utility sl@0: * @return pointer to CEnvironmentalReverb object sl@0: */ sl@0: IMPORT_C static CEnvironmentalReverb* NewL( CMdaAudioOutputStream& aUtility ); sl@0: sl@0: /** sl@0: * Factory function for creating the audio reverb object. sl@0: * @since 3.0 sl@0: * @param aUtility A reference to an audio player utility sl@0: * @return pointer to CEnvironmentalReverb object sl@0: */ sl@0: IMPORT_C static CEnvironmentalReverb* NewL( CMdaAudioPlayerUtility& aUtility ); sl@0: sl@0: /** sl@0: * Factory function for creating the audio reverb object. sl@0: * @since 3.0 sl@0: * @param aUtility A reference to an audio record utility sl@0: * @param aRecordStream ETrue if the effect is to be applied to the recording, sl@0: * EFalse if the effect is to be applied only to the playback sl@0: * @return pointer to CEnvironmentalReverb object sl@0: */ sl@0: IMPORT_C static CEnvironmentalReverb* NewL( CMdaAudioRecorderUtility& aUtility, TBool aRecordStream ); sl@0: sl@0: /** sl@0: * Factory function for creating the audio reverb object. sl@0: * @since 3.0 sl@0: * @param aUtility A reference to an audio tone utility sl@0: * @return pointer to CEnvironmentalReverb object sl@0: */ sl@0: IMPORT_C static CEnvironmentalReverb* NewL( CMdaAudioToneUtility& aUtility ); sl@0: sl@0: /** sl@0: * Factory function for creating the audio reverb object. sl@0: * @since 3.0 sl@0: * @param aDevSound A reference to a DevSound instance sl@0: * @return pointer to CEnvironmentalReverb object sl@0: */ sl@0: IMPORT_C static CEnvironmentalReverb* NewL( CMMFDevSound& aDevSound ); sl@0: sl@0: /** sl@0: * Factory function for creating the audio reverb object. sl@0: * @since 3.0 sl@0: * @param aUtility A reference to a custom command utility sl@0: * @return pointer to CEnvironmentalReverb object sl@0: */ sl@0: IMPORT_C static CEnvironmentalReverb* NewL( CCustomCommandUtility* aUtility ); sl@0: sl@0: /** sl@0: * Factory function for creating the audio reverb object. sl@0: * @since 3.0 sl@0: * @param aCustomInterface A reference to a custom interface sl@0: * @return pointer to CEnvironmentalReverb object sl@0: */ sl@0: IMPORT_C static CEnvironmentalReverb* NewL( MCustomInterface& aCustomInterface ); sl@0: sl@0: /** sl@0: * Factory function for creating the audio reverb object. sl@0: * @since 3.0 sl@0: * @param aUtility A reference to a CMidiClientUtility object sl@0: * @return pointer to CEnvironmentalReverb object sl@0: */ sl@0: IMPORT_C static CEnvironmentalReverb* 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 CEnvironmentalReverb* 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 CEnvironmentalReverb* NewL( CVideoPlayerUtility& aUtility ); sl@0: sl@0: /** sl@0: * sl@0: * Destructor sl@0: */ sl@0: IMPORT_C virtual ~CEnvironmentalReverb(); sl@0: sl@0: /** sl@0: * Gets the decay HF Ratio in hundredths sl@0: * @since 3.0 sl@0: * @return decay HF Ratio sl@0: */ sl@0: IMPORT_C TUint32 DecayHFRatio() const; sl@0: sl@0: /** sl@0: * Gets the reverb decay HF Ratio minimum and maximum in hundredths. sl@0: * @since 3.0 sl@0: * @param aMin Minimum decay HF Ratio sl@0: * @param aMax Maximum decay HF Ratio sl@0: */ sl@0: IMPORT_C void DecayHFRatioRange(TUint32& aMin, TUint32& aMax); sl@0: sl@0: /** sl@0: * Gets the decay time in milliseconds sl@0: * @since 3.0 sl@0: * @return decay time sl@0: */ sl@0: IMPORT_C TUint32 DecayTime() const; sl@0: sl@0: /** sl@0: * Gets the allowable reverb decay time range in milliseconds. sl@0: * @since 3.0 sl@0: * @param aMin Minimum decay time in milliseconds sl@0: * @param aMax Maximum decay time in milliseconds sl@0: */ sl@0: IMPORT_C void DecayTimeRange(TUint32& aMin, TUint32& aMax); sl@0: sl@0: /** sl@0: * Gets the density current value as a percentage in hundredths sl@0: * @since 3.0 sl@0: * @return density value sl@0: */ sl@0: IMPORT_C TUint32 Density() const; sl@0: sl@0: /** sl@0: * Gets the diffusion current value as a percentage in hundredths. sl@0: * @since 3.0 sl@0: * @return diffusion value sl@0: */ sl@0: IMPORT_C TUint32 Diffusion() const; sl@0: sl@0: /** sl@0: * Gets the reverb reflections delay in ms. sl@0: * @since 3.0 sl@0: * @return reverb reflections delay sl@0: */ sl@0: IMPORT_C TUint32 ReflectionsDelay() const; sl@0: sl@0: /** sl@0: * Gets the reverb reflections delay maximum in milliseconds. sl@0: * @since 3.0 sl@0: * @return reverb reflections delay maximum sl@0: */ sl@0: IMPORT_C TUint32 ReflectionsDelayMax() const; sl@0: sl@0: /** sl@0: * Gets the reverb reflections level in mB sl@0: * @since 3.0 sl@0: * @return Reverb reflections level sl@0: */ sl@0: IMPORT_C TInt32 ReflectionsLevel() const; sl@0: sl@0: /** sl@0: * Gets the reverb reflections level maximum and minimum in mB sl@0: * @since 3.0 sl@0: * @param aMin Minimum reflections level sl@0: * @param aMax Maximum reflections level sl@0: */ sl@0: IMPORT_C void ReflectionLevelRange( TInt32& aMin, TInt32& aMax ); sl@0: sl@0: /** sl@0: * Gets the reverb delay in milliseconds sl@0: * @since 3.0 sl@0: * @return reverb delay sl@0: */ sl@0: IMPORT_C TUint32 ReverbDelay() const; sl@0: sl@0: /** sl@0: * Gets the reverb delay maximum in milliseconds sl@0: * @since 3.0 sl@0: * @return reverb delay maximum sl@0: */ sl@0: IMPORT_C TUint32 ReverbDelayMax() const; sl@0: sl@0: /** sl@0: * Gets the reverb current level in mB sl@0: * @since 3.0 sl@0: * @return reverb current level sl@0: */ sl@0: IMPORT_C TInt32 ReverbLevel() const; sl@0: sl@0: /** sl@0: * Gets the reverb current level maximum and minimum in mB sl@0: * @since 3.0 sl@0: * @param aMin Minimum current level sl@0: * @param aMax Maximum current level sl@0: * @return - sl@0: */ sl@0: IMPORT_C void ReverbLevelRange( TInt32& aMin, TInt32& aMax ); sl@0: sl@0: /** sl@0: * Gets the room HF level current ratio sl@0: * @since 3.0 sl@0: * @return room HF level ratio sl@0: */ sl@0: IMPORT_C TInt32 RoomHFLevel() const; sl@0: sl@0: /** sl@0: * Gets the room HF level maximum and minimum ratios sl@0: * @since 3.0 sl@0: * @param aMin Minimum current room HF level sl@0: * @param aMax Maximum current room HF level sl@0: * @return - sl@0: */ sl@0: IMPORT_C void RoomHFLevelRange( TInt32& aMin, TInt32& aMax ); sl@0: sl@0: /** sl@0: * Gets the room level current value in mB sl@0: * @since 3.0 sl@0: * @return room level value sl@0: */ sl@0: IMPORT_C TInt32 RoomLevel() const; sl@0: sl@0: /** sl@0: * Gets the room level maximum and minimum in mB sl@0: * @since 3.0 sl@0: * @param aMin Minimum current room level sl@0: * @param aMax Maximum current room level sl@0: * @return - sl@0: */ sl@0: IMPORT_C void RoomLevelRange( TInt32& aMin, TInt32& aMax ); sl@0: sl@0: /** sl@0: * Sets the decay HF Ratio in hundredths sl@0: * @since 3.0 sl@0: * @param aDecayHFRatio The decay high frequence ratio in hundredths sl@0: * @return - sl@0: */ sl@0: IMPORT_C void SetDecayHFRatioL( TUint32 aDecayHFRatio ); sl@0: sl@0: /** sl@0: * Sets the decay time in millisecond sl@0: * @since 3.0 sl@0: * @param aDecayTime Decay time in ms sl@0: */ sl@0: IMPORT_C void SetDecayTimeL( TUint32 aDecayTime ); sl@0: sl@0: /** sl@0: * Sets the density value as percentage in hundredths sl@0: * @since 3.0 sl@0: * @param aDensity The density. sl@0: */ sl@0: IMPORT_C void SetDensityL( TUint32 aDensity ); sl@0: sl@0: /** sl@0: * Sets the diffusion value as a percentage in hundredths sl@0: * @since 3.0 sl@0: * @param aDiffusion The diffusion. sl@0: */ sl@0: IMPORT_C void SetDiffusionL( TUint32 aDiffusion ); sl@0: sl@0: /** sl@0: * Sets the reverb reflections delay sl@0: * @since 3.0 sl@0: * @param aRefectionsDelay The reflection delay in ms. sl@0: */ sl@0: IMPORT_C void SetReflectionsDelayL( TUint32 aReflectionsDelay ); sl@0: sl@0: /** sl@0: * Sets the reverb reflections level in milli-dB sl@0: * @since 3.0 sl@0: * @param aRefectionsLevel The reflection level in mB sl@0: */ sl@0: IMPORT_C void SetReflectionsLevelL( TInt32 aReflectionsLevel ); sl@0: sl@0: /** sl@0: * Sets the reverb delay sl@0: * @since 3.0 sl@0: * @param aReverbDelay The reverb delay in ms sl@0: */ sl@0: IMPORT_C void SetReverbDelayL( TUint32 aReverbDelay ); sl@0: sl@0: /** sl@0: * Sets the reverb level sl@0: * @since 3.0 sl@0: * @param aReverbLevel The reverb level in mB sl@0: */ sl@0: IMPORT_C void SetReverbLevelL( TInt32 aReverbLevel ); sl@0: sl@0: /** sl@0: * Sets the room HF level ratio sl@0: * @since 3.0 sl@0: * @param aRoomHFLevel The room high frequency ratio sl@0: */ sl@0: IMPORT_C void SetRoomHFLevelL( TInt32 aRoomHFLevel ); sl@0: sl@0: /** sl@0: * Sets the room level value in milli-dB sl@0: * @since 3.0 sl@0: * @param aRoomLevel The room level sl@0: */ sl@0: IMPORT_C void SetRoomLevelL( TInt32 aRoomLevel ); sl@0: sl@0: /** sl@0: * Gets the total delay maximum in milliseconds sl@0: * @since 3.0 sl@0: * @return reverb delay maximum sl@0: */ sl@0: IMPORT_C TUint32 DelayMax() const; sl@0: sl@0: public: // functions from base class sl@0: sl@0: /* sl@0: * From CAudioEffect sl@0: * Get the unique identifier of the audio effect sl@0: * @since 3.0 sl@0: * @return Unique identifier sl@0: */ sl@0: IMPORT_C TUid Uid() const; sl@0: sl@0: protected: // Functions from base classes sl@0: sl@0: /** sl@0: * From CAudioEffect sl@0: * Create a package of the effect data sl@0: * @since 3.0 sl@0: * @return A descriptor containing the effect data. sl@0: */ sl@0: IMPORT_C const TDesC8& DoEffectData(); sl@0: sl@0: /** sl@0: * From CAudioEffect sl@0: * Internal function to unpack effect data sl@0: * @since 3.0 sl@0: * @param aEffectDataBuffer Descriptor containing packed effect data sl@0: * @return - sl@0: */ sl@0: IMPORT_C void SetEffectData( const TDesC8& aEffectDataBuffer ); sl@0: sl@0: protected: sl@0: sl@0: /** sl@0: * Private C++ constructor for this class. sl@0: * @since 3.0 sl@0: * @return - sl@0: */ sl@0: IMPORT_C CEnvironmentalReverb(); sl@0: sl@0: protected: sl@0: sl@0: // Reverb data structure sl@0: TEfEnvironmentalReverb iReverbData; sl@0: // Data package sent to server sl@0: TEfEnvReverbDataPckg iDataPckgTo; sl@0: // Data package received from server sl@0: TEfEnvReverbDataPckg iDataPckgFrom; sl@0: sl@0: protected: // Friend classes sl@0: sl@0: friend class CEnvironmentalReverbMessageHandler; sl@0: friend class CEnvironmentalReverbUtility; sl@0: sl@0: }; sl@0: sl@0: #endif // of CENVIRONMENTALREVERB_H sl@0: sl@0: // End of File