1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/mm/mm_pub/audio_effects_api/inc/StereoWideningBase.h Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,294 @@
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 Stereo Widening effect class.
1.18 +*
1.19 +*/
1.20 +
1.21 +
1.22 +#ifndef CSTEREOWIDENING_H
1.23 +#define CSTEREOWIDENING_H
1.24 +
1.25 +// INCLUDES
1.26 +
1.27 +#include <e32base.h>
1.28 +#include <AudioEffectBase.h>
1.29 +#include <StereoWideningData.h>
1.30 +#include <MCustomInterface.h>
1.31 +
1.32 +const TUid KUidStereoWideningEffect = {0x10203836};
1.33 +
1.34 +// FORWARD DELCARATION
1.35 +class CMdaAudioConvertUtility;
1.36 +class CMdaAudioPlayerUtility;
1.37 +class CMdaAudioRecorderUtility;
1.38 +class CMdaAudioInputStream;
1.39 +class CMdaAudioOutputStream;
1.40 +class CMdaAudioToneUtility;
1.41 +class CCustomCommandUtility;
1.42 +class CCustomInterfaceUtility;
1.43 +class CMMFDevSound;
1.44 +class CMidiClientUtility;
1.45 +class CDrmPlayerUtility;
1.46 +class CVideoPlayerUtility;
1.47 +
1.48 +// CLASS DECLARATION
1.49 +
1.50 +/**
1.51 +* This is the Stereo Widening effect class for managing audio Stereo Widening settings.
1.52 +*
1.53 +* @lib StereoWidening.lib
1.54 +* @since 3.0
1.55 +*/
1.56 +
1.57 +class CStereoWidening : public CAudioEffect
1.58 + {
1.59 +
1.60 + public: //New Functions
1.61 +
1.62 + /**
1.63 + * Factory function for creating the stereo widening object.
1.64 + * @since 3.0
1.65 + * @return pointer to CStereoWidening object
1.66 + */
1.67 + IMPORT_C static CStereoWidening* NewL();
1.68 +
1.69 + /**
1.70 + * Factory function for creating the stereo widening object.
1.71 + * @since 3.0
1.72 + * @param aUtility A reference to a convert utility
1.73 + * @param aEnable Indicate whether the effect will be automatically enabled after creation.
1.74 + * @param aInitialLevel Initial value of stereo widening to be used when aEnable = ETrue
1.75 + * @return pointer to CStereoWidening object
1.76 + */
1.77 + IMPORT_C static CStereoWidening* NewL(CMdaAudioConvertUtility& aUtility,
1.78 + TBool aEnable = EFalse,
1.79 + TInt8 aInitialLevel = 0);
1.80 +
1.81 + /**
1.82 + * Factory function for creating the stereo widening object.
1.83 + * @since 3.0
1.84 + * @param aUtility A reference to an audio input stream utility
1.85 + * @param aEnable Indicate whether the effect will be automatically enabled after creation.
1.86 + * @param aInitialLevel Initial value of stereo widening to be used when aEnable = ETrue
1.87 + * @return pointer to CStereoWidening object
1.88 + */
1.89 + IMPORT_C static CStereoWidening* NewL(CMdaAudioInputStream& aUtility,
1.90 + TBool aEnable = EFalse,
1.91 + TInt8 aInitialLevel = 0);
1.92 +
1.93 + /**
1.94 + * Factory function for creating the stereo widening object.
1.95 + * @since 3.0
1.96 + * @param aUtility A reference to an audio output stream utility
1.97 + * @param aEnable Indicate whether the effect will be automatically enabled after creation.
1.98 + * @param aInitialLevel Initial value of stereo widening to be used when aEnable = ETrue
1.99 + * @return pointer to CStereoWidening object
1.100 + */
1.101 + IMPORT_C static CStereoWidening* NewL(CMdaAudioOutputStream& aUtility,
1.102 + TBool aEnable = EFalse,
1.103 + TInt8 aInitialLevel = 0);
1.104 +
1.105 + /**
1.106 + * Factory function for creating the stereo widening object.
1.107 + * @since 3.0
1.108 + * @param aUtility A reference to an audio player utility
1.109 + * @param aEnable Indicate whether the effect will be automatically enabled after creation.
1.110 + * @param aInitialLevel Initial value of stereo widening to be used when aEnable = ETrue
1.111 + * @return pointer to CStereoWidening object
1.112 + */
1.113 + IMPORT_C static CStereoWidening* NewL(CMdaAudioPlayerUtility& aUtility,
1.114 + TBool aEnable = EFalse,
1.115 + TInt8 aInitialLevel = 0);
1.116 +
1.117 + /**
1.118 + * Factory function for creating the stereo widening object.
1.119 + * @since 3.0
1.120 + * @param aUtility A reference to an audio record utility
1.121 + * @param aRecordStream ETrue if the effect is to be applied to the recording,
1.122 + * EFalse if the effect is to be applied only to the playback
1.123 + * @param aEnable Indicate whether the effect will be automatically enabled after creation.
1.124 + * @param aInitialLevel Initial value of stereo widening to be used when aEnable = ETrue
1.125 + * @return pointer to CStereoWidening object
1.126 + */
1.127 + IMPORT_C static CStereoWidening* NewL(CMdaAudioRecorderUtility& aUtility,
1.128 + TBool aRecordStream,
1.129 + TBool aEnable = EFalse,
1.130 + TInt8 aInitialLevel = 0);
1.131 +
1.132 + /**
1.133 + * Factory function for creating the stereo widening object.
1.134 + * @since 3.0
1.135 + * @param aUtility A reference to an audio tone utility
1.136 + * @param aEnable Indicate whether the effect will be automatically enabled after creation.
1.137 + * @param aInitialLevel Initial value of stereo widening to be used when aEnable = ETrue
1.138 + * @return pointer to CStereoWidening object
1.139 + */
1.140 + IMPORT_C static CStereoWidening* NewL(CMdaAudioToneUtility& aUtility,
1.141 + TBool aEnable = EFalse,
1.142 + TInt8 aInitialLevel = 0);
1.143 +
1.144 + /**
1.145 + * Factory function for creating the stereo widening object.
1.146 + * @since 3.0
1.147 + * @param aDevSound A reference to a DevSound instance
1.148 + * @param aEnable Indicate whether the effect will be automatically enabled after creation.
1.149 + * @param aInitialLevel Initial value of stereo widening to be used when aEnable = ETrue
1.150 + * @return pointer to CStereoWidening object
1.151 + */
1.152 + IMPORT_C static CStereoWidening* NewL(CMMFDevSound& aDevSound,
1.153 + TBool aEnable = EFalse,
1.154 + TInt8 aInitialLevel = 0);
1.155 +
1.156 + /**
1.157 + * Factory function for creating the stereo widening object.
1.158 + * @since 3.0
1.159 + * @param aUtility A reference to a custom command utility
1.160 + * @param aEnable Indicate whether the effect will be automatically enabled after creation.
1.161 + * @param aInitialLevel Initial value of stereo widening to be used when aEnable = ETrue
1.162 + * @return pointer to CStereoWidening object
1.163 + */
1.164 + IMPORT_C static CStereoWidening* NewL(CCustomCommandUtility* aUtility,
1.165 + TBool aEnable = EFalse,
1.166 + TInt8 aInitialLevel = 0);
1.167 +
1.168 + /**
1.169 + * Factory function for creating the stereo widening object.
1.170 + * @since 3.0
1.171 + * @param aCustomInterface A reference to a custom interface
1.172 + * @param aEnable Indicate whether the effect will be automatically enabled after creation.
1.173 + * @param aInitialLevel Initial value of stereo widening to be used when aEnable = ETrue
1.174 + * @return pointer to CStereoWidening object
1.175 + */
1.176 + IMPORT_C static CStereoWidening* NewL(MCustomInterface& aCustomInterface,
1.177 + TBool aEnable = EFalse,
1.178 + TInt8 aInitialLevel = 0);
1.179 +
1.180 + /**
1.181 + * Factory function for creating the stereo widening object.
1.182 + * @since 3.0
1.183 + * @param aUtility A reference to a CMidiClientUtility
1.184 + * @param aEnable Indicate whether the effect will be automatically enabled after creation.
1.185 + * @param aInitialLevel Initial value of stereo widening to be used when aEnable = ETrue
1.186 + * @return pointer to CStereoWidening object
1.187 + */
1.188 + IMPORT_C static CStereoWidening* NewL(CMidiClientUtility& aUtility,
1.189 + TBool aEnable = EFalse,
1.190 + TInt8 aInitialLevel = 0);
1.191 +
1.192 + /**
1.193 + * Factory function for creating the stereo widening object.
1.194 + * @since 3.0
1.195 + * @param CDrmPlayerUtility A reference to a CDrmPlayerUtility object
1.196 + * @return pointer to CStereoWidening object
1.197 + */
1.198 + IMPORT_C static CStereoWidening* NewL(CDrmPlayerUtility& aUtility,
1.199 + TBool aEnable = EFalse,
1.200 + TInt8 aInitialLevel = 0);
1.201 +
1.202 + /**
1.203 + * Factory function for creating the stereo widening object.
1.204 + * @since 3.2
1.205 + * @param CVideoPlayerUtility A reference to a CVideoPlayerUtility object
1.206 + * @return pointer to CStereoWidening object
1.207 + */
1.208 + IMPORT_C static CStereoWidening* NewL(CVideoPlayerUtility& aUtility,
1.209 + TBool aEnable = EFalse,
1.210 + TInt8 aInitialLevel = 0);
1.211 +
1.212 + /**
1.213 + *
1.214 + * Destructor
1.215 + */
1.216 + IMPORT_C virtual ~CStereoWidening();
1.217 +
1.218 + /**
1.219 + * Check if continuous level is supported for stereo widening.
1.220 + * @since 3.0
1.221 + * @return ETrue if continuous level is supported for stereo widening. If this returns
1.222 + * EFalse, then the adaptation is actually setting the level to the nearest supported discrete
1.223 + * value, when SetStereoWidenlingLevelL is called.
1.224 + */
1.225 + IMPORT_C TBool IsContinuousLevelSupported() const;
1.226 +
1.227 + /**
1.228 + * Set stereo widening level.
1.229 + * @since 3.0
1.230 + * @param aLevel Stereo widening level ranges from 0-100, where 0 is None and 100 is Maximum widening.
1.231 + */
1.232 + IMPORT_C void SetStereoWideningLevelL( TUint8 aLevel );
1.233 +
1.234 + /**
1.235 + * Get the stereo widening settings.
1.236 + * @since 3.0
1.237 + * @return Level of widening
1.238 + */
1.239 + IMPORT_C TUint8 StereoWideningLevel() const;
1.240 +
1.241 +
1.242 + public: // functions from base class
1.243 +
1.244 + /*
1.245 + * From CAudioEffect
1.246 + * Get the unique identifier of the audio effect
1.247 + * @since 3.0
1.248 + * @return Unique identifier
1.249 + */
1.250 + IMPORT_C TUid Uid() const;
1.251 +
1.252 + protected: // Functions from base classes
1.253 +
1.254 + /**
1.255 + * From CAudioEffect
1.256 + * Create a package of the effect data
1.257 + * @since 3.0
1.258 + * @return A descriptor containing the effect data.
1.259 + */
1.260 + IMPORT_C const TDesC8& DoEffectData();
1.261 +
1.262 + /**
1.263 + * From CAudioEffect
1.264 + * Internal function to unpack effect data
1.265 + * @since 3.0
1.266 + * @param aEffectDataBuffer Descriptor containing packed effect data
1.267 + * @return -
1.268 + */
1.269 + IMPORT_C void SetEffectData( const TDesC8& aEffectDataBuffer );
1.270 +
1.271 + protected:
1.272 +
1.273 + /**
1.274 + * Private C++ constructor for this class.
1.275 + * @since 3.0
1.276 + * @param aEffectObserver reference to event observer object
1.277 + * @return -
1.278 + */
1.279 + IMPORT_C CStereoWidening();
1.280 +
1.281 + protected:
1.282 +
1.283 + // Balance data structure
1.284 + TEfStereoWidening iStereoWideningData;
1.285 + // Data package sent to server
1.286 + TEfStereoWideningDataPckg iDataPckgTo;
1.287 + // Data package received from server
1.288 + TEfStereoWideningDataPckg iDataPckgFrom;
1.289 +
1.290 + protected: // Friend classes
1.291 + friend class CStereoWideningMessageHandler;
1.292 +
1.293 + };
1.294 +
1.295 +#endif // of CSTEREOWIDENING_H
1.296 +
1.297 +// End of File