os/mm/mmlibs/mmfw/tsrc/mmfintegrationtest/ACLNT/playtruepause.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
// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
sl@0
     2
// All rights reserved.
sl@0
     3
// This component and the accompanying materials are made available
sl@0
     4
// under the terms of "Eclipse Public License v1.0"
sl@0
     5
// which accompanies this distribution, and is available
sl@0
     6
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
sl@0
     7
//
sl@0
     8
// Initial Contributors:
sl@0
     9
// Nokia Corporation - initial contribution.
sl@0
    10
//
sl@0
    11
// Contributors:
sl@0
    12
//
sl@0
    13
// Description:
sl@0
    14
// Part of the TSI_MMFACLNT suite that tests CR1566 (TruePause) on AudioPlayerUtility
sl@0
    15
// 
sl@0
    16
//
sl@0
    17
sl@0
    18
/**
sl@0
    19
 @file PlayTruePause.cpp
sl@0
    20
*/
sl@0
    21
sl@0
    22
#include "playtruepause.h"
sl@0
    23
sl@0
    24
/*
sl@0
    25
 *
sl@0
    26
 * RMdaPlayerUtilityTestBase - Test step constructor
sl@0
    27
 *
sl@0
    28
 */
sl@0
    29
RMdaPlayerUtilityTestBase::RMdaPlayerUtilityTestBase(const TDesC& aTestName, const TDesC& aSectName)
sl@0
    30
	:	iAudioUtilityState(EStateInitial), 
sl@0
    31
		iPlayerUtility(NULL),
sl@0
    32
		iTimer(NULL),
sl@0
    33
		iFilename(KNullDesC),
sl@0
    34
		iStop(EFalse),
sl@0
    35
		iQuery(EFalse),
sl@0
    36
		iVolume(0),
sl@0
    37
		iBalance(0),
sl@0
    38
		iResume(EFalse),
sl@0
    39
		iPauseResumeTimes(0),
sl@0
    40
		iPauseApplied(0),
sl@0
    41
		iDuration(0),
sl@0
    42
		iAllFormat(0),
sl@0
    43
		iPositionSupported(EFalse),
sl@0
    44
		iMiliSec(EFalse)
sl@0
    45
	{
sl@0
    46
	iTestStepName = aTestName;
sl@0
    47
	iSectName = aSectName;
sl@0
    48
	}
sl@0
    49
sl@0
    50
/*
sl@0
    51
 *
sl@0
    52
 * ~RMdaPlayerUtilityTestBase - Test step destructor
sl@0
    53
 *
sl@0
    54
 */
sl@0
    55
RMdaPlayerUtilityTestBase::~RMdaPlayerUtilityTestBase()
sl@0
    56
	{
sl@0
    57
	if (iPlayerUtility)
sl@0
    58
		{
sl@0
    59
		delete iPlayerUtility;
sl@0
    60
		}
sl@0
    61
	if(iTimer)
sl@0
    62
		{
sl@0
    63
		delete iTimer;
sl@0
    64
		}
sl@0
    65
	}
sl@0
    66
sl@0
    67
/*
sl@0
    68
 *
sl@0
    69
 * KickoffTestL - Starts the test
sl@0
    70
 *
sl@0
    71
 */
sl@0
    72
void RMdaPlayerUtilityTestBase::KickoffTestL()
sl@0
    73
	{
sl@0
    74
	INFO_PRINTF1(_L("__________  Creating Player Utility object ___________"));
sl@0
    75
	TRAPD(err,  iPlayerUtility = CMdaAudioPlayerUtility::NewL(*this));
sl@0
    76
	if (err != KErrNone)
sl@0
    77
		{
sl@0
    78
		ERR_PRINTF2(_L("Could not create Player Utility object. Error = %d"), err);
sl@0
    79
		StopTest(err);
sl@0
    80
		return;
sl@0
    81
		}
sl@0
    82
	INFO_PRINTF1(_L("Player Utility State: EStateCreated"));
sl@0
    83
	iAudioUtilityState = EStateCreated;
sl@0
    84
	DoKickoffTestL();
sl@0
    85
	INFO_PRINTF1(_L("Audio Player Utility Event: EEventInitialize"));
sl@0
    86
	Fsm(EEventInitialize, KErrNone);
sl@0
    87
	}
sl@0
    88
sl@0
    89
/*
sl@0
    90
 *
sl@0
    91
 * CloseTest
sl@0
    92
 *
sl@0
    93
 */
sl@0
    94
void RMdaPlayerUtilityTestBase::CloseTest()
sl@0
    95
	{
sl@0
    96
	INFO_PRINTF1(KMsgDelete);
sl@0
    97
	delete iPlayerUtility;
sl@0
    98
	delete iTimer;
sl@0
    99
	}
sl@0
   100
sl@0
   101
/*
sl@0
   102
 *
sl@0
   103
 * StartTimer - Starts timer and timer callback
sl@0
   104
 *
sl@0
   105
 */
sl@0
   106
void RMdaPlayerUtilityTestBase::StartTimer(TTimeIntervalMicroSeconds32 aWaitTime)
sl@0
   107
	{
sl@0
   108
	TTimeIntervalMicroSeconds32 timeInterval;
sl@0
   109
	
sl@0
   110
	if(aWaitTime <= TTimeIntervalMicroSeconds32(0))
sl@0
   111
		{
sl@0
   112
		timeInterval = KMicroSecInOneSec;
sl@0
   113
		}
sl@0
   114
	else
sl@0
   115
		{
sl@0
   116
		timeInterval = aWaitTime;
sl@0
   117
		}
sl@0
   118
	TCallBack callback (TimerCallback, this);
sl@0
   119
	iTimer->Start(timeInterval, timeInterval, callback);
sl@0
   120
	INFO_PRINTF1(_L("Timer has been started"));
sl@0
   121
	}
sl@0
   122
sl@0
   123
/*
sl@0
   124
 *
sl@0
   125
 * TimerCallback
sl@0
   126
 *
sl@0
   127
 */
sl@0
   128
TInt RMdaPlayerUtilityTestBase::TimerCallback(TAny* aPtr)
sl@0
   129
	{
sl@0
   130
	static_cast<RMdaPlayerUtilityTestBase*>(aPtr)->DoTimerCallback();
sl@0
   131
	return KErrNone;
sl@0
   132
	}
sl@0
   133
sl@0
   134
/*
sl@0
   135
 *
sl@0
   136
 * DoTimerCallback
sl@0
   137
 *
sl@0
   138
 */
sl@0
   139
void RMdaPlayerUtilityTestBase::DoTimerCallback()
sl@0
   140
	{
sl@0
   141
	INFO_PRINTF1(_L("DevSound Event: EEventTimerComplete"));
sl@0
   142
	Fsm (EEventTimerComplete, KErrNone);
sl@0
   143
	}
sl@0
   144
sl@0
   145
/*
sl@0
   146
 *
sl@0
   147
 * Fsm - Executes playing events of AudioPlayerUtility in sequence
sl@0
   148
 *
sl@0
   149
 */
sl@0
   150
void RMdaPlayerUtilityTestBase::Fsm(TMdaAudioUtilityEvent aMdaAudioUtilityEvent, TInt aError)
sl@0
   151
	{
sl@0
   152
	switch (iAudioUtilityState)
sl@0
   153
		{
sl@0
   154
		case EStateCreated:
sl@0
   155
			{
sl@0
   156
			__ASSERT_ALWAYS((aError == KErrNone), Panic(iTestStepName.Right(KPanicLength), EFsmIncorrectErrorPassed));
sl@0
   157
			if (aMdaAudioUtilityEvent == EEventInitialize)
sl@0
   158
				{
sl@0
   159
				INFO_PRINTF1(_L("Calling CMdaAudioPlayerUtility::OpenFileL"));
sl@0
   160
				TRAPD(err,iPlayerUtility->OpenFileL(iFilename));
sl@0
   161
				if(err)
sl@0
   162
					{
sl@0
   163
					ERR_PRINTF2(_L("CMdaAudioPlayerUtility::OpenFileL left with err = %d"),err);
sl@0
   164
					StopTest(err);
sl@0
   165
					break;
sl@0
   166
					}
sl@0
   167
				INFO_PRINTF1(_L("AudioPlayerUtility State: EStateInitializing"));
sl@0
   168
				iAudioUtilityState = EStateInitializing;
sl@0
   169
				}
sl@0
   170
			else
sl@0
   171
				{
sl@0
   172
				ERR_PRINTF2(_L("MdaAudioUtility EEventInitialize not received as expected. Received event: %d"), aMdaAudioUtilityEvent);
sl@0
   173
				StopTest(aError, EFail);
sl@0
   174
				}
sl@0
   175
			break;
sl@0
   176
			}
sl@0
   177
		case EStateInitializing:
sl@0
   178
			{
sl@0
   179
			if (aMdaAudioUtilityEvent == EEventInitComplete && aError == KErrNone)
sl@0
   180
				{
sl@0
   181
				INFO_PRINTF1(_L("Calling CMdaAudioPlayerUtility::Play"));
sl@0
   182
				iPlayerUtility->Play();
sl@0
   183
				INFO_PRINTF1(_L("AudioPlayerUtility State: EStatePlaying"));
sl@0
   184
				iAudioUtilityState = EStatePlaying;
sl@0
   185
				if(iMiliSec)
sl@0
   186
					{
sl@0
   187
					StartTimer(iDuration*KMiliSecInOneSec);
sl@0
   188
					}
sl@0
   189
				else
sl@0
   190
					{
sl@0
   191
					StartTimer(iDuration*KMicroSecInOneSec);
sl@0
   192
					}
sl@0
   193
				}
sl@0
   194
			else if (aMdaAudioUtilityEvent == EEventInitComplete && aError != KErrNone)
sl@0
   195
				{
sl@0
   196
				ERR_PRINTF2(_L("MapcInitComplete returned with error = %d"), aError);
sl@0
   197
				StopTest(aError);	
sl@0
   198
				}
sl@0
   199
			else
sl@0
   200
				{
sl@0
   201
				ERR_PRINTF2(_L("MdaAudioUtility EEventInitComplete not received as expected. Received event: %d"), aMdaAudioUtilityEvent);
sl@0
   202
				StopTest(aError, EFail);
sl@0
   203
				}
sl@0
   204
			break;
sl@0
   205
			}
sl@0
   206
		case EStatePlaying:
sl@0
   207
			{
sl@0
   208
			if(aMdaAudioUtilityEvent == EEventTimerComplete)
sl@0
   209
				{
sl@0
   210
				INFO_PRINTF1(_L("Calling CMdaAudioPlayerUtility::Pause"));
sl@0
   211
				TInt err = iPlayerUtility->Pause();
sl@0
   212
				iPauseApplied = ETrue;
sl@0
   213
				INFO_PRINTF1(_L("AudioPlayerUtility State: EStatePause"));
sl@0
   214
				iAudioUtilityState = EStatePause;
sl@0
   215
				}
sl@0
   216
			else
sl@0
   217
				{
sl@0
   218
				ERR_PRINTF2(_L("MdaAudioUtility EEventTimerComplete not received as expected. Received event: %d"), aMdaAudioUtilityEvent);
sl@0
   219
				StopTest(aError, EFail);
sl@0
   220
				}
sl@0
   221
			break;
sl@0
   222
			}
sl@0
   223
		case EStatePause:
sl@0
   224
			{
sl@0
   225
			if (aMdaAudioUtilityEvent == EEventTimerComplete)
sl@0
   226
				{
sl@0
   227
				if(iQuery)
sl@0
   228
					{
sl@0
   229
					INFO_PRINTF2(_L("Setting AudioPlayerUtility volume = %d"), iVolume);
sl@0
   230
					TInt err = iPlayerUtility->SetVolume(iVolume);
sl@0
   231
					if (err != KErrNone)
sl@0
   232
						{
sl@0
   233
						ERR_PRINTF2(_L("Setting volume failed. It returned with error = %d"), err);
sl@0
   234
						StopTest(err);
sl@0
   235
						break;
sl@0
   236
						}
sl@0
   237
					TInt volume = 0;
sl@0
   238
					INFO_PRINTF1(_L("Calling CMdaAudioPlayerUtility::GetVolume for verifying"));
sl@0
   239
					err = iPlayerUtility->GetVolume(volume);
sl@0
   240
					if (err != KErrNone)
sl@0
   241
						{
sl@0
   242
						ERR_PRINTF2(_L("CMdaAudioPlayerUtility::GetVolume returned with error = %d"), err);
sl@0
   243
						StopTest(err);
sl@0
   244
						break;
sl@0
   245
						}
sl@0
   246
					if(iVolume != volume)
sl@0
   247
						{
sl@0
   248
						ERR_PRINTF2(_L("CMdaAudioPlayerUtility::SetVolume returned different set value = %d"), volume);
sl@0
   249
						StopTest(KErrGeneral);
sl@0
   250
						break;
sl@0
   251
						}
sl@0
   252
					INFO_PRINTF2(_L("Setting AudioPlayerUtility balance = %d"), iBalance);
sl@0
   253
					err = iPlayerUtility->SetBalance(iBalance);
sl@0
   254
					if (err != KErrNone)
sl@0
   255
						{
sl@0
   256
						ERR_PRINTF2(_L("Setting balance failed. It returned with error = %d"), err);
sl@0
   257
						StopTest(err);
sl@0
   258
						break;
sl@0
   259
						}
sl@0
   260
					TInt balance = 0;
sl@0
   261
					INFO_PRINTF1(_L("Calling CMdaAudioPlayerUtility::GetBalance for verifying"));
sl@0
   262
					err = iPlayerUtility->GetBalance(balance);
sl@0
   263
					if (err != KErrNone)
sl@0
   264
						{
sl@0
   265
						ERR_PRINTF2(_L("CMdaAudioPlayerUtility::GetBalance returned with error = %d"), err);
sl@0
   266
						StopTest(err);
sl@0
   267
						break;
sl@0
   268
						}
sl@0
   269
					if(Abs(iBalance - balance)<KBalanceTolerance)
sl@0
   270
						{
sl@0
   271
						INFO_PRINTF2(_L("CMdaAudioPlayerUtility::SetBalance returned expected set value %d"),iBalance);
sl@0
   272
						}
sl@0
   273
					else
sl@0
   274
						{
sl@0
   275
						ERR_PRINTF3(_L("CMdaAudioPlayerUtility::SetBalance returned different set value %d. Retrieved %d"), iBalance, balance);
sl@0
   276
						StopTest(KErrGeneral);
sl@0
   277
						break;
sl@0
   278
						}
sl@0
   279
					INFO_PRINTF1(_L("Calling CMdaAudioPlayerUtility::Play"));
sl@0
   280
					iPlayerUtility->Play();
sl@0
   281
					iTimer->Cancel();
sl@0
   282
					INFO_PRINTF1(_L("Audio Player Utility State: EStatePlaying"));
sl@0
   283
					iAudioUtilityState = EStatePlaying;
sl@0
   284
					INFO_PRINTF1(_L("Calling CMdaAudioPlayerUtility::GetVolume for verifying"));
sl@0
   285
					err = iPlayerUtility->GetVolume(volume);
sl@0
   286
					if (err != KErrNone)
sl@0
   287
						{
sl@0
   288
						ERR_PRINTF2(_L("CMdaAudioPlayerUtility::GetVolume returned with error = %d"), err);
sl@0
   289
						StopTest(err);
sl@0
   290
						break;
sl@0
   291
						}
sl@0
   292
					if (volume == iVolume)
sl@0
   293
						{
sl@0
   294
						INFO_PRINTF1(_L("CMdaAudioPlayerUtility::GetVolume returned equal previous set value as expected"));
sl@0
   295
						}
sl@0
   296
					else
sl@0
   297
						{
sl@0
   298
						ERR_PRINTF2(_L("CMdaAudioPlayerUtility::GetVolume returned different set value = %d"), iVolume);
sl@0
   299
						StopTest (KErrGeneral);
sl@0
   300
						break;
sl@0
   301
						}
sl@0
   302
					INFO_PRINTF1(_L("Calling CMdaAudioPlayerUtility::GetBalance for verifying"));
sl@0
   303
					err = iPlayerUtility->GetBalance(balance);
sl@0
   304
					if (err != KErrNone)
sl@0
   305
						{
sl@0
   306
						ERR_PRINTF2(_L("CMdaAudioPlayerUtility::GetBalance returned with error = %d"), err);
sl@0
   307
						StopTest(err);
sl@0
   308
						break;
sl@0
   309
						}
sl@0
   310
					if(Abs(iBalance - balance)<KBalanceTolerance)
sl@0
   311
						{
sl@0
   312
						INFO_PRINTF2(_L("CMdaAudioPlayerUtility::GetBalance returned expected set value %d"),iBalance);
sl@0
   313
						}
sl@0
   314
					else
sl@0
   315
						{
sl@0
   316
						ERR_PRINTF3(_L("CMdaAudioPlayerUtility::GetBalance returned different set value = %d. Retrieved %d"), iBalance, balance);
sl@0
   317
						StopTest(KErrGeneral);
sl@0
   318
						break;
sl@0
   319
						}
sl@0
   320
					}
sl@0
   321
				if(iResume || iStop)
sl@0
   322
					{
sl@0
   323
					TTimeIntervalMicroSeconds position1 = 0;
sl@0
   324
					if(iPositionSupported)
sl@0
   325
						{
sl@0
   326
						INFO_PRINTF1(_L("Calling CMdaAudioPlayerUtility::GetPosition"));
sl@0
   327
						TInt err = iPlayerUtility->GetPosition(position1);
sl@0
   328
						if(err)
sl@0
   329
							{
sl@0
   330
							ERR_PRINTF2(_L("CMdaAudioPlayerUtility::GetPosition returned with err = %d"), err);
sl@0
   331
							StopTest(err);
sl@0
   332
							break;
sl@0
   333
							}
sl@0
   334
						INFO_PRINTF2(_L("AudioPlayerUtility position = %Ld"), position1.Int64());
sl@0
   335
						if(position1.Int64() == 0)
sl@0
   336
							{
sl@0
   337
							INFO_PRINTF1(_L("AudioPlayerUtility position must be longer than 0"));
sl@0
   338
							StopTest(KErrGeneral);
sl@0
   339
							break;
sl@0
   340
							}
sl@0
   341
						}
sl@0
   342
					if(iStop)
sl@0
   343
						{
sl@0
   344
						INFO_PRINTF1(_L("Calling CMdaAudioPlayerUtility::Stop"));
sl@0
   345
						iPlayerUtility->Stop();
sl@0
   346
						}
sl@0
   347
					INFO_PRINTF1(_L("Calling CMdaAudioPlayerUtility::Play"));
sl@0
   348
					iPlayerUtility->Play();
sl@0
   349
					if((--iPauseResumeTimes) <= 0)
sl@0
   350
						{
sl@0
   351
						iTimer->Cancel();
sl@0
   352
						}
sl@0
   353
					INFO_PRINTF1(_L("AudioPlayerUtility State: EStatePlaying"));
sl@0
   354
					iAudioUtilityState = EStatePlaying;
sl@0
   355
					TTimeIntervalMicroSeconds position2 = 0;
sl@0
   356
					if(iPositionSupported)
sl@0
   357
						{
sl@0
   358
						INFO_PRINTF1(_L("Calling CMdaAudioPlayerUtility::GetPosition"));
sl@0
   359
						TInt err = iPlayerUtility->GetPosition(position2);
sl@0
   360
						if(err)
sl@0
   361
							{
sl@0
   362
							ERR_PRINTF2(_L("CMdaAudioPlayerUtility::GetPosition returned with err = %d"), err);
sl@0
   363
							StopTest(err);
sl@0
   364
							break;
sl@0
   365
							}
sl@0
   366
						INFO_PRINTF2(_L(" AudioPlayerUtility position = %Ld"), position2.Int64());
sl@0
   367
						}
sl@0
   368
					if(iStop)
sl@0
   369
						{
sl@0
   370
						if(position2.Int64() == 0)
sl@0
   371
							{
sl@0
   372
							INFO_PRINTF1(_L("AudioPlayerUtility position was reset as expected"));
sl@0
   373
							}
sl@0
   374
						else
sl@0
   375
							{
sl@0
   376
							INFO_PRINTF1(_L("AudioPlayerUtility position was not reset"));
sl@0
   377
							StopTest(KErrGeneral);
sl@0
   378
							break;
sl@0
   379
							}
sl@0
   380
						}
sl@0
   381
					else if(iPositionSupported)
sl@0
   382
						{
sl@0
   383
						if(Abs(position2.Int64() - position1.Int64()) <= KOneSecond/2)
sl@0
   384
							{
sl@0
   385
							INFO_PRINTF2(_L("AudioPlayerUtility position continued from expected position %Ld"),position2.Int64());
sl@0
   386
							}
sl@0
   387
						else
sl@0
   388
							{
sl@0
   389
							ERR_PRINTF3(_L("Playback did not resume from expected position. Expected %Ld Retrieved %Ld"),position1.Int64(),position2.Int64());
sl@0
   390
							StopTest(KErrGeneral);
sl@0
   391
							break;
sl@0
   392
							}
sl@0
   393
						}
sl@0
   394
					else
sl@0
   395
						{
sl@0
   396
						INFO_PRINTF1(_L("AudioPlayerUtility continue playing "));
sl@0
   397
						}
sl@0
   398
					
sl@0
   399
					}
sl@0
   400
				}
sl@0
   401
			else
sl@0
   402
				{
sl@0
   403
				ERR_PRINTF2(_L("MdaAudioUtility EEventTimerComplete not received as expected. Received event: %d"), aMdaAudioUtilityEvent);
sl@0
   404
				StopTest(aError, EFail);
sl@0
   405
				}
sl@0
   406
			break;
sl@0
   407
			}
sl@0
   408
		default:
sl@0
   409
			{
sl@0
   410
			ERR_PRINTF2(_L("Invalid MdaAudioUtility state received: %d"), aMdaAudioUtilityEvent);
sl@0
   411
			StopTest(KErrGeneral);
sl@0
   412
			}
sl@0
   413
		}
sl@0
   414
	}
sl@0
   415
sl@0
   416
/*
sl@0
   417
 *
sl@0
   418
 * MapcInitComplete - From MMdaAudioPlayerCallback
sl@0
   419
 *
sl@0
   420
 */
sl@0
   421
void RMdaPlayerUtilityTestBase::MapcInitComplete(TInt aError, const TTimeIntervalMicroSeconds& /*aDuration*/)
sl@0
   422
	{
sl@0
   423
	INFO_PRINTF1(_L("========== Audio Player Utility MapcInitComplete() callback =========="));
sl@0
   424
	if(iAudioUtilityState == EStateInitializing)
sl@0
   425
		{
sl@0
   426
		INFO_PRINTF1(_L(" Audio Player Utility Event: EEventInitComplete"));
sl@0
   427
		Fsm(EEventInitComplete, aError);
sl@0
   428
		}
sl@0
   429
	}
sl@0
   430
sl@0
   431
/*
sl@0
   432
 *
sl@0
   433
 * MapcPlayComplete - From MMdaAudioPlayerCallback
sl@0
   434
 *
sl@0
   435
 */
sl@0
   436
void RMdaPlayerUtilityTestBase::MapcPlayComplete(TInt aError)
sl@0
   437
	{
sl@0
   438
	INFO_PRINTF1(_L("========== Audio Player Utility MapcPlayComplete() callback =========="));
sl@0
   439
	if (aError == KErrNone)
sl@0
   440
		{
sl@0
   441
		INFO_PRINTF2(_L("AudioPlayerUtility called MapcPlayComplete with error = %d as expected"), aError);
sl@0
   442
		StopTest();
sl@0
   443
		}
sl@0
   444
	else
sl@0
   445
		{
sl@0
   446
		ERR_PRINTF2(_L("AudioPlayerUtility called MapcPlayComplete with error = %d"), aError);
sl@0
   447
		ERR_PRINTF2(_L("Expected error = %d"), KErrNone);
sl@0
   448
		StopTest(aError);
sl@0
   449
		}
sl@0
   450
	}
sl@0
   451
sl@0
   452
/*
sl@0
   453
 *
sl@0
   454
 * Panic
sl@0
   455
 *
sl@0
   456
 */
sl@0
   457
void RMdaPlayerUtilityTestBase::Panic(const TDesC &aCategory, TInt aReason)
sl@0
   458
	{
sl@0
   459
	User::Panic(aCategory, aReason);
sl@0
   460
	}
sl@0
   461
sl@0
   462
/*
sl@0
   463
 *========================================================================================================
sl@0
   464
 * MM-MMF-ACLNT-I-0185-HP
sl@0
   465
 *========================================================================================================
sl@0
   466
 */
sl@0
   467
RMdaPlayerUtiliyPauseStopAndPlayWavTest::RMdaPlayerUtiliyPauseStopAndPlayWavTest(const TDesC& aTestName, const TDesC& aSectName)
sl@0
   468
	:	RMdaPlayerUtilityTestBase(aTestName, aSectName)
sl@0
   469
	{
sl@0
   470
	iStop = ETrue;
sl@0
   471
	iPositionSupported = ETrue;
sl@0
   472
	}
sl@0
   473
sl@0
   474
/*
sl@0
   475
 *
sl@0
   476
 * NewL
sl@0
   477
 *
sl@0
   478
 */
sl@0
   479
RMdaPlayerUtiliyPauseStopAndPlayWavTest* RMdaPlayerUtiliyPauseStopAndPlayWavTest::NewL(const TDesC& aTestName, const TDesC& aSectName)
sl@0
   480
	{
sl@0
   481
	RMdaPlayerUtiliyPauseStopAndPlayWavTest * self = new(ELeave)RMdaPlayerUtiliyPauseStopAndPlayWavTest(aTestName, aSectName);
sl@0
   482
	return self;
sl@0
   483
	}
sl@0
   484
sl@0
   485
/*
sl@0
   486
 *
sl@0
   487
 * DoKickoffTestL
sl@0
   488
 *
sl@0
   489
 */
sl@0
   490
void RMdaPlayerUtiliyPauseStopAndPlayWavTest::DoKickoffTestL()
sl@0
   491
	{
sl@0
   492
	TPtrC filename;
sl@0
   493
	// Get the filename of the audio file to play
sl@0
   494
	if (!GetStringFromConfig(iSectName, KFilenameWAV, filename))
sl@0
   495
		{
sl@0
   496
		ERR_PRINTF1(_L("Filename could not be retrieved from ini file"));
sl@0
   497
		StopTest(KErrNotFound);
sl@0
   498
		return;
sl@0
   499
		}
sl@0
   500
	// open using RFile for playback
sl@0
   501
	iFilename.Copy(filename);
sl@0
   502
	INFO_PRINTF2(_L("File under test  -> %S"), &iFilename);
sl@0
   503
	if (!GetIntFromConfig(iSectName, KDuration1, iDuration))
sl@0
   504
		{
sl@0
   505
		ERR_PRINTF2(KMsgErrorGetParameter, &KDuration1);
sl@0
   506
		StopTest(KErrNotFound);
sl@0
   507
		return;
sl@0
   508
		}
sl@0
   509
	iTimer = CPeriodic::NewL(CActive::EPriorityHigh);
sl@0
   510
	}
sl@0
   511
/*
sl@0
   512
 *========================================================================================================
sl@0
   513
 * MM-MMF-ACLNT-I-0186-HP
sl@0
   514
 *========================================================================================================
sl@0
   515
 */
sl@0
   516
RMdaPlayerUtilityQueryPauseAndPlayWavTest::RMdaPlayerUtilityQueryPauseAndPlayWavTest(const TDesC& aTestName, const TDesC& aSectName)
sl@0
   517
	:	RMdaPlayerUtilityTestBase(aTestName, aSectName)
sl@0
   518
	{
sl@0
   519
	iQuery = ETrue;
sl@0
   520
	}
sl@0
   521
sl@0
   522
/*
sl@0
   523
 *
sl@0
   524
 * NewL
sl@0
   525
 *
sl@0
   526
 */
sl@0
   527
RMdaPlayerUtilityQueryPauseAndPlayWavTest* RMdaPlayerUtilityQueryPauseAndPlayWavTest::NewL(const TDesC& aTestName, const TDesC& aSectName)
sl@0
   528
	{
sl@0
   529
	RMdaPlayerUtilityQueryPauseAndPlayWavTest * self = new(ELeave)RMdaPlayerUtilityQueryPauseAndPlayWavTest(aTestName, aSectName);
sl@0
   530
	return self;
sl@0
   531
	}
sl@0
   532
sl@0
   533
/*
sl@0
   534
 *
sl@0
   535
 * DoKickoffTestL
sl@0
   536
 *
sl@0
   537
 */
sl@0
   538
void RMdaPlayerUtilityQueryPauseAndPlayWavTest::DoKickoffTestL()
sl@0
   539
	{
sl@0
   540
	TPtrC filename;
sl@0
   541
	// Get the filename of the audio file to play
sl@0
   542
	if (!GetStringFromConfig(iSectName, KFilenameWAV, filename))
sl@0
   543
		{
sl@0
   544
		ERR_PRINTF1(_L("Filename could not be retrieved from ini file"));
sl@0
   545
		StopTest(KErrNotFound);
sl@0
   546
		return;
sl@0
   547
		}
sl@0
   548
	// open using RFile for playback
sl@0
   549
	iFilename.Copy(filename);
sl@0
   550
	INFO_PRINTF2(_L("File under test  -> %S"), &iFilename);
sl@0
   551
	if (!GetIntFromConfig(iSectName, KVolume, iVolume))
sl@0
   552
		{
sl@0
   553
		ERR_PRINTF2(KMsgErrorGetParameter, &KVolume);
sl@0
   554
		StopTest(KErrNotFound);
sl@0
   555
		return;
sl@0
   556
		}
sl@0
   557
	if (!GetIntFromConfig(iSectName, KBalance, iBalance))
sl@0
   558
		{
sl@0
   559
		ERR_PRINTF2(KMsgErrorGetParameter, &KBalance);
sl@0
   560
		StopTest(KErrNotFound);
sl@0
   561
		return;
sl@0
   562
		}
sl@0
   563
	if (!GetIntFromConfig(iSectName, KDuration1, iDuration))
sl@0
   564
		{
sl@0
   565
		ERR_PRINTF2(KMsgErrorGetParameter, &KDuration1);
sl@0
   566
		StopTest(KErrNotFound);
sl@0
   567
		return;
sl@0
   568
		}
sl@0
   569
	iTimer = CPeriodic::NewL(CActive::EPriorityHigh);
sl@0
   570
	}
sl@0
   571
sl@0
   572
/*
sl@0
   573
 *========================================================================================================
sl@0
   574
 * MM-MMF-ACLNT-I-0187-HP
sl@0
   575
 *========================================================================================================
sl@0
   576
 */
sl@0
   577
RMdaPlayerUtilityPauseAndPlaySqnTest::RMdaPlayerUtilityPauseAndPlaySqnTest(const TDesC& aTestName, const TDesC& aSectName)
sl@0
   578
	:	RMdaPlayerUtilityTestBase(aTestName, aSectName)
sl@0
   579
	{
sl@0
   580
	iResume = ETrue;
sl@0
   581
	}
sl@0
   582
sl@0
   583
/*
sl@0
   584
 *
sl@0
   585
 * NewL
sl@0
   586
 *
sl@0
   587
 */
sl@0
   588
RMdaPlayerUtilityPauseAndPlaySqnTest* RMdaPlayerUtilityPauseAndPlaySqnTest::NewL(const TDesC& aTestName, const TDesC& aSectName)
sl@0
   589
	{
sl@0
   590
	RMdaPlayerUtilityPauseAndPlaySqnTest * self = new(ELeave)RMdaPlayerUtilityPauseAndPlaySqnTest(aTestName, aSectName);
sl@0
   591
	return self;
sl@0
   592
	}
sl@0
   593
sl@0
   594
/*
sl@0
   595
 *
sl@0
   596
 * DoKickoffTestL
sl@0
   597
 *
sl@0
   598
 */
sl@0
   599
void RMdaPlayerUtilityPauseAndPlaySqnTest::DoKickoffTestL()
sl@0
   600
	{
sl@0
   601
	TPtrC filename;
sl@0
   602
	// Get the filename of the audio file to play
sl@0
   603
	if (!GetStringFromConfig(iSectName, KFilenameSQN, filename))
sl@0
   604
		{
sl@0
   605
		ERR_PRINTF1(_L("Filename could not be retrieved from ini file"));
sl@0
   606
		StopTest(KErrNotFound);
sl@0
   607
		return;
sl@0
   608
		}
sl@0
   609
	// open using RFile for playback
sl@0
   610
	iFilename.Copy(filename);
sl@0
   611
	INFO_PRINTF2(_L("File under test  -> %S"), &iFilename);
sl@0
   612
	if (!GetIntFromConfig(iSectName, KDuration1, iDuration))
sl@0
   613
		{
sl@0
   614
		ERR_PRINTF2(KMsgErrorGetParameter, &KDuration1);
sl@0
   615
		StopTest(KErrNotFound);
sl@0
   616
		return;
sl@0
   617
		}
sl@0
   618
	iTimer = CPeriodic::NewL(CActive::EPriorityHigh);
sl@0
   619
	}
sl@0
   620
sl@0
   621
/*
sl@0
   622
 *========================================================================================================
sl@0
   623
 * MM-MMF-ACLNT-I-0188-HP
sl@0
   624
 *========================================================================================================
sl@0
   625
 */
sl@0
   626
RMdaPlayerUtilityPauseAndPlayThreeTimesSqnTest::RMdaPlayerUtilityPauseAndPlayThreeTimesSqnTest(const TDesC& aTestName, const TDesC& aSectName)
sl@0
   627
	:	RMdaPlayerUtilityTestBase(aTestName, aSectName)
sl@0
   628
	{
sl@0
   629
	iResume = ETrue;
sl@0
   630
	iPauseResumeTimes = KRepeatThrice;
sl@0
   631
	}
sl@0
   632
sl@0
   633
/*
sl@0
   634
 *
sl@0
   635
 * NewL
sl@0
   636
 *
sl@0
   637
 */
sl@0
   638
RMdaPlayerUtilityPauseAndPlayThreeTimesSqnTest* RMdaPlayerUtilityPauseAndPlayThreeTimesSqnTest::NewL(const TDesC& aTestName, const TDesC& aSectName)
sl@0
   639
	{
sl@0
   640
	RMdaPlayerUtilityPauseAndPlayThreeTimesSqnTest * self = new(ELeave)RMdaPlayerUtilityPauseAndPlayThreeTimesSqnTest(aTestName, aSectName);
sl@0
   641
	return self;
sl@0
   642
	}
sl@0
   643
sl@0
   644
/*
sl@0
   645
 *
sl@0
   646
 * DoKickoffTestL
sl@0
   647
 *
sl@0
   648
 */
sl@0
   649
void RMdaPlayerUtilityPauseAndPlayThreeTimesSqnTest::DoKickoffTestL()
sl@0
   650
	{
sl@0
   651
	TPtrC filename;
sl@0
   652
	// Get the filename of the audio file to play
sl@0
   653
	if (!GetStringFromConfig(iSectName, KFilenameSQN, filename))
sl@0
   654
		{
sl@0
   655
		ERR_PRINTF1(_L("Filename could not be retrieved from ini file"));
sl@0
   656
		StopTest(KErrNotFound);
sl@0
   657
		return;
sl@0
   658
		}
sl@0
   659
	// open using RFile for playback
sl@0
   660
	iFilename.Copy(filename);
sl@0
   661
	INFO_PRINTF2(_L("File under test  -> %S"), &iFilename);
sl@0
   662
	if (!GetIntFromConfig(iSectName, KDuration1, iDuration))
sl@0
   663
		{
sl@0
   664
		ERR_PRINTF2(KMsgErrorGetParameter, &KDuration1);
sl@0
   665
		StopTest(KErrNotFound);
sl@0
   666
		return;
sl@0
   667
		}
sl@0
   668
	iTimer = CPeriodic::NewL(CActive::EPriorityHigh);
sl@0
   669
	}
sl@0
   670
sl@0
   671
/*
sl@0
   672
 *========================================================================================================
sl@0
   673
 * MM-MMF-ACLNT-I-0189-HP
sl@0
   674
 *========================================================================================================
sl@0
   675
 */
sl@0
   676
RMdaPlayerUtilityPauseStopAndPlaySqnTest::RMdaPlayerUtilityPauseStopAndPlaySqnTest(const TDesC& aTestName, const TDesC& aSectName)
sl@0
   677
	:	RMdaPlayerUtilityTestBase(aTestName, aSectName)
sl@0
   678
	{
sl@0
   679
	iStop = ETrue;
sl@0
   680
	}
sl@0
   681
sl@0
   682
/*
sl@0
   683
 *
sl@0
   684
 * NewL
sl@0
   685
 *
sl@0
   686
 */
sl@0
   687
RMdaPlayerUtilityPauseStopAndPlaySqnTest* RMdaPlayerUtilityPauseStopAndPlaySqnTest::NewL(const TDesC& aTestName, const TDesC& aSectName)
sl@0
   688
	{
sl@0
   689
	RMdaPlayerUtilityPauseStopAndPlaySqnTest * self = new(ELeave)RMdaPlayerUtilityPauseStopAndPlaySqnTest(aTestName, aSectName);
sl@0
   690
	return self;
sl@0
   691
	}
sl@0
   692
sl@0
   693
/*
sl@0
   694
 *
sl@0
   695
 * DoKickoffTestL
sl@0
   696
 *
sl@0
   697
 */
sl@0
   698
void RMdaPlayerUtilityPauseStopAndPlaySqnTest::DoKickoffTestL()
sl@0
   699
	{
sl@0
   700
	TPtrC filename;
sl@0
   701
	// Get the filename of the audio file to play
sl@0
   702
	if (!GetStringFromConfig(iSectName, KFilenameSQN, filename))
sl@0
   703
		{
sl@0
   704
		ERR_PRINTF1(_L("Filename could not be retrieved from ini file"));
sl@0
   705
		StopTest(KErrNotFound);
sl@0
   706
		return;
sl@0
   707
		}
sl@0
   708
	// open using RFile for playback
sl@0
   709
	iFilename.Copy(filename);
sl@0
   710
	INFO_PRINTF2(_L("File under test  -> %S"), &iFilename);
sl@0
   711
	if (!GetIntFromConfig(iSectName, KDuration1, iDuration))
sl@0
   712
		{
sl@0
   713
		ERR_PRINTF2(KMsgErrorGetParameter, &KDuration1);
sl@0
   714
		StopTest(KErrNotFound);
sl@0
   715
		return;
sl@0
   716
		}
sl@0
   717
	iTimer = CPeriodic::NewL(CActive::EPriorityHigh);
sl@0
   718
	}
sl@0
   719
sl@0
   720
/*
sl@0
   721
 *========================================================================================================
sl@0
   722
 * MM-MMF-ACLNT-I-0190-HP
sl@0
   723
 *========================================================================================================
sl@0
   724
 */
sl@0
   725
RMdaPlayerUtilityGetVolumeAndBalancePauseAndPlaySqnTest::RMdaPlayerUtilityGetVolumeAndBalancePauseAndPlaySqnTest(const TDesC& aTestName, const TDesC& aSectName)
sl@0
   726
	:	RMdaPlayerUtilityTestBase(aTestName, aSectName)
sl@0
   727
	{
sl@0
   728
	iQuery = ETrue;
sl@0
   729
	}
sl@0
   730
sl@0
   731
/*
sl@0
   732
 *
sl@0
   733
 * NewL
sl@0
   734
 *
sl@0
   735
 */
sl@0
   736
RMdaPlayerUtilityGetVolumeAndBalancePauseAndPlaySqnTest* RMdaPlayerUtilityGetVolumeAndBalancePauseAndPlaySqnTest::NewL(const TDesC& aTestName, const TDesC& aSectName)
sl@0
   737
	{
sl@0
   738
	RMdaPlayerUtilityGetVolumeAndBalancePauseAndPlaySqnTest * self = new(ELeave)RMdaPlayerUtilityGetVolumeAndBalancePauseAndPlaySqnTest(aTestName, aSectName);
sl@0
   739
	return self;
sl@0
   740
	}
sl@0
   741
sl@0
   742
/*
sl@0
   743
 *
sl@0
   744
 * DoKickoffTestL
sl@0
   745
 *
sl@0
   746
 */
sl@0
   747
void RMdaPlayerUtilityGetVolumeAndBalancePauseAndPlaySqnTest::DoKickoffTestL()
sl@0
   748
	{
sl@0
   749
	TPtrC filename;
sl@0
   750
	// Get the filename of the audio file to play
sl@0
   751
	if (!GetStringFromConfig(iSectName, KFilenameSQN, filename))
sl@0
   752
		{
sl@0
   753
		ERR_PRINTF1(_L("Filename could not be retrieved from ini file"));
sl@0
   754
		StopTest(KErrNotFound);
sl@0
   755
		return;
sl@0
   756
		}
sl@0
   757
	// open using RFile for playback
sl@0
   758
	iFilename.Copy(filename);
sl@0
   759
	INFO_PRINTF2(_L("File under test  -> %S"), &iFilename);
sl@0
   760
	if (!GetIntFromConfig(iSectName, KVolume, iVolume))
sl@0
   761
		{
sl@0
   762
		ERR_PRINTF2(KMsgErrorGetParameter, &KVolume);
sl@0
   763
		StopTest(KErrNotFound);
sl@0
   764
		return;
sl@0
   765
		}
sl@0
   766
	if (!GetIntFromConfig(iSectName, KBalance, iBalance))
sl@0
   767
		{
sl@0
   768
		ERR_PRINTF2(KMsgErrorGetParameter, &KBalance);
sl@0
   769
		StopTest(KErrNotFound);
sl@0
   770
		return;
sl@0
   771
		}
sl@0
   772
	if (!GetIntFromConfig(iSectName, KDuration1, iDuration))
sl@0
   773
		{
sl@0
   774
		ERR_PRINTF2(KMsgErrorGetParameter, &KDuration1);
sl@0
   775
		StopTest(KErrNotFound);
sl@0
   776
		return;
sl@0
   777
		}
sl@0
   778
	iTimer = CPeriodic::NewL(CActive::EPriorityHigh);
sl@0
   779
	}
sl@0
   780
sl@0
   781
/*
sl@0
   782
 *========================================================================================================
sl@0
   783
 * MM-MMF-ACLNT-I-0191-HP
sl@0
   784
 *========================================================================================================
sl@0
   785
 */
sl@0
   786
RMdaPlayerUtilityPauseAndPlayFormatsTest::RMdaPlayerUtilityPauseAndPlayFormatsTest(const TDesC& aTestName, const TDesC& aSectName)
sl@0
   787
	:	RMdaPlayerUtilityTestBase(aTestName, aSectName)
sl@0
   788
	{
sl@0
   789
	iResume = ETrue;
sl@0
   790
	iPositionSupported = ETrue;
sl@0
   791
	iMiliSec = ETrue;
sl@0
   792
	}
sl@0
   793
sl@0
   794
/*
sl@0
   795
 *
sl@0
   796
 * NewL
sl@0
   797
 *
sl@0
   798
 */
sl@0
   799
RMdaPlayerUtilityPauseAndPlayFormatsTest* RMdaPlayerUtilityPauseAndPlayFormatsTest::NewL(const TDesC& aTestName, const TDesC& aSectName)
sl@0
   800
	{
sl@0
   801
	RMdaPlayerUtilityPauseAndPlayFormatsTest * self = new(ELeave)RMdaPlayerUtilityPauseAndPlayFormatsTest(aTestName, aSectName);
sl@0
   802
	return self;
sl@0
   803
	}
sl@0
   804
sl@0
   805
/*
sl@0
   806
 *
sl@0
   807
 * DoKickoffTestL
sl@0
   808
 *
sl@0
   809
 */
sl@0
   810
void RMdaPlayerUtilityPauseAndPlayFormatsTest::DoKickoffTestL()
sl@0
   811
	{
sl@0
   812
	TPtrC filename;
sl@0
   813
	// Get the filename of the audio file to play
sl@0
   814
	if (!GetStringFromConfig(iSectName, KFilenamePCM16, filename))
sl@0
   815
		{
sl@0
   816
		ERR_PRINTF1(_L("Filename could not be retrieved from ini file"));
sl@0
   817
		StopTest(KErrNotFound);
sl@0
   818
		return;
sl@0
   819
		}
sl@0
   820
	// open using RFile for playback
sl@0
   821
	iFilename.Copy(filename);
sl@0
   822
	INFO_PRINTF2(_L("File \"PCM16\" under test  -> %S"), &iFilename);
sl@0
   823
	if (!GetIntFromConfig(iSectName, KDurationMiliSec, iDuration))
sl@0
   824
		{
sl@0
   825
		ERR_PRINTF2(KMsgErrorGetParameter, &KDurationMiliSec);
sl@0
   826
		StopTest(KErrNotFound);
sl@0
   827
		return;
sl@0
   828
		}
sl@0
   829
	iTimer = CPeriodic::NewL(CActive::EPriorityHigh);
sl@0
   830
	}
sl@0
   831
sl@0
   832
/*
sl@0
   833
 *
sl@0
   834
 * MapcPlayComplete - From MMdaAudioPlayerCallback
sl@0
   835
 *
sl@0
   836
 */
sl@0
   837
void RMdaPlayerUtilityPauseAndPlayFormatsTest::MapcPlayComplete(TInt aError)
sl@0
   838
	{
sl@0
   839
	INFO_PRINTF1(_L("========== Audio Player Utility MapcPlayComplete() callback =========="));
sl@0
   840
	if (aError == KErrNone)
sl@0
   841
		{
sl@0
   842
		if(iPauseApplied)
sl@0
   843
			{
sl@0
   844
			INFO_PRINTF2(_L("AudioPlayerUtility called MapcPlayComplete with error = %d as expected"), aError);
sl@0
   845
			TBuf<KFileFormatSize> fileFormat;
sl@0
   846
			switch(iAllFormat)
sl@0
   847
				{
sl@0
   848
				case EPCM8Format:
sl@0
   849
					{
sl@0
   850
					fileFormat.Copy(KFilenamePCM8);
sl@0
   851
					INFO_PRINTF2(_L("File \"PCM8\" under test  -> %S"), &fileFormat);
sl@0
   852
					break;
sl@0
   853
					}
sl@0
   854
				case EPCMU16Format:
sl@0
   855
					{
sl@0
   856
					fileFormat.Copy(KFilenamePCMU16);
sl@0
   857
					INFO_PRINTF2(_L("File \"PCMU16\" under test  -> %S"), &fileFormat);
sl@0
   858
					break;
sl@0
   859
					}
sl@0
   860
				case EPCMU16BEFormat:
sl@0
   861
					{
sl@0
   862
					fileFormat.Copy(KFilenamePCMU16BE);
sl@0
   863
					INFO_PRINTF2(_L("File \"PCMU16BE\" under test  -> %S"), &fileFormat);
sl@0
   864
					break;
sl@0
   865
					}
sl@0
   866
				case EALAWFormat:
sl@0
   867
					{
sl@0
   868
					fileFormat.Copy(KFilenameAlaw);
sl@0
   869
					INFO_PRINTF2(_L("File \"ALAW\" under test  -> %S"), &fileFormat);
sl@0
   870
					break;
sl@0
   871
					}
sl@0
   872
				case EMULAWFormat:
sl@0
   873
					{
sl@0
   874
					fileFormat.Copy(KFilenameMulaw);
sl@0
   875
					INFO_PRINTF2(_L("File \"MULAW\" under test  -> %S"), &fileFormat);
sl@0
   876
					break;
sl@0
   877
					}
sl@0
   878
				case EGSM610Format:
sl@0
   879
					{
sl@0
   880
					fileFormat.Copy(KFilenameGSM610);
sl@0
   881
					INFO_PRINTF2(_L("File \"GSM610\" under test  -> %S"), &fileFormat);
sl@0
   882
					break;
sl@0
   883
					}
sl@0
   884
				case EIMADFormat:
sl@0
   885
					{
sl@0
   886
					fileFormat.Copy(KFilenameIMAD);
sl@0
   887
					INFO_PRINTF2(_L("File \"IMAD\" under test  -> %S"), &fileFormat);
sl@0
   888
					break;
sl@0
   889
					}
sl@0
   890
				case EPCMU8Format:
sl@0
   891
					{
sl@0
   892
					fileFormat.Copy(KFilenamePCMU8);
sl@0
   893
					INFO_PRINTF2(_L("File \"PCMU8\" under test  -> %S"), &fileFormat);
sl@0
   894
					break;
sl@0
   895
					}
sl@0
   896
				case EOGGFormat:
sl@0
   897
					{
sl@0
   898
					fileFormat.Copy(KFilenameOGG);
sl@0
   899
					INFO_PRINTF2(_L("File \"OGG\" under test  -> %S"), &fileFormat);
sl@0
   900
					break;
sl@0
   901
					}
sl@0
   902
				default:
sl@0
   903
					{
sl@0
   904
					break;
sl@0
   905
					}
sl@0
   906
				}
sl@0
   907
			if(iAllFormat > EOGGFormat)
sl@0
   908
				{
sl@0
   909
				StopTest();
sl@0
   910
				}
sl@0
   911
			else
sl@0
   912
				{
sl@0
   913
				++iAllFormat;
sl@0
   914
				iPauseApplied = EFalse;
sl@0
   915
				TPtrC filename;
sl@0
   916
				if (!GetStringFromConfig(iSectName, fileFormat, filename))
sl@0
   917
					{
sl@0
   918
					ERR_PRINTF1(_L("Filename could not be retrieved from ini file"));
sl@0
   919
					StopTest(KErrNotFound);
sl@0
   920
					return;
sl@0
   921
					}
sl@0
   922
				iFilename.Copy(filename);
sl@0
   923
				INFO_PRINTF1(_L("Player Utility State: EStateCreated"));
sl@0
   924
				iAudioUtilityState = EStateCreated;
sl@0
   925
				INFO_PRINTF1(_L("Audio Player Utility Event: EEventInitialize"));
sl@0
   926
				Fsm(EEventInitialize, KErrNone);
sl@0
   927
				}
sl@0
   928
			}
sl@0
   929
		else
sl@0
   930
			{
sl@0
   931
			ERR_PRINTF2(_L("AudioPlayerUtility called MapcPlayComplete with error = %d"), aError);
sl@0
   932
			ERR_PRINTF1(_L("Audio file was finished before continuing"));
sl@0
   933
			StopTest(KErrGeneral);
sl@0
   934
			}
sl@0
   935
		}
sl@0
   936
	else
sl@0
   937
		{
sl@0
   938
		ERR_PRINTF2(_L("AudioPlayerUtility called MapcPlayComplete with error = %d"), aError);
sl@0
   939
		ERR_PRINTF2(_L("Expected error = %d"), KErrNone);
sl@0
   940
		StopTest(aError);
sl@0
   941
		}
sl@0
   942
	}
sl@0
   943