sl@0: // Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies). sl@0: // All rights reserved. sl@0: // This component and the accompanying materials are made available sl@0: // under the terms of "Eclipse Public License v1.0" sl@0: // which accompanies this distribution, and is available sl@0: // at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: // sl@0: // Initial Contributors: sl@0: // Nokia Corporation - initial contribution. sl@0: // sl@0: // Contributors: sl@0: // sl@0: // Description: sl@0: // This program is designed the test of the MMF_ACLNT. sl@0: // sl@0: // sl@0: sl@0: /** sl@0: @file TestTone.cpp sl@0: */ sl@0: sl@0: sl@0: #include "TestTone.h" sl@0: sl@0: const TInt KHeapSizeToneTestEKA2 = 128000; // Heapsize for tone tests on EKA2 sl@0: sl@0: /** sl@0: * Constructor sl@0: */ sl@0: CTestMmfAclntTone::CTestMmfAclntTone(const TDesC& aTestName, const TInt aExpectedResult) sl@0: { sl@0: // store the name of this test case sl@0: // this is the name that is used by the script file sl@0: // Each test step initialises it's own name sl@0: iTestStepName = aTestName; sl@0: sl@0: // need a bigger heap size on EKA2 HW sl@0: #if !defined __WINS__ sl@0: iHeapSize = KHeapSizeToneTestEKA2; sl@0: #endif // EKA2 sl@0: sl@0: iFrequency = KToneFrequency; sl@0: iDuration = TTimeIntervalMicroSeconds(KOneSecond); sl@0: iExpectedResult = aExpectedResult; sl@0: iStop = ETrue; sl@0: } sl@0: sl@0: CTestMmfAclntTone* CTestMmfAclntTone::NewL(const TDesC& aTestName, const TInt aExpectedResult) sl@0: { sl@0: CTestMmfAclntTone* self = new (ELeave) CTestMmfAclntTone(aTestName,aExpectedResult); sl@0: return self; sl@0: } sl@0: sl@0: void CTestMmfAclntTone::MatoPrepareComplete(TInt aError) sl@0: { sl@0: iError = aError; sl@0: INFO_PRINTF1( _L("CTestMmfAclntTone::MatoPrepareComplete MMdaAudioToneObserver Callback for CMdaAudioToneUtility complete")); sl@0: INFO_PRINTF2( _L("iError %d"), iError); sl@0: if(iStop) sl@0: CActiveScheduler::Stop(); sl@0: } sl@0: sl@0: void CTestMmfAclntTone::MatoPlayComplete(TInt aError) sl@0: { sl@0: iError = aError; sl@0: INFO_PRINTF1( _L("CTestMmfAclntTone::MatoPlayComplete MMdaAudioToneObserver Callback for CMdaAudioToneUtility complete")); sl@0: INFO_PRINTF2( _L("iError %d"), iError); sl@0: if(iStop) sl@0: CActiveScheduler::Stop(); sl@0: } sl@0: sl@0: /** sl@0: * Play a tone sl@0: */ sl@0: TVerdict CTestMmfAclntTone::DoTestStepL() sl@0: { sl@0: INFO_PRINTF1( _L("TestTone : Play")); sl@0: sl@0: iStop = ETrue; sl@0: TVerdict ret = EFail; sl@0: iError = KErrTimedOut; sl@0: sl@0: CMdaAudioToneUtility* toneUtil = CMdaAudioToneUtility::NewL(*this); sl@0: CleanupStack::PushL(toneUtil); sl@0: toneUtil->PrepareToPlayTone(iFrequency,iDuration); sl@0: // Wait for prepare sl@0: INFO_PRINTF1( _L("Initialise CMdaAudioToneUtility")); sl@0: CActiveScheduler::Start(); sl@0: sl@0: if(iError == KErrNone) sl@0: ret = DoTestL(toneUtil); sl@0: sl@0: //produce another tone to confirm that the configuration is retained over multiple plays sl@0: if(iError == KErrNone) sl@0: ret = DoTestL(toneUtil); sl@0: sl@0: if(ret == EFail) sl@0: ERR_PRINTF2( _L("CMdaAudioToneUtility failed with error %d"),iError ); sl@0: sl@0: CleanupStack::PopAndDestroy(toneUtil); sl@0: return ret; sl@0: } sl@0: sl@0: TVerdict CTestMmfAclntTone::DoTestL(CMdaAudioToneUtility* aToneUtil) sl@0: { sl@0: TVerdict ret = EFail; sl@0: iError = KErrTimedOut; sl@0: sl@0: aToneUtil->Play(); sl@0: // wait for play. sl@0: INFO_PRINTF1( _L("Play CMdaAudioToneUtility")); sl@0: CActiveScheduler::Start(); sl@0: sl@0: if(iError == iExpectedResult) sl@0: ret = EPass; sl@0: sl@0: return ret; sl@0: } sl@0: sl@0: //------------------------------------------------------------------ sl@0: sl@0: //Play DualTone Test for Sirocco CR sl@0: CTestMmfAclntDualTone::CTestMmfAclntDualTone(const TDesC& aTestName) sl@0: : CTestMmfAclntTone(aTestName) sl@0: { sl@0: iFreqOne = KToneFrequency; sl@0: iFreqTwo = KToneFrequencyTwo; sl@0: } sl@0: sl@0: CTestMmfAclntDualTone* CTestMmfAclntDualTone::NewL(const TDesC& aTestName) sl@0: { sl@0: CTestMmfAclntDualTone* self = new (ELeave) CTestMmfAclntDualTone(aTestName); sl@0: return self; sl@0: } sl@0: sl@0: sl@0: /** sl@0: * Play a Dual tone sl@0: */ sl@0: sl@0: TVerdict CTestMmfAclntDualTone::DoTestStepL() sl@0: { sl@0: INFO_PRINTF1( _L("TestTone : Play Dual Tone")); sl@0: sl@0: TVerdict ret = EFail; sl@0: iError = KErrTimedOut; sl@0: sl@0: CMdaAudioToneUtility* toneUtil = CMdaAudioToneUtility::NewL(*this); sl@0: CleanupStack::PushL(toneUtil); sl@0: toneUtil->PrepareToPlayDualTone(iFreqOne,iFreqTwo,iDuration); sl@0: sl@0: // Wait for prepare sl@0: INFO_PRINTF1( _L("Initialise CMdaAudioToneUtility")); sl@0: CActiveScheduler::Start(); sl@0: sl@0: if(iError == KErrNone) sl@0: ret = DoTestL(toneUtil); sl@0: sl@0: //produce another tone to confirm that the configuration is retained over multiple plays sl@0: if(iError == KErrNone) sl@0: ret = DoTestL(toneUtil); sl@0: sl@0: if(ret == EFail) sl@0: ERR_PRINTF2( _L("CMdaAudioToneUtility failed with error %d"),iError ); sl@0: sl@0: CleanupStack::PopAndDestroy(toneUtil); sl@0: return ret; sl@0: } sl@0: sl@0: //------------------------------------------------------------------ sl@0: sl@0: sl@0: CTestMmfAclntToneDtmf::CTestMmfAclntToneDtmf(const TDesC& aTestName,const TDesC& aDTMF,const TInt aExpectedResult) sl@0: : CTestMmfAclntTone(aTestName,aExpectedResult), iDTMF(aDTMF) sl@0: {} sl@0: sl@0: CTestMmfAclntToneDtmf* CTestMmfAclntToneDtmf::NewL(const TDesC& aTestName,const TDesC& aDTMF,const TInt aExpectedResult) sl@0: { sl@0: CTestMmfAclntToneDtmf* self = new (ELeave) CTestMmfAclntToneDtmf(aTestName,aDTMF,aExpectedResult); sl@0: return self; sl@0: } sl@0: sl@0: /** sl@0: * Play a DTMF string sl@0: */ sl@0: TVerdict CTestMmfAclntToneDtmf::DoTestStepL() sl@0: { sl@0: INFO_PRINTF1( _L("TestTone : Play DTMF")); sl@0: sl@0: TVerdict ret = EFail; sl@0: iError = KErrTimedOut; sl@0: sl@0: CMdaAudioToneUtility* toneUtil = CMdaAudioToneUtility::NewL(*this); sl@0: CleanupStack::PushL(toneUtil); sl@0: toneUtil->PrepareToPlayDTMFString(iDTMF); sl@0: // Wait for prepare to complete sl@0: INFO_PRINTF1( _L("Initialise CMdaAudioToneUtility")); sl@0: CActiveScheduler::Start(); sl@0: sl@0: toneUtil->PrepareToPlayDTMFString(iDTMF); sl@0: // Wait for prepare to complete sl@0: INFO_PRINTF1( _L("Reinitialise CMdaAudioToneUtility")); sl@0: CActiveScheduler::Start(); sl@0: sl@0: if(iError == KErrNone) sl@0: ret = DoTestL(toneUtil); sl@0: else if (iError == iExpectedResult) sl@0: { sl@0: INFO_PRINTF2( _L("Initialisation failed as expected with code %d"), iError); sl@0: ret = EPass; sl@0: iError = KErrNone; sl@0: } sl@0: sl@0: if(ret == EFail) sl@0: ERR_PRINTF2( _L("CMdaAudioToneUtility failed with error %d"),iError ); sl@0: sl@0: CleanupStack::PopAndDestroy(toneUtil); sl@0: return ret; sl@0: } sl@0: sl@0: //------------------------------------------------------------------ sl@0: sl@0: /** sl@0: * Constructor sl@0: */ sl@0: CTestMmfAclntToneFile::CTestMmfAclntToneFile(const TDesC& aTestName, const TDesC& aSectName, const TDesC& aKeyName) sl@0: : CTestMmfAclntTone(aTestName) sl@0: { sl@0: // store the name of this test case sl@0: // this is the name that is used by the script file sl@0: // Each test step initialises it's own name sl@0: iSectName = aSectName; sl@0: iKeyName= aKeyName; sl@0: } sl@0: sl@0: CTestMmfAclntToneFile* CTestMmfAclntToneFile::NewL(const TDesC& aTestName, const TDesC& aSectName, const TDesC& aKeyName) sl@0: { sl@0: CTestMmfAclntToneFile* self = new (ELeave) CTestMmfAclntToneFile(aTestName,aSectName,aKeyName); sl@0: return self; sl@0: } sl@0: sl@0: TVerdict CTestMmfAclntToneFile::DoTestStepPreambleL() sl@0: { sl@0: TPtrC filename; sl@0: if(!GetStringFromConfig(iSectName, iKeyName, filename)) sl@0: return EInconclusive; sl@0: sl@0: // Create a sequence file sl@0: TInt length; sl@0: RFs fs; sl@0: sl@0: fs.Connect(); sl@0: CleanupClosePushL(fs); sl@0: #ifdef __IPC_V2_PRESENT__ sl@0: User::LeaveIfError(fs.ShareAuto()); sl@0: #else sl@0: User::LeaveIfError(fs.Share(RSessionBase::EExplicitAttach)); sl@0: #endif sl@0: RFile file; sl@0: User::LeaveIfError(file.Replace(fs,filename,EFileWrite)); sl@0: CleanupClosePushL(file); sl@0: User::LeaveIfError(file.Write(KFixedSequenceData())); sl@0: User::LeaveIfError(file.Size(length)); sl@0: CleanupStack::PopAndDestroy(2, &fs); sl@0: sl@0: return CTestMmfAclntStep::DoTestStepPreambleL(); sl@0: } sl@0: sl@0: /** sl@0: * Play a tone file sl@0: */ sl@0: TVerdict CTestMmfAclntToneFile::DoTestStepL( void ) sl@0: { sl@0: INFO_PRINTF1( _L("TestTone : Play File")); sl@0: sl@0: TVerdict ret = EFail; sl@0: sl@0: sl@0: TPtrC filename; sl@0: if(!GetStringFromConfig(iSectName, iKeyName, filename)) sl@0: return EInconclusive; sl@0: sl@0: iError = KErrTimedOut; sl@0: // perform test using this file sl@0: CMdaAudioToneUtility* toneUtil = CMdaAudioToneUtility::NewL(*this); sl@0: CleanupStack::PushL(toneUtil); sl@0: toneUtil->PrepareToPlayFileSequence(filename); sl@0: // Wait for prepare sl@0: INFO_PRINTF1( _L("Initialise CMdaAudioToneUtility")); sl@0: CActiveScheduler::Start(); sl@0: sl@0: toneUtil->PrepareToPlayFileSequence(filename); sl@0: // Wait for prepare sl@0: INFO_PRINTF1( _L("re-initialise CMdaAudioToneUtility")); sl@0: CActiveScheduler::Start(); sl@0: sl@0: if(iError == KErrNone) sl@0: ret = DoTestL(toneUtil); sl@0: sl@0: if(ret == EFail) sl@0: ERR_PRINTF2( _L("CMdaAudioToneUtility failed with error %d"),iError ); sl@0: sl@0: CleanupStack::PopAndDestroy(toneUtil); sl@0: return ret; sl@0: } sl@0: sl@0: //------------------------------------------------------------------ sl@0: sl@0: /** sl@0: * Constructor sl@0: */ sl@0: CTestMmfAclntToneDes::CTestMmfAclntToneDes(const TDesC& aTestName, const TDesC8& aDes, const TInt aExpectedResult) sl@0: : CTestMmfAclntTone(aTestName, aExpectedResult), iDes(aDes) sl@0: {} sl@0: sl@0: CTestMmfAclntToneDes* CTestMmfAclntToneDes::NewL(const TDesC& aTestName, const TDesC8& aDes, const TInt aExpectedResult) sl@0: { sl@0: CTestMmfAclntToneDes* self = new (ELeave) CTestMmfAclntToneDes(aTestName,aDes, aExpectedResult); sl@0: return self; sl@0: } sl@0: sl@0: /** sl@0: * Play a tone from a descriptor. sl@0: */ sl@0: TVerdict CTestMmfAclntToneDes::DoTestStepL() sl@0: { sl@0: INFO_PRINTF1( _L("TestTone : Play Des")); sl@0: sl@0: TVerdict ret = EFail; sl@0: iError = KErrTimedOut; sl@0: sl@0: CMdaAudioToneUtility* toneUtil = CMdaAudioToneUtility::NewL(*this); sl@0: CleanupStack::PushL(toneUtil); sl@0: toneUtil->PrepareToPlayDesSequence(iDes); sl@0: // Wait for prepare sl@0: INFO_PRINTF1( _L("Initialise CMdaAudioToneUtility")); sl@0: CActiveScheduler::Start(); sl@0: sl@0: toneUtil->PrepareToPlayDesSequence(iDes); sl@0: // Wait for prepare sl@0: INFO_PRINTF1( _L("re-initialise CMdaAudioToneUtility")); sl@0: CActiveScheduler::Start(); sl@0: sl@0: if(iError == KErrNone) sl@0: ret = DoTestL(toneUtil); sl@0: sl@0: if(ret == EFail) sl@0: ERR_PRINTF2( _L("CMdaAudioToneUtility failed with error %d"),iError ); sl@0: sl@0: CleanupStack::PopAndDestroy(toneUtil); sl@0: return ret; sl@0: } sl@0: sl@0: //------------------------------------------------------------------ sl@0: sl@0: /** sl@0: * Constructor sl@0: */ sl@0: CTestMmfAclntToneFixed::CTestMmfAclntToneFixed(const TDesC& aTestName,const TInt aTone) sl@0: :CTestMmfAclntTone(aTestName), iTone(aTone) sl@0: {} sl@0: sl@0: CTestMmfAclntToneFixed* CTestMmfAclntToneFixed::NewL(const TDesC& aTestName,const TInt aTone) sl@0: { sl@0: CTestMmfAclntToneFixed* self = new (ELeave) CTestMmfAclntToneFixed(aTestName,aTone); sl@0: return self; sl@0: } sl@0: sl@0: /** sl@0: * Play a predefined/fixed tone sl@0: */ sl@0: TVerdict CTestMmfAclntToneFixed::DoTestStepL() sl@0: { sl@0: #ifdef SYMBIAN_MULTIMEDIA_A3FDEVSOUND sl@0: INFO_PRINTF1( _L("TestTone : Play Fixed - no longer supported")); sl@0: sl@0: TVerdict ret = EFail; sl@0: iError = KErrTimedOut; sl@0: sl@0: CMdaAudioToneUtility* toneUtil = CMdaAudioToneUtility::NewL(*this); sl@0: CleanupStack::PushL(toneUtil); sl@0: toneUtil->PrepareToPlayFixedSequence(iTone); sl@0: // Wait for prepare sl@0: INFO_PRINTF1( _L("Initialise CMdaAudioToneUtility")); sl@0: CActiveScheduler::Start(); sl@0: sl@0: toneUtil->PrepareToPlayFixedSequence(iTone); sl@0: // Wait for prepare sl@0: INFO_PRINTF1( _L("re-initialise CMdaAudioToneUtility")); sl@0: CActiveScheduler::Start(); sl@0: sl@0: // Has Audio Utility intialisied ? sl@0: TInt sequenceCount = toneUtil->FixedSequenceCount(); sl@0: INFO_PRINTF2( _L("FixedSequenceCount() returned %d"),sequenceCount); sl@0: if(sequenceCount <= 0) sl@0: { sl@0: INFO_PRINTF1( _L("Play Fixed Sequence is no longer supported")); sl@0: ret = EPass; sl@0: } sl@0: sl@0: if(ret == EFail) sl@0: ERR_PRINTF2( _L("CMdaAudioToneUtility failed with error %d"),iError ); sl@0: sl@0: CleanupStack::PopAndDestroy(toneUtil); sl@0: return ret; sl@0: sl@0: #else sl@0: INFO_PRINTF1( _L("TestTone : Play Fixed")); sl@0: sl@0: TVerdict ret = EFail; sl@0: iError = KErrTimedOut; sl@0: sl@0: CMdaAudioToneUtility* toneUtil = CMdaAudioToneUtility::NewL(*this); sl@0: CleanupStack::PushL(toneUtil); sl@0: toneUtil->PrepareToPlayFixedSequence(iTone); sl@0: // Wait for prepare sl@0: INFO_PRINTF1( _L("Initialise CMdaAudioToneUtility")); sl@0: CActiveScheduler::Start(); sl@0: sl@0: toneUtil->PrepareToPlayFixedSequence(iTone); sl@0: // Wait for prepare sl@0: INFO_PRINTF1( _L("re-initialise CMdaAudioToneUtility")); sl@0: CActiveScheduler::Start(); sl@0: sl@0: // Has Audio Utility intialisied ? sl@0: TInt sequenceCount = toneUtil->FixedSequenceCount() ; sl@0: if((iError == KErrNone) && (sequenceCount > 0)) sl@0: { sl@0: INFO_PRINTF2( _L("FixedSequenceName is %S"), &toneUtil->FixedSequenceName(sequenceCount - 1)) ; sl@0: ret = DoTestL(toneUtil); sl@0: } sl@0: sl@0: if(ret == EFail) sl@0: ERR_PRINTF2( _L("CMdaAudioToneUtility failed with error %d"),iError ); sl@0: sl@0: CleanupStack::PopAndDestroy(toneUtil); sl@0: return ret; sl@0: #endif sl@0: } sl@0: //------------------------------------------------------------------ sl@0: sl@0: /** sl@0: * Constructor sl@0: */ sl@0: CTestMmfAclntToneAudio::CTestMmfAclntToneAudio() sl@0: { sl@0: // store the name of this test case sl@0: // this is the name that is used by the script file sl@0: // Each test step initialises it's own name sl@0: iTestStepName = _L("MM-MMF-ACLNT-I-0156-LP"); sl@0: sl@0: // this test does not inherit from CTestMmfAclntTone sl@0: // so we need to make the heap bigger here sl@0: // need a bigger heap size on EKA2 HW sl@0: #if !defined __WINS__ sl@0: iHeapSize = KHeapSizeToneTestEKA2; sl@0: #endif // EKA2 sl@0: } sl@0: sl@0: void CTestMmfAclntToneAudio::MatoPrepareComplete(TInt aError) sl@0: { sl@0: iToneError = aError; sl@0: INFO_PRINTF1( _L("CTestMmfAclntToneAudio::MatoPrepareComplete MMdaAudioToneObserver Callback for CMdaAudioToneUtility complete")); sl@0: INFO_PRINTF2( _L("iToneError %d"), iToneError); sl@0: CActiveScheduler::Stop(); sl@0: } sl@0: sl@0: void CTestMmfAclntToneAudio::MatoPlayComplete(TInt aError) sl@0: { sl@0: INFO_PRINTF1( _L("CTestMmfAclntToneAudio::MatoPlayComplete MMdaAudioToneObserver Callback for CMdaAudioToneUtility called")); sl@0: iToneError = aError; sl@0: INFO_PRINTF2( _L("iToneError %d"), iToneError); sl@0: sl@0: if((--iCallbackCount) == 0) sl@0: CActiveScheduler::Stop(); sl@0: } sl@0: sl@0: void CTestMmfAclntToneAudio::MapcInitComplete(TInt aError, const TTimeIntervalMicroSeconds& /*aDuration*/) sl@0: { sl@0: iPlayerError = aError; sl@0: CActiveScheduler::Stop(); sl@0: } sl@0: sl@0: void CTestMmfAclntToneAudio::MapcPlayComplete(TInt aError) sl@0: { sl@0: INFO_PRINTF1( _L("CTestMmfAclntToneAudio::MatcPlayComplete MMdaAudioPlayerCallback for CMdaAudioPlayerUtility called")); sl@0: iPlayerError = aError; sl@0: INFO_PRINTF2( _L("iPlayerError %d"), iPlayerError); sl@0: sl@0: if((--iCallbackCount) == 0) sl@0: CActiveScheduler::Stop(); sl@0: } sl@0: sl@0: //------------------------------------------------------------------ sl@0: sl@0: /** sl@0: * Playing a tone and playing an audio file. sl@0: */ sl@0: TVerdict CTestMmfAclntToneAudio::DoTestStepL( void ) sl@0: { sl@0: INFO_PRINTF1( _L("TestTone : Tone/File")); sl@0: sl@0: TBuf filename; sl@0: TPtrC filename1; sl@0: if(!GetStringFromConfig(_L("SectionOne"), _L("playerAudioFile"), filename1)) sl@0: return EInconclusive; sl@0: sl@0: GetDriveName(filename); sl@0: filename.Append(filename1); sl@0: sl@0: iPlayerError = KErrTimedOut; sl@0: CMdaAudioPlayerUtility* playerUtility = sl@0: //CMdaAudioPlayerUtility::NewFilePlayerL(filename,*this);//, EPriorityHigh); sl@0: CMdaAudioPlayerUtility::NewFilePlayerL(filename,*this, EPriorityNormal); sl@0: sl@0: CleanupStack::PushL(playerUtility); sl@0: sl@0: // Wait for prepare sl@0: INFO_PRINTF1( _L("Initialise CMdaAudioPlayerUtility")); sl@0: CActiveScheduler::Start(); sl@0: sl@0: if(iPlayerError == KErrNone) sl@0: { sl@0: iToneError = KErrTimedOut; sl@0: INFO_PRINTF1( _L("Create audio tone utility...")); sl@0: CMdaAudioToneUtility* toneUtil = CMdaAudioToneUtility::NewL(*this); sl@0: CleanupStack::PushL(toneUtil); sl@0: sl@0: INFO_PRINTF1( _L("Prepare to play tone...")); sl@0: toneUtil->PrepareToPlayTone(KToneFrequency,TTimeIntervalMicroSeconds(KOneSecond)); sl@0: // Wait for prepare sl@0: INFO_PRINTF1( _L("Initialise CMdaAudioToneUtility")); sl@0: CActiveScheduler::Start(); sl@0: sl@0: INFO_PRINTF1( _L("Re-prepare to play tone...")); sl@0: toneUtil->PrepareToPlayTone(KToneFrequency,TTimeIntervalMicroSeconds(KOneSecond)); sl@0: // Wait for prepare sl@0: INFO_PRINTF1( _L("Initialise CMdaAudioToneUtility")); sl@0: CActiveScheduler::Start(); sl@0: sl@0: toneUtil->SetPriority(EPriorityHigh, EMdaPriorityPreferenceNone); sl@0: if(iToneError == KErrNone) sl@0: { sl@0: iPlayerError = KErrTimedOut; sl@0: iToneError = KErrTimedOut; sl@0: sl@0: // play files together sl@0: INFO_PRINTF1( _L("Play CMdaAudioPlayerUtility")); sl@0: playerUtility->Play(); sl@0: INFO_PRINTF1( _L("Play CMdaAudioToneUtility")); sl@0: toneUtil->Play(); sl@0: sl@0: iCallbackCount = 2; sl@0: CActiveScheduler::Start(); sl@0: // Wait for two callbacks sl@0: sl@0: //Tone utility is at priority high - should complete normally sl@0: //Player is at priority normal should complete with KErrInUse sl@0: //KErrAccessDenied is OK here, at least until we can do Mixing sl@0: if(iToneError==KErrNone && (iPlayerError==KErrInUse || iPlayerError==KErrNone)) sl@0: { sl@0: CleanupStack::PopAndDestroy(2); // playerUtility, toneUtil sl@0: return EPass; sl@0: } sl@0: } sl@0: CleanupStack::PopAndDestroy(toneUtil); sl@0: } sl@0: else sl@0: INFO_PRINTF1( _L("Cannot initialise CMdaAudioPlayerUtility")); sl@0: sl@0: ERR_PRINTF2( _L("CMdaAudioToneUtility completed with player error %d"),iPlayerError ); sl@0: ERR_PRINTF2( _L("CMdaAudioToneUtility completed with tone error %d"),iToneError ); sl@0: CleanupStack::PopAndDestroy(playerUtility); sl@0: return EFail; sl@0: } sl@0: sl@0: //------------------------------------------------------------------ sl@0: sl@0: /** Constructor sl@0: */ sl@0: CTestMmfAclntToneCancelP::CTestMmfAclntToneCancelP(const TDesC& aTestName) sl@0: :CTestMmfAclntTone(aTestName) sl@0: {} sl@0: sl@0: CTestMmfAclntToneCancelP* CTestMmfAclntToneCancelP::NewL(const TDesC& aTestName) sl@0: { sl@0: CTestMmfAclntToneCancelP* self = new (ELeave) CTestMmfAclntToneCancelP(aTestName); sl@0: return self; sl@0: } sl@0: sl@0: /** sl@0: * Cancel tone play sl@0: */ sl@0: TVerdict CTestMmfAclntToneCancelP::DoTestL(CMdaAudioToneUtility* aToneUtil) sl@0: { sl@0: INFO_PRINTF1( _L("TestTone : Cancel Play")); sl@0: sl@0: iStop = EFalse; sl@0: TVerdict ret = EFail; sl@0: sl@0: aToneUtil->Play(); sl@0: INFO_PRINTF1( _L("Play CMdaAudioToneUtility")); sl@0: if(aToneUtil->State() == EMdaAudioToneUtilityPlaying) sl@0: { sl@0: // cancel play. sl@0: INFO_PRINTF1( _L("Cancel Play CMdaAudioToneUtility")); sl@0: aToneUtil->CancelPlay(); sl@0: // make sure tone is no longer playing sl@0: if(aToneUtil->State() != EMdaAudioToneUtilityPlaying) sl@0: ret = EPass; sl@0: } sl@0: return ret; sl@0: } sl@0: sl@0: //------------------------------------------------------------------ sl@0: /** sl@0: * Constructor sl@0: */ sl@0: CTestMmfAclntToneCancelIni::CTestMmfAclntToneCancelIni(const TDesC& aTestName) sl@0: :CTestMmfAclntTone(aTestName) sl@0: {} sl@0: sl@0: CTestMmfAclntToneCancelIni* CTestMmfAclntToneCancelIni::NewL(const TDesC& aTestName) sl@0: { sl@0: CTestMmfAclntToneCancelIni* self = new (ELeave) CTestMmfAclntToneCancelIni(aTestName); sl@0: return self; sl@0: } sl@0: sl@0: /** sl@0: * Cancel tone prepare. sl@0: * sl@0: * This fucntion cannot leave sl@0: */ sl@0: TVerdict CTestMmfAclntToneCancelIni::DoTestStepL() sl@0: { sl@0: INFO_PRINTF1( _L("TestTone : Cancel Prepare")); sl@0: sl@0: TVerdict ret = EFail; sl@0: iError = KErrTimedOut; sl@0: sl@0: CMdaAudioToneUtility* toneUtil = CMdaAudioToneUtility::NewL(*this); sl@0: CleanupStack::PushL(toneUtil); sl@0: INFO_PRINTF1( _L("Initialise CMdaAudioToneUtility")); sl@0: toneUtil->PrepareToPlayFixedSequence(0); sl@0: INFO_PRINTF1( _L("Cancel Prep CMdaAudioToneUtility")); sl@0: toneUtil->CancelPrepare(); sl@0: // make sure init callback did not complete sl@0: if((iError == KErrTimedOut) && (toneUtil->State() != EMdaAudioToneUtilityPrepared)) sl@0: ret = EPass; sl@0: sl@0: if(ret == EFail) sl@0: ERR_PRINTF2( _L("CMdaAudioToneUtility failed with error %d"),iError ); sl@0: sl@0: CleanupStack::PopAndDestroy(toneUtil); sl@0: return ret; sl@0: } sl@0: sl@0: //------------------------------------------------------------------ sl@0: sl@0: /** sl@0: * Constructor sl@0: */ sl@0: CTestMmfAclntToneNames::CTestMmfAclntToneNames(const TDesC& aTestName) sl@0: :CTestMmfAclntToneFixed(aTestName,1) sl@0: {} sl@0: sl@0: CTestMmfAclntToneNames* CTestMmfAclntToneNames::NewL(const TDesC& aTestName) sl@0: { sl@0: CTestMmfAclntToneNames* self = new (ELeave) CTestMmfAclntToneNames(aTestName); sl@0: return self; sl@0: } sl@0: sl@0: /** sl@0: * Enquire sequence name sl@0: * sl@0: * This function cannot leave sl@0: */ sl@0: TVerdict CTestMmfAclntToneNames::DoTestL(CMdaAudioToneUtility* aToneUtil) sl@0: { sl@0: INFO_PRINTF1( _L("TestTone : Seq Name")); sl@0: sl@0: TVerdict ret = EPass; sl@0: TBuf<32> seqName; sl@0: TInt count = aToneUtil->FixedSequenceCount(); sl@0: sl@0: for(TInt i = 0; i < count; i++) sl@0: { sl@0: seqName = aToneUtil->FixedSequenceName(i); sl@0: if(seqName.Length() < 1) sl@0: { sl@0: ret = EFail; sl@0: break; sl@0: } sl@0: } sl@0: return ret; sl@0: } sl@0: sl@0: //------------------------------------------------------------------ sl@0: sl@0: /** sl@0: * Constructor sl@0: */ sl@0: CTestMmfAclntToneCount::CTestMmfAclntToneCount(const TDesC& aTestName) sl@0: :CTestMmfAclntToneFixed(aTestName,1) sl@0: {} sl@0: sl@0: CTestMmfAclntToneCount* CTestMmfAclntToneCount::NewL(const TDesC& aTestName) sl@0: { sl@0: CTestMmfAclntToneCount* self = new (ELeave) CTestMmfAclntToneCount(aTestName); sl@0: return self; sl@0: } sl@0: sl@0: /** sl@0: * Enquire sequence count sl@0: */ sl@0: TVerdict CTestMmfAclntToneCount::DoTestL(CMdaAudioToneUtility* aToneUtil) sl@0: { sl@0: INFO_PRINTF1( _L("TestTone : Seq Count")); sl@0: sl@0: iError = KErrTimedOut; sl@0: sl@0: if(aToneUtil->FixedSequenceCount() == KFixedSequenceCount) sl@0: return EPass; sl@0: sl@0: return EFail ; sl@0: } sl@0: sl@0: //------------------------------------------------------------------ sl@0: sl@0: /** sl@0: * Constructor sl@0: */ sl@0: CTestMmfAclntToneVolume::CTestMmfAclntToneVolume(const TDesC& aTestName,const TInt aVolume) sl@0: :CTestMmfAclntTone(aTestName), iVolume(aVolume) sl@0: {} sl@0: sl@0: CTestMmfAclntToneVolume* CTestMmfAclntToneVolume::NewL(const TDesC& aTestName,const TInt aVolume) sl@0: { sl@0: CTestMmfAclntToneVolume* self = new (ELeave) CTestMmfAclntToneVolume(aTestName,aVolume); sl@0: return self; sl@0: } sl@0: sl@0: /** sl@0: * Set volume to max and enquire volume sl@0: */ sl@0: TVerdict CTestMmfAclntToneVolume::DoTestL(CMdaAudioToneUtility* aToneUtil) sl@0: { sl@0: INFO_PRINTF1( _L("TestTone : Volume")); sl@0: sl@0: TVerdict ret = EFail; sl@0: sl@0: // added from CTestMmfAclntTone : we need the device to be open before sl@0: // SetVolume() will function correctly sl@0: sl@0: aToneUtil->Play(); sl@0: // wait for play. sl@0: INFO_PRINTF1( _L("Play CMdaAudioToneUtility")); sl@0: sl@0: // don't wait for it to finish - run this test while playing sl@0: // so we know device is open sl@0: sl@0: // Check maxvolume function sl@0: if(iVolume == -1) sl@0: { sl@0: iVolume = aToneUtil->MaxVolume(); sl@0: aToneUtil->SetVolume(iVolume); sl@0: INFO_PRINTF3(_L("volume = %d iVolume = %d"), aToneUtil->Volume(), iVolume); sl@0: if(aToneUtil->Volume() == iVolume) sl@0: ret = EPass; sl@0: } sl@0: // Volume is truncated to maxvolume sl@0: if(iVolume > aToneUtil->MaxVolume()) sl@0: { sl@0: aToneUtil->SetVolume(iVolume); sl@0: INFO_PRINTF3(_L("volume = %d maxVolume = %d"), aToneUtil->Volume(), aToneUtil->MaxVolume()); sl@0: if(aToneUtil->Volume() == aToneUtil->MaxVolume()) sl@0: ret = EPass; sl@0: } sl@0: // Volume is truncated to 0 sl@0: else if(iVolume < 0) sl@0: { sl@0: aToneUtil->SetVolume(iVolume); sl@0: INFO_PRINTF2(_L("volume = %d, expecting 0"), aToneUtil->Volume()); sl@0: if(aToneUtil->Volume() == 0) sl@0: ret = EPass; sl@0: } sl@0: // Set volume and check sl@0: else sl@0: { sl@0: aToneUtil->SetVolume(iVolume); sl@0: INFO_PRINTF3(_L("volume = %d iVolume = %d"), aToneUtil->Volume(), iVolume); sl@0: if(aToneUtil->Volume() == iVolume) sl@0: ret = EPass; sl@0: } sl@0: sl@0: // let it finish playing sl@0: CActiveScheduler::Start(); sl@0: sl@0: return ret; sl@0: } sl@0: sl@0: sl@0: //------------------------------------------------------------------ sl@0: sl@0: /** sl@0: * Constructor sl@0: */ sl@0: CTestMmfAclntVolumeRamp::CTestMmfAclntVolumeRamp(const TDesC& aTestName, const TInt aRamp) sl@0: :CTestMmfAclntTone(aTestName), iRamp(aRamp) sl@0: {} sl@0: sl@0: CTestMmfAclntVolumeRamp* CTestMmfAclntVolumeRamp::NewL(const TDesC& aTestName, const TInt aRamp) sl@0: { sl@0: CTestMmfAclntVolumeRamp* self = new (ELeave) CTestMmfAclntVolumeRamp(aTestName,aRamp); sl@0: return self; sl@0: } sl@0: sl@0: /** sl@0: * Set volume ramp sl@0: * This function cannot leave sl@0: */ sl@0: TVerdict CTestMmfAclntVolumeRamp::DoTestL(CMdaAudioToneUtility* aToneUtil) sl@0: { sl@0: sl@0: INFO_PRINTF1( _L("TestTone : Ramp")); sl@0: sl@0: TTimeIntervalMicroSeconds ramp(iRamp); sl@0: aToneUtil->SetVolumeRamp(ramp); sl@0: sl@0: // aToneUtil->[Get]VolumeRamp() doesn't exist. sl@0: // For now, if SetVolumeRamp() doesn't panic, we have to return EPass. sl@0: // In future, maybe we can play the clip and get the volume at intervals? sl@0: INFO_PRINTF1(_L("Warning : no API function to get volume ramp")); sl@0: sl@0: return EPass; sl@0: } sl@0: sl@0: //------------------------------------------------------------------ sl@0: sl@0: /** sl@0: * Constructor sl@0: */ sl@0: CTestMmfAclntToneRepeat::CTestMmfAclntToneRepeat(const TDesC& aTestName) sl@0: :CTestMmfAclntTone(aTestName) sl@0: {} sl@0: sl@0: CTestMmfAclntToneRepeat* CTestMmfAclntToneRepeat::NewL(const TDesC& aTestName) sl@0: { sl@0: CTestMmfAclntToneRepeat* self = new (ELeave) CTestMmfAclntToneRepeat(aTestName); sl@0: return self; sl@0: } sl@0: sl@0: /** sl@0: * Set repeats sl@0: */ sl@0: TVerdict CTestMmfAclntToneRepeat::DoTestL(CMdaAudioToneUtility* aToneUtil) sl@0: { sl@0: INFO_PRINTF1( _L("TestTone : Repeats")); sl@0: sl@0: iError = KErrTimedOut; sl@0: sl@0: TTimeIntervalMicroSeconds silence(0); sl@0: aToneUtil->SetRepeats(NUMBER_OF_REPEATS,silence); sl@0: sl@0: TInt duration = I64INT(iDuration.Int64()); sl@0: sl@0: iError = KErrTimedOut; sl@0: INFO_PRINTF1( _L("Play CMdaAudioToneUtility")); sl@0: aToneUtil->Play(); sl@0: sl@0: TTime start; sl@0: start.HomeTime(); sl@0: CActiveScheduler::Start(); sl@0: TTime stop; sl@0: stop.HomeTime(); sl@0: sl@0: TUint actualDuration = I64INT(stop.MicroSecondsFrom(start).Int64()); sl@0: sl@0: INFO_PRINTF2(_L("Repeats : %d"), NUMBER_OF_REPEATS); sl@0: INFO_PRINTF6(_L("Error : %d Start = %d Stop = %d Duration = %d ActualDuration = %d"), sl@0: iError, I64INT(start.Int64()), I64INT(stop.Int64()), duration, actualDuration); sl@0: sl@0: if((iError == KErrNone) && (TimeComparison(actualDuration, duration * (NUMBER_OF_REPEATS + 1), sl@0: KExpectedDeviation * NUMBER_OF_REPEATS))) sl@0: return EPass; sl@0: sl@0: return EFail ; sl@0: } sl@0: sl@0: //------------------------------------------------------------------ sl@0: sl@0: /** sl@0: * Constructor sl@0: */ sl@0: CTestMmfAclntToneLength::CTestMmfAclntToneLength(const TDesC& aTestName) sl@0: :CTestMmfAclntToneDtmf(aTestName,KShortDTMFString) sl@0: {} sl@0: sl@0: CTestMmfAclntToneLength* CTestMmfAclntToneLength::NewL(const TDesC& aTestName) sl@0: { sl@0: CTestMmfAclntToneLength* self = new (ELeave) CTestMmfAclntToneLength(aTestName); sl@0: return self; sl@0: } sl@0: sl@0: /** sl@0: * Configure tone on length, tone off length, pause length of DTMF Tones sl@0: */ sl@0: TVerdict CTestMmfAclntToneLength::DoTestL(CMdaAudioToneUtility* aToneUtil) sl@0: { sl@0: INFO_PRINTF1( _L("TestTone : Length")); sl@0: sl@0: iError = KErrTimedOut; sl@0: TTimeIntervalMicroSeconds32 on(KOneSecond), off(KOneSecond), pause(0); sl@0: sl@0: aToneUtil->SetDTMFLengths(on, off, pause); sl@0: sl@0: iError = KErrTimedOut; sl@0: INFO_PRINTF1( _L("Play CMdaAudioToneUtility")); sl@0: aToneUtil->Play(); sl@0: sl@0: TTime start; sl@0: start.HomeTime(); sl@0: CActiveScheduler::Start(); sl@0: TTime stop; sl@0: stop.HomeTime(); sl@0: sl@0: TUint actualDuration = I64INT(stop.MicroSecondsFrom(start).Int64()); sl@0: sl@0: INFO_PRINTF6(_L("Error : %d Start = %d Stop = %d Duration = %d ActualDuration = %d"), sl@0: iError, I64INT(start.Int64()), I64INT(stop.Int64()), KTwoSeconds, actualDuration); sl@0: sl@0: if((iError == KErrNone) && (TimeComparison(actualDuration, KTwoSeconds, KExpectedDeviation))) sl@0: return EPass; sl@0: sl@0: return EFail ; sl@0: } sl@0: sl@0: //------------------------------------------------------------------ sl@0: sl@0: /** sl@0: * Constructor sl@0: */ sl@0: CTestMmfAclntPriorityTones::CTestMmfAclntPriorityTones() sl@0: { sl@0: // store the name of this test case sl@0: // this is the name that is used by the script file sl@0: // Each test step initialises it's own name sl@0: iTestStepName = _L("MM-MMF-ACLNT-I-0165-HP"); sl@0: } sl@0: sl@0: void CTestMmfAclntPriorityTones::MchoComplete(TInt aID, TInt aError) sl@0: { sl@0: INFO_PRINTF1( _L("CTestMmfAclntPriorityTones : MMdaAudioToneObserver Callback for CMdaAudioToneUtility called")); sl@0: iError = aError; sl@0: INFO_PRINTF3( _L("iError %d ID %d"), iError, aID); sl@0: sl@0: if(iFirstCallback == -1) sl@0: iFirstCallback = aID; sl@0: sl@0: if((--iCallbackCount) == 0) sl@0: CActiveScheduler::Stop(); sl@0: } sl@0: sl@0: /** sl@0: * Set priorities of tones sl@0: */ sl@0: TVerdict CTestMmfAclntPriorityTones::DoTestStepL() sl@0: { sl@0: INFO_PRINTF1( _L("TestTone : Priorities")); sl@0: sl@0: iError = KErrTimedOut; sl@0: sl@0: CMdaAudioToneUtility* toneUtil[2]; sl@0: CToneCallbackHandler* callback[2]; sl@0: sl@0: for(TInt i=0; i<2; i++) sl@0: { sl@0: callback[i] = new (ELeave) CToneCallbackHandler(i,this); sl@0: CleanupStack::PushL(callback[i]); sl@0: } sl@0: sl@0: toneUtil[0] = CMdaAudioToneUtility::NewL(*callback[0],NULL, -10, EMdaPriorityPreferenceTimeAndQuality); sl@0: CleanupStack::PushL(toneUtil[0]); sl@0: toneUtil[1] = CMdaAudioToneUtility::NewL(*callback[1],NULL, 0, EMdaPriorityPreferenceTimeAndQuality); sl@0: CleanupStack::PushL(toneUtil[1]); sl@0: sl@0: toneUtil[0]->PrepareToPlayDTMFString(KDTMFString); sl@0: toneUtil[1]->PrepareToPlayDTMFString(KDTMFString); sl@0: sl@0: // wait for initilisation callback sl@0: iCallbackCount = 2; sl@0: INFO_PRINTF1( _L("Initialise CMdaAudioToneUtility")); sl@0: INFO_PRINTF1( _L("Initialise CMdaAudioToneUtility")); sl@0: CActiveScheduler::Start(); sl@0: sl@0: if(iError == KErrNone) sl@0: { sl@0: iError = KErrTimedOut; sl@0: sl@0: toneUtil[0]->Play(); sl@0: toneUtil[1]->Play(); sl@0: sl@0: INFO_PRINTF1( _L("Play CMdaAudioToneUtility")); sl@0: INFO_PRINTF1( _L("Play CMdaAudioToneUtility")); sl@0: sl@0: // wait for play to complete sl@0: iCallbackCount = 2; sl@0: iFirstCallback = -1; sl@0: CActiveScheduler::Start(); sl@0: sl@0: if((iError == KErrNone) && (iFirstCallback == 0)) sl@0: { sl@0: CleanupStack::PopAndDestroy(4); sl@0: return EPass; sl@0: } sl@0: } sl@0: sl@0: ERR_PRINTF2( _L("CMdaAudioToneUtility failed with error %d"),iError ); sl@0: sl@0: CleanupStack::PopAndDestroy(4); sl@0: return EFail ; sl@0: } sl@0: sl@0: //------------------------------------------------------------------ sl@0: sl@0: /** sl@0: * Constructor sl@0: */ sl@0: CTestMmfAclntToneBalance::CTestMmfAclntToneBalance(const TDesC& aTestName,const TInt aBalance) sl@0: :CTestMmfAclntTone(aTestName) ,iBalance(aBalance) sl@0: {} sl@0: sl@0: CTestMmfAclntToneBalance* CTestMmfAclntToneBalance::NewL(const TDesC& aTestName,const TInt aBalance) sl@0: { sl@0: CTestMmfAclntToneBalance* self = new (ELeave) CTestMmfAclntToneBalance(aTestName,aBalance); sl@0: return self; sl@0: } sl@0: sl@0: /** sl@0: * Set balance and enquire balance sl@0: */ sl@0: TVerdict CTestMmfAclntToneBalance::DoTestL(CMdaAudioToneUtility* aToneUtil) sl@0: { sl@0: INFO_PRINTF1( _L("TestTone : Balance")); sl@0: sl@0: if (iBalance < KMinBalance) sl@0: { sl@0: TRAPD(err, aToneUtil->SetBalanceL(iBalance)); sl@0: sl@0: if (err != KErrNone) sl@0: { sl@0: INFO_PRINTF2(_L("SetBalanceL() returned unexpected error %d"), err); sl@0: return EFail; sl@0: } sl@0: sl@0: if(aToneUtil->GetBalanceL() == KMinBalance) sl@0: return EPass; sl@0: } sl@0: else if (iBalance > KMaxBalance) sl@0: { sl@0: TRAPD(err, aToneUtil->SetBalanceL(iBalance)); sl@0: sl@0: if (err != KErrNone) sl@0: { sl@0: INFO_PRINTF2(_L("SetBalanceL() returned unexpected error %d"), err); sl@0: return EFail; sl@0: } sl@0: sl@0: if(aToneUtil->GetBalanceL() == KMaxBalance) sl@0: return EPass; sl@0: } sl@0: else sl@0: { sl@0: TRAPD(err, aToneUtil->SetBalanceL(iBalance)); sl@0: sl@0: if (err != KErrNone) sl@0: { sl@0: INFO_PRINTF2(_L("SetBalanceL() returned unexpected error %d"), err); sl@0: return EFail; sl@0: } sl@0: sl@0: if(aToneUtil->GetBalanceL() == iBalance) sl@0: return EPass; sl@0: } sl@0: sl@0: return EFail; sl@0: } sl@0: sl@0: //------------------------------------------------------------------ sl@0: sl@0: // NEGATIVE TESTING sl@0: sl@0: //------------------------------------------------------------------ sl@0: sl@0: sl@0: sl@0: /** sl@0: * Constructor sl@0: */ sl@0: CTestMmfAclntOnOffPause::CTestMmfAclntOnOffPause() sl@0: { sl@0: // store the name of this test case sl@0: // this is the name that is used by the script file sl@0: // Each test step initialises it's own name sl@0: iTestStepName = _L("MM-MMF-ACLNT-I-1155-HP"); sl@0: sl@0: // this test does not inherit from CTestMmfAclntTone sl@0: // so we need to make the heap bigger here sl@0: // need a bigger heap size on EKA2 HW sl@0: #if !defined __WINS__ sl@0: iHeapSize = KHeapSizeToneTestEKA2; sl@0: #endif // EKA2 sl@0: } sl@0: sl@0: void CTestMmfAclntOnOffPause::MatoPrepareComplete(TInt aError) sl@0: { sl@0: iError = aError; sl@0: INFO_PRINTF1( _L("CTestMmfAclntOnOffPause::MatoPrepareComplete MMdaAudioToneObserver Callback for CMdaAudioToneUtility complete")); sl@0: INFO_PRINTF2( _L("iError %d"), iError); sl@0: CActiveScheduler::Stop(); sl@0: } sl@0: sl@0: void CTestMmfAclntOnOffPause::MatoPlayComplete(TInt aError) sl@0: { sl@0: iError = aError; sl@0: INFO_PRINTF1( _L("CTestMmfAclntOnOffPause::MatoPlayComplete MMdaAudioToneObserver Callback for CMdaAudioToneUtility complete")); sl@0: INFO_PRINTF2( _L("iError %d"), iError); sl@0: CActiveScheduler::Stop(); sl@0: } sl@0: sl@0: /** sl@0: * Set up tone on, off and pause length to illegal values. sl@0: */ sl@0: TVerdict CTestMmfAclntOnOffPause::DoTestStepL( void ) sl@0: { sl@0: INFO_PRINTF1( _L("TestTone : On/Off/Pause")); sl@0: TVerdict res = EFail; sl@0: sl@0: iError = KErrTimedOut; sl@0: sl@0: CMdaAudioToneUtility* toneUtil = CMdaAudioToneUtility::NewL(*this); sl@0: CleanupStack::PushL(toneUtil); sl@0: toneUtil->PrepareToPlayDTMFString(KDTMFString); sl@0: // Wait for prepare sl@0: INFO_PRINTF1( _L("Initialise CMdaAudioToneUtility")); sl@0: CActiveScheduler::Start(); sl@0: sl@0: if(iError == KErrNone) sl@0: { sl@0: iError = KErrTimedOut; sl@0: sl@0: TTimeIntervalMicroSeconds32 on(-4), off(-3), pause(-5); sl@0: sl@0: toneUtil->SetDTMFLengths(on, off, pause); sl@0: sl@0: toneUtil->Play(); sl@0: // wait for play to complete sl@0: INFO_PRINTF1( _L("Play CMdaAudioToneUtility")); sl@0: CActiveScheduler::Start(); sl@0: sl@0: // check this worked sl@0: if(iError == KErrNone) sl@0: res = EPass; sl@0: } sl@0: sl@0: CleanupStack::Pop(); // toneUtil sl@0: ERR_PRINTF2( _L("CMdaAudioToneUtility completed with error %d"),iError ); sl@0: delete toneUtil; sl@0: return res; sl@0: } sl@0: