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