First public contribution.
1 // Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
2 // All rights reserved.
3 // This component and the accompanying materials are made available
4 // under the terms of "Eclipse Public License v1.0"
5 // which accompanies this distribution, and is available
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
14 // Part of the TSI_MMFACLNT suite that tests CR1566 (TruePause) on AudioPlayerUtility
19 @file PlayTruePause.cpp
22 #include "playtruepause.h"
26 * RMdaPlayerUtilityTestBase - Test step constructor
29 RMdaPlayerUtilityTestBase::RMdaPlayerUtilityTestBase(const TDesC& aTestName, const TDesC& aSectName)
30 : iAudioUtilityState(EStateInitial),
43 iPositionSupported(EFalse),
46 iTestStepName = aTestName;
47 iSectName = aSectName;
52 * ~RMdaPlayerUtilityTestBase - Test step destructor
55 RMdaPlayerUtilityTestBase::~RMdaPlayerUtilityTestBase()
59 delete iPlayerUtility;
69 * KickoffTestL - Starts the test
72 void RMdaPlayerUtilityTestBase::KickoffTestL()
74 INFO_PRINTF1(_L("__________ Creating Player Utility object ___________"));
75 TRAPD(err, iPlayerUtility = CMdaAudioPlayerUtility::NewL(*this));
78 ERR_PRINTF2(_L("Could not create Player Utility object. Error = %d"), err);
82 INFO_PRINTF1(_L("Player Utility State: EStateCreated"));
83 iAudioUtilityState = EStateCreated;
85 INFO_PRINTF1(_L("Audio Player Utility Event: EEventInitialize"));
86 Fsm(EEventInitialize, KErrNone);
94 void RMdaPlayerUtilityTestBase::CloseTest()
96 INFO_PRINTF1(KMsgDelete);
97 delete iPlayerUtility;
103 * StartTimer - Starts timer and timer callback
106 void RMdaPlayerUtilityTestBase::StartTimer(TTimeIntervalMicroSeconds32 aWaitTime)
108 TTimeIntervalMicroSeconds32 timeInterval;
110 if(aWaitTime <= TTimeIntervalMicroSeconds32(0))
112 timeInterval = KMicroSecInOneSec;
116 timeInterval = aWaitTime;
118 TCallBack callback (TimerCallback, this);
119 iTimer->Start(timeInterval, timeInterval, callback);
120 INFO_PRINTF1(_L("Timer has been started"));
128 TInt RMdaPlayerUtilityTestBase::TimerCallback(TAny* aPtr)
130 static_cast<RMdaPlayerUtilityTestBase*>(aPtr)->DoTimerCallback();
139 void RMdaPlayerUtilityTestBase::DoTimerCallback()
141 INFO_PRINTF1(_L("DevSound Event: EEventTimerComplete"));
142 Fsm (EEventTimerComplete, KErrNone);
147 * Fsm - Executes playing events of AudioPlayerUtility in sequence
150 void RMdaPlayerUtilityTestBase::Fsm(TMdaAudioUtilityEvent aMdaAudioUtilityEvent, TInt aError)
152 switch (iAudioUtilityState)
156 __ASSERT_ALWAYS((aError == KErrNone), Panic(iTestStepName.Right(KPanicLength), EFsmIncorrectErrorPassed));
157 if (aMdaAudioUtilityEvent == EEventInitialize)
159 INFO_PRINTF1(_L("Calling CMdaAudioPlayerUtility::OpenFileL"));
160 TRAPD(err,iPlayerUtility->OpenFileL(iFilename));
163 ERR_PRINTF2(_L("CMdaAudioPlayerUtility::OpenFileL left with err = %d"),err);
167 INFO_PRINTF1(_L("AudioPlayerUtility State: EStateInitializing"));
168 iAudioUtilityState = EStateInitializing;
172 ERR_PRINTF2(_L("MdaAudioUtility EEventInitialize not received as expected. Received event: %d"), aMdaAudioUtilityEvent);
173 StopTest(aError, EFail);
177 case EStateInitializing:
179 if (aMdaAudioUtilityEvent == EEventInitComplete && aError == KErrNone)
181 INFO_PRINTF1(_L("Calling CMdaAudioPlayerUtility::Play"));
182 iPlayerUtility->Play();
183 INFO_PRINTF1(_L("AudioPlayerUtility State: EStatePlaying"));
184 iAudioUtilityState = EStatePlaying;
187 StartTimer(iDuration*KMiliSecInOneSec);
191 StartTimer(iDuration*KMicroSecInOneSec);
194 else if (aMdaAudioUtilityEvent == EEventInitComplete && aError != KErrNone)
196 ERR_PRINTF2(_L("MapcInitComplete returned with error = %d"), aError);
201 ERR_PRINTF2(_L("MdaAudioUtility EEventInitComplete not received as expected. Received event: %d"), aMdaAudioUtilityEvent);
202 StopTest(aError, EFail);
208 if(aMdaAudioUtilityEvent == EEventTimerComplete)
210 INFO_PRINTF1(_L("Calling CMdaAudioPlayerUtility::Pause"));
211 TInt err = iPlayerUtility->Pause();
212 iPauseApplied = ETrue;
213 INFO_PRINTF1(_L("AudioPlayerUtility State: EStatePause"));
214 iAudioUtilityState = EStatePause;
218 ERR_PRINTF2(_L("MdaAudioUtility EEventTimerComplete not received as expected. Received event: %d"), aMdaAudioUtilityEvent);
219 StopTest(aError, EFail);
225 if (aMdaAudioUtilityEvent == EEventTimerComplete)
229 INFO_PRINTF2(_L("Setting AudioPlayerUtility volume = %d"), iVolume);
230 TInt err = iPlayerUtility->SetVolume(iVolume);
233 ERR_PRINTF2(_L("Setting volume failed. It returned with error = %d"), err);
238 INFO_PRINTF1(_L("Calling CMdaAudioPlayerUtility::GetVolume for verifying"));
239 err = iPlayerUtility->GetVolume(volume);
242 ERR_PRINTF2(_L("CMdaAudioPlayerUtility::GetVolume returned with error = %d"), err);
246 if(iVolume != volume)
248 ERR_PRINTF2(_L("CMdaAudioPlayerUtility::SetVolume returned different set value = %d"), volume);
249 StopTest(KErrGeneral);
252 INFO_PRINTF2(_L("Setting AudioPlayerUtility balance = %d"), iBalance);
253 err = iPlayerUtility->SetBalance(iBalance);
256 ERR_PRINTF2(_L("Setting balance failed. It returned with error = %d"), err);
261 INFO_PRINTF1(_L("Calling CMdaAudioPlayerUtility::GetBalance for verifying"));
262 err = iPlayerUtility->GetBalance(balance);
265 ERR_PRINTF2(_L("CMdaAudioPlayerUtility::GetBalance returned with error = %d"), err);
269 if(Abs(iBalance - balance)<KBalanceTolerance)
271 INFO_PRINTF2(_L("CMdaAudioPlayerUtility::SetBalance returned expected set value %d"),iBalance);
275 ERR_PRINTF3(_L("CMdaAudioPlayerUtility::SetBalance returned different set value %d. Retrieved %d"), iBalance, balance);
276 StopTest(KErrGeneral);
279 INFO_PRINTF1(_L("Calling CMdaAudioPlayerUtility::Play"));
280 iPlayerUtility->Play();
282 INFO_PRINTF1(_L("Audio Player Utility State: EStatePlaying"));
283 iAudioUtilityState = EStatePlaying;
284 INFO_PRINTF1(_L("Calling CMdaAudioPlayerUtility::GetVolume for verifying"));
285 err = iPlayerUtility->GetVolume(volume);
288 ERR_PRINTF2(_L("CMdaAudioPlayerUtility::GetVolume returned with error = %d"), err);
292 if (volume == iVolume)
294 INFO_PRINTF1(_L("CMdaAudioPlayerUtility::GetVolume returned equal previous set value as expected"));
298 ERR_PRINTF2(_L("CMdaAudioPlayerUtility::GetVolume returned different set value = %d"), iVolume);
299 StopTest (KErrGeneral);
302 INFO_PRINTF1(_L("Calling CMdaAudioPlayerUtility::GetBalance for verifying"));
303 err = iPlayerUtility->GetBalance(balance);
306 ERR_PRINTF2(_L("CMdaAudioPlayerUtility::GetBalance returned with error = %d"), err);
310 if(Abs(iBalance - balance)<KBalanceTolerance)
312 INFO_PRINTF2(_L("CMdaAudioPlayerUtility::GetBalance returned expected set value %d"),iBalance);
316 ERR_PRINTF3(_L("CMdaAudioPlayerUtility::GetBalance returned different set value = %d. Retrieved %d"), iBalance, balance);
317 StopTest(KErrGeneral);
323 TTimeIntervalMicroSeconds position1 = 0;
324 if(iPositionSupported)
326 INFO_PRINTF1(_L("Calling CMdaAudioPlayerUtility::GetPosition"));
327 TInt err = iPlayerUtility->GetPosition(position1);
330 ERR_PRINTF2(_L("CMdaAudioPlayerUtility::GetPosition returned with err = %d"), err);
334 INFO_PRINTF2(_L("AudioPlayerUtility position = %Ld"), position1.Int64());
335 if(position1.Int64() == 0)
337 INFO_PRINTF1(_L("AudioPlayerUtility position must be longer than 0"));
338 StopTest(KErrGeneral);
344 INFO_PRINTF1(_L("Calling CMdaAudioPlayerUtility::Stop"));
345 iPlayerUtility->Stop();
347 INFO_PRINTF1(_L("Calling CMdaAudioPlayerUtility::Play"));
348 iPlayerUtility->Play();
349 if((--iPauseResumeTimes) <= 0)
353 INFO_PRINTF1(_L("AudioPlayerUtility State: EStatePlaying"));
354 iAudioUtilityState = EStatePlaying;
355 TTimeIntervalMicroSeconds position2 = 0;
356 if(iPositionSupported)
358 INFO_PRINTF1(_L("Calling CMdaAudioPlayerUtility::GetPosition"));
359 TInt err = iPlayerUtility->GetPosition(position2);
362 ERR_PRINTF2(_L("CMdaAudioPlayerUtility::GetPosition returned with err = %d"), err);
366 INFO_PRINTF2(_L(" AudioPlayerUtility position = %Ld"), position2.Int64());
370 if(position2.Int64() == 0)
372 INFO_PRINTF1(_L("AudioPlayerUtility position was reset as expected"));
376 INFO_PRINTF1(_L("AudioPlayerUtility position was not reset"));
377 StopTest(KErrGeneral);
381 else if(iPositionSupported)
383 if(Abs(position2.Int64() - position1.Int64()) <= KOneSecond/2)
385 INFO_PRINTF2(_L("AudioPlayerUtility position continued from expected position %Ld"),position2.Int64());
389 ERR_PRINTF3(_L("Playback did not resume from expected position. Expected %Ld Retrieved %Ld"),position1.Int64(),position2.Int64());
390 StopTest(KErrGeneral);
396 INFO_PRINTF1(_L("AudioPlayerUtility continue playing "));
403 ERR_PRINTF2(_L("MdaAudioUtility EEventTimerComplete not received as expected. Received event: %d"), aMdaAudioUtilityEvent);
404 StopTest(aError, EFail);
410 ERR_PRINTF2(_L("Invalid MdaAudioUtility state received: %d"), aMdaAudioUtilityEvent);
411 StopTest(KErrGeneral);
418 * MapcInitComplete - From MMdaAudioPlayerCallback
421 void RMdaPlayerUtilityTestBase::MapcInitComplete(TInt aError, const TTimeIntervalMicroSeconds& /*aDuration*/)
423 INFO_PRINTF1(_L("========== Audio Player Utility MapcInitComplete() callback =========="));
424 if(iAudioUtilityState == EStateInitializing)
426 INFO_PRINTF1(_L(" Audio Player Utility Event: EEventInitComplete"));
427 Fsm(EEventInitComplete, aError);
433 * MapcPlayComplete - From MMdaAudioPlayerCallback
436 void RMdaPlayerUtilityTestBase::MapcPlayComplete(TInt aError)
438 INFO_PRINTF1(_L("========== Audio Player Utility MapcPlayComplete() callback =========="));
439 if (aError == KErrNone)
441 INFO_PRINTF2(_L("AudioPlayerUtility called MapcPlayComplete with error = %d as expected"), aError);
446 ERR_PRINTF2(_L("AudioPlayerUtility called MapcPlayComplete with error = %d"), aError);
447 ERR_PRINTF2(_L("Expected error = %d"), KErrNone);
457 void RMdaPlayerUtilityTestBase::Panic(const TDesC &aCategory, TInt aReason)
459 User::Panic(aCategory, aReason);
463 *========================================================================================================
464 * MM-MMF-ACLNT-I-0185-HP
465 *========================================================================================================
467 RMdaPlayerUtiliyPauseStopAndPlayWavTest::RMdaPlayerUtiliyPauseStopAndPlayWavTest(const TDesC& aTestName, const TDesC& aSectName)
468 : RMdaPlayerUtilityTestBase(aTestName, aSectName)
471 iPositionSupported = ETrue;
479 RMdaPlayerUtiliyPauseStopAndPlayWavTest* RMdaPlayerUtiliyPauseStopAndPlayWavTest::NewL(const TDesC& aTestName, const TDesC& aSectName)
481 RMdaPlayerUtiliyPauseStopAndPlayWavTest * self = new(ELeave)RMdaPlayerUtiliyPauseStopAndPlayWavTest(aTestName, aSectName);
490 void RMdaPlayerUtiliyPauseStopAndPlayWavTest::DoKickoffTestL()
493 // Get the filename of the audio file to play
494 if (!GetStringFromConfig(iSectName, KFilenameWAV, filename))
496 ERR_PRINTF1(_L("Filename could not be retrieved from ini file"));
497 StopTest(KErrNotFound);
500 // open using RFile for playback
501 iFilename.Copy(filename);
502 INFO_PRINTF2(_L("File under test -> %S"), &iFilename);
503 if (!GetIntFromConfig(iSectName, KDuration1, iDuration))
505 ERR_PRINTF2(KMsgErrorGetParameter, &KDuration1);
506 StopTest(KErrNotFound);
509 iTimer = CPeriodic::NewL(CActive::EPriorityHigh);
512 *========================================================================================================
513 * MM-MMF-ACLNT-I-0186-HP
514 *========================================================================================================
516 RMdaPlayerUtilityQueryPauseAndPlayWavTest::RMdaPlayerUtilityQueryPauseAndPlayWavTest(const TDesC& aTestName, const TDesC& aSectName)
517 : RMdaPlayerUtilityTestBase(aTestName, aSectName)
527 RMdaPlayerUtilityQueryPauseAndPlayWavTest* RMdaPlayerUtilityQueryPauseAndPlayWavTest::NewL(const TDesC& aTestName, const TDesC& aSectName)
529 RMdaPlayerUtilityQueryPauseAndPlayWavTest * self = new(ELeave)RMdaPlayerUtilityQueryPauseAndPlayWavTest(aTestName, aSectName);
538 void RMdaPlayerUtilityQueryPauseAndPlayWavTest::DoKickoffTestL()
541 // Get the filename of the audio file to play
542 if (!GetStringFromConfig(iSectName, KFilenameWAV, filename))
544 ERR_PRINTF1(_L("Filename could not be retrieved from ini file"));
545 StopTest(KErrNotFound);
548 // open using RFile for playback
549 iFilename.Copy(filename);
550 INFO_PRINTF2(_L("File under test -> %S"), &iFilename);
551 if (!GetIntFromConfig(iSectName, KVolume, iVolume))
553 ERR_PRINTF2(KMsgErrorGetParameter, &KVolume);
554 StopTest(KErrNotFound);
557 if (!GetIntFromConfig(iSectName, KBalance, iBalance))
559 ERR_PRINTF2(KMsgErrorGetParameter, &KBalance);
560 StopTest(KErrNotFound);
563 if (!GetIntFromConfig(iSectName, KDuration1, iDuration))
565 ERR_PRINTF2(KMsgErrorGetParameter, &KDuration1);
566 StopTest(KErrNotFound);
569 iTimer = CPeriodic::NewL(CActive::EPriorityHigh);
573 *========================================================================================================
574 * MM-MMF-ACLNT-I-0187-HP
575 *========================================================================================================
577 RMdaPlayerUtilityPauseAndPlaySqnTest::RMdaPlayerUtilityPauseAndPlaySqnTest(const TDesC& aTestName, const TDesC& aSectName)
578 : RMdaPlayerUtilityTestBase(aTestName, aSectName)
588 RMdaPlayerUtilityPauseAndPlaySqnTest* RMdaPlayerUtilityPauseAndPlaySqnTest::NewL(const TDesC& aTestName, const TDesC& aSectName)
590 RMdaPlayerUtilityPauseAndPlaySqnTest * self = new(ELeave)RMdaPlayerUtilityPauseAndPlaySqnTest(aTestName, aSectName);
599 void RMdaPlayerUtilityPauseAndPlaySqnTest::DoKickoffTestL()
602 // Get the filename of the audio file to play
603 if (!GetStringFromConfig(iSectName, KFilenameSQN, filename))
605 ERR_PRINTF1(_L("Filename could not be retrieved from ini file"));
606 StopTest(KErrNotFound);
609 // open using RFile for playback
610 iFilename.Copy(filename);
611 INFO_PRINTF2(_L("File under test -> %S"), &iFilename);
612 if (!GetIntFromConfig(iSectName, KDuration1, iDuration))
614 ERR_PRINTF2(KMsgErrorGetParameter, &KDuration1);
615 StopTest(KErrNotFound);
618 iTimer = CPeriodic::NewL(CActive::EPriorityHigh);
622 *========================================================================================================
623 * MM-MMF-ACLNT-I-0188-HP
624 *========================================================================================================
626 RMdaPlayerUtilityPauseAndPlayThreeTimesSqnTest::RMdaPlayerUtilityPauseAndPlayThreeTimesSqnTest(const TDesC& aTestName, const TDesC& aSectName)
627 : RMdaPlayerUtilityTestBase(aTestName, aSectName)
630 iPauseResumeTimes = KRepeatThrice;
638 RMdaPlayerUtilityPauseAndPlayThreeTimesSqnTest* RMdaPlayerUtilityPauseAndPlayThreeTimesSqnTest::NewL(const TDesC& aTestName, const TDesC& aSectName)
640 RMdaPlayerUtilityPauseAndPlayThreeTimesSqnTest * self = new(ELeave)RMdaPlayerUtilityPauseAndPlayThreeTimesSqnTest(aTestName, aSectName);
649 void RMdaPlayerUtilityPauseAndPlayThreeTimesSqnTest::DoKickoffTestL()
652 // Get the filename of the audio file to play
653 if (!GetStringFromConfig(iSectName, KFilenameSQN, filename))
655 ERR_PRINTF1(_L("Filename could not be retrieved from ini file"));
656 StopTest(KErrNotFound);
659 // open using RFile for playback
660 iFilename.Copy(filename);
661 INFO_PRINTF2(_L("File under test -> %S"), &iFilename);
662 if (!GetIntFromConfig(iSectName, KDuration1, iDuration))
664 ERR_PRINTF2(KMsgErrorGetParameter, &KDuration1);
665 StopTest(KErrNotFound);
668 iTimer = CPeriodic::NewL(CActive::EPriorityHigh);
672 *========================================================================================================
673 * MM-MMF-ACLNT-I-0189-HP
674 *========================================================================================================
676 RMdaPlayerUtilityPauseStopAndPlaySqnTest::RMdaPlayerUtilityPauseStopAndPlaySqnTest(const TDesC& aTestName, const TDesC& aSectName)
677 : RMdaPlayerUtilityTestBase(aTestName, aSectName)
687 RMdaPlayerUtilityPauseStopAndPlaySqnTest* RMdaPlayerUtilityPauseStopAndPlaySqnTest::NewL(const TDesC& aTestName, const TDesC& aSectName)
689 RMdaPlayerUtilityPauseStopAndPlaySqnTest * self = new(ELeave)RMdaPlayerUtilityPauseStopAndPlaySqnTest(aTestName, aSectName);
698 void RMdaPlayerUtilityPauseStopAndPlaySqnTest::DoKickoffTestL()
701 // Get the filename of the audio file to play
702 if (!GetStringFromConfig(iSectName, KFilenameSQN, filename))
704 ERR_PRINTF1(_L("Filename could not be retrieved from ini file"));
705 StopTest(KErrNotFound);
708 // open using RFile for playback
709 iFilename.Copy(filename);
710 INFO_PRINTF2(_L("File under test -> %S"), &iFilename);
711 if (!GetIntFromConfig(iSectName, KDuration1, iDuration))
713 ERR_PRINTF2(KMsgErrorGetParameter, &KDuration1);
714 StopTest(KErrNotFound);
717 iTimer = CPeriodic::NewL(CActive::EPriorityHigh);
721 *========================================================================================================
722 * MM-MMF-ACLNT-I-0190-HP
723 *========================================================================================================
725 RMdaPlayerUtilityGetVolumeAndBalancePauseAndPlaySqnTest::RMdaPlayerUtilityGetVolumeAndBalancePauseAndPlaySqnTest(const TDesC& aTestName, const TDesC& aSectName)
726 : RMdaPlayerUtilityTestBase(aTestName, aSectName)
736 RMdaPlayerUtilityGetVolumeAndBalancePauseAndPlaySqnTest* RMdaPlayerUtilityGetVolumeAndBalancePauseAndPlaySqnTest::NewL(const TDesC& aTestName, const TDesC& aSectName)
738 RMdaPlayerUtilityGetVolumeAndBalancePauseAndPlaySqnTest * self = new(ELeave)RMdaPlayerUtilityGetVolumeAndBalancePauseAndPlaySqnTest(aTestName, aSectName);
747 void RMdaPlayerUtilityGetVolumeAndBalancePauseAndPlaySqnTest::DoKickoffTestL()
750 // Get the filename of the audio file to play
751 if (!GetStringFromConfig(iSectName, KFilenameSQN, filename))
753 ERR_PRINTF1(_L("Filename could not be retrieved from ini file"));
754 StopTest(KErrNotFound);
757 // open using RFile for playback
758 iFilename.Copy(filename);
759 INFO_PRINTF2(_L("File under test -> %S"), &iFilename);
760 if (!GetIntFromConfig(iSectName, KVolume, iVolume))
762 ERR_PRINTF2(KMsgErrorGetParameter, &KVolume);
763 StopTest(KErrNotFound);
766 if (!GetIntFromConfig(iSectName, KBalance, iBalance))
768 ERR_PRINTF2(KMsgErrorGetParameter, &KBalance);
769 StopTest(KErrNotFound);
772 if (!GetIntFromConfig(iSectName, KDuration1, iDuration))
774 ERR_PRINTF2(KMsgErrorGetParameter, &KDuration1);
775 StopTest(KErrNotFound);
778 iTimer = CPeriodic::NewL(CActive::EPriorityHigh);
782 *========================================================================================================
783 * MM-MMF-ACLNT-I-0191-HP
784 *========================================================================================================
786 RMdaPlayerUtilityPauseAndPlayFormatsTest::RMdaPlayerUtilityPauseAndPlayFormatsTest(const TDesC& aTestName, const TDesC& aSectName)
787 : RMdaPlayerUtilityTestBase(aTestName, aSectName)
790 iPositionSupported = ETrue;
799 RMdaPlayerUtilityPauseAndPlayFormatsTest* RMdaPlayerUtilityPauseAndPlayFormatsTest::NewL(const TDesC& aTestName, const TDesC& aSectName)
801 RMdaPlayerUtilityPauseAndPlayFormatsTest * self = new(ELeave)RMdaPlayerUtilityPauseAndPlayFormatsTest(aTestName, aSectName);
810 void RMdaPlayerUtilityPauseAndPlayFormatsTest::DoKickoffTestL()
813 // Get the filename of the audio file to play
814 if (!GetStringFromConfig(iSectName, KFilenamePCM16, filename))
816 ERR_PRINTF1(_L("Filename could not be retrieved from ini file"));
817 StopTest(KErrNotFound);
820 // open using RFile for playback
821 iFilename.Copy(filename);
822 INFO_PRINTF2(_L("File \"PCM16\" under test -> %S"), &iFilename);
823 if (!GetIntFromConfig(iSectName, KDurationMiliSec, iDuration))
825 ERR_PRINTF2(KMsgErrorGetParameter, &KDurationMiliSec);
826 StopTest(KErrNotFound);
829 iTimer = CPeriodic::NewL(CActive::EPriorityHigh);
834 * MapcPlayComplete - From MMdaAudioPlayerCallback
837 void RMdaPlayerUtilityPauseAndPlayFormatsTest::MapcPlayComplete(TInt aError)
839 INFO_PRINTF1(_L("========== Audio Player Utility MapcPlayComplete() callback =========="));
840 if (aError == KErrNone)
844 INFO_PRINTF2(_L("AudioPlayerUtility called MapcPlayComplete with error = %d as expected"), aError);
845 TBuf<KFileFormatSize> fileFormat;
850 fileFormat.Copy(KFilenamePCM8);
851 INFO_PRINTF2(_L("File \"PCM8\" under test -> %S"), &fileFormat);
856 fileFormat.Copy(KFilenamePCMU16);
857 INFO_PRINTF2(_L("File \"PCMU16\" under test -> %S"), &fileFormat);
860 case EPCMU16BEFormat:
862 fileFormat.Copy(KFilenamePCMU16BE);
863 INFO_PRINTF2(_L("File \"PCMU16BE\" under test -> %S"), &fileFormat);
868 fileFormat.Copy(KFilenameAlaw);
869 INFO_PRINTF2(_L("File \"ALAW\" under test -> %S"), &fileFormat);
874 fileFormat.Copy(KFilenameMulaw);
875 INFO_PRINTF2(_L("File \"MULAW\" under test -> %S"), &fileFormat);
880 fileFormat.Copy(KFilenameGSM610);
881 INFO_PRINTF2(_L("File \"GSM610\" under test -> %S"), &fileFormat);
886 fileFormat.Copy(KFilenameIMAD);
887 INFO_PRINTF2(_L("File \"IMAD\" under test -> %S"), &fileFormat);
892 fileFormat.Copy(KFilenamePCMU8);
893 INFO_PRINTF2(_L("File \"PCMU8\" under test -> %S"), &fileFormat);
898 fileFormat.Copy(KFilenameOGG);
899 INFO_PRINTF2(_L("File \"OGG\" under test -> %S"), &fileFormat);
907 if(iAllFormat > EOGGFormat)
914 iPauseApplied = EFalse;
916 if (!GetStringFromConfig(iSectName, fileFormat, filename))
918 ERR_PRINTF1(_L("Filename could not be retrieved from ini file"));
919 StopTest(KErrNotFound);
922 iFilename.Copy(filename);
923 INFO_PRINTF1(_L("Player Utility State: EStateCreated"));
924 iAudioUtilityState = EStateCreated;
925 INFO_PRINTF1(_L("Audio Player Utility Event: EEventInitialize"));
926 Fsm(EEventInitialize, KErrNone);
931 ERR_PRINTF2(_L("AudioPlayerUtility called MapcPlayComplete with error = %d"), aError);
932 ERR_PRINTF1(_L("Audio file was finished before continuing"));
933 StopTest(KErrGeneral);
938 ERR_PRINTF2(_L("AudioPlayerUtility called MapcPlayComplete with error = %d"), aError);
939 ERR_PRINTF2(_L("Expected error = %d"), KErrNone);