os/mm/mm_pub/audio_effects_api/inc/RoomLevelBase.h
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/mm/mm_pub/audio_effects_api/inc/RoomLevelBase.h	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,256 @@
     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 RoomLevel effect class.
    1.18 +*
    1.19 +*/
    1.20 +
    1.21 +
    1.22 +#ifndef CROOMLEVEL_H
    1.23 +#define CROOMLEVEL_H
    1.24 +
    1.25 +// INCLUDES
    1.26 +
    1.27 +#include <e32base.h>
    1.28 +#include <AudioEffectBase.h>
    1.29 +#include <RoomLevelData.h>
    1.30 +#include <MCustomInterface.h>
    1.31 +
    1.32 +const TUid KUidRoomLevelEffect = {0x10207B3C};
    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 CEnvironmentalReverb;
    1.46 +class CDrmPlayerUtility;
    1.47 +class CVideoPlayerUtility;
    1.48 +
    1.49 +// CLASS DECLARATION
    1.50 +
    1.51 +/**
    1.52 +*  This is the Environmental RoomLevel effect class for managing RoomLevel settings.
    1.53 +*
    1.54 +*  @lib RoomLevelEffect.lib
    1.55 +*  @since 3.0
    1.56 +*/
    1.57 +
    1.58 +class CRoomLevel : public CAudioEffect
    1.59 +    {
    1.60 +
    1.61 +    public:     //New Functions
    1.62 +        /**
    1.63 +        * Factory function for creating the audio RoomLevel object.
    1.64 +        * @since 3.0
    1.65 +        * @param aUtility A reference to a convert utility
    1.66 +        * @param aReverb A reference to a environmental reverb utility
    1.67 +        * @return pointer to CRoomLevel object
    1.68 +        */
    1.69 +        IMPORT_C static CRoomLevel* NewL( CMdaAudioConvertUtility& aUtility, CEnvironmentalReverb& aReverb);
    1.70 +
    1.71 +        /**
    1.72 +        * Factory function for creating the audio RoomLevel object.
    1.73 +        * @since 3.0
    1.74 +        * @param aUtility A reference to an audio input stream utility
    1.75 +        * @param aReverb A reference to a environmental reverb utility
    1.76 +        * @return pointer to CRoomLevel object
    1.77 +        */
    1.78 +        IMPORT_C static CRoomLevel* NewL( CMdaAudioInputStream& aUtility, CEnvironmentalReverb& aReverb );
    1.79 +
    1.80 +        /**
    1.81 +        * Factory function for creating the audio RoomLevel object.
    1.82 +        * @since 3.0
    1.83 +        * @param aUtility A reference to an audio output stream utility
    1.84 +        * @param aReverb A reference to a environmental reverb utility
    1.85 +        * @return pointer to CRoomLevel object
    1.86 +        */
    1.87 +        IMPORT_C static CRoomLevel* NewL( CMdaAudioOutputStream& aUtility, CEnvironmentalReverb& aReverb);
    1.88 +
    1.89 +        /**
    1.90 +        * Factory function for creating the audio RoomLevel object.
    1.91 +        * @since 3.0
    1.92 +        * @param aUtility A reference to an audio player utility
    1.93 +        * @param aReverb A reference to a environmental reverb utility
    1.94 +        * @return pointer to CRoomLevel object
    1.95 +        */
    1.96 +        IMPORT_C static CRoomLevel* NewL( CMdaAudioPlayerUtility& aUtility, CEnvironmentalReverb& aReverb );
    1.97 +
    1.98 +        /**
    1.99 +        * Factory function for creating the audio RoomLevel object.
   1.100 +        * @since 3.0
   1.101 +        * @param aUtility A reference to an audio record utility
   1.102 +        * @param aRecordStream ETrue if the effect is to be applied to the recording,
   1.103 +        *                      EFalse if the effect is to be applied only to the playback
   1.104 +        * @param aReverb A reference to a environmental reverb utility
   1.105 +        * @return pointer to CRoomLevel object
   1.106 +        */
   1.107 +        IMPORT_C static CRoomLevel* NewL( CMdaAudioRecorderUtility& aUtility, TBool aRecordStream, CEnvironmentalReverb& aReverb);
   1.108 +
   1.109 +        /**
   1.110 +        * Factory function for creating the audio RoomLevel object.
   1.111 +        * @since 3.0
   1.112 +        * @param aUtility A reference to an audio tone utility
   1.113 +        * @param aReverb A reference to a environmental reverb utility
   1.114 +        * @return pointer to CRoomLevel object
   1.115 +        */
   1.116 +        IMPORT_C static CRoomLevel* NewL( CMdaAudioToneUtility& aUtility, CEnvironmentalReverb& aReverb );
   1.117 +
   1.118 +        /**
   1.119 +        * Factory function for creating the audio RoomLevel object.
   1.120 +        * @since 3.0
   1.121 +        * @param aDevSound A reference to a DevSound instance
   1.122 +        * @param aReverb A reference to a environmental reverb utility
   1.123 +        * @return pointer to CRoomLevel object
   1.124 +        */
   1.125 +        IMPORT_C static CRoomLevel* NewL( CMMFDevSound& aDevSound, CEnvironmentalReverb& aReverb);
   1.126 +
   1.127 +        /**
   1.128 +        * Factory function for creating the audio RoomLevel object.
   1.129 +        * @since 3.0
   1.130 +        * @param aUtility A reference to a custom command utility
   1.131 +        * @param aReverb A reference to a environmental reverb utility
   1.132 +        * @return pointer to CRoomLevel object
   1.133 +        */
   1.134 +        IMPORT_C static CRoomLevel* NewL( CCustomCommandUtility* aUtility, CEnvironmentalReverb& aReverb );
   1.135 +
   1.136 +        /**
   1.137 +        * Factory function for creating the audio RoomLevel object.
   1.138 +        * @since 3.0
   1.139 +        * @param aCustomInterface A reference to a custom interface
   1.140 +        * @param aReverb A reference to a environmental reverb utility
   1.141 +        * @return pointer to CRoomLevel object
   1.142 +        */
   1.143 +        IMPORT_C static CRoomLevel* NewL( MCustomInterface& aCustomInterface, CEnvironmentalReverb& aReverb );
   1.144 +
   1.145 +        /**
   1.146 +        * Factory function for creating the audio RoomLevel object.
   1.147 +        * @since 3.0
   1.148 +        * @param aUtility A reference to a CMidiClientUtility object
   1.149 +        * @param aReverb A reference to a environmental reverb utility
   1.150 +        * @return pointer to CRoomLevel object
   1.151 +        */
   1.152 +        IMPORT_C static CRoomLevel* NewL( CMidiClientUtility& aUtility, CEnvironmentalReverb& aReverb);
   1.153 +
   1.154 +        /**
   1.155 +        * Factory function for creating the RoomLevel object.
   1.156 +        * @since 3.0
   1.157 +        * @param CDrmPlayerUtility A reference to a CDrmPlayerUtility object
   1.158 +        * @return pointer to CRoomLevel object
   1.159 +        */
   1.160 +        IMPORT_C static CRoomLevel* NewL( CDrmPlayerUtility& aUtility, CEnvironmentalReverb& aReverb );
   1.161 +
   1.162 +        /**
   1.163 +        * Factory function for creating the RoomLevel object.
   1.164 +        * @since 3.2
   1.165 +        * @param CVideoPlayerUtility A reference to a CVideoPlayerUtility object
   1.166 +        * @return pointer to CRoomLevel object
   1.167 +        */
   1.168 +        IMPORT_C static CRoomLevel* NewL( CVideoPlayerUtility& aUtility, CEnvironmentalReverb& aReverb );
   1.169 +
   1.170 +        /**
   1.171 +        *
   1.172 +        * Destructor
   1.173 +        */
   1.174 +        IMPORT_C virtual ~CRoomLevel();
   1.175 +
   1.176 +        /**
   1.177 +        * Gets the RoomLevel current level in mB
   1.178 +        * @since 3.0
   1.179 +        * @return RoomLevel current level
   1.180 +        */
   1.181 +        IMPORT_C TInt32 Level() const;
   1.182 +
   1.183 +        /**
   1.184 +        * Gets the RoomLevel current level maximum and minimum in mB
   1.185 +        * @since 3.0
   1.186 +        * @param aMin Minimum current level
   1.187 +        * @param aMax Maximum current level
   1.188 +        * @return -
   1.189 +        */
   1.190 +        IMPORT_C void LevelRange( TInt32& aMin, TInt32& aMax );
   1.191 +
   1.192 +        /**
   1.193 +        * Sets the RoomLevel level, it will leave if aRoomLevel is not within range of Min and Max
   1.194 +        * @since 3.0
   1.195 +        * @param aRoomLevelLevel The RoomLevel level in mB
   1.196 +        */
   1.197 +        IMPORT_C void SetRoomLevelL( TInt32 aRoomLevel );
   1.198 +
   1.199 +
   1.200 +    public: // functions from base class
   1.201 +
   1.202 +        /*
   1.203 +        * From CAudioEffect
   1.204 +        * Get the unique identifier of the audio effect
   1.205 +        * @since 3.0
   1.206 +        * @return Unique identifier
   1.207 +        */
   1.208 +        IMPORT_C TUid Uid() const;
   1.209 +
   1.210 +    protected:  // Functions from base classes
   1.211 +
   1.212 +        /**
   1.213 +        * From CAudioEffect
   1.214 +        * Create a package of the effect data
   1.215 +        * @since 3.0
   1.216 +        * @return A descriptor containing the effect data.
   1.217 +        */
   1.218 +        IMPORT_C const TDesC8& DoEffectData();
   1.219 +
   1.220 +        /**
   1.221 +        * From CAudioEffect
   1.222 +        * Internal function to unpack effect data
   1.223 +        * @since 3.0
   1.224 +        * @param aEffectDataBuffer Descriptor containing packed effect data
   1.225 +        * @return -
   1.226 +        */
   1.227 +        IMPORT_C void SetEffectData( const TDesC8& aEffectDataBuffer );
   1.228 +
   1.229 +
   1.230 +
   1.231 +
   1.232 +
   1.233 +
   1.234 +    protected:
   1.235 +
   1.236 +        /**
   1.237 +        * Private C++ constructor for this class.
   1.238 +        * @since 3.0
   1.239 +        * @return   -
   1.240 +        */
   1.241 +        IMPORT_C CRoomLevel();
   1.242 +
   1.243 +    protected:
   1.244 +        CEnvironmentalReverb* iClientReverb;
   1.245 +        // RoomLevel data structure
   1.246 +        TEfRoomLevel iRoomLevelData;
   1.247 +        // Data package sent to server
   1.248 +        TEfRoomLevelDataPckg iDataPckgTo;
   1.249 +        // Data package received from server
   1.250 +        TEfRoomLevelDataPckg iDataPckgFrom;
   1.251 +
   1.252 +    friend class CRoomLevelMessageHandler;
   1.253 +//    friend class CEnvironmentalReverbImpl;
   1.254 +
   1.255 +    };
   1.256 +
   1.257 +#endif  // of CROOMLEVEL_H
   1.258 +
   1.259 +// End of File