sl@0
|
1 |
// Copyright (c) 2001-2009 Nokia Corporation and/or its subsidiary(-ies).
|
sl@0
|
2 |
// All rights reserved.
|
sl@0
|
3 |
// This component and the accompanying materials are made available
|
sl@0
|
4 |
// under the terms of "Eclipse Public License v1.0"
|
sl@0
|
5 |
// which accompanies this distribution, and is available
|
sl@0
|
6 |
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
sl@0
|
7 |
//
|
sl@0
|
8 |
// Initial Contributors:
|
sl@0
|
9 |
// Nokia Corporation - initial contribution.
|
sl@0
|
10 |
//
|
sl@0
|
11 |
// Contributors:
|
sl@0
|
12 |
//
|
sl@0
|
13 |
// Description:
|
sl@0
|
14 |
// SoundDeviceBody.inl
|
sl@0
|
15 |
// Initializes DevSound object for the mode aMode for processing audio data
|
sl@0
|
16 |
// with hardware device aHWDev.
|
sl@0
|
17 |
// On completion of Initialization, the observer will be notified via call back
|
sl@0
|
18 |
// InitializeComplete().
|
sl@0
|
19 |
// Leaves on failure.
|
sl@0
|
20 |
// @param "MDevSoundObserver& aDevSoundObserver"
|
sl@0
|
21 |
// A reference to DevSound Observer instance.
|
sl@0
|
22 |
// @param "TUid aHWDev"
|
sl@0
|
23 |
// CMMFHwDevice implementation identifier.
|
sl@0
|
24 |
// @param "TMMFState aMode"
|
sl@0
|
25 |
// Mode for which this object will be used.
|
sl@0
|
26 |
//
|
sl@0
|
27 |
//
|
sl@0
|
28 |
|
sl@0
|
29 |
inline void CMMFDevSoundClientImp::InitializeL(MDevSoundObserver& aDevSoundObserver, TUid aHWDev, TMMFState aMode)
|
sl@0
|
30 |
{
|
sl@0
|
31 |
TInt initError = KErrNone;
|
sl@0
|
32 |
iDevSoundObserver = &aDevSoundObserver;
|
sl@0
|
33 |
|
sl@0
|
34 |
// Need to set up an init complete event and message handler
|
sl@0
|
35 |
// prior to calling InitializeL()
|
sl@0
|
36 |
if (iICHandler)
|
sl@0
|
37 |
{
|
sl@0
|
38 |
iICHandler->CancelReceiveEvents();
|
sl@0
|
39 |
}
|
sl@0
|
40 |
else
|
sl@0
|
41 |
{
|
sl@0
|
42 |
iICHandler = CMMFInitializeCompleteHandler::NewL(iDevSoundProxy, *iDevSoundObserver);
|
sl@0
|
43 |
}
|
sl@0
|
44 |
iICHandler->ReceiveEvents();
|
sl@0
|
45 |
|
sl@0
|
46 |
initError = iDevSoundProxy->InitializeL(aHWDev, aMode);
|
sl@0
|
47 |
|
sl@0
|
48 |
if (initError)
|
sl@0
|
49 |
{
|
sl@0
|
50 |
iDevSoundObserver->InitializeComplete(initError);
|
sl@0
|
51 |
User::Leave(initError);
|
sl@0
|
52 |
}
|
sl@0
|
53 |
|
sl@0
|
54 |
if(iBTBFHandler)
|
sl@0
|
55 |
{
|
sl@0
|
56 |
iBTBFHandler->CancelReceiveEvents();
|
sl@0
|
57 |
}
|
sl@0
|
58 |
else
|
sl@0
|
59 |
{
|
sl@0
|
60 |
iBTBFHandler = CMMFBufferToBeFilledHandler::NewL(iDevSoundProxy, *iDevSoundObserver);
|
sl@0
|
61 |
}
|
sl@0
|
62 |
iBTBFHandler->ReceiveEvents();
|
sl@0
|
63 |
|
sl@0
|
64 |
|
sl@0
|
65 |
if(iPEHandler)
|
sl@0
|
66 |
{
|
sl@0
|
67 |
iPEHandler->CancelReceiveEvents();
|
sl@0
|
68 |
}
|
sl@0
|
69 |
else
|
sl@0
|
70 |
{
|
sl@0
|
71 |
iPEHandler = CMMFPlayErrorHandler::NewL(iDevSoundProxy, *iDevSoundObserver);
|
sl@0
|
72 |
}
|
sl@0
|
73 |
iPEHandler->ReceiveEvents();
|
sl@0
|
74 |
|
sl@0
|
75 |
|
sl@0
|
76 |
if(iREHandler)
|
sl@0
|
77 |
{
|
sl@0
|
78 |
iREHandler->CancelReceiveEvents();
|
sl@0
|
79 |
}
|
sl@0
|
80 |
else
|
sl@0
|
81 |
{
|
sl@0
|
82 |
iREHandler = CMMFRecordErrorHandler::NewL(iDevSoundProxy, *iDevSoundObserver);
|
sl@0
|
83 |
}
|
sl@0
|
84 |
iREHandler->ReceiveEvents();
|
sl@0
|
85 |
|
sl@0
|
86 |
|
sl@0
|
87 |
if(iTFHandler)
|
sl@0
|
88 |
{
|
sl@0
|
89 |
iTFHandler->CancelReceiveEvents();
|
sl@0
|
90 |
}
|
sl@0
|
91 |
else
|
sl@0
|
92 |
{
|
sl@0
|
93 |
iTFHandler = CMMFToneFinishedHandler::NewL(iDevSoundProxy, *iDevSoundObserver);
|
sl@0
|
94 |
}
|
sl@0
|
95 |
iTFHandler->ReceiveEvents();
|
sl@0
|
96 |
|
sl@0
|
97 |
|
sl@0
|
98 |
if(iBTBEHandler)
|
sl@0
|
99 |
{
|
sl@0
|
100 |
iBTBEHandler->CancelReceiveEvents();
|
sl@0
|
101 |
}
|
sl@0
|
102 |
else
|
sl@0
|
103 |
{
|
sl@0
|
104 |
iBTBEHandler = CMMFBufferToBeEmptiedHandler::NewL(iDevSoundProxy, *iDevSoundObserver);
|
sl@0
|
105 |
}
|
sl@0
|
106 |
iBTBEHandler->ReceiveEvents();
|
sl@0
|
107 |
|
sl@0
|
108 |
|
sl@0
|
109 |
if(iSETCHandler)
|
sl@0
|
110 |
{
|
sl@0
|
111 |
iSETCHandler->CancelReceiveEvents();
|
sl@0
|
112 |
}
|
sl@0
|
113 |
else
|
sl@0
|
114 |
{
|
sl@0
|
115 |
iSETCHandler = CMMFSendEventToClientHandler::NewL(iDevSoundProxy, *iDevSoundObserver);
|
sl@0
|
116 |
}
|
sl@0
|
117 |
iSETCHandler->ReceiveEvents();
|
sl@0
|
118 |
}
|
sl@0
|
119 |
|
sl@0
|
120 |
|
sl@0
|
121 |
|
sl@0
|
122 |
/*
|
sl@0
|
123 |
*
|
sl@0
|
124 |
* Initializes DevSound object for the mode aMode for processing audio data
|
sl@0
|
125 |
* using an array of Hardware devices identified by aHWDevArray identifier
|
sl@0
|
126 |
* array. The hardware devices are chained together with data flow starting
|
sl@0
|
127 |
* with first array element.
|
sl@0
|
128 |
*
|
sl@0
|
129 |
* On completion of Initialization, the observer will be notified via call back
|
sl@0
|
130 |
* InitializeComplete().
|
sl@0
|
131 |
*
|
sl@0
|
132 |
* Leaves on failure.
|
sl@0
|
133 |
*
|
sl@0
|
134 |
* @param "MDevSoundObserver& aDevSoundObserver"
|
sl@0
|
135 |
* A reference to DevSound Observer instance.
|
sl@0
|
136 |
*
|
sl@0
|
137 |
* @param "CArrayPtr<TUid> aHWDevArray"
|
sl@0
|
138 |
* Array of CMMFHwDevice implementation identifiers.
|
sl@0
|
139 |
*
|
sl@0
|
140 |
* @param "TMMFState aMode"
|
sl@0
|
141 |
* Mode for which this object will be used.
|
sl@0
|
142 |
*
|
sl@0
|
143 |
*/
|
sl@0
|
144 |
inline void CMMFDevSoundClientImp::InitializeL(MDevSoundObserver& /*aDevSoundObserver*/,
|
sl@0
|
145 |
CArrayPtr<TUid> /*aHWDevArray*/, TMMFState /*aMode*/)
|
sl@0
|
146 |
{
|
sl@0
|
147 |
User::Leave(KErrNotSupported);
|
sl@0
|
148 |
}
|
sl@0
|
149 |
|
sl@0
|
150 |
/*
|
sl@0
|
151 |
*
|
sl@0
|
152 |
* Initializes DevSound object for the mode aMode for processing audio data
|
sl@0
|
153 |
* with hardware device supporting FourCC aDesiredFourCC.
|
sl@0
|
154 |
*
|
sl@0
|
155 |
* On completion of Initialization, the observer will be notified via call back
|
sl@0
|
156 |
* InitializeComplete().
|
sl@0
|
157 |
*
|
sl@0
|
158 |
* Leaves on failure.
|
sl@0
|
159 |
*
|
sl@0
|
160 |
* @param "MDevSoundObserver& aDevSoundObserver"
|
sl@0
|
161 |
* A reference to DevSound Observer instance.
|
sl@0
|
162 |
*
|
sl@0
|
163 |
* @param "TFourCC aDesiredFourCC"
|
sl@0
|
164 |
* CMMFHwDevice implementation FourCC.
|
sl@0
|
165 |
*
|
sl@0
|
166 |
* @param "TMMFState aMode"
|
sl@0
|
167 |
* Mode for which this object will be used.
|
sl@0
|
168 |
*
|
sl@0
|
169 |
*/
|
sl@0
|
170 |
inline void CMMFDevSoundClientImp::InitializeL(MDevSoundObserver& aDevSoundObserver,
|
sl@0
|
171 |
TFourCC aDesiredFourCC, TMMFState aMode)
|
sl@0
|
172 |
{
|
sl@0
|
173 |
TInt initError = KErrNone;
|
sl@0
|
174 |
iDevSoundObserver = &aDevSoundObserver;
|
sl@0
|
175 |
|
sl@0
|
176 |
// Need to set up an init complete event and message handler
|
sl@0
|
177 |
// prior to calling InitializeL()
|
sl@0
|
178 |
if (iICHandler)
|
sl@0
|
179 |
{
|
sl@0
|
180 |
iICHandler->CancelReceiveEvents();
|
sl@0
|
181 |
}
|
sl@0
|
182 |
else
|
sl@0
|
183 |
{
|
sl@0
|
184 |
iICHandler = CMMFInitializeCompleteHandler::NewL(iDevSoundProxy, *iDevSoundObserver);
|
sl@0
|
185 |
}
|
sl@0
|
186 |
iICHandler->ReceiveEvents();
|
sl@0
|
187 |
|
sl@0
|
188 |
initError = iDevSoundProxy->InitializeL(aDesiredFourCC, aMode);
|
sl@0
|
189 |
|
sl@0
|
190 |
if (initError)
|
sl@0
|
191 |
{
|
sl@0
|
192 |
iDevSoundObserver->InitializeComplete(initError);
|
sl@0
|
193 |
User::Leave(initError);
|
sl@0
|
194 |
}
|
sl@0
|
195 |
|
sl@0
|
196 |
if(iBTBFHandler)
|
sl@0
|
197 |
{
|
sl@0
|
198 |
iBTBFHandler->CancelReceiveEvents();
|
sl@0
|
199 |
}
|
sl@0
|
200 |
else
|
sl@0
|
201 |
{
|
sl@0
|
202 |
iBTBFHandler = CMMFBufferToBeFilledHandler::NewL(iDevSoundProxy, *iDevSoundObserver);
|
sl@0
|
203 |
}
|
sl@0
|
204 |
iBTBFHandler->ReceiveEvents();
|
sl@0
|
205 |
|
sl@0
|
206 |
|
sl@0
|
207 |
if(iPEHandler)
|
sl@0
|
208 |
{
|
sl@0
|
209 |
iPEHandler->CancelReceiveEvents();
|
sl@0
|
210 |
}
|
sl@0
|
211 |
else
|
sl@0
|
212 |
{
|
sl@0
|
213 |
iPEHandler = CMMFPlayErrorHandler::NewL(iDevSoundProxy, *iDevSoundObserver);
|
sl@0
|
214 |
}
|
sl@0
|
215 |
iPEHandler->ReceiveEvents();
|
sl@0
|
216 |
|
sl@0
|
217 |
|
sl@0
|
218 |
if(iREHandler)
|
sl@0
|
219 |
{
|
sl@0
|
220 |
iREHandler->CancelReceiveEvents();
|
sl@0
|
221 |
}
|
sl@0
|
222 |
else
|
sl@0
|
223 |
{
|
sl@0
|
224 |
iREHandler = CMMFRecordErrorHandler::NewL(iDevSoundProxy, *iDevSoundObserver);
|
sl@0
|
225 |
}
|
sl@0
|
226 |
iREHandler->ReceiveEvents();
|
sl@0
|
227 |
|
sl@0
|
228 |
|
sl@0
|
229 |
if(iTFHandler)
|
sl@0
|
230 |
{
|
sl@0
|
231 |
iTFHandler->CancelReceiveEvents();
|
sl@0
|
232 |
}
|
sl@0
|
233 |
else
|
sl@0
|
234 |
{
|
sl@0
|
235 |
iTFHandler = CMMFToneFinishedHandler::NewL(iDevSoundProxy, *iDevSoundObserver);
|
sl@0
|
236 |
}
|
sl@0
|
237 |
iTFHandler->ReceiveEvents();
|
sl@0
|
238 |
|
sl@0
|
239 |
|
sl@0
|
240 |
if(iBTBEHandler)
|
sl@0
|
241 |
{
|
sl@0
|
242 |
iBTBEHandler->CancelReceiveEvents();
|
sl@0
|
243 |
}
|
sl@0
|
244 |
else
|
sl@0
|
245 |
{
|
sl@0
|
246 |
iBTBEHandler = CMMFBufferToBeEmptiedHandler::NewL(iDevSoundProxy, *iDevSoundObserver);
|
sl@0
|
247 |
}
|
sl@0
|
248 |
iBTBEHandler->ReceiveEvents();
|
sl@0
|
249 |
|
sl@0
|
250 |
|
sl@0
|
251 |
if(iSETCHandler)
|
sl@0
|
252 |
{
|
sl@0
|
253 |
iSETCHandler->CancelReceiveEvents();
|
sl@0
|
254 |
}
|
sl@0
|
255 |
else
|
sl@0
|
256 |
{
|
sl@0
|
257 |
iSETCHandler = CMMFSendEventToClientHandler::NewL(iDevSoundProxy, *iDevSoundObserver);
|
sl@0
|
258 |
}
|
sl@0
|
259 |
iSETCHandler->ReceiveEvents();
|
sl@0
|
260 |
|
sl@0
|
261 |
}
|
sl@0
|
262 |
|
sl@0
|
263 |
/*
|
sl@0
|
264 |
*
|
sl@0
|
265 |
* Returns the supported Audio settings.
|
sl@0
|
266 |
*
|
sl@0
|
267 |
* @return "TMMFCapabilities"
|
sl@0
|
268 |
* Device settings.
|
sl@0
|
269 |
*
|
sl@0
|
270 |
*/
|
sl@0
|
271 |
inline TMMFCapabilities CMMFDevSoundClientImp::Capabilities()
|
sl@0
|
272 |
{
|
sl@0
|
273 |
return iDevSoundProxy->Capabilities();
|
sl@0
|
274 |
}
|
sl@0
|
275 |
|
sl@0
|
276 |
/*
|
sl@0
|
277 |
*
|
sl@0
|
278 |
* Returns the current audio settings.
|
sl@0
|
279 |
*
|
sl@0
|
280 |
* @return "TMMFCapabilities"
|
sl@0
|
281 |
* Device settings.
|
sl@0
|
282 |
*
|
sl@0
|
283 |
*/
|
sl@0
|
284 |
inline TMMFCapabilities CMMFDevSoundClientImp::Config() const
|
sl@0
|
285 |
{
|
sl@0
|
286 |
return iDevSoundProxy->Config();
|
sl@0
|
287 |
}
|
sl@0
|
288 |
|
sl@0
|
289 |
/*
|
sl@0
|
290 |
*
|
sl@0
|
291 |
* Returns an integer representing the maximum volume.
|
sl@0
|
292 |
*
|
sl@0
|
293 |
* This is the maximum value which can be passed to CMMFDevSound::SetVolume.
|
sl@0
|
294 |
*
|
sl@0
|
295 |
* @return "TInt"
|
sl@0
|
296 |
* The maximum volume. This value is platform dependent but is always
|
sl@0
|
297 |
* greater than or equal to one.
|
sl@0
|
298 |
*
|
sl@0
|
299 |
*/
|
sl@0
|
300 |
inline TInt CMMFDevSoundClientImp::MaxVolume()
|
sl@0
|
301 |
{
|
sl@0
|
302 |
return iDevSoundProxy->MaxVolume();
|
sl@0
|
303 |
}
|
sl@0
|
304 |
|
sl@0
|
305 |
/*
|
sl@0
|
306 |
*
|
sl@0
|
307 |
* Returns an integer representing the current volume.
|
sl@0
|
308 |
*
|
sl@0
|
309 |
* @return "TInt"
|
sl@0
|
310 |
* The current volume level.
|
sl@0
|
311 |
*
|
sl@0
|
312 |
*/
|
sl@0
|
313 |
inline TInt CMMFDevSoundClientImp::Volume()
|
sl@0
|
314 |
{
|
sl@0
|
315 |
return iDevSoundProxy->Volume();
|
sl@0
|
316 |
}
|
sl@0
|
317 |
|
sl@0
|
318 |
/*
|
sl@0
|
319 |
*
|
sl@0
|
320 |
* Returns an integer representing the maximum gain.
|
sl@0
|
321 |
*
|
sl@0
|
322 |
* This is the maximum value which can be passed to CMMFDevSound::SetGain.
|
sl@0
|
323 |
*
|
sl@0
|
324 |
* @return "TInt"
|
sl@0
|
325 |
* The maximum gain. This value is platform dependent but is always
|
sl@0
|
326 |
* greater than or equal to one.
|
sl@0
|
327 |
*
|
sl@0
|
328 |
*/
|
sl@0
|
329 |
inline TInt CMMFDevSoundClientImp::MaxGain()
|
sl@0
|
330 |
{
|
sl@0
|
331 |
return iDevSoundProxy->MaxGain();
|
sl@0
|
332 |
}
|
sl@0
|
333 |
|
sl@0
|
334 |
/*
|
sl@0
|
335 |
*
|
sl@0
|
336 |
* Returns an integer representing the current gain.
|
sl@0
|
337 |
*
|
sl@0
|
338 |
* @return "TInt"
|
sl@0
|
339 |
* The current gain level.
|
sl@0
|
340 |
*
|
sl@0
|
341 |
*/
|
sl@0
|
342 |
inline TInt CMMFDevSoundClientImp::Gain()
|
sl@0
|
343 |
{
|
sl@0
|
344 |
return iDevSoundProxy->Gain();
|
sl@0
|
345 |
}
|
sl@0
|
346 |
|
sl@0
|
347 |
/*
|
sl@0
|
348 |
*
|
sl@0
|
349 |
* Returns the speaker balance set for playing.
|
sl@0
|
350 |
*
|
sl@0
|
351 |
* Leaves on failure.
|
sl@0
|
352 |
*
|
sl@0
|
353 |
* @param "TInt& aLeftPercentage"
|
sl@0
|
354 |
* On return contains the left speaker volume percentage.
|
sl@0
|
355 |
*
|
sl@0
|
356 |
* @param "TInt& aRightPercentage"
|
sl@0
|
357 |
* On return contains the right speaker volume percentage.
|
sl@0
|
358 |
*
|
sl@0
|
359 |
*/
|
sl@0
|
360 |
inline void CMMFDevSoundClientImp::GetPlayBalanceL(TInt& aLeftPercentage, TInt& aRightPercentage)
|
sl@0
|
361 |
{
|
sl@0
|
362 |
iDevSoundProxy->GetPlayBalanceL(aLeftPercentage, aRightPercentage);
|
sl@0
|
363 |
}
|
sl@0
|
364 |
|
sl@0
|
365 |
/*
|
sl@0
|
366 |
*
|
sl@0
|
367 |
* Returns the microphone gain balance set for recording.
|
sl@0
|
368 |
*
|
sl@0
|
369 |
* Leaves on failure.
|
sl@0
|
370 |
*
|
sl@0
|
371 |
* @param "TInt& aLeftPercentage"
|
sl@0
|
372 |
* On return contains the left microphone gain percentage.
|
sl@0
|
373 |
*
|
sl@0
|
374 |
* @param "TInt& aRightPercentage"
|
sl@0
|
375 |
* On return contains the right microphone gain percentage.
|
sl@0
|
376 |
*
|
sl@0
|
377 |
*/
|
sl@0
|
378 |
inline void CMMFDevSoundClientImp::GetRecordBalanceL(TInt& aLeftPercentage, TInt& aRightPercentage)
|
sl@0
|
379 |
{
|
sl@0
|
380 |
iDevSoundProxy->GetRecordBalanceL(aLeftPercentage, aRightPercentage);
|
sl@0
|
381 |
}
|
sl@0
|
382 |
|
sl@0
|
383 |
/*
|
sl@0
|
384 |
*
|
sl@0
|
385 |
* Contine the process of recording. Once the buffer is filled with recorded
|
sl@0
|
386 |
* data, the Observer gets reference to buffer along with callback
|
sl@0
|
387 |
* BufferToBeEmptied(). After processing the buffer (copying over to a
|
sl@0
|
388 |
* different buffer or writing to file) the client should call this
|
sl@0
|
389 |
* method to continue recording process.
|
sl@0
|
390 |
*
|
sl@0
|
391 |
*/
|
sl@0
|
392 |
inline void CMMFDevSoundClientImp::RecordData()
|
sl@0
|
393 |
{
|
sl@0
|
394 |
ASSERT(iDevSoundObserver);
|
sl@0
|
395 |
iDevSoundProxy->RecordData();
|
sl@0
|
396 |
}
|
sl@0
|
397 |
|
sl@0
|
398 |
/*
|
sl@0
|
399 |
*
|
sl@0
|
400 |
* Defines the number of times the audio is to be repeated during the tone
|
sl@0
|
401 |
* playback operation.
|
sl@0
|
402 |
*
|
sl@0
|
403 |
* A period of silence can follow each playing of tone. The tone playing can
|
sl@0
|
404 |
* be repeated indefinitely.
|
sl@0
|
405 |
*
|
sl@0
|
406 |
* @param "TInt aRepeatCount"
|
sl@0
|
407 |
* The number of times the tone, together with the trailing silence,
|
sl@0
|
408 |
* is to be repeated. If this is set to KMdaRepeatForever, then the
|
sl@0
|
409 |
* tone, together with the trailing silence, is repeated indefinitely
|
sl@0
|
410 |
* or until Stop() is called. If this is set to zero, then the tone is
|
sl@0
|
411 |
* not repeated.
|
sl@0
|
412 |
*
|
sl@0
|
413 |
* Supported only during tone playing.
|
sl@0
|
414 |
*
|
sl@0
|
415 |
*/
|
sl@0
|
416 |
inline void CMMFDevSoundClientImp::SetToneRepeats(TInt aRepeatCount,
|
sl@0
|
417 |
const TTimeIntervalMicroSeconds& aRepeatTrailingSilence)
|
sl@0
|
418 |
{
|
sl@0
|
419 |
iDevSoundProxy->SetToneRepeats(aRepeatCount, aRepeatTrailingSilence);
|
sl@0
|
420 |
}
|
sl@0
|
421 |
|
sl@0
|
422 |
/*
|
sl@0
|
423 |
*
|
sl@0
|
424 |
* Defines the priority settings that should be used for this instance.
|
sl@0
|
425 |
*
|
sl@0
|
426 |
* @param "const TMMFPrioritySettings& aPrioritySettings"
|
sl@0
|
427 |
* An class type representing the client's priority, priority
|
sl@0
|
428 |
* preference and state.
|
sl@0
|
429 |
*
|
sl@0
|
430 |
*/
|
sl@0
|
431 |
inline void CMMFDevSoundClientImp::SetPrioritySettings(const TMMFPrioritySettings& aPrioritySettings)
|
sl@0
|
432 |
{
|
sl@0
|
433 |
iDevSoundProxy->SetPrioritySettings(aPrioritySettings);
|
sl@0
|
434 |
}
|
sl@0
|
435 |
|
sl@0
|
436 |
/*
|
sl@0
|
437 |
*
|
sl@0
|
438 |
* Initializes and starts conversion process. Once the process is initiated,
|
sl@0
|
439 |
* observer's call back method BufferToBeFilled() is called with reference to
|
sl@0
|
440 |
* the buffer into which source format data is to be read.
|
sl@0
|
441 |
*
|
sl@0
|
442 |
* The maximum size of data (in bytes) that can be converted is specified in
|
sl@0
|
443 |
* CMMFBuffer::RequestSize(). Any data that is read into buffer beyond this
|
sl@0
|
444 |
* size will be ignored.
|
sl@0
|
445 |
*
|
sl@0
|
446 |
* Leaves on failure.
|
sl@0
|
447 |
* @prototype
|
sl@0
|
448 |
*/
|
sl@0
|
449 |
inline void CMMFDevSoundClientImp::ConvertInitL()
|
sl@0
|
450 |
{
|
sl@0
|
451 |
iDevSoundProxy->ConvertInitL();
|
sl@0
|
452 |
}
|
sl@0
|
453 |
|
sl@0
|
454 |
/*
|
sl@0
|
455 |
*
|
sl@0
|
456 |
* Converts the data in the buffer from source format to destination format.
|
sl@0
|
457 |
* After the data is converted to destination format, a reference to the buffer
|
sl@0
|
458 |
* containing data in destination format is passed in the observer call back
|
sl@0
|
459 |
* method BufferToBeEmptied().
|
sl@0
|
460 |
*
|
sl@0
|
461 |
* The amount of data contained in buffer is specified in
|
sl@0
|
462 |
* CMMFBuffer::RequestSize().
|
sl@0
|
463 |
* @prototype
|
sl@0
|
464 |
*/
|
sl@0
|
465 |
inline void CMMFDevSoundClientImp::ConvertData()
|
sl@0
|
466 |
{
|
sl@0
|
467 |
iDevSoundProxy->ConvertData();
|
sl@0
|
468 |
}
|
sl@0
|
469 |
|
sl@0
|
470 |
// No custom interfaces are supported sp return NULL.
|
sl@0
|
471 |
inline TAny* CMMFDevSoundClientImp::CustomInterface(TUid aInterfaceId)
|
sl@0
|
472 |
{
|
sl@0
|
473 |
if(aInterfaceId == KMmfUidDevSoundAudioResourceCustomInterface)
|
sl@0
|
474 |
{
|
sl@0
|
475 |
MAutoPauseResumeSupport* result = this;
|
sl@0
|
476 |
return result;
|
sl@0
|
477 |
}
|
sl@0
|
478 |
if(aInterfaceId == KMmfUidDevSoundAudioClientThreadInfoCustomInterface)
|
sl@0
|
479 |
{
|
sl@0
|
480 |
MAudioClientThreadInfo* result = this;
|
sl@0
|
481 |
return result;
|
sl@0
|
482 |
}
|
sl@0
|
483 |
return iDevSoundProxy->CustomInterface(aInterfaceId);
|
sl@0
|
484 |
}
|
sl@0
|
485 |
|
sl@0
|
486 |
/*
|
sl@0
|
487 |
*
|
sl@0
|
488 |
* Returns the number of available pre-defined tone sequences.
|
sl@0
|
489 |
*
|
sl@0
|
490 |
* This is the number of fixed sequence supported by DevSound by default.
|
sl@0
|
491 |
*
|
sl@0
|
492 |
* @return "TInt"
|
sl@0
|
493 |
* The fixed sequence count. This value is implementation dependent
|
sl@0
|
494 |
* but is always greater than or equal to zero.
|
sl@0
|
495 |
*
|
sl@0
|
496 |
*/
|
sl@0
|
497 |
inline TInt CMMFDevSoundClientImp::FixedSequenceCount()
|
sl@0
|
498 |
{
|
sl@0
|
499 |
|
sl@0
|
500 |
return iDevSoundProxy->FixedSequenceCount();
|
sl@0
|
501 |
}
|
sl@0
|
502 |
|
sl@0
|
503 |
/*
|
sl@0
|
504 |
*
|
sl@0
|
505 |
* Returns the name assigned to a specific pre-defined tone sequence.
|
sl@0
|
506 |
*
|
sl@0
|
507 |
* This is the number of fixed sequence supported by DevSound by default.
|
sl@0
|
508 |
*
|
sl@0
|
509 |
* The function raises a panic if sequence number specified invalid.
|
sl@0
|
510 |
*
|
sl@0
|
511 |
* @return "TDesC&"
|
sl@0
|
512 |
* A reference to a Descriptor containing the fixed sequence
|
sl@0
|
513 |
* name indexed by aSequenceNumber.
|
sl@0
|
514 |
*
|
sl@0
|
515 |
* @param "TInt aSequenceNumber"
|
sl@0
|
516 |
* The index identifying the specific pre-defined tone sequence. Index
|
sl@0
|
517 |
* values are relative to zero.
|
sl@0
|
518 |
* This can be any value from zero to the value returned by a call to
|
sl@0
|
519 |
* CMdaAudioPlayerUtility::FixedSequenceCount() - 1.
|
sl@0
|
520 |
* The function raises a panic if sequence number is not within this
|
sl@0
|
521 |
* range.
|
sl@0
|
522 |
*
|
sl@0
|
523 |
*/
|
sl@0
|
524 |
inline const TDesC& CMMFDevSoundClientImp::FixedSequenceName(TInt aSequenceNumber)
|
sl@0
|
525 |
{
|
sl@0
|
526 |
return iDevSoundProxy->FixedSequenceName(aSequenceNumber);
|
sl@0
|
527 |
}
|
sl@0
|
528 |
|