2 * Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies).
4 * This component and the accompanying materials are made available
5 * under the terms of "Eclipse Public License v1.0"
6 * which accompanies this distribution, and is available
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
9 * Initial Contributors:
10 * Nokia Corporation - initial contribution.
14 * Description: This is the definition of the RoomLevel effect class.
25 #include <AudioEffectBase.h>
26 #include <RoomLevelData.h>
27 #include <MCustomInterface.h>
29 const TUid KUidRoomLevelEffect = {0x10207B3C};
31 // FORWARD DELCARATION
32 class CMdaAudioConvertUtility;
33 class CMdaAudioPlayerUtility;
34 class CMdaAudioRecorderUtility;
35 class CMdaAudioInputStream;
36 class CMdaAudioOutputStream;
37 class CMdaAudioToneUtility;
38 class CCustomCommandUtility;
39 class CCustomInterfaceUtility;
41 class CMidiClientUtility;
42 class CEnvironmentalReverb;
43 class CDrmPlayerUtility;
44 class CVideoPlayerUtility;
49 * This is the Environmental RoomLevel effect class for managing RoomLevel settings.
51 * @lib RoomLevelEffect.lib
55 class CRoomLevel : public CAudioEffect
58 public: //New Functions
60 * Factory function for creating the audio RoomLevel object.
62 * @param aUtility A reference to a convert utility
63 * @param aReverb A reference to a environmental reverb utility
64 * @return pointer to CRoomLevel object
66 IMPORT_C static CRoomLevel* NewL( CMdaAudioConvertUtility& aUtility, CEnvironmentalReverb& aReverb);
69 * Factory function for creating the audio RoomLevel object.
71 * @param aUtility A reference to an audio input stream utility
72 * @param aReverb A reference to a environmental reverb utility
73 * @return pointer to CRoomLevel object
75 IMPORT_C static CRoomLevel* NewL( CMdaAudioInputStream& aUtility, CEnvironmentalReverb& aReverb );
78 * Factory function for creating the audio RoomLevel object.
80 * @param aUtility A reference to an audio output stream utility
81 * @param aReverb A reference to a environmental reverb utility
82 * @return pointer to CRoomLevel object
84 IMPORT_C static CRoomLevel* NewL( CMdaAudioOutputStream& aUtility, CEnvironmentalReverb& aReverb);
87 * Factory function for creating the audio RoomLevel object.
89 * @param aUtility A reference to an audio player utility
90 * @param aReverb A reference to a environmental reverb utility
91 * @return pointer to CRoomLevel object
93 IMPORT_C static CRoomLevel* NewL( CMdaAudioPlayerUtility& aUtility, CEnvironmentalReverb& aReverb );
96 * Factory function for creating the audio RoomLevel object.
98 * @param aUtility A reference to an audio record utility
99 * @param aRecordStream ETrue if the effect is to be applied to the recording,
100 * EFalse if the effect is to be applied only to the playback
101 * @param aReverb A reference to a environmental reverb utility
102 * @return pointer to CRoomLevel object
104 IMPORT_C static CRoomLevel* NewL( CMdaAudioRecorderUtility& aUtility, TBool aRecordStream, CEnvironmentalReverb& aReverb);
107 * Factory function for creating the audio RoomLevel object.
109 * @param aUtility A reference to an audio tone utility
110 * @param aReverb A reference to a environmental reverb utility
111 * @return pointer to CRoomLevel object
113 IMPORT_C static CRoomLevel* NewL( CMdaAudioToneUtility& aUtility, CEnvironmentalReverb& aReverb );
116 * Factory function for creating the audio RoomLevel object.
118 * @param aDevSound A reference to a DevSound instance
119 * @param aReverb A reference to a environmental reverb utility
120 * @return pointer to CRoomLevel object
122 IMPORT_C static CRoomLevel* NewL( CMMFDevSound& aDevSound, CEnvironmentalReverb& aReverb);
125 * Factory function for creating the audio RoomLevel object.
127 * @param aUtility A reference to a custom command utility
128 * @param aReverb A reference to a environmental reverb utility
129 * @return pointer to CRoomLevel object
131 IMPORT_C static CRoomLevel* NewL( CCustomCommandUtility* aUtility, CEnvironmentalReverb& aReverb );
134 * Factory function for creating the audio RoomLevel object.
136 * @param aCustomInterface A reference to a custom interface
137 * @param aReverb A reference to a environmental reverb utility
138 * @return pointer to CRoomLevel object
140 IMPORT_C static CRoomLevel* NewL( MCustomInterface& aCustomInterface, CEnvironmentalReverb& aReverb );
143 * Factory function for creating the audio RoomLevel object.
145 * @param aUtility A reference to a CMidiClientUtility object
146 * @param aReverb A reference to a environmental reverb utility
147 * @return pointer to CRoomLevel object
149 IMPORT_C static CRoomLevel* NewL( CMidiClientUtility& aUtility, CEnvironmentalReverb& aReverb);
152 * Factory function for creating the RoomLevel object.
154 * @param CDrmPlayerUtility A reference to a CDrmPlayerUtility object
155 * @return pointer to CRoomLevel object
157 IMPORT_C static CRoomLevel* NewL( CDrmPlayerUtility& aUtility, CEnvironmentalReverb& aReverb );
160 * Factory function for creating the RoomLevel object.
162 * @param CVideoPlayerUtility A reference to a CVideoPlayerUtility object
163 * @return pointer to CRoomLevel object
165 IMPORT_C static CRoomLevel* NewL( CVideoPlayerUtility& aUtility, CEnvironmentalReverb& aReverb );
171 IMPORT_C virtual ~CRoomLevel();
174 * Gets the RoomLevel current level in mB
176 * @return RoomLevel current level
178 IMPORT_C TInt32 Level() const;
181 * Gets the RoomLevel current level maximum and minimum in mB
183 * @param aMin Minimum current level
184 * @param aMax Maximum current level
187 IMPORT_C void LevelRange( TInt32& aMin, TInt32& aMax );
190 * Sets the RoomLevel level, it will leave if aRoomLevel is not within range of Min and Max
192 * @param aRoomLevelLevel The RoomLevel level in mB
194 IMPORT_C void SetRoomLevelL( TInt32 aRoomLevel );
197 public: // functions from base class
201 * Get the unique identifier of the audio effect
203 * @return Unique identifier
205 IMPORT_C TUid Uid() const;
207 protected: // Functions from base classes
211 * Create a package of the effect data
213 * @return A descriptor containing the effect data.
215 IMPORT_C const TDesC8& DoEffectData();
219 * Internal function to unpack effect data
221 * @param aEffectDataBuffer Descriptor containing packed effect data
224 IMPORT_C void SetEffectData( const TDesC8& aEffectDataBuffer );
234 * Private C++ constructor for this class.
238 IMPORT_C CRoomLevel();
241 CEnvironmentalReverb* iClientReverb;
242 // RoomLevel data structure
243 TEfRoomLevel iRoomLevelData;
244 // Data package sent to server
245 TEfRoomLevelDataPckg iDataPckgTo;
246 // Data package received from server
247 TEfRoomLevelDataPckg iDataPckgFrom;
249 friend class CRoomLevelMessageHandler;
250 // friend class CEnvironmentalReverbImpl;
254 #endif // of CROOMLEVEL_H