williamr@2: /* williamr@2: * Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). williamr@2: * All rights reserved. williamr@2: * This component and the accompanying materials are made available williamr@4: * under the terms of "Eclipse Public License v1.0" williamr@2: * which accompanies this distribution, and is available williamr@4: * at the URL "http://www.eclipse.org/legal/epl-v10.html". williamr@2: * williamr@2: * Initial Contributors: williamr@2: * Nokia Corporation - initial contribution. williamr@2: * williamr@2: * Contributors: williamr@2: * williamr@2: * Description: This is the definition of the Stereo Widening effect class. williamr@2: * williamr@2: */ williamr@2: williamr@2: williamr@2: #ifndef CSTEREOWIDENING_H williamr@2: #define CSTEREOWIDENING_H williamr@2: williamr@2: // INCLUDES williamr@2: williamr@2: #include williamr@2: #include williamr@2: #include williamr@2: #include williamr@2: williamr@2: const TUid KUidStereoWideningEffect = {0x10203836}; williamr@2: williamr@2: // FORWARD DELCARATION williamr@2: class CMdaAudioConvertUtility; williamr@2: class CMdaAudioPlayerUtility; williamr@2: class CMdaAudioRecorderUtility; williamr@2: class CMdaAudioInputStream; williamr@2: class CMdaAudioOutputStream; williamr@2: class CMdaAudioToneUtility; williamr@2: class CCustomCommandUtility; williamr@2: class CCustomInterfaceUtility; williamr@2: class CMMFDevSound; williamr@2: class CMidiClientUtility; williamr@2: class CDrmPlayerUtility; williamr@2: class CVideoPlayerUtility; williamr@2: williamr@2: // CLASS DECLARATION williamr@2: williamr@2: /** williamr@2: * This is the Stereo Widening effect class for managing audio Stereo Widening settings. williamr@2: * williamr@2: * @lib StereoWidening.lib williamr@2: * @since 3.0 williamr@2: */ williamr@2: williamr@2: class CStereoWidening : public CAudioEffect williamr@2: { williamr@2: williamr@2: public: //New Functions williamr@2: williamr@2: /** williamr@2: * Factory function for creating the stereo widening object. williamr@2: * @since 3.0 williamr@2: * @return pointer to CStereoWidening object williamr@2: */ williamr@2: IMPORT_C static CStereoWidening* NewL(); williamr@2: williamr@2: /** williamr@2: * Factory function for creating the stereo widening object. williamr@2: * @since 3.0 williamr@2: * @param aUtility A reference to a convert utility williamr@2: * @param aEnable Indicate whether the effect will be automatically enabled after creation. williamr@2: * @param aInitialLevel Initial value of stereo widening to be used when aEnable = ETrue williamr@2: * @return pointer to CStereoWidening object williamr@2: */ williamr@2: IMPORT_C static CStereoWidening* NewL(CMdaAudioConvertUtility& aUtility, williamr@2: TBool aEnable = EFalse, williamr@2: TInt8 aInitialLevel = 0); williamr@2: williamr@2: /** williamr@2: * Factory function for creating the stereo widening object. williamr@2: * @since 3.0 williamr@2: * @param aUtility A reference to an audio input stream utility williamr@2: * @param aEnable Indicate whether the effect will be automatically enabled after creation. williamr@2: * @param aInitialLevel Initial value of stereo widening to be used when aEnable = ETrue williamr@2: * @return pointer to CStereoWidening object williamr@2: */ williamr@2: IMPORT_C static CStereoWidening* NewL(CMdaAudioInputStream& aUtility, williamr@2: TBool aEnable = EFalse, williamr@2: TInt8 aInitialLevel = 0); williamr@2: williamr@2: /** williamr@2: * Factory function for creating the stereo widening object. williamr@2: * @since 3.0 williamr@2: * @param aUtility A reference to an audio output stream utility williamr@2: * @param aEnable Indicate whether the effect will be automatically enabled after creation. williamr@2: * @param aInitialLevel Initial value of stereo widening to be used when aEnable = ETrue williamr@2: * @return pointer to CStereoWidening object williamr@2: */ williamr@2: IMPORT_C static CStereoWidening* NewL(CMdaAudioOutputStream& aUtility, williamr@2: TBool aEnable = EFalse, williamr@2: TInt8 aInitialLevel = 0); williamr@2: williamr@2: /** williamr@2: * Factory function for creating the stereo widening object. williamr@2: * @since 3.0 williamr@2: * @param aUtility A reference to an audio player utility williamr@2: * @param aEnable Indicate whether the effect will be automatically enabled after creation. williamr@2: * @param aInitialLevel Initial value of stereo widening to be used when aEnable = ETrue williamr@2: * @return pointer to CStereoWidening object williamr@2: */ williamr@2: IMPORT_C static CStereoWidening* NewL(CMdaAudioPlayerUtility& aUtility, williamr@2: TBool aEnable = EFalse, williamr@2: TInt8 aInitialLevel = 0); williamr@2: williamr@2: /** williamr@2: * Factory function for creating the stereo widening object. williamr@2: * @since 3.0 williamr@2: * @param aUtility A reference to an audio record utility williamr@2: * @param aRecordStream ETrue if the effect is to be applied to the recording, williamr@2: * EFalse if the effect is to be applied only to the playback williamr@2: * @param aEnable Indicate whether the effect will be automatically enabled after creation. williamr@2: * @param aInitialLevel Initial value of stereo widening to be used when aEnable = ETrue williamr@2: * @return pointer to CStereoWidening object williamr@2: */ williamr@2: IMPORT_C static CStereoWidening* NewL(CMdaAudioRecorderUtility& aUtility, williamr@2: TBool aRecordStream, williamr@2: TBool aEnable = EFalse, williamr@2: TInt8 aInitialLevel = 0); williamr@2: williamr@2: /** williamr@2: * Factory function for creating the stereo widening object. williamr@2: * @since 3.0 williamr@2: * @param aUtility A reference to an audio tone utility williamr@2: * @param aEnable Indicate whether the effect will be automatically enabled after creation. williamr@2: * @param aInitialLevel Initial value of stereo widening to be used when aEnable = ETrue williamr@2: * @return pointer to CStereoWidening object williamr@2: */ williamr@2: IMPORT_C static CStereoWidening* NewL(CMdaAudioToneUtility& aUtility, williamr@2: TBool aEnable = EFalse, williamr@2: TInt8 aInitialLevel = 0); williamr@2: williamr@2: /** williamr@2: * Factory function for creating the stereo widening object. williamr@2: * @since 3.0 williamr@2: * @param aDevSound A reference to a DevSound instance williamr@2: * @param aEnable Indicate whether the effect will be automatically enabled after creation. williamr@2: * @param aInitialLevel Initial value of stereo widening to be used when aEnable = ETrue williamr@2: * @return pointer to CStereoWidening object williamr@2: */ williamr@2: IMPORT_C static CStereoWidening* NewL(CMMFDevSound& aDevSound, williamr@2: TBool aEnable = EFalse, williamr@2: TInt8 aInitialLevel = 0); williamr@2: williamr@2: /** williamr@2: * Factory function for creating the stereo widening object. williamr@2: * @since 3.0 williamr@2: * @param aUtility A reference to a custom command utility williamr@2: * @param aEnable Indicate whether the effect will be automatically enabled after creation. williamr@2: * @param aInitialLevel Initial value of stereo widening to be used when aEnable = ETrue williamr@2: * @return pointer to CStereoWidening object williamr@2: */ williamr@2: IMPORT_C static CStereoWidening* NewL(CCustomCommandUtility* aUtility, williamr@2: TBool aEnable = EFalse, williamr@2: TInt8 aInitialLevel = 0); williamr@2: williamr@2: /** williamr@2: * Factory function for creating the stereo widening object. williamr@2: * @since 3.0 williamr@2: * @param aCustomInterface A reference to a custom interface williamr@2: * @param aEnable Indicate whether the effect will be automatically enabled after creation. williamr@2: * @param aInitialLevel Initial value of stereo widening to be used when aEnable = ETrue williamr@2: * @return pointer to CStereoWidening object williamr@2: */ williamr@2: IMPORT_C static CStereoWidening* NewL(MCustomInterface& aCustomInterface, williamr@2: TBool aEnable = EFalse, williamr@2: TInt8 aInitialLevel = 0); williamr@2: williamr@2: /** williamr@2: * Factory function for creating the stereo widening object. williamr@2: * @since 3.0 williamr@2: * @param aUtility A reference to a CMidiClientUtility williamr@2: * @param aEnable Indicate whether the effect will be automatically enabled after creation. williamr@2: * @param aInitialLevel Initial value of stereo widening to be used when aEnable = ETrue williamr@2: * @return pointer to CStereoWidening object williamr@2: */ williamr@2: IMPORT_C static CStereoWidening* NewL(CMidiClientUtility& aUtility, williamr@2: TBool aEnable = EFalse, williamr@2: TInt8 aInitialLevel = 0); williamr@2: williamr@2: /** williamr@2: * Factory function for creating the stereo widening object. williamr@2: * @since 3.0 williamr@2: * @param CDrmPlayerUtility A reference to a CDrmPlayerUtility object williamr@2: * @return pointer to CStereoWidening object williamr@2: */ williamr@2: IMPORT_C static CStereoWidening* NewL(CDrmPlayerUtility& aUtility, williamr@2: TBool aEnable = EFalse, williamr@2: TInt8 aInitialLevel = 0); williamr@2: williamr@2: /** williamr@2: * Factory function for creating the stereo widening object. williamr@2: * @since 3.2 williamr@2: * @param CVideoPlayerUtility A reference to a CVideoPlayerUtility object williamr@2: * @return pointer to CStereoWidening object williamr@2: */ williamr@2: IMPORT_C static CStereoWidening* NewL(CVideoPlayerUtility& aUtility, williamr@2: TBool aEnable = EFalse, williamr@2: TInt8 aInitialLevel = 0); williamr@2: williamr@2: /** williamr@2: * williamr@2: * Destructor williamr@2: */ williamr@2: IMPORT_C virtual ~CStereoWidening(); williamr@2: williamr@2: /** williamr@2: * Check if continuous level is supported for stereo widening. williamr@2: * @since 3.0 williamr@2: * @return ETrue if continuous level is supported for stereo widening. If this returns williamr@2: * EFalse, then the adaptation is actually setting the level to the nearest supported discrete williamr@2: * value, when SetStereoWidenlingLevelL is called. williamr@2: */ williamr@2: IMPORT_C TBool IsContinuousLevelSupported() const; williamr@2: williamr@2: /** williamr@2: * Set stereo widening level. williamr@2: * @since 3.0 williamr@2: * @param aLevel Stereo widening level ranges from 0-100, where 0 is None and 100 is Maximum widening. williamr@2: */ williamr@2: IMPORT_C void SetStereoWideningLevelL( TUint8 aLevel ); williamr@2: williamr@2: /** williamr@2: * Get the stereo widening settings. williamr@2: * @since 3.0 williamr@2: * @return Level of widening williamr@2: */ williamr@2: IMPORT_C TUint8 StereoWideningLevel() const; williamr@2: williamr@2: williamr@2: public: // functions from base class williamr@2: williamr@2: /* williamr@2: * From CAudioEffect williamr@2: * Get the unique identifier of the audio effect williamr@2: * @since 3.0 williamr@2: * @return Unique identifier williamr@2: */ williamr@2: IMPORT_C TUid Uid() const; williamr@2: williamr@2: protected: // Functions from base classes williamr@2: williamr@2: /** williamr@2: * From CAudioEffect williamr@2: * Create a package of the effect data williamr@2: * @since 3.0 williamr@2: * @return A descriptor containing the effect data. williamr@2: */ williamr@2: IMPORT_C const TDesC8& DoEffectData(); williamr@2: williamr@2: /** williamr@2: * From CAudioEffect williamr@2: * Internal function to unpack effect data williamr@2: * @since 3.0 williamr@2: * @param aEffectDataBuffer Descriptor containing packed effect data williamr@2: * @return - williamr@2: */ williamr@2: IMPORT_C void SetEffectData( const TDesC8& aEffectDataBuffer ); williamr@2: williamr@2: protected: williamr@2: williamr@2: /** williamr@2: * Private C++ constructor for this class. williamr@2: * @since 3.0 williamr@2: * @param aEffectObserver reference to event observer object williamr@2: * @return - williamr@2: */ williamr@2: IMPORT_C CStereoWidening(); williamr@2: williamr@2: protected: williamr@2: williamr@2: // Balance data structure williamr@2: TEfStereoWidening iStereoWideningData; williamr@2: // Data package sent to server williamr@2: TEfStereoWideningDataPckg iDataPckgTo; williamr@2: // Data package received from server williamr@2: TEfStereoWideningDataPckg iDataPckgFrom; williamr@2: williamr@2: protected: // Friend classes williamr@2: friend class CStereoWideningMessageHandler; williamr@2: williamr@2: }; williamr@2: williamr@2: #endif // of CSTEREOWIDENING_H williamr@2: williamr@2: // End of File