|
1 /* |
|
2 * Copyright (c) 2009 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 "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". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: This file contains testclass implementation. |
|
15 * |
|
16 */ |
|
17 |
|
18 // [INCLUDE FILES] - do not remove |
|
19 #include <e32svr.h> |
|
20 #include <StifParser.h> |
|
21 #include <StifTestInterface.h> |
|
22 #include "openmaxaltestmodule.h" |
|
23 |
|
24 // EXTERNAL DATA STRUCTURES |
|
25 //extern ?external_data; |
|
26 |
|
27 // EXTERNAL FUNCTION PROTOTYPES |
|
28 //extern ?external_function( ?arg_type,?arg_type ); |
|
29 |
|
30 // CONSTANTS |
|
31 //const ?type ?constant_var = ?constant; |
|
32 |
|
33 // MACROS |
|
34 //#define ?macro ?macro_def |
|
35 |
|
36 // LOCAL CONSTANTS AND MACROS |
|
37 //const ?type ?constant_var = ?constant; |
|
38 //#define ?macro_name ?macro_def |
|
39 |
|
40 // MODULE DATA STRUCTURES |
|
41 //enum ?declaration |
|
42 //typedef ?declaration |
|
43 |
|
44 // LOCAL FUNCTION PROTOTYPES |
|
45 //?type ?function_name( ?arg_type, ?arg_type ); |
|
46 |
|
47 // FORWARD DECLARATIONS |
|
48 //class ?FORWARD_CLASSNAME; |
|
49 |
|
50 // ============================= LOCAL FUNCTIONS =============================== |
|
51 |
|
52 // ----------------------------------------------------------------------------- |
|
53 // ?function_name ?description. |
|
54 // ?description |
|
55 // Returns: ?value_1: ?description |
|
56 // ?value_n: ?description_line1 |
|
57 // ?description_line2 |
|
58 // ----------------------------------------------------------------------------- |
|
59 // |
|
60 /* |
|
61 ?type ?function_name( |
|
62 ?arg_type arg, // ?description |
|
63 ?arg_type arg) // ?description |
|
64 { |
|
65 |
|
66 ?code // ?comment |
|
67 |
|
68 // ?comment |
|
69 ?code |
|
70 } |
|
71 */ |
|
72 TInt COpenMAXALTestModule::al_engitf_CreateCameraDevice( CStifItemParser& aItem ) |
|
73 { |
|
74 TInt status(KErrNone); |
|
75 TInt objectId; |
|
76 TInt numInterfaces(0); |
|
77 XAresult res; |
|
78 |
|
79 |
|
80 /* Initialize arrays required[] and iidArray[] */ |
|
81 for (TInt i = 0; i < MAX_NUMBER_INTERFACES; i++) |
|
82 { |
|
83 required[i] = XA_BOOLEAN_FALSE; |
|
84 iidArray[i] = XA_IID_NULL; |
|
85 } |
|
86 |
|
87 status = aItem.GetNextInt(numInterfaces); |
|
88 if(!status) |
|
89 { |
|
90 for(TInt j = 0; j < numInterfaces; j++) |
|
91 { |
|
92 TInt interface(0); |
|
93 status = aItem.GetNextInt(interface); |
|
94 if(!status) |
|
95 { |
|
96 required[j] = XA_BOOLEAN_TRUE; |
|
97 iidArray[j] = MapInterface(interface); |
|
98 numInterfaces++; |
|
99 } |
|
100 else |
|
101 { |
|
102 break; |
|
103 } |
|
104 } |
|
105 } |
|
106 |
|
107 |
|
108 status = aItem.GetNextInt(objectId); |
|
109 if(!status) |
|
110 { |
|
111 if(m_EngineItf) |
|
112 { |
|
113 res = (*m_EngineItf)->CreateCameraDevice( |
|
114 m_EngineItf, &m_MOCameraObject, objectId, |
|
115 numInterfaces, iidArray, required); |
|
116 status = res; |
|
117 } |
|
118 else |
|
119 { |
|
120 status = KErrNotFound; |
|
121 } |
|
122 } |
|
123 return status; |
|
124 } |
|
125 |
|
126 |
|
127 TInt COpenMAXALTestModule::al_engitf_CreateRadioDevice( CStifItemParser& aItem ) |
|
128 { |
|
129 TInt status(KErrNone); |
|
130 TInt numInterfaces(0); |
|
131 XAresult res; |
|
132 |
|
133 |
|
134 /* Initialize arrays required[] and iidArray[] */ |
|
135 for (TInt i = 0; i < MAX_NUMBER_INTERFACES; i++) |
|
136 { |
|
137 required[i] = XA_BOOLEAN_FALSE; |
|
138 iidArray[i] = XA_IID_NULL; |
|
139 } |
|
140 |
|
141 status = aItem.GetNextInt(numInterfaces); |
|
142 if(!status) |
|
143 { |
|
144 for(TInt j = 0; j < numInterfaces; j++) |
|
145 { |
|
146 TInt interface(0); |
|
147 status = aItem.GetNextInt(interface); |
|
148 if(!status) |
|
149 { |
|
150 required[j] = XA_BOOLEAN_TRUE; |
|
151 iidArray[j] = MapInterface(interface); |
|
152 numInterfaces++; |
|
153 } |
|
154 else |
|
155 { |
|
156 break; |
|
157 } |
|
158 } |
|
159 } |
|
160 |
|
161 |
|
162 if(m_EngineItf) |
|
163 { |
|
164 res = (*m_EngineItf)->CreateRadioDevice( |
|
165 m_EngineItf, &m_MORadioObject, |
|
166 numInterfaces, iidArray, required); |
|
167 status = res; |
|
168 } |
|
169 else |
|
170 { |
|
171 status = KErrNotFound; |
|
172 } |
|
173 return status; |
|
174 } |
|
175 |
|
176 TInt COpenMAXALTestModule::al_engitf_CreateLEDDevice( CStifItemParser& aItem ) |
|
177 { |
|
178 TInt status(KErrNone); |
|
179 TInt objectId; |
|
180 TInt numInterfaces(0); |
|
181 XAresult res; |
|
182 |
|
183 |
|
184 /* Initialize arrays required[] and iidArray[] */ |
|
185 for (TInt i = 0; i < MAX_NUMBER_INTERFACES; i++) |
|
186 { |
|
187 required[i] = XA_BOOLEAN_FALSE; |
|
188 iidArray[i] = XA_IID_NULL; |
|
189 } |
|
190 |
|
191 status = aItem.GetNextInt(numInterfaces); |
|
192 if(!status) |
|
193 { |
|
194 for(TInt j = 0; j < numInterfaces; j++) |
|
195 { |
|
196 TInt interface(0); |
|
197 status = aItem.GetNextInt(interface); |
|
198 if(!status) |
|
199 { |
|
200 required[j] = XA_BOOLEAN_TRUE; |
|
201 iidArray[j] = MapInterface(interface); |
|
202 numInterfaces++; |
|
203 } |
|
204 else |
|
205 { |
|
206 break; |
|
207 } |
|
208 } |
|
209 } |
|
210 |
|
211 |
|
212 status = aItem.GetNextInt(objectId); |
|
213 if(!status) |
|
214 { |
|
215 if(m_EngineItf) |
|
216 { |
|
217 res = (*m_EngineItf)->CreateLEDDevice( |
|
218 m_EngineItf, &m_MOVibraObject, objectId, |
|
219 numInterfaces, iidArray, required); |
|
220 status = res; |
|
221 } |
|
222 else |
|
223 { |
|
224 status = KErrNotFound; |
|
225 } |
|
226 } |
|
227 return status; |
|
228 } |
|
229 |
|
230 TInt COpenMAXALTestModule::al_engitf_CreateVibraDevice( CStifItemParser& aItem ) |
|
231 { |
|
232 TInt status(KErrNone); |
|
233 TInt objectId; |
|
234 TInt numInterfaces(0); |
|
235 XAresult res; |
|
236 |
|
237 |
|
238 /* Initialize arrays required[] and iidArray[] */ |
|
239 for (TInt i = 0; i < MAX_NUMBER_INTERFACES; i++) |
|
240 { |
|
241 required[i] = XA_BOOLEAN_FALSE; |
|
242 iidArray[i] = XA_IID_NULL; |
|
243 } |
|
244 |
|
245 status = aItem.GetNextInt(numInterfaces); |
|
246 if(!status) |
|
247 { |
|
248 for(TInt j = 0; j < numInterfaces; j++) |
|
249 { |
|
250 TInt interface(0); |
|
251 status = aItem.GetNextInt(interface); |
|
252 if(!status) |
|
253 { |
|
254 required[j] = XA_BOOLEAN_TRUE; |
|
255 iidArray[j] = MapInterface(interface); |
|
256 numInterfaces++; |
|
257 } |
|
258 else |
|
259 { |
|
260 break; |
|
261 } |
|
262 } |
|
263 } |
|
264 |
|
265 |
|
266 status = aItem.GetNextInt(objectId); |
|
267 if(!status) |
|
268 { |
|
269 if(m_EngineItf) |
|
270 { |
|
271 res = (*m_EngineItf)->CreateVibraDevice( |
|
272 m_EngineItf, &m_MOVibraObject, objectId, |
|
273 numInterfaces, iidArray, required); |
|
274 status = res; |
|
275 } |
|
276 else |
|
277 { |
|
278 status = KErrNotFound; |
|
279 } |
|
280 } |
|
281 return status; |
|
282 } |
|
283 |
|
284 TInt COpenMAXALTestModule::al_engitf_CreateMediaPlayer( CStifItemParser& aItem ) |
|
285 { |
|
286 TInt status(KErrNone); |
|
287 XADataSource* audioSource(NULL); |
|
288 XADataSource* videoSource(NULL); |
|
289 XADataSink* audioSink(NULL); |
|
290 XADataSink* videoSink(NULL); |
|
291 XADataSink* ledSink(NULL); |
|
292 XADataSink* vibraSink(NULL); |
|
293 TInt numInterfaces(0); |
|
294 XAresult res; |
|
295 |
|
296 |
|
297 /* Initialize arrays required[] and iidArray[] */ |
|
298 for (TInt i = 0; i < MAX_NUMBER_INTERFACES; i++) |
|
299 { |
|
300 required[i] = XA_BOOLEAN_FALSE; |
|
301 iidArray[i] = XA_IID_NULL; |
|
302 } |
|
303 |
|
304 status = aItem.GetNextInt(numInterfaces); |
|
305 if(!status) |
|
306 { |
|
307 for(TInt j = 0; j < numInterfaces; j++) |
|
308 { |
|
309 TInt interface(0); |
|
310 status = aItem.GetNextInt(interface); |
|
311 if(!status) |
|
312 { |
|
313 required[j] = XA_BOOLEAN_TRUE; |
|
314 iidArray[j] = MapInterface(interface); |
|
315 numInterfaces++; |
|
316 } |
|
317 else |
|
318 { |
|
319 break; |
|
320 } |
|
321 } |
|
322 } |
|
323 |
|
324 if(m_AudioSource.pFormat && m_AudioSource.pLocator) |
|
325 { |
|
326 audioSource = &m_AudioSource; |
|
327 } |
|
328 |
|
329 if(m_VideoSource.pFormat && m_VideoSource.pLocator) |
|
330 { |
|
331 videoSource = &m_VideoSource; |
|
332 } |
|
333 |
|
334 if(m_VibraSink.pFormat && m_VibraSink.pLocator) |
|
335 { |
|
336 vibraSink = &m_VibraSink; |
|
337 } |
|
338 |
|
339 if(m_LEDSink.pFormat && m_LEDSink.pLocator) |
|
340 { |
|
341 ledSink = &m_LEDSink; |
|
342 } |
|
343 |
|
344 if(m_AudioSink.pFormat && m_AudioSink.pLocator) |
|
345 { |
|
346 audioSink = &m_AudioSink; |
|
347 } |
|
348 |
|
349 if(m_VideoSink.pFormat && m_VideoSink.pLocator) |
|
350 { |
|
351 videoSink = &m_VideoSink; |
|
352 } |
|
353 |
|
354 if(m_EngineItf) |
|
355 { |
|
356 res = (*m_EngineItf)->CreateMediaPlayer( |
|
357 m_EngineItf, &m_MOPlayer, audioSource, videoSource, |
|
358 audioSink,videoSink, ledSink, vibraSink, |
|
359 numInterfaces, iidArray, required); |
|
360 status = res; |
|
361 } |
|
362 else |
|
363 { |
|
364 status = KErrNotFound; |
|
365 } |
|
366 return status; |
|
367 } |
|
368 |
|
369 TInt COpenMAXALTestModule::al_engitf_CreateMediaRecorder( CStifItemParser& aItem ) |
|
370 { |
|
371 TInt status(KErrNone); |
|
372 XAresult res; |
|
373 TInt numInterfaces(0); |
|
374 XADataSource* audioSource(NULL); |
|
375 XADataSource* videoSource(NULL); |
|
376 XADataSink* dataSink(NULL); |
|
377 /* Initialize arrays required[] and iidArray[] */ |
|
378 for (TInt i = 0; i < MAX_NUMBER_INTERFACES; i++) |
|
379 { |
|
380 required[i] = XA_BOOLEAN_FALSE; |
|
381 iidArray[i] = XA_IID_NULL; |
|
382 } |
|
383 |
|
384 status = aItem.GetNextInt(numInterfaces); |
|
385 if(!status) |
|
386 { |
|
387 for(TInt j = 0; j < numInterfaces; j++) |
|
388 { |
|
389 TInt interface(0); |
|
390 status = aItem.GetNextInt(interface); |
|
391 if(!status) |
|
392 { |
|
393 required[j] = XA_BOOLEAN_TRUE; |
|
394 iidArray[j] = MapInterface(interface); |
|
395 numInterfaces++; |
|
396 } |
|
397 else |
|
398 { |
|
399 break; |
|
400 } |
|
401 } |
|
402 } |
|
403 |
|
404 |
|
405 if(m_AudioSource.pFormat && m_AudioSource.pLocator) |
|
406 { |
|
407 audioSource = &m_AudioSource; |
|
408 } |
|
409 |
|
410 if(m_VideoSource.pFormat && m_VideoSource.pLocator) |
|
411 { |
|
412 videoSource = &m_VideoSource; |
|
413 } |
|
414 |
|
415 if(m_DataSink.pFormat && m_DataSink.pLocator) |
|
416 { |
|
417 dataSink = &m_DataSink; |
|
418 } |
|
419 |
|
420 if(m_EngineItf) |
|
421 { |
|
422 res = (*m_EngineItf)->CreateMediaRecorder( |
|
423 m_EngineItf, &m_MORecorder, audioSource, videoSource, dataSink, |
|
424 numInterfaces, iidArray, required); |
|
425 status = res; |
|
426 } |
|
427 else |
|
428 { |
|
429 status = KErrNotFound; |
|
430 } |
|
431 return status; |
|
432 } |
|
433 |
|
434 TInt COpenMAXALTestModule::al_engitf_CreateOutputMix( CStifItemParser& aItem ) |
|
435 { |
|
436 TInt status(KErrNone); |
|
437 XAresult res; |
|
438 TInt numInterfaces(0); |
|
439 |
|
440 /* Initialize arrays required[] and iidArray[] */ |
|
441 for (TInt i = 0; i < MAX_NUMBER_INTERFACES; i++) |
|
442 { |
|
443 required[i] = XA_BOOLEAN_FALSE; |
|
444 iidArray[i] = XA_IID_NULL; |
|
445 } |
|
446 |
|
447 status = aItem.GetNextInt(numInterfaces); |
|
448 if(!status) |
|
449 { |
|
450 for(TInt j = 0; j < numInterfaces; j++) |
|
451 { |
|
452 TInt interface(0); |
|
453 status = aItem.GetNextInt(interface); |
|
454 if(!status) |
|
455 { |
|
456 required[j] = XA_BOOLEAN_TRUE; |
|
457 iidArray[j] = MapInterface(interface); |
|
458 numInterfaces++; |
|
459 } |
|
460 else |
|
461 { |
|
462 break; |
|
463 } |
|
464 } |
|
465 } |
|
466 |
|
467 if(m_EngineItf) |
|
468 { |
|
469 res = (*m_EngineItf)->CreateOutputMix( |
|
470 m_EngineItf, &m_MOOutputMix, |
|
471 numInterfaces, iidArray, required); |
|
472 status = res; |
|
473 } |
|
474 else |
|
475 { |
|
476 status = KErrNotFound; |
|
477 } |
|
478 return status; |
|
479 } |
|
480 |
|
481 TInt COpenMAXALTestModule::al_engitf_CreateMetadataExtractor( CStifItemParser& aItem ) |
|
482 { |
|
483 TInt status(KErrNone); |
|
484 XAresult res; |
|
485 TInt numInterfaces(0); |
|
486 XADataSource* metadataSource(NULL); |
|
487 /* Initialize arrays required[] and iidArray[] */ |
|
488 for (TInt i = 0; i < MAX_NUMBER_INTERFACES; i++) |
|
489 { |
|
490 required[i] = XA_BOOLEAN_FALSE; |
|
491 iidArray[i] = XA_IID_NULL; |
|
492 } |
|
493 |
|
494 status = aItem.GetNextInt(numInterfaces); |
|
495 if(!status) |
|
496 { |
|
497 for(TInt j = 0; j < numInterfaces; j++) |
|
498 { |
|
499 TInt interface(0); |
|
500 status = aItem.GetNextInt(interface); |
|
501 if(!status) |
|
502 { |
|
503 required[j] = XA_BOOLEAN_TRUE; |
|
504 iidArray[j] = MapInterface(interface); |
|
505 numInterfaces++; |
|
506 } |
|
507 else |
|
508 { |
|
509 break; |
|
510 } |
|
511 } |
|
512 } |
|
513 |
|
514 if(m_MOMetadataExtractorSource.pFormat && m_MOMetadataExtractorSource.pLocator) |
|
515 { |
|
516 metadataSource = &m_MOMetadataExtractorSource; |
|
517 } |
|
518 |
|
519 if(m_EngineItf) |
|
520 { |
|
521 res = (*m_EngineItf)->CreateMetadataExtractor( |
|
522 m_EngineItf, &m_MOMetadataExtractor, metadataSource, |
|
523 numInterfaces, iidArray, required); |
|
524 status = res; |
|
525 } |
|
526 else |
|
527 { |
|
528 status = KErrNotFound; |
|
529 } |
|
530 return status; |
|
531 } |
|
532 |
|
533 TInt COpenMAXALTestModule::al_engitf_CreateExtensionObject( CStifItemParser& aItem ) |
|
534 { |
|
535 TInt status(KErrNone); |
|
536 XAresult res; |
|
537 TInt numInterfaces(0); |
|
538 TInt objectId(0); |
|
539 |
|
540 /* Initialize arrays required[] and iidArray[] */ |
|
541 for (TInt i = 0; i < MAX_NUMBER_INTERFACES; i++) |
|
542 { |
|
543 required[i] = XA_BOOLEAN_FALSE; |
|
544 iidArray[i] = XA_IID_NULL; |
|
545 } |
|
546 |
|
547 status = aItem.GetNextInt(numInterfaces); |
|
548 if(!status) |
|
549 { |
|
550 for(TInt j = 0; j < numInterfaces; j++) |
|
551 { |
|
552 TInt interface(0); |
|
553 status = aItem.GetNextInt(interface); |
|
554 if(!status) |
|
555 { |
|
556 required[j] = XA_BOOLEAN_TRUE; |
|
557 iidArray[j] = MapInterface(interface); |
|
558 numInterfaces++; |
|
559 } |
|
560 else |
|
561 { |
|
562 break; |
|
563 } |
|
564 } |
|
565 } |
|
566 |
|
567 |
|
568 status = aItem.GetNextInt(objectId); |
|
569 if(!status) |
|
570 { |
|
571 if(m_EngineItf) |
|
572 { |
|
573 res = (*m_EngineItf)->CreateExtensionObject( |
|
574 m_EngineItf, &m_MOExtnObject, NULL, objectId, |
|
575 numInterfaces, iidArray, required); |
|
576 status = res; |
|
577 } |
|
578 else |
|
579 { |
|
580 status = KErrNotFound; |
|
581 } |
|
582 } |
|
583 return status; |
|
584 } |
|
585 |
|
586 TInt COpenMAXALTestModule::al_engitf_GetImplementationInfo( CStifItemParser& /*aItem*/ ) |
|
587 { |
|
588 TInt status(KErrNone); |
|
589 XAresult res; |
|
590 XAuint32 major; |
|
591 XAuint32 minor; |
|
592 XAuint32 step; |
|
593 const XAchar* implText(NULL); |
|
594 |
|
595 if(m_EngineItf) |
|
596 { |
|
597 res = (*m_EngineItf)->GetImplementationInfo( |
|
598 m_EngineItf, &major, &minor, &step, implText); |
|
599 status = res; |
|
600 iLog->Log(_L("GetImplementationInfo Major[%d] Minor[%d] Step[%d]"),major,minor,step); |
|
601 } |
|
602 else |
|
603 { |
|
604 status = KErrNotFound; |
|
605 } |
|
606 return status; |
|
607 } |
|
608 |
|
609 TInt COpenMAXALTestModule::al_engitf_QuerySupportedProfiles( CStifItemParser& /*aItem*/ ) |
|
610 { |
|
611 TInt status(KErrNone); |
|
612 XAresult res; |
|
613 XAint16 profiles; |
|
614 |
|
615 if(m_EngineItf) |
|
616 { |
|
617 res = (*m_EngineItf)->QuerySupportedProfiles( |
|
618 m_EngineItf, &profiles); |
|
619 status = res; |
|
620 iLog->Log(_L("QuerySupportedProfiles Profiles[%d] "),profiles); |
|
621 } |
|
622 else |
|
623 { |
|
624 status = KErrNotFound; |
|
625 } |
|
626 return status; |
|
627 } |
|
628 |
|
629 TInt COpenMAXALTestModule::al_engitf_QueryNumSupportedInterfaces( CStifItemParser& aItem ) |
|
630 { |
|
631 TInt status(KErrNone); |
|
632 TUint object(0); |
|
633 XAuint32 numInterfaces(0); |
|
634 XAresult res; |
|
635 XAuint32 objectId; |
|
636 status = aItem.GetNextInt(object); |
|
637 if(!status) |
|
638 { |
|
639 objectId = object; |
|
640 if(m_EngineItf) |
|
641 { |
|
642 res = (*m_EngineItf)->QueryNumSupportedInterfaces( |
|
643 m_EngineItf, objectId,&numInterfaces); |
|
644 status = res; |
|
645 } |
|
646 else |
|
647 { |
|
648 status = KErrNotFound; |
|
649 } |
|
650 } |
|
651 return status; |
|
652 } |
|
653 |
|
654 TInt COpenMAXALTestModule::al_engitf_QuerySupportedInterfaces( CStifItemParser& aItem ) |
|
655 { |
|
656 TInt status(KErrNone); |
|
657 TUint object(0); |
|
658 TInt index(0); |
|
659 XAresult res; |
|
660 XAInterfaceID interface; |
|
661 XAuint32 objectId; |
|
662 status = aItem.GetNextInt(object); |
|
663 if(!status) |
|
664 { |
|
665 objectId = object; |
|
666 status = aItem.GetNextInt(index); |
|
667 if(!status) |
|
668 { |
|
669 if(m_EngineItf) |
|
670 { |
|
671 res = (*m_EngineItf)->QuerySupportedInterfaces( |
|
672 m_EngineItf, objectId, index,&interface); |
|
673 status = res; |
|
674 } |
|
675 else |
|
676 { |
|
677 status = KErrNotFound; |
|
678 } |
|
679 } |
|
680 else |
|
681 { |
|
682 status = KErrGeneral; |
|
683 } |
|
684 } |
|
685 else |
|
686 { |
|
687 status = KErrGeneral; |
|
688 } |
|
689 return status; |
|
690 } |
|
691 |
|
692 TInt COpenMAXALTestModule::al_engitf_QueryNumSupportedExtension( CStifItemParser& /*aItem*/ ) |
|
693 { |
|
694 TInt status(KErrNone); |
|
695 XAresult res; |
|
696 XAuint32 extensions; |
|
697 |
|
698 if(m_EngineItf) |
|
699 { |
|
700 res = (*m_EngineItf)->QueryNumSupportedExtensions( |
|
701 m_EngineItf, &extensions); |
|
702 status = res; |
|
703 iLog->Log(_L("QueryNumSupportedExtensions Extensions[%d] "),extensions); |
|
704 } |
|
705 else |
|
706 { |
|
707 status = KErrNotFound; |
|
708 } |
|
709 return status; |
|
710 } |
|
711 |
|
712 TInt COpenMAXALTestModule::al_engitf_QuerySupportedExtension( CStifItemParser& aItem ) |
|
713 { |
|
714 TInt status(KErrNone); |
|
715 TInt length(0); |
|
716 TInt index(0); |
|
717 XAresult res; |
|
718 XAint16 namelen; |
|
719 status = aItem.GetNextInt(index); |
|
720 XAchar extensionName[20]; |
|
721 if(!status) |
|
722 { |
|
723 status = aItem.GetNextInt(length); |
|
724 if(!status) |
|
725 { |
|
726 if(m_EngineItf) |
|
727 { |
|
728 res = (*m_EngineItf)->QuerySupportedExtension( |
|
729 m_EngineItf, index, extensionName, &namelen); |
|
730 status = res; |
|
731 } |
|
732 else |
|
733 { |
|
734 status = KErrNotFound; |
|
735 } |
|
736 } |
|
737 else |
|
738 { |
|
739 if(m_EngineItf) |
|
740 { |
|
741 res = (*m_EngineItf)->QuerySupportedExtension( |
|
742 m_EngineItf, index, NULL, &namelen); |
|
743 status = res; |
|
744 } |
|
745 else |
|
746 { |
|
747 status = KErrNotFound; |
|
748 } |
|
749 } |
|
750 } |
|
751 else |
|
752 { |
|
753 status = KErrGeneral; |
|
754 } |
|
755 return status; |
|
756 } |
|
757 |
|
758 TInt COpenMAXALTestModule::al_engitf_IsExtensionSupported( CStifItemParser& aItem ) |
|
759 { |
|
760 TInt status(KErrNone); |
|
761 XAboolean supported(0); |
|
762 TPtrC extensionName; |
|
763 XAresult res; |
|
764 HBufC8* extnName; |
|
765 |
|
766 status = aItem.GetNextString(extensionName); |
|
767 if(!status) |
|
768 { |
|
769 extnName = HBufC8::NewL(extensionName.Length()+1); |
|
770 CleanupStack::PushL(extnName); |
|
771 TPtr8 des = extnName->Des(); |
|
772 des.Copy(extensionName); |
|
773 if(m_EngineItf) |
|
774 { |
|
775 res = (*m_EngineItf)->IsExtensionSupported( |
|
776 m_EngineItf,des.PtrZ(), &supported ); |
|
777 status = res; |
|
778 } |
|
779 else |
|
780 { |
|
781 status = KErrNotFound; |
|
782 } |
|
783 CleanupStack::PopAndDestroy(extnName); |
|
784 } |
|
785 |
|
786 return status; |
|
787 } |
|
788 |
|
789 TInt COpenMAXALTestModule::al_engitf_QueryLEDCapabilities( CStifItemParser& aItem ) |
|
790 { |
|
791 TInt status(KErrNone); |
|
792 XAuint32 deviceId(0); |
|
793 TInt index(0); |
|
794 XAuint32 ledindex(0); |
|
795 XAresult res; |
|
796 XALEDDescriptor desc; |
|
797 |
|
798 status = aItem.GetNextInt(index); |
|
799 if(!status) |
|
800 { |
|
801 ledindex = index; |
|
802 if(m_EngineItf) |
|
803 { |
|
804 res = (*m_EngineItf)->QueryLEDCapabilities( |
|
805 m_EngineItf, &ledindex, &deviceId, &desc); |
|
806 status = res; |
|
807 } |
|
808 else |
|
809 { |
|
810 status = KErrNotFound; |
|
811 } |
|
812 } |
|
813 else |
|
814 { |
|
815 if(m_EngineItf) |
|
816 { |
|
817 res = (*m_EngineItf)->QueryLEDCapabilities( |
|
818 m_EngineItf, &ledindex, NULL, NULL); |
|
819 status = res; |
|
820 } |
|
821 else |
|
822 { |
|
823 status = KErrNotFound; |
|
824 } |
|
825 } |
|
826 return status; |
|
827 } |
|
828 |
|
829 TInt COpenMAXALTestModule::al_engitf_QueryVibraCapabilities( CStifItemParser& aItem ) |
|
830 { |
|
831 TInt status(KErrNone); |
|
832 XAuint32 deviceId(0); |
|
833 TInt index(0); |
|
834 XAuint32 ledindex(0); |
|
835 XAresult res; |
|
836 XAVibraDescriptor desc; |
|
837 |
|
838 status = aItem.GetNextInt(index); |
|
839 if(!status) |
|
840 { |
|
841 ledindex = index; |
|
842 if(m_EngineItf) |
|
843 { |
|
844 res = (*m_EngineItf)->QueryVibraCapabilities( |
|
845 m_EngineItf, &ledindex, &deviceId, &desc); |
|
846 status = res; |
|
847 } |
|
848 else |
|
849 { |
|
850 status = KErrNotFound; |
|
851 } |
|
852 } |
|
853 else |
|
854 { |
|
855 if(m_EngineItf) |
|
856 { |
|
857 res = (*m_EngineItf)->QueryVibraCapabilities( |
|
858 m_EngineItf, &ledindex, NULL, NULL); |
|
859 status = res; |
|
860 } |
|
861 else |
|
862 { |
|
863 status = KErrNotFound; |
|
864 } |
|
865 } |
|
866 return status; |
|
867 } |
|
868 |