0
|
1 |
/*
|
|
2 |
* Copyright (c) 2002 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: AudioroutingControl test module
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
|
18 |
|
|
19 |
|
|
20 |
// INCLUDE FILES
|
|
21 |
#include <e32svr.h>
|
|
22 |
#include <StifParser.h>
|
|
23 |
#include <Stiftestinterface.h>
|
|
24 |
#include "AudioRoutingTestClass.h"
|
|
25 |
#include "debug.h"
|
|
26 |
|
|
27 |
// EXTERNAL DATA STRUCTURES
|
|
28 |
//extern ?external_data;
|
|
29 |
|
|
30 |
// EXTERNAL FUNCTION PROTOTYPES
|
|
31 |
//extern ?external_function( ?arg_type,?arg_type );
|
|
32 |
|
|
33 |
// CONSTANTS
|
|
34 |
//const ?type ?constant_var = ?constant;
|
|
35 |
|
|
36 |
// MACROS
|
|
37 |
//#define ?macro ?macro_def
|
|
38 |
|
|
39 |
// LOCAL CONSTANTS AND MACROS
|
|
40 |
//const ?type ?constant_var = ?constant;
|
|
41 |
//#define ?macro_name ?macro_def
|
|
42 |
|
|
43 |
// MODULE DATA STRUCTURES
|
|
44 |
//enum ?declaration
|
|
45 |
//typedef ?declaration
|
|
46 |
|
|
47 |
// LOCAL FUNCTION PROTOTYPES
|
|
48 |
//?type ?function_name( ?arg_type, ?arg_type );
|
|
49 |
|
|
50 |
// FORWARD DECLARATIONS
|
|
51 |
//class ?FORWARD_CLASSNAME;
|
|
52 |
|
|
53 |
// ============================= LOCAL FUNCTIONS ===============================
|
|
54 |
|
|
55 |
// -----------------------------------------------------------------------------
|
|
56 |
// ?function_name ?description.
|
|
57 |
// ?description
|
|
58 |
// Returns: ?value_1: ?description
|
|
59 |
// ?value_n: ?description_line1
|
|
60 |
// ?description_line2
|
|
61 |
// -----------------------------------------------------------------------------
|
|
62 |
//
|
|
63 |
/*
|
|
64 |
?type ?function_name(
|
|
65 |
?arg_type arg, // ?description
|
|
66 |
?arg_type arg) // ?description
|
|
67 |
{
|
|
68 |
|
|
69 |
?code // ?comment
|
|
70 |
|
|
71 |
// ?comment
|
|
72 |
?code
|
|
73 |
}
|
|
74 |
*/
|
|
75 |
|
|
76 |
// ============================ MEMBER FUNCTIONS ===============================
|
|
77 |
|
|
78 |
// -----------------------------------------------------------------------------
|
|
79 |
// CAudioAudioRoutingTest::Delete
|
|
80 |
// Delete here all resources allocated and opened from test methods.
|
|
81 |
// Called from destructor.
|
|
82 |
// -----------------------------------------------------------------------------
|
|
83 |
//
|
|
84 |
TInt CAudioRoutingTestClass::Delete()
|
|
85 |
{
|
|
86 |
TInt error= KErrNone;
|
|
87 |
FTRACE(FPrint(_L("CAudioRoutingTestClass::Delete")));
|
|
88 |
|
|
89 |
iExpectedEvents.Close();
|
|
90 |
iOcurredEvents.Close();
|
|
91 |
|
|
92 |
iLog->Log(_L("Deleting test class..."));
|
|
93 |
iLog->Log(_L(""));
|
|
94 |
iLog->Log(_L(""));
|
|
95 |
|
|
96 |
|
|
97 |
if (iAudioInput)
|
|
98 |
{
|
|
99 |
delete iAudioInput;
|
|
100 |
}
|
|
101 |
|
|
102 |
if (iAudioOutput)
|
|
103 |
{
|
|
104 |
delete iAudioOutput;
|
|
105 |
}
|
|
106 |
|
|
107 |
if (iAudioTone)
|
|
108 |
{
|
|
109 |
delete iAudioTone;
|
|
110 |
}
|
|
111 |
|
|
112 |
if (iAudioInputStream)
|
|
113 |
{
|
|
114 |
delete iAudioInputStream;
|
|
115 |
}
|
|
116 |
|
|
117 |
if (iAudioOutputStream)
|
|
118 |
{
|
|
119 |
delete iAudioOutputStream;
|
|
120 |
}
|
|
121 |
|
|
122 |
if (iCustomCommandUtility)
|
|
123 |
{
|
|
124 |
delete iCustomCommandUtility;
|
|
125 |
}
|
|
126 |
|
|
127 |
if (iMidiClientUtility)
|
|
128 |
{
|
|
129 |
iMidiClientUtility->Close();
|
|
130 |
delete iMidiClientUtility;
|
|
131 |
}
|
|
132 |
|
|
133 |
if (iRecorder)
|
|
134 |
{
|
|
135 |
delete iRecorder;
|
|
136 |
}
|
|
137 |
|
|
138 |
if (iUtil)
|
|
139 |
{
|
|
140 |
delete iUtil;
|
|
141 |
}
|
|
142 |
|
|
143 |
if (iDrmPlayerUtility)
|
|
144 |
{
|
|
145 |
delete iDrmPlayerUtility;
|
|
146 |
}
|
|
147 |
|
|
148 |
|
|
149 |
if (iVideoPlayerUtility)
|
|
150 |
{
|
|
151 |
delete iVideoPlayerUtility;
|
|
152 |
DeleteVideoWindow();
|
|
153 |
}
|
|
154 |
if (iDevSound)
|
|
155 |
{
|
|
156 |
delete iDevSound;
|
|
157 |
}
|
|
158 |
REComSession::FinalClose();
|
|
159 |
return error;
|
|
160 |
}
|
|
161 |
|
|
162 |
// -----------------------------------------------------------------------------
|
|
163 |
// CAudioAudioRoutingTest::RunMethodL
|
|
164 |
// Run specified method. Contains also table of test mothods and their names.
|
|
165 |
// -----------------------------------------------------------------------------
|
|
166 |
//
|
|
167 |
TInt CAudioRoutingTestClass::RunMethodL( CStifItemParser& aItem )
|
|
168 |
{
|
|
169 |
|
|
170 |
static TStifFunctionInfo const KFunctions[] =
|
|
171 |
{
|
|
172 |
// Copy this line for every implemented function.
|
|
173 |
// First string is the function name used in TestScripter script file.
|
|
174 |
// Second is the actual implementation member function.
|
|
175 |
ENTRY( "AudioInput", CAudioRoutingTestClass::CreateAudioInput),
|
|
176 |
ENTRY( "CreateObject", CAudioRoutingTestClass::CreateObject),
|
|
177 |
ENTRY( "AudioInputs", CAudioRoutingTestClass::AudioInput),
|
|
178 |
ENTRY( "SetAudioInput", CAudioRoutingTestClass::SetAudioInputL),
|
|
179 |
ENTRY( "AudioOutput", CAudioRoutingTestClass::AudioOutput),
|
|
180 |
ENTRY( "DefaultAudioOutput", CAudioRoutingTestClass::DefaultAudioOutput),
|
|
181 |
ENTRY( "RegisterObserver", CAudioRoutingTestClass::RegisterObserverL),
|
|
182 |
ENTRY( "SecureOutput", CAudioRoutingTestClass::SecureOutput),
|
|
183 |
ENTRY( "SetAudioOutput", CAudioRoutingTestClass::SetAudioOutputL),
|
|
184 |
ENTRY( "SetSecureOutput", CAudioRoutingTestClass::SetSecureOutputL),
|
|
185 |
ENTRY( "UnregisterObserver", CAudioRoutingTestClass::UnregisterObserver),
|
|
186 |
};
|
|
187 |
|
|
188 |
const TInt count = sizeof( KFunctions ) / sizeof( TStifFunctionInfo );
|
|
189 |
|
|
190 |
return RunInternalL( KFunctions, count, aItem );
|
|
191 |
|
|
192 |
}
|
|
193 |
|
|
194 |
|
|
195 |
// -----------------------------------------------------------------------------
|
|
196 |
// CAudioAudioRoutingTest::EventName
|
|
197 |
// Return descriptor with the notification description
|
|
198 |
// -----------------------------------------------------------------------------
|
|
199 |
TPtrC CAudioRoutingTestClass::EventName( TInt aKey )
|
|
200 |
{
|
|
201 |
static TText* const badKeyword = (TText*)L"BadKeyword";
|
|
202 |
static TText* const keywords[] =
|
|
203 |
{
|
|
204 |
|
|
205 |
(TText*)L"EInitializeComplete",
|
|
206 |
|
|
207 |
};
|
|
208 |
|
|
209 |
|
|
210 |
|
|
211 |
if( (TUint)aKey >= (sizeof( keywords )/sizeof(TText*)) )
|
|
212 |
{
|
|
213 |
iLog->Log(_L("Keyword out of bounds"));
|
|
214 |
TPtrC keyword( badKeyword );
|
|
215 |
return keyword;
|
|
216 |
}
|
|
217 |
else
|
|
218 |
{
|
|
219 |
TPtrC keyword( keywords[aKey] );
|
|
220 |
return keyword;
|
|
221 |
}
|
|
222 |
}
|
|
223 |
|
|
224 |
// -----------------------------------------------------------------------------
|
|
225 |
// CAudioAudioRoutingTest::AddExpectedEvent
|
|
226 |
// Add an event to the expected events' list
|
|
227 |
// -----------------------------------------------------------------------------
|
|
228 |
void CAudioRoutingTestClass::AddExpectedEvent(TG711ExpectedEvent event, TInt ms)
|
|
229 |
{
|
|
230 |
FTRACE(FPrint(_L("CAudioRoutingTestClass::AddExpectedEvent")));
|
|
231 |
iExpectedEvents.Append(event);
|
|
232 |
TPtrC eventName = EventName(event);
|
|
233 |
iLog->Log(_L("Adding expected event:(0x%02x)%S Total=%d"), event, &eventName, iExpectedEvents.Count() );
|
|
234 |
|
|
235 |
if ( iTimeoutController && !iTimeoutController->IsActive() )
|
|
236 |
{
|
|
237 |
if (ms > 0)
|
|
238 |
{
|
|
239 |
iTimeoutController->Start( TTimeIntervalMicroSeconds(ms * 1000) );
|
|
240 |
}
|
|
241 |
else
|
|
242 |
{
|
|
243 |
iLog->Log(_L("Timeout with default value (1s)"));
|
|
244 |
iTimeoutController->Start( TTimeIntervalMicroSeconds(1000000) );
|
|
245 |
}
|
|
246 |
}
|
|
247 |
}
|
|
248 |
|
|
249 |
// -----------------------------------------------------------------------------
|
|
250 |
// CAudioAudioRoutingTest::RemoveExpectedEvent
|
|
251 |
// Remove the indicated event from the expected events' list
|
|
252 |
// -----------------------------------------------------------------------------
|
|
253 |
TBool CAudioRoutingTestClass::RemoveExpectedEvent(TG711ExpectedEvent aEvent)
|
|
254 |
{
|
|
255 |
FTRACE(FPrint(_L("CAudioRoutingTestClass::RemoveExpectedEvent")));
|
|
256 |
TBool match = EFalse;
|
|
257 |
for (TUint i=0; i < iExpectedEvents.Count() ; i++)
|
|
258 |
{
|
|
259 |
if (iExpectedEvents[i] == aEvent)
|
|
260 |
{
|
|
261 |
iExpectedEvents.Remove(i);
|
|
262 |
match = ETrue;
|
|
263 |
break;
|
|
264 |
}
|
|
265 |
}
|
|
266 |
|
|
267 |
return match;
|
|
268 |
}
|
|
269 |
|
|
270 |
|
|
271 |
// -----------------------------------------------------------------------------
|
|
272 |
// CAudioAudioRoutingTest::RemoveAllExpectedEvents
|
|
273 |
// Remove the indicated event from the expected events' list
|
|
274 |
// -----------------------------------------------------------------------------
|
|
275 |
void CAudioRoutingTestClass::RemoveAllExpectedEvents()
|
|
276 |
{
|
|
277 |
FTRACE(FPrint(_L("CAudioRoutingTestClass::RemoveAllExpectedEvents")));
|
|
278 |
iLog->Log(_L("Removing all expected events"));
|
|
279 |
|
|
280 |
iExpectedEvents.Reset();
|
|
281 |
iOcurredEvents.Reset();
|
|
282 |
}
|
|
283 |
|
|
284 |
|
|
285 |
// -----------------------------------------------------------------------------
|
|
286 |
// CAudioAudioRoutingTest::ProcessEvent
|
|
287 |
// -----------------------------------------------------------------------------
|
|
288 |
void CAudioRoutingTestClass::ProcessEvent(TG711ExpectedEvent aEvent, TInt aError)
|
|
289 |
{
|
|
290 |
FTRACE(FPrint(_L("CAudioRoutingTestClass::ProcessEvent")));
|
|
291 |
TPtrC nameEvent = EventName(aEvent);
|
|
292 |
|
|
293 |
// Check for error
|
|
294 |
if (aError == KErrNone)
|
|
295 |
{
|
|
296 |
// Remove the event
|
|
297 |
if (RemoveExpectedEvent(aEvent))
|
|
298 |
{
|
|
299 |
iLog->Log(_L("Expected Event: (0x%02x)%S has ocurred Total=%d"), aEvent, &nameEvent,iExpectedEvents.Count());
|
|
300 |
}
|
|
301 |
else
|
|
302 |
{
|
|
303 |
iLog->Log(_L("Event: (0x%02x)%S has ocurred"), aEvent, &nameEvent);
|
|
304 |
return;
|
|
305 |
}
|
|
306 |
|
|
307 |
// All expected events have ocurred
|
|
308 |
if (iExpectedEvents.Count() == 0 )
|
|
309 |
{
|
|
310 |
Signal();
|
|
311 |
iTimeoutController->Cancel();
|
|
312 |
}
|
|
313 |
}
|
|
314 |
else
|
|
315 |
{
|
|
316 |
iLog->Log(_L("[Error] Event: (0x%02x)%S return with error code=%d"), aEvent, &nameEvent, aError);
|
|
317 |
if (iExpectedEvents.Count() != 0 )
|
|
318 |
{
|
|
319 |
RemoveExpectedEvent(aEvent);
|
|
320 |
}
|
|
321 |
iTimeoutController->Cancel();
|
|
322 |
Signal(KErrCallbackErrorCode);
|
|
323 |
}
|
|
324 |
}
|
|
325 |
|
|
326 |
// -----------------------------------------------------------------------------
|
|
327 |
// CAudioAudioRoutingTest::HandleTimeout
|
|
328 |
// Review if all the expected events have ocurred once the time is over
|
|
329 |
// -----------------------------------------------------------------------------
|
|
330 |
|
|
331 |
void CAudioRoutingTestClass::HandleTimeout(TInt aError)
|
|
332 |
{
|
|
333 |
FTRACE(FPrint(_L("CAudioRoutingTestClass::HandleTimeout")));
|
|
334 |
// All expected events have ocurred
|
|
335 |
if (aError != KErrNone)
|
|
336 |
{
|
|
337 |
if (iExpectedEvents.Count() == 0 )
|
|
338 |
{
|
|
339 |
iLog->Log(_L("Timing out but events have ocurred"));
|
|
340 |
Signal();
|
|
341 |
}
|
|
342 |
else
|
|
343 |
{
|
|
344 |
RemoveAllExpectedEvents();
|
|
345 |
iLog->Log(_L("Timing out and events still pending"));
|
|
346 |
Signal(KErrEventPending);
|
|
347 |
}
|
|
348 |
}
|
|
349 |
else
|
|
350 |
{
|
|
351 |
iLog->Log(_L("Timing out return a error %d"), aError);
|
|
352 |
Signal(aError);
|
|
353 |
}
|
|
354 |
}
|
|
355 |
|
|
356 |
// -----------------------------------------------------------------------------
|
|
357 |
// CAudioAudioRoutingTest::SetTimeout
|
|
358 |
// Create a timer and set a timeout
|
|
359 |
// When the timeout is reached the test case is marked as failed
|
|
360 |
// It's used rather than the "timeout" keyword in the configuration file
|
|
361 |
// because in this way the log continues
|
|
362 |
// -----------------------------------------------------------------------------
|
|
363 |
TInt CAudioRoutingTestClass::SetTimeout( CStifItemParser& aItem )
|
|
364 |
{
|
|
365 |
FTRACE(FPrint(_L("CAudioRoutingTestClass::SetTimeout")));
|
|
366 |
TInt timeout=0;
|
|
367 |
TInt error = aItem.GetNextInt(timeout) ;
|
|
368 |
if ( iTimeoutController )
|
|
369 |
{
|
|
370 |
if ( timeout > 0 )
|
|
371 |
{
|
|
372 |
iTimeoutController->Start( TTimeIntervalMicroSeconds(timeout*1000) );
|
|
373 |
}
|
|
374 |
else
|
|
375 |
{
|
|
376 |
iTimeoutController->Start( TTimeIntervalMicroSeconds(1000000) );
|
|
377 |
}
|
|
378 |
}
|
|
379 |
else
|
|
380 |
{
|
|
381 |
iLog->Log(_L("Timeout Controller doesn't exist"));
|
|
382 |
error = KErrTimeoutController;
|
|
383 |
}
|
|
384 |
return error;
|
|
385 |
}
|
|
386 |
|
|
387 |
|
|
388 |
// -----------------------------------------------------------------------------
|
|
389 |
// Uses the TestModuleBase API to allow a panic as exit reason for a test case
|
|
390 |
// -----------------------------------------------------------------------------
|
|
391 |
TInt CAudioRoutingTestClass::SetAllowedPanic( CStifItemParser& aItem )
|
|
392 |
{
|
|
393 |
FTRACE(FPrint(_L("CAudioRoutingTestClass::SetAllowedPanic")));
|
|
394 |
TInt error = KErrNone;
|
|
395 |
TInt panicCode;
|
|
396 |
TPtrC panicType;
|
|
397 |
if ( ( KErrNone == aItem.GetNextString(panicType) ) &&
|
|
398 |
( KErrNone == aItem.GetNextInt(panicCode) ) )
|
|
399 |
{
|
|
400 |
iLog->Log(_L("Allowing panic: %S %d"), &panicType, panicCode);
|
|
401 |
iTestModuleIf.SetExitReason( CTestModuleIf::EPanic, panicCode );
|
|
402 |
iNormalExitReason = EFalse;
|
|
403 |
}
|
|
404 |
else
|
|
405 |
{
|
|
406 |
iLog->Log(KMsgBadTestParameters);
|
|
407 |
error = KErrBadTestParameter;
|
|
408 |
}
|
|
409 |
return error;
|
|
410 |
}
|
|
411 |
|
|
412 |
// -----------------------------------------------------------------------------
|
|
413 |
// CAudioAudioRoutingTest::SetExpectedEvents()
|
|
414 |
// -----------------------------------------------------------------------------
|
|
415 |
TInt CAudioRoutingTestClass::SetExpectedEvents( CStifItemParser& aItem )
|
|
416 |
{
|
|
417 |
FTRACE(FPrint(_L("CAudioRoutingTestClass::SetExpectedEvents")));
|
|
418 |
TInt error = KErrNone;
|
|
419 |
TInt event=0;
|
|
420 |
while ( KErrNone == aItem.GetNextInt(event))
|
|
421 |
{
|
|
422 |
AddExpectedEvent(static_cast<TG711ExpectedEvent>(event), 0); // Default timeout value
|
|
423 |
}
|
|
424 |
return error;
|
|
425 |
}
|
|
426 |
|
|
427 |
|
|
428 |
// -----------------------------------------------------------------------------
|
|
429 |
// CAudioAudioRoutingTest::ExampleL
|
|
430 |
// Example test method function.
|
|
431 |
// (other items were commented in a header).
|
|
432 |
// -----------------------------------------------------------------------------
|
|
433 |
//
|
|
434 |
TInt CAudioRoutingTestClass::ExampleL( CStifItemParser& aItem )
|
|
435 |
{
|
|
436 |
_LIT( KAudioRoutingTestClass, "AudioRoutingTestClass" );
|
|
437 |
_LIT( KExample, "In Example" );
|
|
438 |
TestModuleIf().Printf( 0, KAudioRoutingTestClass, KExample );
|
|
439 |
|
|
440 |
iLog->Log( KExample );
|
|
441 |
|
|
442 |
TInt i = 0;
|
|
443 |
TPtrC string;
|
|
444 |
_LIT( KParam, "Param[%i]: %S" );
|
|
445 |
while ( aItem.GetNextString ( string ) == KErrNone )
|
|
446 |
{
|
|
447 |
TestModuleIf().Printf( i, KAudioRoutingTestClass, KParam, i, &string );
|
|
448 |
i++;
|
|
449 |
}
|
|
450 |
|
|
451 |
return KErrNone;
|
|
452 |
}
|
|
453 |
|
|
454 |
// -----------------------------------------------------------------------------
|
|
455 |
// CG711DecoderIntfcTestClass::CreateObject
|
|
456 |
// Create Factory
|
|
457 |
// -----------------------------------------------------------------------------
|
|
458 |
//
|
|
459 |
|
|
460 |
|
|
461 |
TInt CAudioRoutingTestClass::CreateObject( CStifItemParser& aItem )
|
|
462 |
{
|
|
463 |
FTRACE(FPrint(_L("CAudioAudioRoutingTest::CreateObject")));
|
|
464 |
iLog->Log(_L("CAudioAudioRoutingTest::CreateObject"));
|
|
465 |
TInt error = KErrNone;
|
|
466 |
|
|
467 |
TPtrC object;
|
|
468 |
aItem.GetNextString ( object );
|
|
469 |
|
|
470 |
iObject.Set(object);
|
|
471 |
iLog->Log(_L("the object to create is [%S]"),&object);
|
|
472 |
|
|
473 |
if (object == KTagDevSound)
|
|
474 |
{
|
|
475 |
TRAP(error, iDevSound = CMMFDevSound::NewL());
|
|
476 |
if (error == KErrNone)
|
|
477 |
{
|
|
478 |
TRAP(error,iDevSound->InitializeL(*this,KMMFFourCCCodeAMR,EMMFStatePlaying));
|
|
479 |
}
|
|
480 |
}
|
|
481 |
else if (object == KTagRecorder)
|
|
482 |
{
|
|
483 |
iInputOutput = ETrue;
|
|
484 |
CreateInput();
|
|
485 |
}
|
|
486 |
else if (object== KTagCustomCommand)
|
|
487 |
{
|
|
488 |
TPtrC type;
|
|
489 |
aItem.GetNextString ( type );
|
|
490 |
if (type == KTagAudioPlayer)
|
|
491 |
{
|
|
492 |
TRAP(error,iCustomCommandUtility = CCustomCommandUtility::NewL(*iUtil));
|
|
493 |
}
|
|
494 |
else
|
|
495 |
{
|
|
496 |
TRAP(error,iCustomCommandUtility = CCustomCommandUtility::NewL(*iRecorder,ETrue));
|
|
497 |
}
|
|
498 |
}
|
|
499 |
else if (object == KTagCustomInterface)
|
|
500 |
{
|
|
501 |
TPtrC type;
|
|
502 |
aItem.GetNextString ( type );
|
|
503 |
if (type == KTagAudioPlayer)
|
|
504 |
{
|
|
505 |
TRAP(error,iCustomInterfaceUtility = CCustomInterfaceUtility::NewL(*iUtil));
|
|
506 |
}
|
|
507 |
else if (type == KTagCustomCommand)
|
|
508 |
{
|
|
509 |
TRAP(error,iCustomInterfaceUtility = CCustomInterfaceUtility::NewL(*iCustomCommandUtility));
|
|
510 |
}
|
|
511 |
else if (type == KTagRecorder)
|
|
512 |
{
|
|
513 |
TRAP(error,iCustomInterfaceUtility = CCustomInterfaceUtility::NewL(*iRecorder,ETrue));
|
|
514 |
}
|
|
515 |
}
|
|
516 |
else if (object == KTagInputStream)
|
|
517 |
{
|
|
518 |
TRAP(error,iAudioInputStream = CMdaAudioInputStream::NewL(*this));
|
|
519 |
}
|
|
520 |
else if (object == KTagAudioPlayer)
|
|
521 |
{
|
|
522 |
CreateOutput();
|
|
523 |
}
|
|
524 |
else if (object == KTagOuputRecord)
|
|
525 |
{
|
|
526 |
iInputOutput = EFalse;
|
|
527 |
CreateInput();
|
|
528 |
}
|
|
529 |
else if (object == KTagOutputStream)
|
|
530 |
{
|
|
531 |
iStreamSettings.iChannels = TMdaAudioDataSettings::EChannelsMono;
|
|
532 |
iStreamSettings.iSampleRate = TMdaAudioDataSettings::ESampleRate16000Hz;
|
|
533 |
iStreamSettings.iVolume = 1;
|
|
534 |
TRAPD(error, iAudioOutputStream = CMdaAudioOutputStream::NewL(*this));
|
|
535 |
if (error == KErrNone)
|
|
536 |
{
|
|
537 |
iAudioOutputStream->Open(&iStreamSettings);
|
|
538 |
}
|
|
539 |
}
|
|
540 |
else if (object == KTagToneUtility)
|
|
541 |
{
|
|
542 |
TRAP(error,iAudioTone = CMdaAudioToneUtility::NewL(*this));
|
|
543 |
}
|
|
544 |
else if (object == KTagDevSound1)
|
|
545 |
{
|
|
546 |
TRAP(error, iDevSound = CMMFDevSound::NewL());
|
|
547 |
}
|
|
548 |
else if (object == KTagMidiClient)
|
|
549 |
{
|
|
550 |
TRAP(error, iMidiClientUtility = CMidiClientUtility::NewL(*this,80,TMdaPriorityPreference(0x00000000),EFalse));
|
|
551 |
//TRAP(error, iMidiClientUtility = CMidiClientUtility::NewL(*this));
|
|
552 |
if(error == KErrNone)
|
|
553 |
{
|
|
554 |
isInput = EFalse;
|
|
555 |
//iMidiClientUtility->OpenFile(KAudioMidiFile);
|
|
556 |
}
|
|
557 |
}
|
|
558 |
else if (object == KTagDrmPlayer)
|
|
559 |
{
|
|
560 |
TRAP(error, iDrmPlayerUtility = CDrmPlayerUtility::NewL(*this,EMdaPriorityNormal,TMdaPriorityPreference(0x00000000)));
|
|
561 |
if (error == KErrNone)
|
|
562 |
{
|
|
563 |
iDrmPlayerUtility->OpenFileL(KAudioDrmFile);
|
|
564 |
}
|
|
565 |
}
|
|
566 |
else if (object == KTagVideoPlayer)
|
|
567 |
{
|
|
568 |
aItem.GetNextString ( object );
|
|
569 |
error = KErrNone;
|
|
570 |
TRAP(error, CreateSessionAndScreen());
|
|
571 |
TRAP(error, CreateWindowGroup());
|
|
572 |
TRAP(error, CreateVideoWindow());
|
|
573 |
TRAP(error, CreateVideoObject());
|
|
574 |
}
|
|
575 |
else if(object == KTagVideoRecord)
|
|
576 |
{
|
|
577 |
TRAP(error, CreateVideoRecorderObject());
|
|
578 |
}
|
|
579 |
if (error == KErrNone)
|
|
580 |
{
|
|
581 |
AddExpectedEvent(EInitializeComplete, KMediumTimeout);
|
|
582 |
}
|
|
583 |
else
|
|
584 |
{
|
|
585 |
iLog->Log(_L("CAudioRoutingTestClass::CreateObject Error [%d] - [%S]"),error,&object);
|
|
586 |
FTRACE(FPrint(_L("CAudioRoutingTestClass::CreateObject Error [%d] - [%S]"),error,&object));
|
|
587 |
}
|
|
588 |
return error;
|
|
589 |
}
|
|
590 |
|
|
591 |
TInt CAudioRoutingTestClass::CreateAudioInput( CStifItemParser& aItem )
|
|
592 |
{
|
|
593 |
TInt error = KErrNone;
|
|
594 |
|
|
595 |
TPtrC object;
|
|
596 |
RArray<CAudioInput::TAudioInputPreference> inputArray;
|
|
597 |
|
|
598 |
aItem.GetNextString ( object );
|
|
599 |
iLog->Log(_L("The AudioInput to create is with [%S]"),&object);
|
|
600 |
|
|
601 |
if ( object == KTagVideoRecord )
|
|
602 |
{
|
|
603 |
FTRACE(FPrint(_L("CAudioRoutingTest::CAudioInput")));
|
|
604 |
iLog->Log(_L("CAudioRoutingTest::CAudioInput"));
|
|
605 |
TRAP(error, iAudioInput = CAudioInput::NewL(*iVideoRecord));
|
|
606 |
if (error == KErrNone)
|
|
607 |
{
|
|
608 |
iLog->Log(_L("CAudioInput::NewL(*iVideoRecord) OK"));
|
|
609 |
}
|
|
610 |
}
|
|
611 |
|
|
612 |
else if ( object == KTagDevSound )
|
|
613 |
{
|
|
614 |
FTRACE(FPrint(_L("CAudioRoutingTest::CAudioInput")));
|
|
615 |
iLog->Log(_L("CAudioRoutingTest::CAudioInput"));
|
|
616 |
TRAP(error, iAudioInput = CAudioInput::NewL(*iDevSound));
|
|
617 |
if (error == KErrNone)
|
|
618 |
{
|
|
619 |
iLog->Log(_L("CAudioInput::NewL(*iDevSound) OK"));
|
|
620 |
}
|
|
621 |
}
|
|
622 |
else if (object == KTagRecorder)
|
|
623 |
{
|
|
624 |
FTRACE(FPrint(_L("CAudioRoutingTest::CAudioInput")));
|
|
625 |
iLog->Log(_L("CAudioRoutingTest::CAudioInput"));
|
|
626 |
TRAP(error, iAudioInput = CAudioInput::NewL(*iRecorder));
|
|
627 |
if (error == KErrNone)
|
|
628 |
{
|
|
629 |
iLog->Log(_L("CAudioInput::NewL(*iRecorder) OK"));
|
|
630 |
}
|
|
631 |
}
|
|
632 |
else if (object == KTagCustomCommand)
|
|
633 |
{
|
|
634 |
FTRACE(FPrint(_L("CAudioRoutingTest::CAudioInput - iCustomCommandUtility")));
|
|
635 |
iLog->Log(_L("CAudioRoutingTest::CAudioInput - iCustomCommandUtility"));
|
|
636 |
TRAP(error, iAudioInput = CAudioInput::NewL(*iCustomCommandUtility));
|
|
637 |
if (error == KErrNone)
|
|
638 |
{
|
|
639 |
iLog->Log(_L("CAudioInput::NewL(*iCustomCommandUtility) OK"));
|
|
640 |
}
|
|
641 |
}
|
|
642 |
else if (object == KTagCustomInterface)
|
|
643 |
{
|
|
644 |
FTRACE(FPrint(_L("CAudioRoutingTest::CAudioInput - CustomInterfaceUtility")));
|
|
645 |
iLog->Log(_L("CAudioRoutingTest::CAudioInput - CustomInterfaceUtility"));
|
|
646 |
TRAP(error, iAudioInput = CAudioInput::NewL(*iCustomInterfaceUtility));
|
|
647 |
if (error == KErrNone)
|
|
648 |
{
|
|
649 |
iLog->Log(_L("CAudioInput::NewL(*iCustomInterfaceUtility) OK"));
|
|
650 |
}
|
|
651 |
}
|
|
652 |
else if (object == KTagInputStream)
|
|
653 |
{
|
|
654 |
FTRACE(FPrint(_L("CAudioRoutingTest::CAudioInput - InputStream")));
|
|
655 |
iLog->Log(_L("CAudioRoutingTest::CAudioInput - InputStream"));
|
|
656 |
TRAP(error, iAudioInput = CAudioInput::NewL(*iAudioInputStream));
|
|
657 |
if (error == KErrNone)
|
|
658 |
{
|
|
659 |
iLog->Log(_L(" CAudioInput::NewL(*iAudioInputStream) OK"));
|
|
660 |
}
|
|
661 |
}
|
|
662 |
else if (object == KTagOuputRecord)
|
|
663 |
{
|
|
664 |
FTRACE(FPrint(_L("CAudioRoutingTest::CAudioInput - InputStream")));
|
|
665 |
iLog->Log(_L("CAudioRoutingTest::CAudioInput - InputStream"));
|
|
666 |
TRAP(error, iAudioOutput = CAudioOutput::NewL(*iRecorder,ETrue));
|
|
667 |
if (error == KErrNone)
|
|
668 |
{
|
|
669 |
iLog->Log(_L("CAudioOutput::NewL(*iRecorder,ETrue OK"));
|
|
670 |
}
|
|
671 |
}
|
|
672 |
else if (object == KTagOutputStream)
|
|
673 |
{
|
|
674 |
FTRACE(FPrint(_L("CAudioRoutingTest::CAudioOutput - OutputStream")));
|
|
675 |
iLog->Log(_L("CAudioRoutingTest::CAudioOutput - OutputStream"));
|
|
676 |
TRAP(error, iAudioOutput = CAudioOutput::NewL(*iAudioOutputStream));
|
|
677 |
if (error == KErrNone)
|
|
678 |
{
|
|
679 |
iLog->Log(_L("CAudioOutput::NewL(*iAudioOutputStream) OK"));
|
|
680 |
}
|
|
681 |
}
|
|
682 |
else if (object == KTagToneUtility)
|
|
683 |
{
|
|
684 |
FTRACE(FPrint(_L("CAudioRoutingTest::CAudioOutput - AudioTone")));
|
|
685 |
iLog->Log(_L("CAudioRoutingTest::CAudioOutput - AudioTone"));
|
|
686 |
TRAP(error, iAudioOutput = CAudioOutput::NewL(*iAudioTone));
|
|
687 |
if (error == KErrNone)
|
|
688 |
{
|
|
689 |
iLog->Log(_L("CAudioOutput::NewL(*iAudioTone) OK"));
|
|
690 |
}
|
|
691 |
}
|
|
692 |
else if (object == KTagDevSound1)
|
|
693 |
{
|
|
694 |
FTRACE(FPrint(_L("CAudioRoutingTest::CAudioOutput - DevSound")));
|
|
695 |
iLog->Log(_L("CAudioRoutingTest::CAudioOutput - DevSound"));
|
|
696 |
TRAP(error, iAudioOutput = CAudioOutput::NewL(*iDevSound));
|
|
697 |
if (error == KErrNone)
|
|
698 |
{
|
|
699 |
iLog->Log(_L("CAudioOutput::NewL(*iDevSound) OK"));
|
|
700 |
}
|
|
701 |
}
|
|
702 |
else if (object == KTagCustomInterfaceOutput)
|
|
703 |
{
|
|
704 |
FTRACE(FPrint(_L("CAudioRoutingTest::CAudioOutput - CustomInterfaceOutput")));
|
|
705 |
iLog->Log(_L("CAudioRoutingTest::CAudioOutput - CustomInterfaceOutput"));
|
|
706 |
TRAP(error, iAudioOutput = CAudioOutput::NewL(*iCustomInterfaceUtility));
|
|
707 |
}
|
|
708 |
else if (object == KTagAudioPlayer)
|
|
709 |
{
|
|
710 |
FTRACE(FPrint(_L("CAudioRoutingTest::CAudioOutput - AudioPlayer")));
|
|
711 |
iLog->Log(_L("CAudioRoutingTest::CAudioOutput - AudioPlayer"));
|
|
712 |
TRAPD(error,iAudioOutput = CAudioOutput::NewL(*iUtil));
|
|
713 |
if (error == KErrNone)
|
|
714 |
{
|
|
715 |
iLog->Log(_L("CAudioOutput::NewL(*iUtil) OK"));
|
|
716 |
}
|
|
717 |
}
|
|
718 |
else if (object == KTagCustomCommandOutput)
|
|
719 |
{
|
|
720 |
FTRACE(FPrint(_L("CAudioRoutingTest::CAudioOutput - iCustomCommandOutput")));
|
|
721 |
iLog->Log(_L("CAudioRoutingTest::CAudioOutput - iCustomCommandOutput"));
|
|
722 |
TRAP(error, iAudioOutput = CAudioOutput::NewL(*iCustomCommandUtility));
|
|
723 |
if (error == KErrNone)
|
|
724 |
{
|
|
725 |
iLog->Log(_L("CAudioOutput::NewL(*iCustomCommandUtility) OK"));
|
|
726 |
}
|
|
727 |
}
|
|
728 |
|
|
729 |
else if (object == KTagMidiClient)
|
|
730 |
{
|
|
731 |
FTRACE(FPrint(_L("CAudioRoutingTest::CAudioOutput - CMidiClientUtility")));
|
|
732 |
iLog->Log(_L("CAudioRoutingTest::CAudioOutput - CMidiClientUtility"));
|
|
733 |
TRAP(error, iAudioOutput = CAudioOutput::NewL(*iMidiClientUtility));
|
|
734 |
if (error == KErrNone)
|
|
735 |
{
|
|
736 |
iLog->Log(_L("CAudioOutput::NewL(*iMidiClientUtility) OK"));
|
|
737 |
}
|
|
738 |
}
|
|
739 |
else if (object == KTagDrmPlayer)
|
|
740 |
{
|
|
741 |
FTRACE(FPrint(_L("CAudioRoutingTest::CAudioOutput - CDrmPlayerUtility")));
|
|
742 |
iLog->Log(_L("CAudioRoutingTest::CAudioOutput - CDrmPlayerUtility"));
|
|
743 |
TRAP(error, iAudioOutput = CAudioOutput::NewL(*iDrmPlayerUtility));
|
|
744 |
if (error == KErrNone)
|
|
745 |
{
|
|
746 |
iLog->Log(_L("CAudioOutput::NewL(*iDrmPlayerUtility) OK"));
|
|
747 |
}
|
|
748 |
}
|
|
749 |
else if (object == KTagVideoPlayer)
|
|
750 |
{
|
|
751 |
FTRACE(FPrint(_L("CAudioRoutingTest::CAudioOutput - VideoPlayer")));
|
|
752 |
iLog->Log(_L("CAudioRoutingTest::CAudioOutput - VideoPlayer"));
|
|
753 |
TRAP(error, iAudioOutput = CAudioOutput::NewL(*iVideoPlayerUtility));
|
|
754 |
if (error == KErrNone)
|
|
755 |
{
|
|
756 |
iLog->Log(_L("CAudioOutput::NewL(*iVideoPlayerUtility) OK"));
|
|
757 |
}
|
|
758 |
}
|
|
759 |
else
|
|
760 |
{
|
|
761 |
iLog->Log(_L(" No Intut Data"));
|
|
762 |
}
|
|
763 |
if (error != KErrNone)
|
|
764 |
{
|
|
765 |
iLog->Log(_L("CAudioRoutingTestClass::CreateAudioInput ERROR [%d] for [%s]"),error,&object);
|
|
766 |
}
|
|
767 |
return error;
|
|
768 |
}
|
|
769 |
|
|
770 |
void CAudioRoutingTestClass::CreateInput()
|
|
771 |
{
|
|
772 |
//TInt error = KErrNone;
|
|
773 |
isInput = ETrue;
|
|
774 |
iUtil = CMdaAudioPlayerUtility::NewFilePlayerL(KMp3TestFile, *this);
|
|
775 |
TRAPD(error, iRecorder = CMdaAudioRecorderUtility::NewL(*this));
|
|
776 |
if (error == KErrNone)
|
|
777 |
{
|
|
778 |
iLog->Log(_L("CMdaAudioRecorderUtility::NewL(*this) OK"));
|
|
779 |
}
|
|
780 |
}
|
|
781 |
|
|
782 |
void CAudioRoutingTestClass::CreateOutput()
|
|
783 |
{
|
|
784 |
isInput = EFalse;
|
|
785 |
iUtil = CMdaAudioPlayerUtility::NewFilePlayerL(KMp3TestFile, *this);
|
|
786 |
}
|
|
787 |
|
|
788 |
TInt CAudioRoutingTestClass::CreateVideoInput()
|
|
789 |
{
|
|
790 |
// TInt error1 = KErrNone;
|
|
791 |
TInt error = KErrNone;
|
|
792 |
isInput = ETrue;
|
|
793 |
iUtil = CMdaAudioPlayerUtility::NewFilePlayerL(KMp3TestFile,*this);
|
|
794 |
if (iUtil)
|
|
795 |
{
|
|
796 |
iRecorder = CMdaAudioRecorderUtility::NewL(*this);
|
|
797 |
if (iRecorder)
|
|
798 |
{
|
|
799 |
iLog->Log(_L("CMdaAudioRecorderUtility::NewL(*this) OK"));
|
|
800 |
}
|
|
801 |
}
|
|
802 |
return error;
|
|
803 |
}
|
|
804 |
|
|
805 |
TInt CAudioRoutingTestClass::CreateVideoWindow()
|
|
806 |
{
|
|
807 |
TInt error = KErrNone;
|
|
808 |
TRAP(error,iWindow = RWindow( iWindowSession ));
|
|
809 |
if (error == KErrNone)
|
|
810 |
{
|
|
811 |
TRAP(error,User::LeaveIfError(iWindow.Construct(iWindowGroup, reinterpret_cast<TUint32>(&iWindowGroup) + 1)));
|
|
812 |
if (error == KErrNone)
|
|
813 |
{
|
|
814 |
iWindow.SetBackgroundColor(TRgb(0x90, 0x90, 0x90));
|
|
815 |
iWindow.Activate();
|
|
816 |
iWindow.SetExtent(TPoint(0, 0), TSize(screenWidth, screenHeight));
|
|
817 |
iWindow.SetVisible(ETrue);
|
|
818 |
iWindowGc->Activate(iWindow);
|
|
819 |
iRect = TRect(iWindow.Size());
|
|
820 |
iWindow.Invalidate(iRect);
|
|
821 |
iWindow.BeginRedraw(iRect);
|
|
822 |
}
|
|
823 |
}
|
|
824 |
return error;
|
|
825 |
}
|
|
826 |
|
|
827 |
TInt CAudioRoutingTestClass::DeleteVideoWindow()
|
|
828 |
{
|
|
829 |
TInt error = KErrNone;
|
|
830 |
|
|
831 |
TRAP(error,iWindowSession.Close());
|
|
832 |
|
|
833 |
if (iScreenDevice)
|
|
834 |
{
|
|
835 |
|
|
836 |
}
|
|
837 |
if (iWindowGc)
|
|
838 |
{
|
|
839 |
|
|
840 |
}
|
|
841 |
|
|
842 |
return error;
|
|
843 |
}
|
|
844 |
|
|
845 |
TInt CAudioRoutingTestClass::CreateSessionAndScreen()
|
|
846 |
{
|
|
847 |
TInt error = KErrNone;
|
|
848 |
error = User::LeaveIfError(iWindowSession.Connect());
|
|
849 |
|
|
850 |
if (error == KErrNone)
|
|
851 |
{
|
|
852 |
TRAP(error,iScreenDevice = new(ELeave) CWsScreenDevice(iWindowSession));
|
|
853 |
}
|
|
854 |
|
|
855 |
if (error == KErrNone)
|
|
856 |
{
|
|
857 |
TRAP(error, iScreenDevice->Construct());
|
|
858 |
}
|
|
859 |
|
|
860 |
return error;
|
|
861 |
}
|
|
862 |
|
|
863 |
TInt CAudioRoutingTestClass::CreateVideoObject( )
|
|
864 |
{
|
|
865 |
TInt error = KErrNone;
|
|
866 |
|
|
867 |
|
|
868 |
TRAP(error, iVideoPlayerUtility = CVideoPlayerUtility::NewL ( *this,
|
|
869 |
EMdaPriorityNormal,
|
|
870 |
EMdaPriorityPreferenceNone,
|
|
871 |
iWindowSession,
|
|
872 |
*iScreenDevice,
|
|
873 |
iWindow,
|
|
874 |
iRect,
|
|
875 |
iRect));
|
|
876 |
if (error == KErrNone)
|
|
877 |
{
|
|
878 |
TRAP(error, iVideoPlayerUtility->OpenFileL(K3gpTestFile));
|
|
879 |
// AddExpectedEvent(EInitializeComplete, 6000);
|
|
880 |
CActiveScheduler::Start();
|
|
881 |
}
|
|
882 |
if (error == KErrNone)
|
|
883 |
{
|
|
884 |
EndDrawing();
|
|
885 |
iWindow.Close();
|
|
886 |
iWindowGroup.Close();
|
|
887 |
}
|
|
888 |
return error;
|
|
889 |
|
|
890 |
}
|
|
891 |
TInt CAudioRoutingTestClass::CreateVideoRecorderObject()
|
|
892 |
{
|
|
893 |
TInt error = KErrNone;
|
|
894 |
TRAP(error, iVideoRecord = CVideoRecorderUtility::NewL(*this));
|
|
895 |
|
|
896 |
if (error == KErrNone)
|
|
897 |
{
|
|
898 |
// const TUid KVidTstControllerUid = {0x101F8503};
|
|
899 |
TUid NULLUid ={0};
|
|
900 |
|
|
901 |
TRAP(error,iVideoRecord->OpenFileL(K3gpTestFile, NULL, NULLUid, NULLUid));
|
|
902 |
}
|
|
903 |
|
|
904 |
return error;
|
|
905 |
}
|
|
906 |
|
|
907 |
TInt CAudioRoutingTestClass::CreateWindowGroup()
|
|
908 |
{
|
|
909 |
TInt error = KErrNone;
|
|
910 |
TRAP(error, iWindowGroup = RWindowGroup(iWindowSession));
|
|
911 |
if (error == KErrNone)
|
|
912 |
{
|
|
913 |
error = User::LeaveIfError(iWindowGroup.Construct(reinterpret_cast<TUint32>(&iWindowGroup), EFalse));
|
|
914 |
if (error == KErrNone)
|
|
915 |
{
|
|
916 |
TRAP(error, iWindowGroup.SetOrdinalPosition(10, ECoeWinPriorityAlwaysAtFront));
|
|
917 |
}
|
|
918 |
}
|
|
919 |
else
|
|
920 |
{
|
|
921 |
iLog->Log(_L("iWindowGroup = RWindowGroup(iWindowSession) Failed [%d]"),error);
|
|
922 |
}
|
|
923 |
|
|
924 |
User::LeaveIfError(iScreenDevice->CreateContext(iWindowGc));
|
|
925 |
|
|
926 |
return error;
|
|
927 |
}
|
|
928 |
|
|
929 |
TInt CAudioRoutingTestClass::EndDrawing()
|
|
930 |
{
|
|
931 |
TInt error = KErrNone;
|
|
932 |
TRAP(error,{iWindow.EndRedraw();iWindowGc->Deactivate();iWindowSession.Flush();});
|
|
933 |
if (error!=KErrNone)
|
|
934 |
{
|
|
935 |
iLog->Log(_L("CAudioRoutingTestClass::EndDrawing Failed [%d]"),error);
|
|
936 |
}
|
|
937 |
return error;
|
|
938 |
}
|
|
939 |
|
|
940 |
TInt CAudioRoutingTestClass::AudioInput()
|
|
941 |
{
|
|
942 |
if (iAudioInput)
|
|
943 |
{
|
|
944 |
CAudioInput::TAudioInputArray currentInputs = iAudioInput->AudioInput();
|
|
945 |
CAudioInput::TAudioInputPreference currentInput = currentInputs[0];
|
|
946 |
iLog->Log(_L("AudioInput - currentInput = %d"),currentInput);
|
|
947 |
}
|
|
948 |
return KErrNone;
|
|
949 |
}
|
|
950 |
|
|
951 |
TInt CAudioRoutingTestClass::SetAudioInputL()
|
|
952 |
{
|
|
953 |
if (iAudioInput)
|
|
954 |
{
|
|
955 |
RArray<CAudioInput::TAudioInputPreference> inputArray;
|
|
956 |
inputArray.Append(CAudioInput::EDefaultMic);
|
|
957 |
iAudioInput->SetAudioInputL(inputArray.Array());
|
|
958 |
inputArray.Reset();
|
|
959 |
}
|
|
960 |
iLog->Log(_L("AudioInput - SetAudioInputL "));
|
|
961 |
return KErrNone;
|
|
962 |
}
|
|
963 |
|
|
964 |
TInt CAudioRoutingTestClass::AudioOutput()
|
|
965 |
{
|
|
966 |
if (iAudioOutput)
|
|
967 |
{
|
|
968 |
iAudioOutput->AudioOutput();
|
|
969 |
}
|
|
970 |
iLog->Log(_L("AudioOutput - AudioOutput "));
|
|
971 |
return KErrNone;
|
|
972 |
}
|
|
973 |
TInt CAudioRoutingTestClass::DefaultAudioOutput()
|
|
974 |
{
|
|
975 |
if (iAudioOutput)
|
|
976 |
{
|
|
977 |
iAudioOutput->DefaultAudioOutput();
|
|
978 |
}
|
|
979 |
iLog->Log(_L("iAudioOutput - DefaultAudioOutput "));
|
|
980 |
return KErrNone;
|
|
981 |
}
|
|
982 |
|
|
983 |
TInt CAudioRoutingTestClass::RegisterObserverL()
|
|
984 |
{
|
|
985 |
if(iAudioOutput)
|
|
986 |
{
|
|
987 |
iAudioOutput->RegisterObserverL(*this);
|
|
988 |
}
|
|
989 |
iLog->Log(_L("iAudioOutput - RegisterObserverL "));
|
|
990 |
return KErrNone;
|
|
991 |
}
|
|
992 |
|
|
993 |
TInt CAudioRoutingTestClass::SecureOutput()
|
|
994 |
{
|
|
995 |
if (iAudioOutput)
|
|
996 |
{
|
|
997 |
TBool secureOutput = iAudioOutput->SecureOutput();
|
|
998 |
iLog->Log(_L("CAudioRoutingTestClass::SecureOutput - SecureOutput = %d"),secureOutput);
|
|
999 |
}
|
|
1000 |
iLog->Log(_L("iAudioOutput - SecureOutput "));
|
|
1001 |
return KErrNone;
|
|
1002 |
}
|
|
1003 |
|
|
1004 |
|
|
1005 |
TInt CAudioRoutingTestClass::SetAudioOutputL()
|
|
1006 |
{
|
|
1007 |
if(iAudioOutput)
|
|
1008 |
{
|
|
1009 |
iAudioOutput->SetAudioOutputL(CAudioOutput::EPublic);
|
|
1010 |
}
|
|
1011 |
iLog->Log(_L("iAudioOutput - SetAudioOutputL "));
|
|
1012 |
return KErrNone;
|
|
1013 |
}
|
|
1014 |
|
|
1015 |
TInt CAudioRoutingTestClass::SetSecureOutputL()
|
|
1016 |
{
|
|
1017 |
TInt err;
|
|
1018 |
if(iAudioOutput)
|
|
1019 |
{
|
|
1020 |
TRAP(err,iAudioOutput->SetSecureOutputL(EFalse));
|
|
1021 |
}
|
|
1022 |
if(err == KErrNotSupported)
|
|
1023 |
{
|
|
1024 |
iLog->Log(_L("SetsecureoutputL is deprecated,so not supported"));
|
|
1025 |
return KErrNone;
|
|
1026 |
}
|
|
1027 |
else
|
|
1028 |
{
|
|
1029 |
return KErrGeneral;
|
|
1030 |
}
|
|
1031 |
|
|
1032 |
}
|
|
1033 |
|
|
1034 |
TInt CAudioRoutingTestClass::UnregisterObserver()
|
|
1035 |
{
|
|
1036 |
iLog->Log(_L("iAudioOutput - UnregisterObserver INIT"));
|
|
1037 |
if(iAudioOutput)
|
|
1038 |
{
|
|
1039 |
iAudioOutput->UnregisterObserver(*this);
|
|
1040 |
}
|
|
1041 |
iLog->Log(_L("iAudioOutput - UnregisterObserver "));
|
|
1042 |
return KErrNone;
|
|
1043 |
}
|
|
1044 |
// End of File
|