os/mm/devsoundextensions/effects/EffectTest/EffectConsoleTest.cpp
author sl@SLION-WIN7.fritz.box
Fri, 15 Jun 2012 03:10:57 +0200
changeset 0 bde4ae8d615e
permissions -rw-r--r--
First public contribution.
sl@0
     1
/*
sl@0
     2
* Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies). 
sl@0
     3
* All rights reserved.
sl@0
     4
* This component and the accompanying materials are made available
sl@0
     5
* under the terms of "Eclipse Public License v1.0"
sl@0
     6
* which accompanies this distribution, and is available
sl@0
     7
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
sl@0
     8
*
sl@0
     9
* Initial Contributors:
sl@0
    10
* Nokia Corporation - initial contribution.
sl@0
    11
*
sl@0
    12
* Contributors:
sl@0
    13
*
sl@0
    14
* Description:  Effects console test implementation
sl@0
    15
*
sl@0
    16
*/
sl@0
    17
sl@0
    18
sl@0
    19
sl@0
    20
#include "EffectConsoleTest.h"
sl@0
    21
sl@0
    22
_LIT(KNewLine,"\n");
sl@0
    23
sl@0
    24
//////////////////////////////////////////////////////////////////////////////
sl@0
    25
//
sl@0
    26
// -----> CmyActiveScheduler (implementation)
sl@0
    27
//
sl@0
    28
//////////////////////////////////////////////////////////////////////////////
sl@0
    29
void CmyActiveScheduler::Error(TInt aError) const
sl@0
    30
	{
sl@0
    31
	_LIT(KMsgSchedErr,"CmyActiveScheduler-error");
sl@0
    32
	User::Panic(KMsgSchedErr,aError);
sl@0
    33
	}
sl@0
    34
sl@0
    35
sl@0
    36
//////////////////////////////////////////////////////////////////////////////
sl@0
    37
//
sl@0
    38
// -----> CActiveConsole (implementation)
sl@0
    39
//
sl@0
    40
//////////////////////////////////////////////////////////////////////////////
sl@0
    41
CActiveConsole::CActiveConsole( CConsoleBase* aConsole)
sl@0
    42
	: CActive(CActive::EPriorityStandard)
sl@0
    43
	  // Construct high-priority active object
sl@0
    44
	{
sl@0
    45
	iConsole = aConsole;
sl@0
    46
	}
sl@0
    47
sl@0
    48
void CActiveConsole::ConstructL()
sl@0
    49
	{
sl@0
    50
	  // Add to active scheduler
sl@0
    51
	CActiveScheduler::Add(this);
sl@0
    52
	}
sl@0
    53
sl@0
    54
CActiveConsole::~CActiveConsole()
sl@0
    55
	{
sl@0
    56
	// Make sure we're cancelled
sl@0
    57
	Cancel();
sl@0
    58
	}
sl@0
    59
sl@0
    60
void  CActiveConsole::DoCancel()
sl@0
    61
	{
sl@0
    62
	iConsole->ReadCancel();
sl@0
    63
	}
sl@0
    64
sl@0
    65
void  CActiveConsole::RunL()
sl@0
    66
	{
sl@0
    67
	  // Handle completed request
sl@0
    68
	ProcessKeyPress(TChar(iConsole->KeyCode()));
sl@0
    69
	}
sl@0
    70
sl@0
    71
void CActiveConsole::RequestCharacter()
sl@0
    72
	{
sl@0
    73
	  // A request is issued to the CConsoleBase to accept a
sl@0
    74
	  // character from the keyboard.
sl@0
    75
	iConsole->Read(iStatus);
sl@0
    76
	SetActive();
sl@0
    77
	}
sl@0
    78
sl@0
    79
sl@0
    80
//////////////////////////////////////////////////////////////////////////////
sl@0
    81
//
sl@0
    82
// -----> CWriteKeyProcessor (implementation)
sl@0
    83
//
sl@0
    84
//////////////////////////////////////////////////////////////////////////////
sl@0
    85
CConsoleTest::CConsoleTest(CConsoleBase* aConsole)
sl@0
    86
	:	CActiveConsole(aConsole),
sl@0
    87
		iMenu(EMain)
sl@0
    88
	{
sl@0
    89
	iEqualizer = NULL;
sl@0
    90
	iEnvironmentalReverb = NULL;
sl@0
    91
	iStereoWidening = NULL;
sl@0
    92
	iInitStatus = -1;
sl@0
    93
	};
sl@0
    94
sl@0
    95
CConsoleTest::~CConsoleTest()
sl@0
    96
{
sl@0
    97
	RDebug::Print(_L("CConsoleTest::~CConsoleTest\n"));
sl@0
    98
	// Make sure we're cancelled
sl@0
    99
	Cancel();
sl@0
   100
sl@0
   101
	delete iPlayerAudioEqualizer;
sl@0
   102
	delete iPlayerEnvironmentalReverb;
sl@0
   103
	delete iPlayerStereoWidening;
sl@0
   104
	delete iRecorderAudioEqualizer;
sl@0
   105
	delete iRecorderEnvironmentalReverb;
sl@0
   106
	delete iRecorderStereoWidening;
sl@0
   107
sl@0
   108
	delete iCIUtility;
sl@0
   109
sl@0
   110
	delete iAudioPlayer;
sl@0
   111
	delete iAudioRecorder;
sl@0
   112
	delete iAudioConverter;
sl@0
   113
sl@0
   114
	iGoodData.Close();
sl@0
   115
	iBadData.Close();
sl@0
   116
sl@0
   117
	iFs.Close();
sl@0
   118
sl@0
   119
}
sl@0
   120
sl@0
   121
void CConsoleTest::ConstructL()
sl@0
   122
{
sl@0
   123
	User::LeaveIfError(iFs.Connect());
sl@0
   124
sl@0
   125
	iAudioPlayer = CMdaAudioPlayerUtility::NewFilePlayerL(KAMRTestFile, *this);
sl@0
   126
	//iAudioRecorder = CMdaAudioRecorderUtility::NewL(*this);
sl@0
   127
	//iAudioConverter = CMdaAudioConvertUtility::NewL(*this);
sl@0
   128
sl@0
   129
	//iAudioPlayer->OpenFileL(KWAVTestFile);
sl@0
   130
sl@0
   131
	// Add to active scheduler
sl@0
   132
	CActiveScheduler::Add(this);
sl@0
   133
	InitializeTestData();
sl@0
   134
}
sl@0
   135
sl@0
   136
CConsoleTest* CConsoleTest::NewLC(CConsoleBase* aConsole)
sl@0
   137
{
sl@0
   138
	CConsoleTest* self=new (ELeave) CConsoleTest(aConsole);
sl@0
   139
	CleanupStack::PushL(self);
sl@0
   140
	self->ConstructL();
sl@0
   141
	return self;
sl@0
   142
}
sl@0
   143
sl@0
   144
CConsoleTest* CConsoleTest::NewL(CConsoleBase* aConsole)
sl@0
   145
{
sl@0
   146
	CConsoleTest* self=NewLC(aConsole);
sl@0
   147
	CleanupStack::Pop();
sl@0
   148
	return self;
sl@0
   149
}
sl@0
   150
sl@0
   151
sl@0
   152
sl@0
   153
void CConsoleTest::ProcessKeyPress(TChar aChar)
sl@0
   154
{
sl@0
   155
//	iConsole->Printf(_L("You pressed: %d\n"), (TUint) aChar);
sl@0
   156
sl@0
   157
	  // if key is ESC
sl@0
   158
	  //   cancel any outstanding request
sl@0
   159
	  //   stop the scheduler
sl@0
   160
      TInt err(KErrNone);
sl@0
   161
#ifdef __WINS__
sl@0
   162
	if (aChar == EKeyEscape)
sl@0
   163
#else
sl@0
   164
	if (aChar == ' ')
sl@0
   165
#endif
sl@0
   166
	{
sl@0
   167
		Cancel();
sl@0
   168
		CActiveScheduler::Stop();
sl@0
   169
		return;
sl@0
   170
	}
sl@0
   171
sl@0
   172
	if (aChar == EKeyEnter)
sl@0
   173
	{
sl@0
   174
		iConsole->Printf(KNewLine);
sl@0
   175
		// Issue another request
sl@0
   176
		RequestCharacter();
sl@0
   177
		return;
sl@0
   178
	}
sl@0
   179
sl@0
   180
#ifdef __WINS__
sl@0
   181
	if (aChar == '?')
sl@0
   182
#else
sl@0
   183
	if (aChar == '7')
sl@0
   184
#endif
sl@0
   185
	{
sl@0
   186
		ShowMenu();
sl@0
   187
		// Issue another request
sl@0
   188
		RequestCharacter();
sl@0
   189
		return;
sl@0
   190
	}
sl@0
   191
sl@0
   192
	switch (iMenu)
sl@0
   193
	{
sl@0
   194
	case EMain:
sl@0
   195
		ProcessMain(aChar);
sl@0
   196
		break;
sl@0
   197
sl@0
   198
	case EPlay:
sl@0
   199
		TRAP(err,ProcessPlayL(aChar));
sl@0
   200
		break;
sl@0
   201
sl@0
   202
	case ERecord:
sl@0
   203
		//ProcessRecord(aChar);
sl@0
   204
		break;
sl@0
   205
sl@0
   206
	case EEqualizer:
sl@0
   207
		TRAP(err,ProcessEqualizerL(aChar));
sl@0
   208
		break;
sl@0
   209
sl@0
   210
	case EBandId:
sl@0
   211
		ProcessBandId(aChar);
sl@0
   212
		break;
sl@0
   213
sl@0
   214
	case EBandLevel:
sl@0
   215
		TRAP(err,ProcessBandLevelL(aChar));
sl@0
   216
		break;
sl@0
   217
sl@0
   218
	case EEnvironmentalReverb1:
sl@0
   219
		TRAP(err,ProcessEnvironmentalReverbL(aChar));
sl@0
   220
		break;
sl@0
   221
sl@0
   222
	case EEnvironmentalReverb2:
sl@0
   223
		break;
sl@0
   224
sl@0
   225
	case EStereoWideningLevel:
sl@0
   226
		TRAP(err,ProcessStereoWideningLevelL(aChar));
sl@0
   227
		break;
sl@0
   228
sl@0
   229
	case EStereoWidening:
sl@0
   230
		TRAP(err,ProcessStereoWideningL(aChar));
sl@0
   231
		break;
sl@0
   232
sl@0
   233
sl@0
   234
	default:
sl@0
   235
		iConsole->Printf(_L("ProcessKeyPress - Unknown function\n"));
sl@0
   236
		// Issue another request
sl@0
   237
		RequestCharacter();
sl@0
   238
		break;
sl@0
   239
	}
sl@0
   240
}
sl@0
   241
sl@0
   242
sl@0
   243
void CConsoleTest::ShowMenu()
sl@0
   244
{
sl@0
   245
	iConsole->ClearScreen();
sl@0
   246
	switch (iMenu)
sl@0
   247
	{
sl@0
   248
	case EMain:
sl@0
   249
		iConsole->Printf(_L("1: Player\n"));
sl@0
   250
		iConsole->Printf(_L("2: Recorder\n"));
sl@0
   251
		iConsole->Printf(_L("3: Converter\n"));
sl@0
   252
		iConsole->Printf(_L("9: Exit\n"));
sl@0
   253
		break;
sl@0
   254
sl@0
   255
	case EPlay:
sl@0
   256
	case ERecord:
sl@0
   257
	case EConvert:
sl@0
   258
		iConsole->Printf(_L("0: Main Menu\n"));
sl@0
   259
		iConsole->Printf(_L("1: Equalizer\n"));
sl@0
   260
		iConsole->Printf(_L("2: Env Reverb\n"));
sl@0
   261
		iConsole->Printf(_L("3: StereoWidening\n"));
sl@0
   262
sl@0
   263
		break;
sl@0
   264
sl@0
   265
	case EEqualizer:
sl@0
   266
		iConsole->Printf(_L("0: Main Menu\n"));
sl@0
   267
		iConsole->Printf(_L("1: Enable/Disable\n"));
sl@0
   268
		iConsole->Printf(_L("2: Toggle Enforce\n"));
sl@0
   269
		iConsole->Printf(_L("3: Set Band Level\n"));
sl@0
   270
		iConsole->Printf(_L("4: Show Equalizer info\n"));
sl@0
   271
		iConsole->Printf(_L("5: Show Band info\n"));
sl@0
   272
		iConsole->Printf(_L("6: Apply Settings\n"));
sl@0
   273
		iConsole->Printf(_L("9: Delete Equalizer\n"));
sl@0
   274
		break;
sl@0
   275
sl@0
   276
	case EBandLevel:
sl@0
   277
		iConsole->Printf(_L("0: Equalizer Menu\n"));
sl@0
   278
		iConsole->Printf(_L("1: Band Level Up\n"));
sl@0
   279
		iConsole->Printf(_L("2: Band Level Down\n"));
sl@0
   280
		iConsole->Printf(_L("3: Show Band info\n"));
sl@0
   281
		break;
sl@0
   282
sl@0
   283
	case EEnvironmentalReverb1:
sl@0
   284
		iConsole->Printf(_L("0: Main Menu\n"));
sl@0
   285
		iConsole->Printf(_L("1: Enable/Disable\n"));
sl@0
   286
		iConsole->Printf(_L("2: Toggle Enforce\n"));
sl@0
   287
		iConsole->Printf(_L("3: Test Case 1\n"));
sl@0
   288
		iConsole->Printf(_L("4: Test Case 2\n"));
sl@0
   289
		iConsole->Printf(_L("5: Test Case 3\n"));
sl@0
   290
		iConsole->Printf(_L("6: Undef\n"));
sl@0
   291
		iConsole->Printf(_L("7: Undef\n"));
sl@0
   292
		iConsole->Printf(_L("8: Apply Settings\n"));
sl@0
   293
		iConsole->Printf(_L("9: Del Env Reverb\n"));
sl@0
   294
		break;
sl@0
   295
	case EEnvironmentalReverb2:
sl@0
   296
		iConsole->Printf(_L("0: Main Menu\n"));
sl@0
   297
		iConsole->Printf(_L("1: \n"));
sl@0
   298
		iConsole->Printf(_L("2: \n"));
sl@0
   299
		iConsole->Printf(_L("3: \n"));
sl@0
   300
		iConsole->Printf(_L("4: \n"));
sl@0
   301
		iConsole->Printf(_L("5: \n"));
sl@0
   302
		iConsole->Printf(_L("6: \n"));
sl@0
   303
		iConsole->Printf(_L("7: More\n"));
sl@0
   304
		iConsole->Printf(_L("8: Apply Settings\n"));
sl@0
   305
		iConsole->Printf(_L("9: Del Env Reverb\n"));
sl@0
   306
		break;
sl@0
   307
sl@0
   308
	case EStereoWidening:
sl@0
   309
		iConsole->Printf(_L("0: Main Menu\n"));
sl@0
   310
		iConsole->Printf(_L("1: Enable/Disable\n"));
sl@0
   311
		iConsole->Printf(_L("2: Toggle Enforce\n"));
sl@0
   312
		iConsole->Printf(_L("3: Set Widening Level\n"));
sl@0
   313
		iConsole->Printf(_L("4: Apply Settings\n"));
sl@0
   314
		iConsole->Printf(_L("9: Delete Effect\n"));
sl@0
   315
		break;
sl@0
   316
sl@0
   317
sl@0
   318
	case EStereoWideningLevel:
sl@0
   319
		iConsole->Printf(_L("0: StereoWidening Menu\n"));
sl@0
   320
		iConsole->Printf(_L("1: Level Up\n"));
sl@0
   321
		iConsole->Printf(_L("2: Level Down\n"));
sl@0
   322
		iConsole->Printf(_L("3: Show Effect info\n"));
sl@0
   323
		iConsole->Printf(_L("9: Go Back\n"));
sl@0
   324
		break;
sl@0
   325
sl@0
   326
sl@0
   327
sl@0
   328
		default:
sl@0
   329
		// Do nothing
sl@0
   330
		break;
sl@0
   331
	}
sl@0
   332
	iConsole->Printf(KNewLine);
sl@0
   333
}
sl@0
   334
sl@0
   335
sl@0
   336
sl@0
   337
//////////////////////////////////////////////////////////////////////////////
sl@0
   338
//
sl@0
   339
// -----> MAIN
sl@0
   340
//
sl@0
   341
//////////////////////////////////////////////////////////////////////////////
sl@0
   342
sl@0
   343
void CConsoleTest::ProcessMain(TChar aChar)
sl@0
   344
{
sl@0
   345
sl@0
   346
	if ( !iInitStatus )
sl@0
   347
	{
sl@0
   348
		switch (aChar)
sl@0
   349
		{
sl@0
   350
		case '1':
sl@0
   351
			iMenu = iParentMenu = EPlay;
sl@0
   352
			ShowMenu();
sl@0
   353
			break;
sl@0
   354
sl@0
   355
		case '2':
sl@0
   356
			iMenu = iParentMenu = EPlay;
sl@0
   357
			ShowMenu();
sl@0
   358
			break;
sl@0
   359
sl@0
   360
		case '3':
sl@0
   361
			iMenu = iParentMenu = EPlay;
sl@0
   362
			ShowMenu();
sl@0
   363
			break;
sl@0
   364
sl@0
   365
		case '9':
sl@0
   366
			iConsole->Printf(_L("Stopping Scheduler...\n"));
sl@0
   367
			CActiveScheduler::Stop();
sl@0
   368
			iConsole->Printf(_L("Exiting...\n"));
sl@0
   369
			break;
sl@0
   370
sl@0
   371
sl@0
   372
		default:
sl@0
   373
			iConsole->Printf(_L("ProcessMain - Unknown command\n"));
sl@0
   374
			break;
sl@0
   375
		};
sl@0
   376
	}
sl@0
   377
	else
sl@0
   378
		iConsole->Printf(_L("Not Ready!\n"));
sl@0
   379
sl@0
   380
sl@0
   381
sl@0
   382
	// Issue another request
sl@0
   383
	RequestCharacter();
sl@0
   384
}
sl@0
   385
sl@0
   386
sl@0
   387
//////////////////////////////////////////////////////////////////////////////
sl@0
   388
//
sl@0
   389
// -----> Play menu
sl@0
   390
//
sl@0
   391
//////////////////////////////////////////////////////////////////////////////
sl@0
   392
sl@0
   393
void CConsoleTest::ProcessPlayL(TChar aChar)
sl@0
   394
{
sl@0
   395
	switch (aChar)
sl@0
   396
	{
sl@0
   397
	case '0':	// Main Menu
sl@0
   398
		iMenu = EMain;
sl@0
   399
		ShowMenu();
sl@0
   400
		break;
sl@0
   401
sl@0
   402
	case '1':	// Equalizer
sl@0
   403
		iMenu = EEqualizer;
sl@0
   404
		if (!iPlayerAudioEqualizer)
sl@0
   405
			{
sl@0
   406
			iPlayerAudioEqualizer = CAudioEqualizer::NewL(*iAudioPlayer);
sl@0
   407
			iPlayerAudioEqualizer->RegisterObserverL(*this);
sl@0
   408
			}
sl@0
   409
		iAudioEqualizer = iPlayerAudioEqualizer;
sl@0
   410
		ShowMenu();
sl@0
   411
		break;
sl@0
   412
sl@0
   413
	case '2':	// Environmental Reverb
sl@0
   414
		iMenu = EEnvironmentalReverb1;
sl@0
   415
		if (!iPlayerEnvironmentalReverb)
sl@0
   416
			{
sl@0
   417
			iPlayerEnvironmentalReverb = CEnvironmentalReverb::NewL(*iAudioPlayer);
sl@0
   418
			iPlayerEnvironmentalReverb->RegisterObserverL(*this);
sl@0
   419
			}
sl@0
   420
		iEnvironmentalReverb = iPlayerEnvironmentalReverb;
sl@0
   421
		ShowMenu();
sl@0
   422
		break;
sl@0
   423
sl@0
   424
sl@0
   425
	case '3':	// Stereo Widening
sl@0
   426
		iMenu = EStereoWidening;
sl@0
   427
		if (!iPlayerStereoWidening)
sl@0
   428
			{
sl@0
   429
			iPlayerStereoWidening = CStereoWidening::NewL(*iAudioPlayer,EFalse,5);
sl@0
   430
			iPlayerStereoWidening->RegisterObserverL(*this);
sl@0
   431
			}
sl@0
   432
		iStereoWidening = iPlayerStereoWidening;
sl@0
   433
		ShowMenu();
sl@0
   434
		break;
sl@0
   435
sl@0
   436
sl@0
   437
sl@0
   438
	default:
sl@0
   439
		iConsole->Printf(_L("Play Menu - Unknown command\n"));
sl@0
   440
		break;
sl@0
   441
	};
sl@0
   442
sl@0
   443
	// Issue another request
sl@0
   444
	RequestCharacter();
sl@0
   445
}
sl@0
   446
sl@0
   447
sl@0
   448
sl@0
   449
//////////////////////////////////////////////////////////////////////////////
sl@0
   450
//
sl@0
   451
// -----> Equalizer Menu
sl@0
   452
//
sl@0
   453
//////////////////////////////////////////////////////////////////////////////
sl@0
   454
sl@0
   455
sl@0
   456
void CConsoleTest::ProcessEqualizerL(TChar aChar)
sl@0
   457
{
sl@0
   458
	TInt32 min, max;
sl@0
   459
sl@0
   460
	switch (aChar)
sl@0
   461
	{
sl@0
   462
	case '0':	// Main Menu
sl@0
   463
		iMenu = EMain;
sl@0
   464
		ShowMenu();
sl@0
   465
		break;
sl@0
   466
sl@0
   467
	case '1':	// Enable / disable
sl@0
   468
		if ( iAudioEqualizer->IsEnabled() )
sl@0
   469
			iAudioEqualizer->DisableL();
sl@0
   470
		else
sl@0
   471
			iAudioEqualizer->EnableL();
sl@0
   472
sl@0
   473
		break;
sl@0
   474
sl@0
   475
	case '2':	// Enforce
sl@0
   476
		if ( iAudioEqualizer->IsEnforced() )
sl@0
   477
			iAudioEqualizer->EnforceL(EFalse);
sl@0
   478
		else
sl@0
   479
			iAudioEqualizer->EnforceL(ETrue);
sl@0
   480
		break;
sl@0
   481
sl@0
   482
	case '3':	// Set Band Level
sl@0
   483
		iMenu = EBandId;
sl@0
   484
		iConsole->Printf(_L("Enter Band ID: "));
sl@0
   485
		break;
sl@0
   486
sl@0
   487
	case '4':	// Print Equalizer information
sl@0
   488
		iConsole->Printf(_L("Enabled: %d\n"), iAudioEqualizer->IsEnabled());
sl@0
   489
		iConsole->Printf(_L("Enforced: %d\n"), iAudioEqualizer->IsEnforced());
sl@0
   490
		iConsole->Printf(_L("Number Of Bands: %d\n"), iAudioEqualizer->NumberOfBands());
sl@0
   491
		iAudioEqualizer->DbLevelLimits(min,max);
sl@0
   492
		iConsole->Printf(_L("Db Min %d, Max %d\n"), min, max );
sl@0
   493
		break;
sl@0
   494
sl@0
   495
	case '5':	// Print Band Info
sl@0
   496
		iMenu = EBandId;
sl@0
   497
		iConsole->Printf(_L("Enter Band ID: "));
sl@0
   498
		break;
sl@0
   499
sl@0
   500
	case '6':	// Apply Settings
sl@0
   501
		iAudioEqualizer->ApplyL();
sl@0
   502
		break;
sl@0
   503
sl@0
   504
	case '9':	// Delete volume object
sl@0
   505
		if (iParentMenu == EPlay)
sl@0
   506
			{
sl@0
   507
			delete iAudioEqualizer;
sl@0
   508
			iAudioEqualizer = NULL;
sl@0
   509
			iPlayerAudioEqualizer = NULL;
sl@0
   510
			}
sl@0
   511
sl@0
   512
		if (iParentMenu == ERecord)
sl@0
   513
			{
sl@0
   514
			delete iAudioEqualizer;
sl@0
   515
			iAudioEqualizer = NULL;
sl@0
   516
			iRecorderAudioEqualizer = NULL;
sl@0
   517
			}
sl@0
   518
		break;
sl@0
   519
sl@0
   520
	default:
sl@0
   521
		iConsole->Printf(_L("ProcessEqualizerL - Unknown command\n"));
sl@0
   522
		break;
sl@0
   523
	};
sl@0
   524
sl@0
   525
	// Issue another request
sl@0
   526
	RequestCharacter();
sl@0
   527
}
sl@0
   528
sl@0
   529
sl@0
   530
//////////////////////////////////////////////////////////////////////////////
sl@0
   531
//
sl@0
   532
// -----> Band Menu
sl@0
   533
//
sl@0
   534
//////////////////////////////////////////////////////////////////////////////
sl@0
   535
sl@0
   536
sl@0
   537
void CConsoleTest::ProcessBandId(TChar aChar)
sl@0
   538
{
sl@0
   539
	iBandId = aChar.GetNumericValue();
sl@0
   540
	iMenu = EBandLevel;
sl@0
   541
	ShowMenu();
sl@0
   542
	RequestCharacter();
sl@0
   543
sl@0
   544
}
sl@0
   545
sl@0
   546
sl@0
   547
void CConsoleTest::ProcessBandLevelL(TChar aChar)
sl@0
   548
{
sl@0
   549
	switch (aChar)
sl@0
   550
	{
sl@0
   551
	case '0':	// Main Menu
sl@0
   552
		iMenu = EEqualizer;
sl@0
   553
		ShowMenu();
sl@0
   554
		break;
sl@0
   555
sl@0
   556
	case '1':	// Level UP
sl@0
   557
		ShowMenu();
sl@0
   558
		iAudioEqualizer->SetBandLevelL(iBandId, iAudioEqualizer->BandLevel(iBandId) + 1);
sl@0
   559
		iConsole->Printf(_L("Band[%d] Level[%d]\n"), iBandId, iAudioEqualizer->BandLevel(iBandId) );
sl@0
   560
		//iAudioEqualizer->ApplyL();
sl@0
   561
		break;
sl@0
   562
sl@0
   563
	case '2':	// Level Down
sl@0
   564
		ShowMenu();
sl@0
   565
		iAudioEqualizer->SetBandLevelL(iBandId, iAudioEqualizer->BandLevel(iBandId) - 1);
sl@0
   566
		iConsole->Printf(_L("Band[%d] Level[%d]\n"), iBandId, iAudioEqualizer->BandLevel(iBandId) );
sl@0
   567
		//iAudioEqualizer->ApplyL();
sl@0
   568
		break;
sl@0
   569
sl@0
   570
	case '3':	// Print Band information
sl@0
   571
		iConsole->Printf(_L("Band Number: %d\n"), iBandId);
sl@0
   572
		iConsole->Printf(_L("BandLevel: %d\n"), iAudioEqualizer->BandLevel(iBandId));
sl@0
   573
		iConsole->Printf(_L("BandWidth: %d\n"), iAudioEqualizer->BandWidth(iBandId));
sl@0
   574
		iConsole->Printf(_L("Crossover Fequency %d\n"), iAudioEqualizer->CrossoverFrequency(iBandId));
sl@0
   575
		iConsole->Printf(_L("Center Fequency %d\n"), iAudioEqualizer->CenterFrequency(iBandId));
sl@0
   576
		break;
sl@0
   577
sl@0
   578
	default:
sl@0
   579
		iConsole->Printf(_L("ProcessEqualizerL - Unknown command\n"));
sl@0
   580
		break;
sl@0
   581
	};
sl@0
   582
sl@0
   583
	// Issue another request
sl@0
   584
	RequestCharacter();
sl@0
   585
}
sl@0
   586
sl@0
   587
//////////////////////////////////////////////////////////////////////////////
sl@0
   588
//
sl@0
   589
// -----> Stereo Widening Menu
sl@0
   590
//
sl@0
   591
//////////////////////////////////////////////////////////////////////////////
sl@0
   592
sl@0
   593
sl@0
   594
void CConsoleTest::ProcessStereoWideningL(TChar aChar)
sl@0
   595
{
sl@0
   596
sl@0
   597
	switch (aChar)
sl@0
   598
	{
sl@0
   599
	case '0':	// Main Menu
sl@0
   600
		iMenu = EMain;
sl@0
   601
		ShowMenu();
sl@0
   602
		break;
sl@0
   603
sl@0
   604
	case '1':	// Enable / disable
sl@0
   605
		if ( iStereoWidening->IsEnabled() )
sl@0
   606
			iStereoWidening->DisableL();
sl@0
   607
		else
sl@0
   608
			iStereoWidening->EnableL();
sl@0
   609
sl@0
   610
		break;
sl@0
   611
sl@0
   612
	case '2':	// Enforce
sl@0
   613
		if ( iStereoWidening->IsEnforced() )
sl@0
   614
			iStereoWidening->EnforceL(EFalse);
sl@0
   615
		else
sl@0
   616
			iStereoWidening->EnforceL(ETrue);
sl@0
   617
		break;
sl@0
   618
sl@0
   619
	case '3':	// Set Stereo Widening Level
sl@0
   620
		iMenu = EStereoWideningLevel;
sl@0
   621
		break;
sl@0
   622
sl@0
   623
	case '4':	// Apply Settings
sl@0
   624
		iStereoWidening->ApplyL();
sl@0
   625
		break;
sl@0
   626
sl@0
   627
	case '9':	// Delete volume object
sl@0
   628
		if (iParentMenu == EPlay)
sl@0
   629
			{
sl@0
   630
			delete iStereoWidening;
sl@0
   631
			iStereoWidening = NULL;
sl@0
   632
			iPlayerStereoWidening = NULL;
sl@0
   633
			}
sl@0
   634
		if (iParentMenu == ERecord)
sl@0
   635
			{
sl@0
   636
			delete iStereoWidening;
sl@0
   637
			iStereoWidening = NULL;
sl@0
   638
			iRecorderStereoWidening = NULL;
sl@0
   639
			}
sl@0
   640
sl@0
   641
			iMenu = EMain;
sl@0
   642
			ShowMenu();
sl@0
   643
			break;
sl@0
   644
sl@0
   645
	default:
sl@0
   646
		iConsole->Printf(_L("ProcessStereoWideningL - Unknown command\n"));
sl@0
   647
		break;
sl@0
   648
	};
sl@0
   649
sl@0
   650
	// Issue another request
sl@0
   651
	RequestCharacter();
sl@0
   652
}
sl@0
   653
sl@0
   654
void CConsoleTest::ProcessStereoWideningLevelL(TChar aChar)
sl@0
   655
{
sl@0
   656
sl@0
   657
	ShowMenu();
sl@0
   658
	switch (aChar)
sl@0
   659
	{
sl@0
   660
sl@0
   661
	case '1':	// Level UP
sl@0
   662
		ShowMenu();
sl@0
   663
		iStereoWidening->SetStereoWideningLevelL(iStereoWidening->StereoWideningLevel() + 1);
sl@0
   664
		iConsole->Printf(_L("Level[%d]\n"), iStereoWidening->StereoWideningLevel() );
sl@0
   665
		break;
sl@0
   666
sl@0
   667
	case '2':	// Level Down
sl@0
   668
		ShowMenu();
sl@0
   669
		iStereoWidening->SetStereoWideningLevelL(iStereoWidening->StereoWideningLevel() - 1);
sl@0
   670
		iConsole->Printf(_L("Level[%d]\n"), iStereoWidening->StereoWideningLevel() );
sl@0
   671
		break;
sl@0
   672
sl@0
   673
	case '3':	// Print Level information
sl@0
   674
		iConsole->Printf(_L("Level: %d\n"), iStereoWidening->StereoWideningLevel());
sl@0
   675
		iConsole->Printf(_L("Continuous Level %d\n"), iStereoWidening->IsContinuousLevelSupported());
sl@0
   676
		break;
sl@0
   677
	case '9':	// Main Menu
sl@0
   678
		iMenu = EStereoWidening;
sl@0
   679
		ShowMenu();
sl@0
   680
		break;
sl@0
   681
sl@0
   682
	default:
sl@0
   683
		iConsole->Printf(_L("ProcessStereoWideningL - Unknown command\n"));
sl@0
   684
		break;
sl@0
   685
	};
sl@0
   686
sl@0
   687
	// Issue another request
sl@0
   688
	RequestCharacter();
sl@0
   689
}
sl@0
   690
sl@0
   691
//////////////////////////////////////////////////////////////////////////////
sl@0
   692
//
sl@0
   693
// -----> Environmental reverb Menu
sl@0
   694
//
sl@0
   695
//////////////////////////////////////////////////////////////////////////////
sl@0
   696
sl@0
   697
void CConsoleTest::InitializeTestData()
sl@0
   698
{
sl@0
   699
	iGoodData.Append(1000); // Decay HF Ratio
sl@0
   700
	iGoodData.Append(1000); // Decay Time
sl@0
   701
	iGoodData.Append(1000); // Density
sl@0
   702
	iGoodData.Append(1000); // Diffusion
sl@0
   703
	iGoodData.Append(1000); // Reflections Delay
sl@0
   704
	iGoodData.Append(1000); // Reflections Level
sl@0
   705
	iGoodData.Append(1000); // Reverb Delay
sl@0
   706
	iGoodData.Append(1000); // Reverb Level
sl@0
   707
	iGoodData.Append(1000); // Room HF Level
sl@0
   708
	iGoodData.Append(1000); // Room Level
sl@0
   709
sl@0
   710
	iBadData.Append(50000); // Decay HF Ratio
sl@0
   711
	iBadData.Append(300000); // Decay Time
sl@0
   712
	iBadData.Append(10005); // Density
sl@0
   713
	iBadData.Append(10005); // Diffusion
sl@0
   714
	iBadData.Append(300000); // Reflections Delay
sl@0
   715
	iBadData.Append(2000); // Reflections Level
sl@0
   716
	iBadData.Append(300000); // Reverb Delay
sl@0
   717
	iBadData.Append(2000); // Reverb Level
sl@0
   718
	iBadData.Append(2000); // Room HF Level
sl@0
   719
	iBadData.Append(2000); // Room Level
sl@0
   720
sl@0
   721
}
sl@0
   722
sl@0
   723
void CConsoleTest::ProcessEnvironmentalReverbL(TChar aChar)
sl@0
   724
{
sl@0
   725
sl@0
   726
	switch (aChar)
sl@0
   727
	{
sl@0
   728
	case '0':	// Main Menu
sl@0
   729
		iMenu = EMain;
sl@0
   730
		ShowMenu();
sl@0
   731
		break;
sl@0
   732
sl@0
   733
	case '1':	// Enable / disable
sl@0
   734
		if ( iEnvironmentalReverb->IsEnabled() )
sl@0
   735
			iEnvironmentalReverb->DisableL();
sl@0
   736
		else
sl@0
   737
			iEnvironmentalReverb->EnableL();
sl@0
   738
sl@0
   739
		break;
sl@0
   740
sl@0
   741
	case '2':	// Enforce
sl@0
   742
		if ( iEnvironmentalReverb->IsEnforced() )
sl@0
   743
			iEnvironmentalReverb->EnforceL(EFalse);
sl@0
   744
		else
sl@0
   745
			iEnvironmentalReverb->EnforceL(ETrue);
sl@0
   746
		break;
sl@0
   747
sl@0
   748
	case '3':	// Test 1: Setters normal case
sl@0
   749
		TestCase1();
sl@0
   750
		break;
sl@0
   751
sl@0
   752
	case '4':	// Test 2: Setters abnormal case
sl@0
   753
		TestCase2();
sl@0
   754
		break;
sl@0
   755
sl@0
   756
	case '5':	// Test 3: Getters abnormal case
sl@0
   757
		TestCase3();
sl@0
   758
		break;
sl@0
   759
sl@0
   760
	case '8':	// Apply Settings
sl@0
   761
		iEnvironmentalReverb->ApplyL();
sl@0
   762
		break;
sl@0
   763
sl@0
   764
	case '9':	// Delete environmental reverb object
sl@0
   765
		if (iParentMenu == EPlay)
sl@0
   766
			{
sl@0
   767
			delete iEnvironmentalReverb;
sl@0
   768
			iEnvironmentalReverb = NULL;
sl@0
   769
			iPlayerEnvironmentalReverb = NULL;
sl@0
   770
			}
sl@0
   771
sl@0
   772
		if (iParentMenu == ERecord)
sl@0
   773
			{
sl@0
   774
			delete iEnvironmentalReverb;
sl@0
   775
			iEnvironmentalReverb = NULL;
sl@0
   776
			iRecorderEnvironmentalReverb = NULL;
sl@0
   777
			}
sl@0
   778
		break;
sl@0
   779
sl@0
   780
	default:
sl@0
   781
		iConsole->Printf(_L("ProcessEnvironmentalReverbL - Unknown command\n"));
sl@0
   782
		break;
sl@0
   783
	};
sl@0
   784
sl@0
   785
	// Issue another request
sl@0
   786
	RequestCharacter();
sl@0
   787
}
sl@0
   788
sl@0
   789
void CConsoleTest::TestCase1()
sl@0
   790
{
sl@0
   791
	TRAPD(err1, iEnvironmentalReverb->SetDecayHFRatioL(iGoodData[0]));
sl@0
   792
	iConsole->Printf(_L("Result 1.1 - %d\n"),err1);
sl@0
   793
	TRAPD(err2, iEnvironmentalReverb->SetDecayTimeL(iGoodData[1]));
sl@0
   794
	iConsole->Printf(_L("Result 1.2 - %d\n"),err2);
sl@0
   795
	TRAPD(err3, iEnvironmentalReverb->SetDensityL(iGoodData[2]));
sl@0
   796
	iConsole->Printf(_L("Result 1.3 - %d\n"),err3);
sl@0
   797
	TRAPD(err4, iEnvironmentalReverb->SetDiffusionL(iGoodData[3]));
sl@0
   798
	iConsole->Printf(_L("Result 1.4 - %d\n"),err4);
sl@0
   799
	TRAPD(err5, iEnvironmentalReverb->SetReflectionsDelayL(iGoodData[4]));
sl@0
   800
	iConsole->Printf(_L("Result 1.5 - %d\n"),err5);
sl@0
   801
	TRAPD(err6, iEnvironmentalReverb->SetReverbDelayL(iGoodData[6]));
sl@0
   802
	iConsole->Printf(_L("Result 1.6 - %d\n"),err6);
sl@0
   803
	TRAPD(err7, iEnvironmentalReverb->SetReverbLevelL(iGoodData[7]));
sl@0
   804
	iConsole->Printf(_L("Result 1.7 - %d\n"),err7);
sl@0
   805
	TRAPD(err8, iEnvironmentalReverb->SetRoomHFLevelL(iGoodData[8]));
sl@0
   806
	iConsole->Printf(_L("Result 1.8 - %d\n"),err8);
sl@0
   807
	TRAPD(err9, iEnvironmentalReverb->SetRoomLevelL(iGoodData[9]));
sl@0
   808
	iConsole->Printf(_L("Result 1.9 - %d\n"),err9);
sl@0
   809
	TRAPD(err10, iEnvironmentalReverb->SetReflectionsLevelL(iGoodData[5]));
sl@0
   810
	iConsole->Printf(_L("Result 1.10 - %d\n"),err10);
sl@0
   811
}
sl@0
   812
sl@0
   813
void CConsoleTest::TestCase2()
sl@0
   814
{
sl@0
   815
	TRAPD(err1, iEnvironmentalReverb->SetDecayHFRatioL(iBadData[0]));
sl@0
   816
	iConsole->Printf(_L("Result 1.1 - %d\n"),err1);
sl@0
   817
	TRAPD(err2, iEnvironmentalReverb->SetDecayTimeL(iBadData[1]));
sl@0
   818
	iConsole->Printf(_L("Result 1.2 - %d\n"),err2);
sl@0
   819
	TRAPD(err3, iEnvironmentalReverb->SetDensityL(iBadData[2]));
sl@0
   820
	iConsole->Printf(_L("Result 1.3 - %d\n"),err3);
sl@0
   821
	TRAPD(err4, iEnvironmentalReverb->SetDiffusionL(iBadData[3]));
sl@0
   822
	iConsole->Printf(_L("Result 1.4 - %d\n"),err4);
sl@0
   823
	TRAPD(err5, iEnvironmentalReverb->SetReflectionsDelayL(iBadData[4]));
sl@0
   824
	iConsole->Printf(_L("Result 1.5 - %d\n"),err5);
sl@0
   825
	TRAPD(err6, iEnvironmentalReverb->SetReverbDelayL(iBadData[6]));
sl@0
   826
	iConsole->Printf(_L("Result 1.6 - %d\n"),err6);
sl@0
   827
	TRAPD(err7, iEnvironmentalReverb->SetReverbLevelL(iBadData[7]));
sl@0
   828
	iConsole->Printf(_L("Result 1.7 - %d\n"),err7);
sl@0
   829
	TRAPD(err8, iEnvironmentalReverb->SetRoomHFLevelL(iBadData[8]));
sl@0
   830
	iConsole->Printf(_L("Result 1.8 - %d\n"),err8);
sl@0
   831
	TRAPD(err9, iEnvironmentalReverb->SetRoomLevelL(iBadData[9]));
sl@0
   832
	iConsole->Printf(_L("Result 1.9 - %d\n"),err9);
sl@0
   833
	TRAPD(err10, iEnvironmentalReverb->SetReflectionsLevelL(iBadData[5]));
sl@0
   834
	iConsole->Printf(_L("Result 1.10 - %d\n"),err10);
sl@0
   835
}
sl@0
   836
sl@0
   837
void CConsoleTest::TestCase3()
sl@0
   838
{
sl@0
   839
	if ( iEnvironmentalReverb->DecayHFRatio() == iGoodData[0] )
sl@0
   840
		iConsole->Printf(_L("Result 3.1 - 1\n"));
sl@0
   841
	else
sl@0
   842
		iConsole->Printf(_L("Result 3.1 - 0\n"));
sl@0
   843
sl@0
   844
	if ( iEnvironmentalReverb->DecayTime() == iGoodData[1] )
sl@0
   845
		iConsole->Printf(_L("Result 3.2 - 1\n"));
sl@0
   846
	else
sl@0
   847
		iConsole->Printf(_L("Result 3.2 - 0\n"));
sl@0
   848
sl@0
   849
	if ( iEnvironmentalReverb->Density() == iGoodData[2] )
sl@0
   850
		iConsole->Printf(_L("Result 3.3 - 1\n"));
sl@0
   851
	else
sl@0
   852
		iConsole->Printf(_L("Result 3.3 - 0\n"));
sl@0
   853
sl@0
   854
	if ( iEnvironmentalReverb->Diffusion() == iGoodData[3] )
sl@0
   855
		iConsole->Printf(_L("Result 3.4 - 1\n"));
sl@0
   856
	else
sl@0
   857
		iConsole->Printf(_L("Result 3.4 - 0\n"));
sl@0
   858
sl@0
   859
	if ( iEnvironmentalReverb->ReflectionsDelay() == iGoodData[4] )
sl@0
   860
		iConsole->Printf(_L("Result 3.5 - 1\n"));
sl@0
   861
	else
sl@0
   862
		iConsole->Printf(_L("Result 3.5 - 0\n"));
sl@0
   863
sl@0
   864
	if ( iEnvironmentalReverb->ReflectionsLevel() == iGoodData[5] )
sl@0
   865
		iConsole->Printf(_L("Result 3.6 - 1\n"));
sl@0
   866
	else
sl@0
   867
		iConsole->Printf(_L("Result 3.6 - 0\n"));
sl@0
   868
sl@0
   869
	if ( iEnvironmentalReverb->ReverbDelay() == iGoodData[6] )
sl@0
   870
		iConsole->Printf(_L("Result 3.7 - 1\n"));
sl@0
   871
	else
sl@0
   872
		iConsole->Printf(_L("Result 3.7 - 0\n"));
sl@0
   873
sl@0
   874
	if ( iEnvironmentalReverb->ReverbLevel() == iGoodData[7] )
sl@0
   875
		iConsole->Printf(_L("Result 3.8 - 1\n"));
sl@0
   876
	else
sl@0
   877
		iConsole->Printf(_L("Result 3.8 - 0\n"));
sl@0
   878
sl@0
   879
	if ( iEnvironmentalReverb->RoomHFLevel() == iGoodData[8] )
sl@0
   880
		iConsole->Printf(_L("Result 3.9 - 1\n"));
sl@0
   881
	else
sl@0
   882
		iConsole->Printf(_L("Result 3.9 - 0\n"));
sl@0
   883
sl@0
   884
	if ( iEnvironmentalReverb->RoomLevel() == iGoodData[9] )
sl@0
   885
		iConsole->Printf(_L("Result 3.10 - 1\n"));
sl@0
   886
	else
sl@0
   887
		iConsole->Printf(_L("Result 3.10 - 0\n"));
sl@0
   888
}
sl@0
   889
sl@0
   890
/************************************************************************************************************/
sl@0
   891
sl@0
   892
sl@0
   893
sl@0
   894
sl@0
   895
void CConsoleTest::MapcInitComplete(TInt aStatus, const TTimeIntervalMicroSeconds& aDuration)
sl@0
   896
	{
sl@0
   897
	iConsole->Printf(_L("MapcInit: %d\n"), aStatus);
sl@0
   898
	iInitStatus = aStatus;
sl@0
   899
	TInt d = I64INT(aDuration.Int64());
sl@0
   900
	RDebug::Print(_L("CConsoleTest::MapcInitComplete :-> Status[%d] Duration[%d]"), aStatus, d);
sl@0
   901
	}
sl@0
   902
sl@0
   903
void CConsoleTest::MapcPlayComplete(TInt aErr)
sl@0
   904
	{
sl@0
   905
	iConsole->Printf(_L("MapcPlay: %d"), aErr);
sl@0
   906
	RDebug::Print(_L("CConsoleTest::MapcPlayComplete :-> Error[%d]"), aErr);
sl@0
   907
	}
sl@0
   908
sl@0
   909
void CConsoleTest::EffectChanged( const CAudioEffect* aAudioEffect, TUint8 aEvent )
sl@0
   910
	{
sl@0
   911
	RDebug::Print(_L("CConsoleTest::EffectChanged, Event = %d "), aEvent);
sl@0
   912
sl@0
   913
	if ( aAudioEffect->Uid() == KUidAudioEqualizerEffect )
sl@0
   914
		{
sl@0
   915
		if ( aEvent == KEnabled )
sl@0
   916
			{
sl@0
   917
			iConsole->Printf(_L("Equalizer state: %d"), ((CAudioEqualizer*)aAudioEffect)->IsEnabled());
sl@0
   918
			RDebug::Print(_L("CConsoleTest::EffectChanged :-> Enabled[%d]"), ((CAudioEqualizer*)aAudioEffect)->IsEnabled());
sl@0
   919
			}
sl@0
   920
		}
sl@0
   921
	else if ( aAudioEffect->Uid() == KUidStereoWideningEffect )
sl@0
   922
			{
sl@0
   923
			if ( aEvent == KEnabled )
sl@0
   924
				{
sl@0
   925
				iConsole->Printf(_L("StereoWidening state: %d"), ((CStereoWidening*)aAudioEffect)->IsEnabled());
sl@0
   926
				RDebug::Print(_L("CConsoleTest::EffectChanged :-> Enabled[%d]"), ((CStereoWidening*)aAudioEffect)->IsEnabled());
sl@0
   927
				}
sl@0
   928
			else
sl@0
   929
				{
sl@0
   930
				iConsole->Printf(_L("StereoWidening state: %d"), ((CStereoWidening*)aAudioEffect)->IsEnabled());
sl@0
   931
				RDebug::Print(_L("CConsoleTest::EffectChanged :-> Enabled[%d]"), ((CStereoWidening*)aAudioEffect)->IsEnabled());
sl@0
   932
				}
sl@0
   933
			}
sl@0
   934
sl@0
   935
sl@0
   936
	}
sl@0
   937
sl@0
   938
void CConsoleTest::MoscoStateChangeEvent(CBase* /*aObject*/, TInt aPreviousState, TInt aCurrentState, TInt aErrorCode)
sl@0
   939
	{
sl@0
   940
	RDebug::Print(_L("aPreviousState[%d], aCurrentState[%d], aErrorCode[%d]"), aPreviousState, aCurrentState, aErrorCode);
sl@0
   941
	iInitStatus = aErrorCode;
sl@0
   942
	iConsole->Printf(_L("Mosco: %d\n"), aErrorCode);
sl@0
   943
	}
sl@0
   944
sl@0
   945
sl@0
   946
sl@0
   947
//////////////////////////////////////////////////////////////////////////////
sl@0
   948
//
sl@0
   949
// Do the testing
sl@0
   950
//
sl@0
   951
//////////////////////////////////////////////////////////////////////////////
sl@0
   952
LOCAL_C void doTestL()
sl@0
   953
{
sl@0
   954
sl@0
   955
	CConsoleBase* console = Console::NewL(KTxtDBTest,TSize(KConsFullScreen,KConsFullScreen));
sl@0
   956
	CleanupStack::PushL(console);
sl@0
   957
sl@0
   958
	CmyActiveScheduler* myScheduler = new (ELeave) CmyActiveScheduler;
sl@0
   959
	CleanupStack::PushL(myScheduler);
sl@0
   960
	CActiveScheduler::Install(myScheduler);
sl@0
   961
sl@0
   962
	// Create a CConsoleTest active object
sl@0
   963
	CConsoleTest* consoleTest = CConsoleTest::NewLC(console);
sl@0
   964
	consoleTest->ShowMenu();
sl@0
   965
	// Issue the first request
sl@0
   966
	consoleTest->RequestCharacter();
sl@0
   967
sl@0
   968
#ifdef __WINS__
sl@0
   969
	_LIT(KTitleMsg,"Ready!\nPress ESC to end.\n\n");
sl@0
   970
#else
sl@0
   971
	_LIT(KTitleMsg,"Press SPACE(0) to end.\n");
sl@0
   972
#endif
sl@0
   973
	console->Printf(KTitleMsg);
sl@0
   974
//	test.Title();
sl@0
   975
sl@0
   976
	// Main part of program is a wait loop
sl@0
   977
	// This function completes when the scheduler stops
sl@0
   978
	CActiveScheduler::Start();
sl@0
   979
sl@0
   980
	_LIT(KTxtPressAnyKey," [press any key]");
sl@0
   981
	console->Printf(KTxtPressAnyKey);
sl@0
   982
	console->Getch();					// get and ignore character
sl@0
   983
sl@0
   984
	// Remove from the cleanup stack and destroy:
sl@0
   985
	// 1. consoleTest
sl@0
   986
	// 2. myScheduler
sl@0
   987
	// 3. console
sl@0
   988
	CleanupStack::PopAndDestroy(3);
sl@0
   989
}
sl@0
   990