williamr@2
|
1 |
/*
|
williamr@2
|
2 |
* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies).
|
williamr@2
|
3 |
* All rights reserved.
|
williamr@2
|
4 |
* This component and the accompanying materials are made available
|
williamr@2
|
5 |
* under the terms of the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
|
williamr@2
|
6 |
* which accompanies this distribution, and is available
|
williamr@2
|
7 |
* at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
|
williamr@2
|
8 |
*
|
williamr@2
|
9 |
* Initial Contributors:
|
williamr@2
|
10 |
* Nokia Corporation - initial contribution.
|
williamr@2
|
11 |
*
|
williamr@2
|
12 |
* Contributors:
|
williamr@2
|
13 |
*
|
williamr@2
|
14 |
* Description: This is the definition of the Distance Attenuation effect class.
|
williamr@2
|
15 |
*
|
williamr@2
|
16 |
*/
|
williamr@2
|
17 |
|
williamr@2
|
18 |
|
williamr@2
|
19 |
#ifndef CDISTANCEATTENUATION_H
|
williamr@2
|
20 |
#define CDISTANCEATTENUATION_H
|
williamr@2
|
21 |
|
williamr@2
|
22 |
// INCLUDES
|
williamr@2
|
23 |
|
williamr@2
|
24 |
#include <e32base.h>
|
williamr@2
|
25 |
#include <AudioEffectBase.h>
|
williamr@2
|
26 |
#include <DistanceAttenuationData.h>
|
williamr@2
|
27 |
#include <MCustomInterface.h>
|
williamr@2
|
28 |
|
williamr@2
|
29 |
|
williamr@2
|
30 |
const TUid KUidDistanceAttenuationEffect = {0x1020382C};
|
williamr@2
|
31 |
|
williamr@2
|
32 |
// FORWARD DELCARATION
|
williamr@2
|
33 |
class CMdaAudioConvertUtility;
|
williamr@2
|
34 |
class CMdaAudioPlayerUtility;
|
williamr@2
|
35 |
class CMdaAudioRecorderUtility;
|
williamr@2
|
36 |
class CMdaAudioInputStream;
|
williamr@2
|
37 |
class CMdaAudioOutputStream;
|
williamr@2
|
38 |
class CMdaAudioToneUtility;
|
williamr@2
|
39 |
class CCustomCommandUtility;
|
williamr@2
|
40 |
class CCustomInterfaceUtility;
|
williamr@2
|
41 |
class CMMFDevSound;
|
williamr@2
|
42 |
class CMidiClientUtility;
|
williamr@2
|
43 |
class CDrmPlayerUtility;
|
williamr@2
|
44 |
class CVideoPlayerUtility;
|
williamr@2
|
45 |
|
williamr@2
|
46 |
// CLASS DECLARATION
|
williamr@2
|
47 |
|
williamr@2
|
48 |
/**
|
williamr@2
|
49 |
* This is the Distance Attenuation effect class for managing audio Distance Attenuation settings.
|
williamr@2
|
50 |
*
|
williamr@2
|
51 |
* @lib DistanceAttenuationEffect.lib
|
williamr@2
|
52 |
* @since 3.0
|
williamr@2
|
53 |
*/
|
williamr@2
|
54 |
|
williamr@2
|
55 |
class CDistanceAttenuation : public CAudioEffect
|
williamr@2
|
56 |
{
|
williamr@2
|
57 |
|
williamr@2
|
58 |
public: //New Functions
|
williamr@2
|
59 |
|
williamr@2
|
60 |
/**
|
williamr@2
|
61 |
* Factory function for creating the distance attenuation object.
|
williamr@2
|
62 |
* @since 3.0
|
williamr@2
|
63 |
* @param aUtility A reference to a convert utility
|
williamr@2
|
64 |
* @return pointer to CDistanceAttenuation object
|
williamr@2
|
65 |
*/
|
williamr@2
|
66 |
IMPORT_C static CDistanceAttenuation* NewL( CMdaAudioConvertUtility& aUtility );
|
williamr@2
|
67 |
|
williamr@2
|
68 |
/**
|
williamr@2
|
69 |
* Factory function for creating the distance attenuation object.
|
williamr@2
|
70 |
* @since 3.0
|
williamr@2
|
71 |
* @param aUtility A reference to an audio input stream utility
|
williamr@2
|
72 |
* @return pointer to CDistanceAttenuation object
|
williamr@2
|
73 |
*/
|
williamr@2
|
74 |
IMPORT_C static CDistanceAttenuation* NewL( CMdaAudioInputStream& aUtility );
|
williamr@2
|
75 |
|
williamr@2
|
76 |
/**
|
williamr@2
|
77 |
* Factory function for creating the distance attenuation object.
|
williamr@2
|
78 |
* @since 3.0
|
williamr@2
|
79 |
* @param aUtility A reference to an audio output stream utility
|
williamr@2
|
80 |
* @return pointer to CDistanceAttenuation object
|
williamr@2
|
81 |
*/
|
williamr@2
|
82 |
IMPORT_C static CDistanceAttenuation* NewL( CMdaAudioOutputStream& aUtility );
|
williamr@2
|
83 |
|
williamr@2
|
84 |
/**
|
williamr@2
|
85 |
* Factory function for creating the distance attenuation object.
|
williamr@2
|
86 |
* @since 3.0
|
williamr@2
|
87 |
* @param aUtility A reference to an audio player utility
|
williamr@2
|
88 |
* @return pointer to CDistanceAttenuation object
|
williamr@2
|
89 |
*/
|
williamr@2
|
90 |
IMPORT_C static CDistanceAttenuation* NewL( CMdaAudioPlayerUtility& aUtility );
|
williamr@2
|
91 |
|
williamr@2
|
92 |
/**
|
williamr@2
|
93 |
* Factory function for creating the distance attenuation object.
|
williamr@2
|
94 |
* @since 3.0
|
williamr@2
|
95 |
* @param aUtility A reference to an audio record utility
|
williamr@2
|
96 |
* @param aRecordStream ETrue if the effect is to be applied to the recording,
|
williamr@2
|
97 |
* EFalse if the effect is to be applied only to the playback
|
williamr@2
|
98 |
* @return pointer to CDistanceAttenuation object
|
williamr@2
|
99 |
*/
|
williamr@2
|
100 |
IMPORT_C static CDistanceAttenuation* NewL( CMdaAudioRecorderUtility& aUtility, TBool aRecordStream );
|
williamr@2
|
101 |
|
williamr@2
|
102 |
/**
|
williamr@2
|
103 |
* Factory function for creating the distance attenuation object.
|
williamr@2
|
104 |
* @since 3.0
|
williamr@2
|
105 |
* @param aDevSound A reference to a DevSound instance
|
williamr@2
|
106 |
* @return pointer to CDistanceAttenuation object
|
williamr@2
|
107 |
*/
|
williamr@2
|
108 |
IMPORT_C static CDistanceAttenuation* NewL( CMMFDevSound& aDevSound );
|
williamr@2
|
109 |
|
williamr@2
|
110 |
/**
|
williamr@2
|
111 |
* Factory function for creating the distance attenuation object.
|
williamr@2
|
112 |
* @since 3.0
|
williamr@2
|
113 |
* @param aUtility A reference to an audio tone utility
|
williamr@2
|
114 |
* @return pointer to CDistanceAttenuation object
|
williamr@2
|
115 |
*/
|
williamr@2
|
116 |
IMPORT_C static CDistanceAttenuation* NewL( CMdaAudioToneUtility& aUtility );
|
williamr@2
|
117 |
|
williamr@2
|
118 |
/**
|
williamr@2
|
119 |
* Factory function for creating the distance attenuation object.
|
williamr@2
|
120 |
* @since 3.0
|
williamr@2
|
121 |
* @param aUtility A reference to a custom command utility
|
williamr@2
|
122 |
* @return pointer to CDistanceAttenuation object
|
williamr@2
|
123 |
*/
|
williamr@2
|
124 |
IMPORT_C static CDistanceAttenuation* NewL( CCustomCommandUtility* aUtility );
|
williamr@2
|
125 |
|
williamr@2
|
126 |
/**
|
williamr@2
|
127 |
* Factory function for creating the distance attenuation object.
|
williamr@2
|
128 |
* @since 3.0
|
williamr@2
|
129 |
* @param aCustomInterface A reference to a custom interface
|
williamr@2
|
130 |
* @return pointer to CDistanceAttenuation object
|
williamr@2
|
131 |
*/
|
williamr@2
|
132 |
IMPORT_C static CDistanceAttenuation* NewL( MCustomInterface& aCustomInterface );
|
williamr@2
|
133 |
|
williamr@2
|
134 |
/**
|
williamr@2
|
135 |
* Factory function for creating the distance attenuation object.
|
williamr@2
|
136 |
* @since 3.0
|
williamr@2
|
137 |
* @param aUtility A reference to a CMidiClientUtility
|
williamr@2
|
138 |
* @return pointer to CDistanceAttenuation object
|
williamr@2
|
139 |
*/
|
williamr@2
|
140 |
IMPORT_C static CDistanceAttenuation* NewL( CMidiClientUtility& aUtility );
|
williamr@2
|
141 |
|
williamr@2
|
142 |
|
williamr@2
|
143 |
/**
|
williamr@2
|
144 |
* Factory function for creating the distance attenuation object.
|
williamr@2
|
145 |
* @since 3.0
|
williamr@2
|
146 |
* @param CDrmPlayerUtility A reference to a CDrmPlayerUtility object
|
williamr@2
|
147 |
* @return pointer to CDistanceAttenuation object
|
williamr@2
|
148 |
*/
|
williamr@2
|
149 |
IMPORT_C static CDistanceAttenuation* NewL( CDrmPlayerUtility& aUtility );
|
williamr@2
|
150 |
|
williamr@2
|
151 |
/**
|
williamr@2
|
152 |
* Factory function for creating the distance attenuation object.
|
williamr@2
|
153 |
* @since 3.2
|
williamr@2
|
154 |
* @param CVideoPlayerUtility A reference to a CVideoPlayerUtility object
|
williamr@2
|
155 |
* @return pointer to CDistanceAttenuation object
|
williamr@2
|
156 |
*/
|
williamr@2
|
157 |
IMPORT_C static CDistanceAttenuation* NewL( CVideoPlayerUtility& aUtility );
|
williamr@2
|
158 |
|
williamr@2
|
159 |
/**
|
williamr@2
|
160 |
*
|
williamr@2
|
161 |
* Destructor
|
williamr@2
|
162 |
*/
|
williamr@2
|
163 |
IMPORT_C virtual ~CDistanceAttenuation();
|
williamr@2
|
164 |
|
williamr@2
|
165 |
/**
|
williamr@2
|
166 |
* Gets the Distance Attenuation of the listener.
|
williamr@2
|
167 |
* @since 3.0
|
williamr@2
|
168 |
* @param aRMin The source-to-listener distance below which the sound level is constant
|
williamr@2
|
169 |
* @param aRMax The source-to-listener distance above which the sound level is constant or zero
|
williamr@2
|
170 |
* @param aMuteAfterMax Indicate if the sound is muted beyond RMax
|
williamr@2
|
171 |
* @param aRollOffFactor Multiplier factor to source-to-listener distance
|
williamr@2
|
172 |
* @param aRoomRollOffFactor Multiplier factor to source-to-listener distance for Room effect.
|
williamr@2
|
173 |
* @return -
|
williamr@2
|
174 |
*/
|
williamr@2
|
175 |
IMPORT_C void DistanceAttenuation( TInt32& aRMin, TInt32& aRMax, TBool& aMuteAfterMax,
|
williamr@2
|
176 |
TUint32& aRollOffFactor, TUint32& aRoomRollOffFactor );
|
williamr@2
|
177 |
|
williamr@2
|
178 |
/**
|
williamr@2
|
179 |
* Get roll off factor maximum value.
|
williamr@2
|
180 |
* @since 3.0
|
williamr@2
|
181 |
* @param aRollOffFactor The maximum multiplier factor to source-to-listener distance for Room effect.
|
williamr@2
|
182 |
* @return -
|
williamr@2
|
183 |
*/
|
williamr@2
|
184 |
IMPORT_C void RollOffFactorMax( TUint32& aRollOfFactorMax );
|
williamr@2
|
185 |
|
williamr@2
|
186 |
/**
|
williamr@2
|
187 |
* Get room roll off factor maximum value.
|
williamr@2
|
188 |
* @since 3.0
|
williamr@2
|
189 |
* @param aRollOffFactor The maximum multiplier factor to source-to-listener distance for Room effect.
|
williamr@2
|
190 |
* @return -
|
williamr@2
|
191 |
*/
|
williamr@2
|
192 |
IMPORT_C void RoomRollOffFactorMax( TUint32& aRoomRollOfFactorMax );
|
williamr@2
|
193 |
|
williamr@2
|
194 |
/**
|
williamr@2
|
195 |
* Sets the Distance Attenuation
|
williamr@2
|
196 |
* @since 3.0
|
williamr@2
|
197 |
* @param aRMin The source-to-listener distance below which the sound level is constant
|
williamr@2
|
198 |
* @param aRMax The source-to-listener distance above which the sound level is constant or zero
|
williamr@2
|
199 |
* @param aMuteAfterMax Indicate if the sound is muted beyond RMax
|
williamr@2
|
200 |
* @param aRollOffFactor Multiplier factor to source-to-listener distance
|
williamr@2
|
201 |
* @param aRoomRollOffFactor Multiplier factor to source-to-listener distance for Room effect.
|
williamr@2
|
202 |
* @return -
|
williamr@2
|
203 |
*/
|
williamr@2
|
204 |
IMPORT_C void SetDistanceAttenuationL( TInt32 aRMin, TInt32 aRMax, TBool aMuteAfterMax,
|
williamr@2
|
205 |
TUint32 aRollOffFactor, TUint32 aRoomRollOffFactor );
|
williamr@2
|
206 |
|
williamr@2
|
207 |
public: // functions from base class
|
williamr@2
|
208 |
|
williamr@2
|
209 |
/*
|
williamr@2
|
210 |
* From CAudioEffect
|
williamr@2
|
211 |
* Get the unique identifier of the audio effect
|
williamr@2
|
212 |
* @since 3.0
|
williamr@2
|
213 |
* @return Unique identifier
|
williamr@2
|
214 |
*/
|
williamr@2
|
215 |
IMPORT_C TUid Uid() const;
|
williamr@2
|
216 |
|
williamr@2
|
217 |
protected: // Functions from base classes
|
williamr@2
|
218 |
|
williamr@2
|
219 |
/**
|
williamr@2
|
220 |
* From CAudioEffect
|
williamr@2
|
221 |
* Create a package of the effect data
|
williamr@2
|
222 |
* @since 3.0
|
williamr@2
|
223 |
* @return A descriptor containing the effect data.
|
williamr@2
|
224 |
*/
|
williamr@2
|
225 |
IMPORT_C const TDesC8& DoEffectData();
|
williamr@2
|
226 |
|
williamr@2
|
227 |
/**
|
williamr@2
|
228 |
* From CAudioEffect
|
williamr@2
|
229 |
* Internal function to unpack effect data
|
williamr@2
|
230 |
* @since 3.0
|
williamr@2
|
231 |
* @param aEffectDataBuffer Descriptor containing packed effect data
|
williamr@2
|
232 |
* @return -
|
williamr@2
|
233 |
*/
|
williamr@2
|
234 |
IMPORT_C void SetEffectData( const TDesC8& aEffectDataBuffer );
|
williamr@2
|
235 |
|
williamr@2
|
236 |
protected:
|
williamr@2
|
237 |
|
williamr@2
|
238 |
/**
|
williamr@2
|
239 |
* Private C++ constructor for this class.
|
williamr@2
|
240 |
* @since 3.0
|
williamr@2
|
241 |
* @param aEffectObserver reference to event observer object
|
williamr@2
|
242 |
* @return -
|
williamr@2
|
243 |
*/
|
williamr@2
|
244 |
IMPORT_C CDistanceAttenuation();
|
williamr@2
|
245 |
|
williamr@2
|
246 |
protected:
|
williamr@2
|
247 |
|
williamr@2
|
248 |
// Distance Attenuation data structure
|
williamr@2
|
249 |
TEfDistanceAttenuation iDistanceAttenuationData;
|
williamr@2
|
250 |
// Data package sent to server
|
williamr@2
|
251 |
TEfDistanceAttenuationDataPckg iDataPckgTo;
|
williamr@2
|
252 |
// Data package received from server
|
williamr@2
|
253 |
TEfDistanceAttenuationDataPckg iDataPckgFrom;
|
williamr@2
|
254 |
|
williamr@2
|
255 |
protected: // Friend classes
|
williamr@2
|
256 |
|
williamr@2
|
257 |
friend class CDistanceAttenuationMessageHandler;
|
williamr@2
|
258 |
|
williamr@2
|
259 |
};
|
williamr@2
|
260 |
|
williamr@2
|
261 |
#endif // of CDISTANCEATTENUATION_H
|
williamr@2
|
262 |
|
williamr@2
|
263 |
// End of File
|