sl@0
|
1 |
// Copyright (c) 2002-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 |
// This program is designed the test of the MMF_ACLNT.
|
sl@0
|
15 |
//
|
sl@0
|
16 |
//
|
sl@0
|
17 |
|
sl@0
|
18 |
/**
|
sl@0
|
19 |
@file TestTone.cpp
|
sl@0
|
20 |
*/
|
sl@0
|
21 |
|
sl@0
|
22 |
|
sl@0
|
23 |
#include "TestTone.h"
|
sl@0
|
24 |
|
sl@0
|
25 |
const TInt KHeapSizeToneTestEKA2 = 128000; // Heapsize for tone tests on EKA2
|
sl@0
|
26 |
|
sl@0
|
27 |
/**
|
sl@0
|
28 |
* Constructor
|
sl@0
|
29 |
*/
|
sl@0
|
30 |
CTestMmfAclntTone::CTestMmfAclntTone(const TDesC& aTestName, const TInt aExpectedResult)
|
sl@0
|
31 |
{
|
sl@0
|
32 |
// store the name of this test case
|
sl@0
|
33 |
// this is the name that is used by the script file
|
sl@0
|
34 |
// Each test step initialises it's own name
|
sl@0
|
35 |
iTestStepName = aTestName;
|
sl@0
|
36 |
|
sl@0
|
37 |
// need a bigger heap size on EKA2 HW
|
sl@0
|
38 |
#if !defined __WINS__
|
sl@0
|
39 |
iHeapSize = KHeapSizeToneTestEKA2;
|
sl@0
|
40 |
#endif // EKA2
|
sl@0
|
41 |
|
sl@0
|
42 |
iFrequency = KToneFrequency;
|
sl@0
|
43 |
iDuration = TTimeIntervalMicroSeconds(KOneSecond);
|
sl@0
|
44 |
iExpectedResult = aExpectedResult;
|
sl@0
|
45 |
iStop = ETrue;
|
sl@0
|
46 |
}
|
sl@0
|
47 |
|
sl@0
|
48 |
CTestMmfAclntTone* CTestMmfAclntTone::NewL(const TDesC& aTestName, const TInt aExpectedResult)
|
sl@0
|
49 |
{
|
sl@0
|
50 |
CTestMmfAclntTone* self = new (ELeave) CTestMmfAclntTone(aTestName,aExpectedResult);
|
sl@0
|
51 |
return self;
|
sl@0
|
52 |
}
|
sl@0
|
53 |
|
sl@0
|
54 |
void CTestMmfAclntTone::MatoPrepareComplete(TInt aError)
|
sl@0
|
55 |
{
|
sl@0
|
56 |
iError = aError;
|
sl@0
|
57 |
INFO_PRINTF1( _L("CTestMmfAclntTone::MatoPrepareComplete MMdaAudioToneObserver Callback for CMdaAudioToneUtility complete"));
|
sl@0
|
58 |
INFO_PRINTF2( _L("iError %d"), iError);
|
sl@0
|
59 |
if(iStop)
|
sl@0
|
60 |
CActiveScheduler::Stop();
|
sl@0
|
61 |
}
|
sl@0
|
62 |
|
sl@0
|
63 |
void CTestMmfAclntTone::MatoPlayComplete(TInt aError)
|
sl@0
|
64 |
{
|
sl@0
|
65 |
iError = aError;
|
sl@0
|
66 |
INFO_PRINTF1( _L("CTestMmfAclntTone::MatoPlayComplete MMdaAudioToneObserver Callback for CMdaAudioToneUtility complete"));
|
sl@0
|
67 |
INFO_PRINTF2( _L("iError %d"), iError);
|
sl@0
|
68 |
if(iStop)
|
sl@0
|
69 |
CActiveScheduler::Stop();
|
sl@0
|
70 |
}
|
sl@0
|
71 |
|
sl@0
|
72 |
/**
|
sl@0
|
73 |
* Play a tone
|
sl@0
|
74 |
*/
|
sl@0
|
75 |
TVerdict CTestMmfAclntTone::DoTestStepL()
|
sl@0
|
76 |
{
|
sl@0
|
77 |
INFO_PRINTF1( _L("TestTone : Play"));
|
sl@0
|
78 |
|
sl@0
|
79 |
iStop = ETrue;
|
sl@0
|
80 |
TVerdict ret = EFail;
|
sl@0
|
81 |
iError = KErrTimedOut;
|
sl@0
|
82 |
|
sl@0
|
83 |
CMdaAudioToneUtility* toneUtil = CMdaAudioToneUtility::NewL(*this);
|
sl@0
|
84 |
CleanupStack::PushL(toneUtil);
|
sl@0
|
85 |
toneUtil->PrepareToPlayTone(iFrequency,iDuration);
|
sl@0
|
86 |
// Wait for prepare
|
sl@0
|
87 |
INFO_PRINTF1( _L("Initialise CMdaAudioToneUtility"));
|
sl@0
|
88 |
CActiveScheduler::Start();
|
sl@0
|
89 |
|
sl@0
|
90 |
if(iError == KErrNone)
|
sl@0
|
91 |
ret = DoTestL(toneUtil);
|
sl@0
|
92 |
|
sl@0
|
93 |
//produce another tone to confirm that the configuration is retained over multiple plays
|
sl@0
|
94 |
if(iError == KErrNone)
|
sl@0
|
95 |
ret = DoTestL(toneUtil);
|
sl@0
|
96 |
|
sl@0
|
97 |
if(ret == EFail)
|
sl@0
|
98 |
ERR_PRINTF2( _L("CMdaAudioToneUtility failed with error %d"),iError );
|
sl@0
|
99 |
|
sl@0
|
100 |
CleanupStack::PopAndDestroy(toneUtil);
|
sl@0
|
101 |
return ret;
|
sl@0
|
102 |
}
|
sl@0
|
103 |
|
sl@0
|
104 |
TVerdict CTestMmfAclntTone::DoTestL(CMdaAudioToneUtility* aToneUtil)
|
sl@0
|
105 |
{
|
sl@0
|
106 |
TVerdict ret = EFail;
|
sl@0
|
107 |
iError = KErrTimedOut;
|
sl@0
|
108 |
|
sl@0
|
109 |
aToneUtil->Play();
|
sl@0
|
110 |
// wait for play.
|
sl@0
|
111 |
INFO_PRINTF1( _L("Play CMdaAudioToneUtility"));
|
sl@0
|
112 |
CActiveScheduler::Start();
|
sl@0
|
113 |
|
sl@0
|
114 |
if(iError == iExpectedResult)
|
sl@0
|
115 |
ret = EPass;
|
sl@0
|
116 |
|
sl@0
|
117 |
return ret;
|
sl@0
|
118 |
}
|
sl@0
|
119 |
|
sl@0
|
120 |
//------------------------------------------------------------------
|
sl@0
|
121 |
|
sl@0
|
122 |
//Play DualTone Test for Sirocco CR
|
sl@0
|
123 |
CTestMmfAclntDualTone::CTestMmfAclntDualTone(const TDesC& aTestName)
|
sl@0
|
124 |
: CTestMmfAclntTone(aTestName)
|
sl@0
|
125 |
{
|
sl@0
|
126 |
iFreqOne = KToneFrequency;
|
sl@0
|
127 |
iFreqTwo = KToneFrequencyTwo;
|
sl@0
|
128 |
}
|
sl@0
|
129 |
|
sl@0
|
130 |
CTestMmfAclntDualTone* CTestMmfAclntDualTone::NewL(const TDesC& aTestName)
|
sl@0
|
131 |
{
|
sl@0
|
132 |
CTestMmfAclntDualTone* self = new (ELeave) CTestMmfAclntDualTone(aTestName);
|
sl@0
|
133 |
return self;
|
sl@0
|
134 |
}
|
sl@0
|
135 |
|
sl@0
|
136 |
|
sl@0
|
137 |
/**
|
sl@0
|
138 |
* Play a Dual tone
|
sl@0
|
139 |
*/
|
sl@0
|
140 |
|
sl@0
|
141 |
TVerdict CTestMmfAclntDualTone::DoTestStepL()
|
sl@0
|
142 |
{
|
sl@0
|
143 |
INFO_PRINTF1( _L("TestTone : Play Dual Tone"));
|
sl@0
|
144 |
|
sl@0
|
145 |
TVerdict ret = EFail;
|
sl@0
|
146 |
iError = KErrTimedOut;
|
sl@0
|
147 |
|
sl@0
|
148 |
CMdaAudioToneUtility* toneUtil = CMdaAudioToneUtility::NewL(*this);
|
sl@0
|
149 |
CleanupStack::PushL(toneUtil);
|
sl@0
|
150 |
toneUtil->PrepareToPlayDualTone(iFreqOne,iFreqTwo,iDuration);
|
sl@0
|
151 |
|
sl@0
|
152 |
// Wait for prepare
|
sl@0
|
153 |
INFO_PRINTF1( _L("Initialise CMdaAudioToneUtility"));
|
sl@0
|
154 |
CActiveScheduler::Start();
|
sl@0
|
155 |
|
sl@0
|
156 |
if(iError == KErrNone)
|
sl@0
|
157 |
ret = DoTestL(toneUtil);
|
sl@0
|
158 |
|
sl@0
|
159 |
//produce another tone to confirm that the configuration is retained over multiple plays
|
sl@0
|
160 |
if(iError == KErrNone)
|
sl@0
|
161 |
ret = DoTestL(toneUtil);
|
sl@0
|
162 |
|
sl@0
|
163 |
if(ret == EFail)
|
sl@0
|
164 |
ERR_PRINTF2( _L("CMdaAudioToneUtility failed with error %d"),iError );
|
sl@0
|
165 |
|
sl@0
|
166 |
CleanupStack::PopAndDestroy(toneUtil);
|
sl@0
|
167 |
return ret;
|
sl@0
|
168 |
}
|
sl@0
|
169 |
|
sl@0
|
170 |
//------------------------------------------------------------------
|
sl@0
|
171 |
|
sl@0
|
172 |
|
sl@0
|
173 |
CTestMmfAclntToneDtmf::CTestMmfAclntToneDtmf(const TDesC& aTestName,const TDesC& aDTMF,const TInt aExpectedResult)
|
sl@0
|
174 |
: CTestMmfAclntTone(aTestName,aExpectedResult), iDTMF(aDTMF)
|
sl@0
|
175 |
{}
|
sl@0
|
176 |
|
sl@0
|
177 |
CTestMmfAclntToneDtmf* CTestMmfAclntToneDtmf::NewL(const TDesC& aTestName,const TDesC& aDTMF,const TInt aExpectedResult)
|
sl@0
|
178 |
{
|
sl@0
|
179 |
CTestMmfAclntToneDtmf* self = new (ELeave) CTestMmfAclntToneDtmf(aTestName,aDTMF,aExpectedResult);
|
sl@0
|
180 |
return self;
|
sl@0
|
181 |
}
|
sl@0
|
182 |
|
sl@0
|
183 |
/**
|
sl@0
|
184 |
* Play a DTMF string
|
sl@0
|
185 |
*/
|
sl@0
|
186 |
TVerdict CTestMmfAclntToneDtmf::DoTestStepL()
|
sl@0
|
187 |
{
|
sl@0
|
188 |
INFO_PRINTF1( _L("TestTone : Play DTMF"));
|
sl@0
|
189 |
|
sl@0
|
190 |
TVerdict ret = EFail;
|
sl@0
|
191 |
iError = KErrTimedOut;
|
sl@0
|
192 |
|
sl@0
|
193 |
CMdaAudioToneUtility* toneUtil = CMdaAudioToneUtility::NewL(*this);
|
sl@0
|
194 |
CleanupStack::PushL(toneUtil);
|
sl@0
|
195 |
toneUtil->PrepareToPlayDTMFString(iDTMF);
|
sl@0
|
196 |
// Wait for prepare to complete
|
sl@0
|
197 |
INFO_PRINTF1( _L("Initialise CMdaAudioToneUtility"));
|
sl@0
|
198 |
CActiveScheduler::Start();
|
sl@0
|
199 |
|
sl@0
|
200 |
toneUtil->PrepareToPlayDTMFString(iDTMF);
|
sl@0
|
201 |
// Wait for prepare to complete
|
sl@0
|
202 |
INFO_PRINTF1( _L("Reinitialise CMdaAudioToneUtility"));
|
sl@0
|
203 |
CActiveScheduler::Start();
|
sl@0
|
204 |
|
sl@0
|
205 |
if(iError == KErrNone)
|
sl@0
|
206 |
ret = DoTestL(toneUtil);
|
sl@0
|
207 |
else if (iError == iExpectedResult)
|
sl@0
|
208 |
{
|
sl@0
|
209 |
INFO_PRINTF2( _L("Initialisation failed as expected with code %d"), iError);
|
sl@0
|
210 |
ret = EPass;
|
sl@0
|
211 |
iError = KErrNone;
|
sl@0
|
212 |
}
|
sl@0
|
213 |
|
sl@0
|
214 |
if(ret == EFail)
|
sl@0
|
215 |
ERR_PRINTF2( _L("CMdaAudioToneUtility failed with error %d"),iError );
|
sl@0
|
216 |
|
sl@0
|
217 |
CleanupStack::PopAndDestroy(toneUtil);
|
sl@0
|
218 |
return ret;
|
sl@0
|
219 |
}
|
sl@0
|
220 |
|
sl@0
|
221 |
//------------------------------------------------------------------
|
sl@0
|
222 |
|
sl@0
|
223 |
/**
|
sl@0
|
224 |
* Constructor
|
sl@0
|
225 |
*/
|
sl@0
|
226 |
CTestMmfAclntToneFile::CTestMmfAclntToneFile(const TDesC& aTestName, const TDesC& aSectName, const TDesC& aKeyName)
|
sl@0
|
227 |
: CTestMmfAclntTone(aTestName)
|
sl@0
|
228 |
{
|
sl@0
|
229 |
// store the name of this test case
|
sl@0
|
230 |
// this is the name that is used by the script file
|
sl@0
|
231 |
// Each test step initialises it's own name
|
sl@0
|
232 |
iSectName = aSectName;
|
sl@0
|
233 |
iKeyName= aKeyName;
|
sl@0
|
234 |
}
|
sl@0
|
235 |
|
sl@0
|
236 |
CTestMmfAclntToneFile* CTestMmfAclntToneFile::NewL(const TDesC& aTestName, const TDesC& aSectName, const TDesC& aKeyName)
|
sl@0
|
237 |
{
|
sl@0
|
238 |
CTestMmfAclntToneFile* self = new (ELeave) CTestMmfAclntToneFile(aTestName,aSectName,aKeyName);
|
sl@0
|
239 |
return self;
|
sl@0
|
240 |
}
|
sl@0
|
241 |
|
sl@0
|
242 |
TVerdict CTestMmfAclntToneFile::DoTestStepPreambleL()
|
sl@0
|
243 |
{
|
sl@0
|
244 |
TPtrC filename;
|
sl@0
|
245 |
if(!GetStringFromConfig(iSectName, iKeyName, filename))
|
sl@0
|
246 |
return EInconclusive;
|
sl@0
|
247 |
|
sl@0
|
248 |
// Create a sequence file
|
sl@0
|
249 |
TInt length;
|
sl@0
|
250 |
RFs fs;
|
sl@0
|
251 |
|
sl@0
|
252 |
fs.Connect();
|
sl@0
|
253 |
CleanupClosePushL(fs);
|
sl@0
|
254 |
#ifdef __IPC_V2_PRESENT__
|
sl@0
|
255 |
User::LeaveIfError(fs.ShareAuto());
|
sl@0
|
256 |
#else
|
sl@0
|
257 |
User::LeaveIfError(fs.Share(RSessionBase::EExplicitAttach));
|
sl@0
|
258 |
#endif
|
sl@0
|
259 |
RFile file;
|
sl@0
|
260 |
User::LeaveIfError(file.Replace(fs,filename,EFileWrite));
|
sl@0
|
261 |
CleanupClosePushL(file);
|
sl@0
|
262 |
User::LeaveIfError(file.Write(KFixedSequenceData()));
|
sl@0
|
263 |
User::LeaveIfError(file.Size(length));
|
sl@0
|
264 |
CleanupStack::PopAndDestroy(2, &fs);
|
sl@0
|
265 |
|
sl@0
|
266 |
return CTestMmfAclntStep::DoTestStepPreambleL();
|
sl@0
|
267 |
}
|
sl@0
|
268 |
|
sl@0
|
269 |
/**
|
sl@0
|
270 |
* Play a tone file
|
sl@0
|
271 |
*/
|
sl@0
|
272 |
TVerdict CTestMmfAclntToneFile::DoTestStepL( void )
|
sl@0
|
273 |
{
|
sl@0
|
274 |
INFO_PRINTF1( _L("TestTone : Play File"));
|
sl@0
|
275 |
|
sl@0
|
276 |
TVerdict ret = EFail;
|
sl@0
|
277 |
|
sl@0
|
278 |
|
sl@0
|
279 |
TPtrC filename;
|
sl@0
|
280 |
if(!GetStringFromConfig(iSectName, iKeyName, filename))
|
sl@0
|
281 |
return EInconclusive;
|
sl@0
|
282 |
|
sl@0
|
283 |
iError = KErrTimedOut;
|
sl@0
|
284 |
// perform test using this file
|
sl@0
|
285 |
CMdaAudioToneUtility* toneUtil = CMdaAudioToneUtility::NewL(*this);
|
sl@0
|
286 |
CleanupStack::PushL(toneUtil);
|
sl@0
|
287 |
toneUtil->PrepareToPlayFileSequence(filename);
|
sl@0
|
288 |
// Wait for prepare
|
sl@0
|
289 |
INFO_PRINTF1( _L("Initialise CMdaAudioToneUtility"));
|
sl@0
|
290 |
CActiveScheduler::Start();
|
sl@0
|
291 |
|
sl@0
|
292 |
toneUtil->PrepareToPlayFileSequence(filename);
|
sl@0
|
293 |
// Wait for prepare
|
sl@0
|
294 |
INFO_PRINTF1( _L("re-initialise CMdaAudioToneUtility"));
|
sl@0
|
295 |
CActiveScheduler::Start();
|
sl@0
|
296 |
|
sl@0
|
297 |
if(iError == KErrNone)
|
sl@0
|
298 |
ret = DoTestL(toneUtil);
|
sl@0
|
299 |
|
sl@0
|
300 |
if(ret == EFail)
|
sl@0
|
301 |
ERR_PRINTF2( _L("CMdaAudioToneUtility failed with error %d"),iError );
|
sl@0
|
302 |
|
sl@0
|
303 |
CleanupStack::PopAndDestroy(toneUtil);
|
sl@0
|
304 |
return ret;
|
sl@0
|
305 |
}
|
sl@0
|
306 |
|
sl@0
|
307 |
//------------------------------------------------------------------
|
sl@0
|
308 |
|
sl@0
|
309 |
/**
|
sl@0
|
310 |
* Constructor
|
sl@0
|
311 |
*/
|
sl@0
|
312 |
CTestMmfAclntToneDes::CTestMmfAclntToneDes(const TDesC& aTestName, const TDesC8& aDes, const TInt aExpectedResult)
|
sl@0
|
313 |
: CTestMmfAclntTone(aTestName, aExpectedResult), iDes(aDes)
|
sl@0
|
314 |
{}
|
sl@0
|
315 |
|
sl@0
|
316 |
CTestMmfAclntToneDes* CTestMmfAclntToneDes::NewL(const TDesC& aTestName, const TDesC8& aDes, const TInt aExpectedResult)
|
sl@0
|
317 |
{
|
sl@0
|
318 |
CTestMmfAclntToneDes* self = new (ELeave) CTestMmfAclntToneDes(aTestName,aDes, aExpectedResult);
|
sl@0
|
319 |
return self;
|
sl@0
|
320 |
}
|
sl@0
|
321 |
|
sl@0
|
322 |
/**
|
sl@0
|
323 |
* Play a tone from a descriptor.
|
sl@0
|
324 |
*/
|
sl@0
|
325 |
TVerdict CTestMmfAclntToneDes::DoTestStepL()
|
sl@0
|
326 |
{
|
sl@0
|
327 |
INFO_PRINTF1( _L("TestTone : Play Des"));
|
sl@0
|
328 |
|
sl@0
|
329 |
TVerdict ret = EFail;
|
sl@0
|
330 |
iError = KErrTimedOut;
|
sl@0
|
331 |
|
sl@0
|
332 |
CMdaAudioToneUtility* toneUtil = CMdaAudioToneUtility::NewL(*this);
|
sl@0
|
333 |
CleanupStack::PushL(toneUtil);
|
sl@0
|
334 |
toneUtil->PrepareToPlayDesSequence(iDes);
|
sl@0
|
335 |
// Wait for prepare
|
sl@0
|
336 |
INFO_PRINTF1( _L("Initialise CMdaAudioToneUtility"));
|
sl@0
|
337 |
CActiveScheduler::Start();
|
sl@0
|
338 |
|
sl@0
|
339 |
toneUtil->PrepareToPlayDesSequence(iDes);
|
sl@0
|
340 |
// Wait for prepare
|
sl@0
|
341 |
INFO_PRINTF1( _L("re-initialise CMdaAudioToneUtility"));
|
sl@0
|
342 |
CActiveScheduler::Start();
|
sl@0
|
343 |
|
sl@0
|
344 |
if(iError == KErrNone)
|
sl@0
|
345 |
ret = DoTestL(toneUtil);
|
sl@0
|
346 |
|
sl@0
|
347 |
if(ret == EFail)
|
sl@0
|
348 |
ERR_PRINTF2( _L("CMdaAudioToneUtility failed with error %d"),iError );
|
sl@0
|
349 |
|
sl@0
|
350 |
CleanupStack::PopAndDestroy(toneUtil);
|
sl@0
|
351 |
return ret;
|
sl@0
|
352 |
}
|
sl@0
|
353 |
|
sl@0
|
354 |
//------------------------------------------------------------------
|
sl@0
|
355 |
|
sl@0
|
356 |
/**
|
sl@0
|
357 |
* Constructor
|
sl@0
|
358 |
*/
|
sl@0
|
359 |
CTestMmfAclntToneFixed::CTestMmfAclntToneFixed(const TDesC& aTestName,const TInt aTone)
|
sl@0
|
360 |
:CTestMmfAclntTone(aTestName), iTone(aTone)
|
sl@0
|
361 |
{}
|
sl@0
|
362 |
|
sl@0
|
363 |
CTestMmfAclntToneFixed* CTestMmfAclntToneFixed::NewL(const TDesC& aTestName,const TInt aTone)
|
sl@0
|
364 |
{
|
sl@0
|
365 |
CTestMmfAclntToneFixed* self = new (ELeave) CTestMmfAclntToneFixed(aTestName,aTone);
|
sl@0
|
366 |
return self;
|
sl@0
|
367 |
}
|
sl@0
|
368 |
|
sl@0
|
369 |
/**
|
sl@0
|
370 |
* Play a predefined/fixed tone
|
sl@0
|
371 |
*/
|
sl@0
|
372 |
TVerdict CTestMmfAclntToneFixed::DoTestStepL()
|
sl@0
|
373 |
{
|
sl@0
|
374 |
#ifdef SYMBIAN_MULTIMEDIA_A3FDEVSOUND
|
sl@0
|
375 |
INFO_PRINTF1( _L("TestTone : Play Fixed - no longer supported"));
|
sl@0
|
376 |
|
sl@0
|
377 |
TVerdict ret = EFail;
|
sl@0
|
378 |
iError = KErrTimedOut;
|
sl@0
|
379 |
|
sl@0
|
380 |
CMdaAudioToneUtility* toneUtil = CMdaAudioToneUtility::NewL(*this);
|
sl@0
|
381 |
CleanupStack::PushL(toneUtil);
|
sl@0
|
382 |
toneUtil->PrepareToPlayFixedSequence(iTone);
|
sl@0
|
383 |
// Wait for prepare
|
sl@0
|
384 |
INFO_PRINTF1( _L("Initialise CMdaAudioToneUtility"));
|
sl@0
|
385 |
CActiveScheduler::Start();
|
sl@0
|
386 |
|
sl@0
|
387 |
toneUtil->PrepareToPlayFixedSequence(iTone);
|
sl@0
|
388 |
// Wait for prepare
|
sl@0
|
389 |
INFO_PRINTF1( _L("re-initialise CMdaAudioToneUtility"));
|
sl@0
|
390 |
CActiveScheduler::Start();
|
sl@0
|
391 |
|
sl@0
|
392 |
// Has Audio Utility intialisied ?
|
sl@0
|
393 |
TInt sequenceCount = toneUtil->FixedSequenceCount();
|
sl@0
|
394 |
INFO_PRINTF2( _L("FixedSequenceCount() returned %d"),sequenceCount);
|
sl@0
|
395 |
if(sequenceCount <= 0)
|
sl@0
|
396 |
{
|
sl@0
|
397 |
INFO_PRINTF1( _L("Play Fixed Sequence is no longer supported"));
|
sl@0
|
398 |
ret = EPass;
|
sl@0
|
399 |
}
|
sl@0
|
400 |
|
sl@0
|
401 |
if(ret == EFail)
|
sl@0
|
402 |
ERR_PRINTF2( _L("CMdaAudioToneUtility failed with error %d"),iError );
|
sl@0
|
403 |
|
sl@0
|
404 |
CleanupStack::PopAndDestroy(toneUtil);
|
sl@0
|
405 |
return ret;
|
sl@0
|
406 |
|
sl@0
|
407 |
#else
|
sl@0
|
408 |
INFO_PRINTF1( _L("TestTone : Play Fixed"));
|
sl@0
|
409 |
|
sl@0
|
410 |
TVerdict ret = EFail;
|
sl@0
|
411 |
iError = KErrTimedOut;
|
sl@0
|
412 |
|
sl@0
|
413 |
CMdaAudioToneUtility* toneUtil = CMdaAudioToneUtility::NewL(*this);
|
sl@0
|
414 |
CleanupStack::PushL(toneUtil);
|
sl@0
|
415 |
toneUtil->PrepareToPlayFixedSequence(iTone);
|
sl@0
|
416 |
// Wait for prepare
|
sl@0
|
417 |
INFO_PRINTF1( _L("Initialise CMdaAudioToneUtility"));
|
sl@0
|
418 |
CActiveScheduler::Start();
|
sl@0
|
419 |
|
sl@0
|
420 |
toneUtil->PrepareToPlayFixedSequence(iTone);
|
sl@0
|
421 |
// Wait for prepare
|
sl@0
|
422 |
INFO_PRINTF1( _L("re-initialise CMdaAudioToneUtility"));
|
sl@0
|
423 |
CActiveScheduler::Start();
|
sl@0
|
424 |
|
sl@0
|
425 |
// Has Audio Utility intialisied ?
|
sl@0
|
426 |
TInt sequenceCount = toneUtil->FixedSequenceCount() ;
|
sl@0
|
427 |
if((iError == KErrNone) && (sequenceCount > 0))
|
sl@0
|
428 |
{
|
sl@0
|
429 |
INFO_PRINTF2( _L("FixedSequenceName is %S"), &toneUtil->FixedSequenceName(sequenceCount - 1)) ;
|
sl@0
|
430 |
ret = DoTestL(toneUtil);
|
sl@0
|
431 |
}
|
sl@0
|
432 |
|
sl@0
|
433 |
if(ret == EFail)
|
sl@0
|
434 |
ERR_PRINTF2( _L("CMdaAudioToneUtility failed with error %d"),iError );
|
sl@0
|
435 |
|
sl@0
|
436 |
CleanupStack::PopAndDestroy(toneUtil);
|
sl@0
|
437 |
return ret;
|
sl@0
|
438 |
#endif
|
sl@0
|
439 |
}
|
sl@0
|
440 |
//------------------------------------------------------------------
|
sl@0
|
441 |
|
sl@0
|
442 |
/**
|
sl@0
|
443 |
* Constructor
|
sl@0
|
444 |
*/
|
sl@0
|
445 |
CTestMmfAclntToneAudio::CTestMmfAclntToneAudio()
|
sl@0
|
446 |
{
|
sl@0
|
447 |
// store the name of this test case
|
sl@0
|
448 |
// this is the name that is used by the script file
|
sl@0
|
449 |
// Each test step initialises it's own name
|
sl@0
|
450 |
iTestStepName = _L("MM-MMF-ACLNT-I-0156-LP");
|
sl@0
|
451 |
|
sl@0
|
452 |
// this test does not inherit from CTestMmfAclntTone
|
sl@0
|
453 |
// so we need to make the heap bigger here
|
sl@0
|
454 |
// need a bigger heap size on EKA2 HW
|
sl@0
|
455 |
#if !defined __WINS__
|
sl@0
|
456 |
iHeapSize = KHeapSizeToneTestEKA2;
|
sl@0
|
457 |
#endif // EKA2
|
sl@0
|
458 |
}
|
sl@0
|
459 |
|
sl@0
|
460 |
void CTestMmfAclntToneAudio::MatoPrepareComplete(TInt aError)
|
sl@0
|
461 |
{
|
sl@0
|
462 |
iToneError = aError;
|
sl@0
|
463 |
INFO_PRINTF1( _L("CTestMmfAclntToneAudio::MatoPrepareComplete MMdaAudioToneObserver Callback for CMdaAudioToneUtility complete"));
|
sl@0
|
464 |
INFO_PRINTF2( _L("iToneError %d"), iToneError);
|
sl@0
|
465 |
CActiveScheduler::Stop();
|
sl@0
|
466 |
}
|
sl@0
|
467 |
|
sl@0
|
468 |
void CTestMmfAclntToneAudio::MatoPlayComplete(TInt aError)
|
sl@0
|
469 |
{
|
sl@0
|
470 |
INFO_PRINTF1( _L("CTestMmfAclntToneAudio::MatoPlayComplete MMdaAudioToneObserver Callback for CMdaAudioToneUtility called"));
|
sl@0
|
471 |
iToneError = aError;
|
sl@0
|
472 |
INFO_PRINTF2( _L("iToneError %d"), iToneError);
|
sl@0
|
473 |
|
sl@0
|
474 |
if((--iCallbackCount) == 0)
|
sl@0
|
475 |
CActiveScheduler::Stop();
|
sl@0
|
476 |
}
|
sl@0
|
477 |
|
sl@0
|
478 |
void CTestMmfAclntToneAudio::MapcInitComplete(TInt aError, const TTimeIntervalMicroSeconds& /*aDuration*/)
|
sl@0
|
479 |
{
|
sl@0
|
480 |
iPlayerError = aError;
|
sl@0
|
481 |
CActiveScheduler::Stop();
|
sl@0
|
482 |
}
|
sl@0
|
483 |
|
sl@0
|
484 |
void CTestMmfAclntToneAudio::MapcPlayComplete(TInt aError)
|
sl@0
|
485 |
{
|
sl@0
|
486 |
INFO_PRINTF1( _L("CTestMmfAclntToneAudio::MatcPlayComplete MMdaAudioPlayerCallback for CMdaAudioPlayerUtility called"));
|
sl@0
|
487 |
iPlayerError = aError;
|
sl@0
|
488 |
INFO_PRINTF2( _L("iPlayerError %d"), iPlayerError);
|
sl@0
|
489 |
|
sl@0
|
490 |
if((--iCallbackCount) == 0)
|
sl@0
|
491 |
CActiveScheduler::Stop();
|
sl@0
|
492 |
}
|
sl@0
|
493 |
|
sl@0
|
494 |
//------------------------------------------------------------------
|
sl@0
|
495 |
|
sl@0
|
496 |
/**
|
sl@0
|
497 |
* Playing a tone and playing an audio file.
|
sl@0
|
498 |
*/
|
sl@0
|
499 |
TVerdict CTestMmfAclntToneAudio::DoTestStepL( void )
|
sl@0
|
500 |
{
|
sl@0
|
501 |
INFO_PRINTF1( _L("TestTone : Tone/File"));
|
sl@0
|
502 |
|
sl@0
|
503 |
TBuf<KSizeBuf> filename;
|
sl@0
|
504 |
TPtrC filename1;
|
sl@0
|
505 |
if(!GetStringFromConfig(_L("SectionOne"), _L("playerAudioFile"), filename1))
|
sl@0
|
506 |
return EInconclusive;
|
sl@0
|
507 |
|
sl@0
|
508 |
GetDriveName(filename);
|
sl@0
|
509 |
filename.Append(filename1);
|
sl@0
|
510 |
|
sl@0
|
511 |
iPlayerError = KErrTimedOut;
|
sl@0
|
512 |
CMdaAudioPlayerUtility* playerUtility =
|
sl@0
|
513 |
//CMdaAudioPlayerUtility::NewFilePlayerL(filename,*this);//, EPriorityHigh);
|
sl@0
|
514 |
CMdaAudioPlayerUtility::NewFilePlayerL(filename,*this, EPriorityNormal);
|
sl@0
|
515 |
|
sl@0
|
516 |
CleanupStack::PushL(playerUtility);
|
sl@0
|
517 |
|
sl@0
|
518 |
// Wait for prepare
|
sl@0
|
519 |
INFO_PRINTF1( _L("Initialise CMdaAudioPlayerUtility"));
|
sl@0
|
520 |
CActiveScheduler::Start();
|
sl@0
|
521 |
|
sl@0
|
522 |
if(iPlayerError == KErrNone)
|
sl@0
|
523 |
{
|
sl@0
|
524 |
iToneError = KErrTimedOut;
|
sl@0
|
525 |
INFO_PRINTF1( _L("Create audio tone utility..."));
|
sl@0
|
526 |
CMdaAudioToneUtility* toneUtil = CMdaAudioToneUtility::NewL(*this);
|
sl@0
|
527 |
CleanupStack::PushL(toneUtil);
|
sl@0
|
528 |
|
sl@0
|
529 |
INFO_PRINTF1( _L("Prepare to play tone..."));
|
sl@0
|
530 |
toneUtil->PrepareToPlayTone(KToneFrequency,TTimeIntervalMicroSeconds(KOneSecond));
|
sl@0
|
531 |
// Wait for prepare
|
sl@0
|
532 |
INFO_PRINTF1( _L("Initialise CMdaAudioToneUtility"));
|
sl@0
|
533 |
CActiveScheduler::Start();
|
sl@0
|
534 |
|
sl@0
|
535 |
INFO_PRINTF1( _L("Re-prepare to play tone..."));
|
sl@0
|
536 |
toneUtil->PrepareToPlayTone(KToneFrequency,TTimeIntervalMicroSeconds(KOneSecond));
|
sl@0
|
537 |
// Wait for prepare
|
sl@0
|
538 |
INFO_PRINTF1( _L("Initialise CMdaAudioToneUtility"));
|
sl@0
|
539 |
CActiveScheduler::Start();
|
sl@0
|
540 |
|
sl@0
|
541 |
toneUtil->SetPriority(EPriorityHigh, EMdaPriorityPreferenceNone);
|
sl@0
|
542 |
if(iToneError == KErrNone)
|
sl@0
|
543 |
{
|
sl@0
|
544 |
iPlayerError = KErrTimedOut;
|
sl@0
|
545 |
iToneError = KErrTimedOut;
|
sl@0
|
546 |
|
sl@0
|
547 |
// play files together
|
sl@0
|
548 |
INFO_PRINTF1( _L("Play CMdaAudioPlayerUtility"));
|
sl@0
|
549 |
playerUtility->Play();
|
sl@0
|
550 |
INFO_PRINTF1( _L("Play CMdaAudioToneUtility"));
|
sl@0
|
551 |
toneUtil->Play();
|
sl@0
|
552 |
|
sl@0
|
553 |
iCallbackCount = 2;
|
sl@0
|
554 |
CActiveScheduler::Start();
|
sl@0
|
555 |
// Wait for two callbacks
|
sl@0
|
556 |
|
sl@0
|
557 |
//Tone utility is at priority high - should complete normally
|
sl@0
|
558 |
//Player is at priority normal should complete with KErrInUse
|
sl@0
|
559 |
//KErrAccessDenied is OK here, at least until we can do Mixing
|
sl@0
|
560 |
if(iToneError==KErrNone && (iPlayerError==KErrInUse || iPlayerError==KErrNone))
|
sl@0
|
561 |
{
|
sl@0
|
562 |
CleanupStack::PopAndDestroy(2); // playerUtility, toneUtil
|
sl@0
|
563 |
return EPass;
|
sl@0
|
564 |
}
|
sl@0
|
565 |
}
|
sl@0
|
566 |
CleanupStack::PopAndDestroy(toneUtil);
|
sl@0
|
567 |
}
|
sl@0
|
568 |
else
|
sl@0
|
569 |
INFO_PRINTF1( _L("Cannot initialise CMdaAudioPlayerUtility"));
|
sl@0
|
570 |
|
sl@0
|
571 |
ERR_PRINTF2( _L("CMdaAudioToneUtility completed with player error %d"),iPlayerError );
|
sl@0
|
572 |
ERR_PRINTF2( _L("CMdaAudioToneUtility completed with tone error %d"),iToneError );
|
sl@0
|
573 |
CleanupStack::PopAndDestroy(playerUtility);
|
sl@0
|
574 |
return EFail;
|
sl@0
|
575 |
}
|
sl@0
|
576 |
|
sl@0
|
577 |
//------------------------------------------------------------------
|
sl@0
|
578 |
|
sl@0
|
579 |
/** Constructor
|
sl@0
|
580 |
*/
|
sl@0
|
581 |
CTestMmfAclntToneCancelP::CTestMmfAclntToneCancelP(const TDesC& aTestName)
|
sl@0
|
582 |
:CTestMmfAclntTone(aTestName)
|
sl@0
|
583 |
{}
|
sl@0
|
584 |
|
sl@0
|
585 |
CTestMmfAclntToneCancelP* CTestMmfAclntToneCancelP::NewL(const TDesC& aTestName)
|
sl@0
|
586 |
{
|
sl@0
|
587 |
CTestMmfAclntToneCancelP* self = new (ELeave) CTestMmfAclntToneCancelP(aTestName);
|
sl@0
|
588 |
return self;
|
sl@0
|
589 |
}
|
sl@0
|
590 |
|
sl@0
|
591 |
/**
|
sl@0
|
592 |
* Cancel tone play
|
sl@0
|
593 |
*/
|
sl@0
|
594 |
TVerdict CTestMmfAclntToneCancelP::DoTestL(CMdaAudioToneUtility* aToneUtil)
|
sl@0
|
595 |
{
|
sl@0
|
596 |
INFO_PRINTF1( _L("TestTone : Cancel Play"));
|
sl@0
|
597 |
|
sl@0
|
598 |
iStop = EFalse;
|
sl@0
|
599 |
TVerdict ret = EFail;
|
sl@0
|
600 |
|
sl@0
|
601 |
aToneUtil->Play();
|
sl@0
|
602 |
INFO_PRINTF1( _L("Play CMdaAudioToneUtility"));
|
sl@0
|
603 |
if(aToneUtil->State() == EMdaAudioToneUtilityPlaying)
|
sl@0
|
604 |
{
|
sl@0
|
605 |
// cancel play.
|
sl@0
|
606 |
INFO_PRINTF1( _L("Cancel Play CMdaAudioToneUtility"));
|
sl@0
|
607 |
aToneUtil->CancelPlay();
|
sl@0
|
608 |
// make sure tone is no longer playing
|
sl@0
|
609 |
if(aToneUtil->State() != EMdaAudioToneUtilityPlaying)
|
sl@0
|
610 |
ret = EPass;
|
sl@0
|
611 |
}
|
sl@0
|
612 |
return ret;
|
sl@0
|
613 |
}
|
sl@0
|
614 |
|
sl@0
|
615 |
//------------------------------------------------------------------
|
sl@0
|
616 |
/**
|
sl@0
|
617 |
* Constructor
|
sl@0
|
618 |
*/
|
sl@0
|
619 |
CTestMmfAclntToneCancelIni::CTestMmfAclntToneCancelIni(const TDesC& aTestName)
|
sl@0
|
620 |
:CTestMmfAclntTone(aTestName)
|
sl@0
|
621 |
{}
|
sl@0
|
622 |
|
sl@0
|
623 |
CTestMmfAclntToneCancelIni* CTestMmfAclntToneCancelIni::NewL(const TDesC& aTestName)
|
sl@0
|
624 |
{
|
sl@0
|
625 |
CTestMmfAclntToneCancelIni* self = new (ELeave) CTestMmfAclntToneCancelIni(aTestName);
|
sl@0
|
626 |
return self;
|
sl@0
|
627 |
}
|
sl@0
|
628 |
|
sl@0
|
629 |
/**
|
sl@0
|
630 |
* Cancel tone prepare.
|
sl@0
|
631 |
*
|
sl@0
|
632 |
* This fucntion cannot leave
|
sl@0
|
633 |
*/
|
sl@0
|
634 |
TVerdict CTestMmfAclntToneCancelIni::DoTestStepL()
|
sl@0
|
635 |
{
|
sl@0
|
636 |
INFO_PRINTF1( _L("TestTone : Cancel Prepare"));
|
sl@0
|
637 |
|
sl@0
|
638 |
TVerdict ret = EFail;
|
sl@0
|
639 |
iError = KErrTimedOut;
|
sl@0
|
640 |
|
sl@0
|
641 |
CMdaAudioToneUtility* toneUtil = CMdaAudioToneUtility::NewL(*this);
|
sl@0
|
642 |
CleanupStack::PushL(toneUtil);
|
sl@0
|
643 |
INFO_PRINTF1( _L("Initialise CMdaAudioToneUtility"));
|
sl@0
|
644 |
toneUtil->PrepareToPlayFixedSequence(0);
|
sl@0
|
645 |
INFO_PRINTF1( _L("Cancel Prep CMdaAudioToneUtility"));
|
sl@0
|
646 |
toneUtil->CancelPrepare();
|
sl@0
|
647 |
// make sure init callback did not complete
|
sl@0
|
648 |
if((iError == KErrTimedOut) && (toneUtil->State() != EMdaAudioToneUtilityPrepared))
|
sl@0
|
649 |
ret = EPass;
|
sl@0
|
650 |
|
sl@0
|
651 |
if(ret == EFail)
|
sl@0
|
652 |
ERR_PRINTF2( _L("CMdaAudioToneUtility failed with error %d"),iError );
|
sl@0
|
653 |
|
sl@0
|
654 |
CleanupStack::PopAndDestroy(toneUtil);
|
sl@0
|
655 |
return ret;
|
sl@0
|
656 |
}
|
sl@0
|
657 |
|
sl@0
|
658 |
//------------------------------------------------------------------
|
sl@0
|
659 |
|
sl@0
|
660 |
/**
|
sl@0
|
661 |
* Constructor
|
sl@0
|
662 |
*/
|
sl@0
|
663 |
CTestMmfAclntToneNames::CTestMmfAclntToneNames(const TDesC& aTestName)
|
sl@0
|
664 |
:CTestMmfAclntToneFixed(aTestName,1)
|
sl@0
|
665 |
{}
|
sl@0
|
666 |
|
sl@0
|
667 |
CTestMmfAclntToneNames* CTestMmfAclntToneNames::NewL(const TDesC& aTestName)
|
sl@0
|
668 |
{
|
sl@0
|
669 |
CTestMmfAclntToneNames* self = new (ELeave) CTestMmfAclntToneNames(aTestName);
|
sl@0
|
670 |
return self;
|
sl@0
|
671 |
}
|
sl@0
|
672 |
|
sl@0
|
673 |
/**
|
sl@0
|
674 |
* Enquire sequence name
|
sl@0
|
675 |
*
|
sl@0
|
676 |
* This function cannot leave
|
sl@0
|
677 |
*/
|
sl@0
|
678 |
TVerdict CTestMmfAclntToneNames::DoTestL(CMdaAudioToneUtility* aToneUtil)
|
sl@0
|
679 |
{
|
sl@0
|
680 |
INFO_PRINTF1( _L("TestTone : Seq Name"));
|
sl@0
|
681 |
|
sl@0
|
682 |
TVerdict ret = EPass;
|
sl@0
|
683 |
TBuf<32> seqName;
|
sl@0
|
684 |
TInt count = aToneUtil->FixedSequenceCount();
|
sl@0
|
685 |
|
sl@0
|
686 |
for(TInt i = 0; i < count; i++)
|
sl@0
|
687 |
{
|
sl@0
|
688 |
seqName = aToneUtil->FixedSequenceName(i);
|
sl@0
|
689 |
if(seqName.Length() < 1)
|
sl@0
|
690 |
{
|
sl@0
|
691 |
ret = EFail;
|
sl@0
|
692 |
break;
|
sl@0
|
693 |
}
|
sl@0
|
694 |
}
|
sl@0
|
695 |
return ret;
|
sl@0
|
696 |
}
|
sl@0
|
697 |
|
sl@0
|
698 |
//------------------------------------------------------------------
|
sl@0
|
699 |
|
sl@0
|
700 |
/**
|
sl@0
|
701 |
* Constructor
|
sl@0
|
702 |
*/
|
sl@0
|
703 |
CTestMmfAclntToneCount::CTestMmfAclntToneCount(const TDesC& aTestName)
|
sl@0
|
704 |
:CTestMmfAclntToneFixed(aTestName,1)
|
sl@0
|
705 |
{}
|
sl@0
|
706 |
|
sl@0
|
707 |
CTestMmfAclntToneCount* CTestMmfAclntToneCount::NewL(const TDesC& aTestName)
|
sl@0
|
708 |
{
|
sl@0
|
709 |
CTestMmfAclntToneCount* self = new (ELeave) CTestMmfAclntToneCount(aTestName);
|
sl@0
|
710 |
return self;
|
sl@0
|
711 |
}
|
sl@0
|
712 |
|
sl@0
|
713 |
/**
|
sl@0
|
714 |
* Enquire sequence count
|
sl@0
|
715 |
*/
|
sl@0
|
716 |
TVerdict CTestMmfAclntToneCount::DoTestL(CMdaAudioToneUtility* aToneUtil)
|
sl@0
|
717 |
{
|
sl@0
|
718 |
INFO_PRINTF1( _L("TestTone : Seq Count"));
|
sl@0
|
719 |
|
sl@0
|
720 |
iError = KErrTimedOut;
|
sl@0
|
721 |
|
sl@0
|
722 |
if(aToneUtil->FixedSequenceCount() == KFixedSequenceCount)
|
sl@0
|
723 |
return EPass;
|
sl@0
|
724 |
|
sl@0
|
725 |
return EFail ;
|
sl@0
|
726 |
}
|
sl@0
|
727 |
|
sl@0
|
728 |
//------------------------------------------------------------------
|
sl@0
|
729 |
|
sl@0
|
730 |
/**
|
sl@0
|
731 |
* Constructor
|
sl@0
|
732 |
*/
|
sl@0
|
733 |
CTestMmfAclntToneVolume::CTestMmfAclntToneVolume(const TDesC& aTestName,const TInt aVolume)
|
sl@0
|
734 |
:CTestMmfAclntTone(aTestName), iVolume(aVolume)
|
sl@0
|
735 |
{}
|
sl@0
|
736 |
|
sl@0
|
737 |
CTestMmfAclntToneVolume* CTestMmfAclntToneVolume::NewL(const TDesC& aTestName,const TInt aVolume)
|
sl@0
|
738 |
{
|
sl@0
|
739 |
CTestMmfAclntToneVolume* self = new (ELeave) CTestMmfAclntToneVolume(aTestName,aVolume);
|
sl@0
|
740 |
return self;
|
sl@0
|
741 |
}
|
sl@0
|
742 |
|
sl@0
|
743 |
/**
|
sl@0
|
744 |
* Set volume to max and enquire volume
|
sl@0
|
745 |
*/
|
sl@0
|
746 |
TVerdict CTestMmfAclntToneVolume::DoTestL(CMdaAudioToneUtility* aToneUtil)
|
sl@0
|
747 |
{
|
sl@0
|
748 |
INFO_PRINTF1( _L("TestTone : Volume"));
|
sl@0
|
749 |
|
sl@0
|
750 |
TVerdict ret = EFail;
|
sl@0
|
751 |
|
sl@0
|
752 |
// added from CTestMmfAclntTone : we need the device to be open before
|
sl@0
|
753 |
// SetVolume() will function correctly
|
sl@0
|
754 |
|
sl@0
|
755 |
aToneUtil->Play();
|
sl@0
|
756 |
// wait for play.
|
sl@0
|
757 |
INFO_PRINTF1( _L("Play CMdaAudioToneUtility"));
|
sl@0
|
758 |
|
sl@0
|
759 |
// don't wait for it to finish - run this test while playing
|
sl@0
|
760 |
// so we know device is open
|
sl@0
|
761 |
|
sl@0
|
762 |
// Check maxvolume function
|
sl@0
|
763 |
if(iVolume == -1)
|
sl@0
|
764 |
{
|
sl@0
|
765 |
iVolume = aToneUtil->MaxVolume();
|
sl@0
|
766 |
aToneUtil->SetVolume(iVolume);
|
sl@0
|
767 |
INFO_PRINTF3(_L("volume = %d iVolume = %d"), aToneUtil->Volume(), iVolume);
|
sl@0
|
768 |
if(aToneUtil->Volume() == iVolume)
|
sl@0
|
769 |
ret = EPass;
|
sl@0
|
770 |
}
|
sl@0
|
771 |
// Volume is truncated to maxvolume
|
sl@0
|
772 |
if(iVolume > aToneUtil->MaxVolume())
|
sl@0
|
773 |
{
|
sl@0
|
774 |
aToneUtil->SetVolume(iVolume);
|
sl@0
|
775 |
INFO_PRINTF3(_L("volume = %d maxVolume = %d"), aToneUtil->Volume(), aToneUtil->MaxVolume());
|
sl@0
|
776 |
if(aToneUtil->Volume() == aToneUtil->MaxVolume())
|
sl@0
|
777 |
ret = EPass;
|
sl@0
|
778 |
}
|
sl@0
|
779 |
// Volume is truncated to 0
|
sl@0
|
780 |
else if(iVolume < 0)
|
sl@0
|
781 |
{
|
sl@0
|
782 |
aToneUtil->SetVolume(iVolume);
|
sl@0
|
783 |
INFO_PRINTF2(_L("volume = %d, expecting 0"), aToneUtil->Volume());
|
sl@0
|
784 |
if(aToneUtil->Volume() == 0)
|
sl@0
|
785 |
ret = EPass;
|
sl@0
|
786 |
}
|
sl@0
|
787 |
// Set volume and check
|
sl@0
|
788 |
else
|
sl@0
|
789 |
{
|
sl@0
|
790 |
aToneUtil->SetVolume(iVolume);
|
sl@0
|
791 |
INFO_PRINTF3(_L("volume = %d iVolume = %d"), aToneUtil->Volume(), iVolume);
|
sl@0
|
792 |
if(aToneUtil->Volume() == iVolume)
|
sl@0
|
793 |
ret = EPass;
|
sl@0
|
794 |
}
|
sl@0
|
795 |
|
sl@0
|
796 |
// let it finish playing
|
sl@0
|
797 |
CActiveScheduler::Start();
|
sl@0
|
798 |
|
sl@0
|
799 |
return ret;
|
sl@0
|
800 |
}
|
sl@0
|
801 |
|
sl@0
|
802 |
|
sl@0
|
803 |
//------------------------------------------------------------------
|
sl@0
|
804 |
|
sl@0
|
805 |
/**
|
sl@0
|
806 |
* Constructor
|
sl@0
|
807 |
*/
|
sl@0
|
808 |
CTestMmfAclntVolumeRamp::CTestMmfAclntVolumeRamp(const TDesC& aTestName, const TInt aRamp)
|
sl@0
|
809 |
:CTestMmfAclntTone(aTestName), iRamp(aRamp)
|
sl@0
|
810 |
{}
|
sl@0
|
811 |
|
sl@0
|
812 |
CTestMmfAclntVolumeRamp* CTestMmfAclntVolumeRamp::NewL(const TDesC& aTestName, const TInt aRamp)
|
sl@0
|
813 |
{
|
sl@0
|
814 |
CTestMmfAclntVolumeRamp* self = new (ELeave) CTestMmfAclntVolumeRamp(aTestName,aRamp);
|
sl@0
|
815 |
return self;
|
sl@0
|
816 |
}
|
sl@0
|
817 |
|
sl@0
|
818 |
/**
|
sl@0
|
819 |
* Set volume ramp
|
sl@0
|
820 |
* This function cannot leave
|
sl@0
|
821 |
*/
|
sl@0
|
822 |
TVerdict CTestMmfAclntVolumeRamp::DoTestL(CMdaAudioToneUtility* aToneUtil)
|
sl@0
|
823 |
{
|
sl@0
|
824 |
|
sl@0
|
825 |
INFO_PRINTF1( _L("TestTone : Ramp"));
|
sl@0
|
826 |
|
sl@0
|
827 |
TTimeIntervalMicroSeconds ramp(iRamp);
|
sl@0
|
828 |
aToneUtil->SetVolumeRamp(ramp);
|
sl@0
|
829 |
|
sl@0
|
830 |
// aToneUtil->[Get]VolumeRamp() doesn't exist.
|
sl@0
|
831 |
// For now, if SetVolumeRamp() doesn't panic, we have to return EPass.
|
sl@0
|
832 |
// In future, maybe we can play the clip and get the volume at intervals?
|
sl@0
|
833 |
INFO_PRINTF1(_L("Warning : no API function to get volume ramp"));
|
sl@0
|
834 |
|
sl@0
|
835 |
return EPass;
|
sl@0
|
836 |
}
|
sl@0
|
837 |
|
sl@0
|
838 |
//------------------------------------------------------------------
|
sl@0
|
839 |
|
sl@0
|
840 |
/**
|
sl@0
|
841 |
* Constructor
|
sl@0
|
842 |
*/
|
sl@0
|
843 |
CTestMmfAclntToneRepeat::CTestMmfAclntToneRepeat(const TDesC& aTestName)
|
sl@0
|
844 |
:CTestMmfAclntTone(aTestName)
|
sl@0
|
845 |
{}
|
sl@0
|
846 |
|
sl@0
|
847 |
CTestMmfAclntToneRepeat* CTestMmfAclntToneRepeat::NewL(const TDesC& aTestName)
|
sl@0
|
848 |
{
|
sl@0
|
849 |
CTestMmfAclntToneRepeat* self = new (ELeave) CTestMmfAclntToneRepeat(aTestName);
|
sl@0
|
850 |
return self;
|
sl@0
|
851 |
}
|
sl@0
|
852 |
|
sl@0
|
853 |
/**
|
sl@0
|
854 |
* Set repeats
|
sl@0
|
855 |
*/
|
sl@0
|
856 |
TVerdict CTestMmfAclntToneRepeat::DoTestL(CMdaAudioToneUtility* aToneUtil)
|
sl@0
|
857 |
{
|
sl@0
|
858 |
INFO_PRINTF1( _L("TestTone : Repeats"));
|
sl@0
|
859 |
|
sl@0
|
860 |
iError = KErrTimedOut;
|
sl@0
|
861 |
|
sl@0
|
862 |
TTimeIntervalMicroSeconds silence(0);
|
sl@0
|
863 |
aToneUtil->SetRepeats(NUMBER_OF_REPEATS,silence);
|
sl@0
|
864 |
|
sl@0
|
865 |
TInt duration = I64INT(iDuration.Int64());
|
sl@0
|
866 |
|
sl@0
|
867 |
iError = KErrTimedOut;
|
sl@0
|
868 |
INFO_PRINTF1( _L("Play CMdaAudioToneUtility"));
|
sl@0
|
869 |
aToneUtil->Play();
|
sl@0
|
870 |
|
sl@0
|
871 |
TTime start;
|
sl@0
|
872 |
start.HomeTime();
|
sl@0
|
873 |
CActiveScheduler::Start();
|
sl@0
|
874 |
TTime stop;
|
sl@0
|
875 |
stop.HomeTime();
|
sl@0
|
876 |
|
sl@0
|
877 |
TUint actualDuration = I64INT(stop.MicroSecondsFrom(start).Int64());
|
sl@0
|
878 |
|
sl@0
|
879 |
INFO_PRINTF2(_L("Repeats : %d"), NUMBER_OF_REPEATS);
|
sl@0
|
880 |
INFO_PRINTF6(_L("Error : %d Start = %d Stop = %d Duration = %d ActualDuration = %d"),
|
sl@0
|
881 |
iError, I64INT(start.Int64()), I64INT(stop.Int64()), duration, actualDuration);
|
sl@0
|
882 |
|
sl@0
|
883 |
if((iError == KErrNone) && (TimeComparison(actualDuration, duration * (NUMBER_OF_REPEATS + 1),
|
sl@0
|
884 |
KExpectedDeviation * NUMBER_OF_REPEATS)))
|
sl@0
|
885 |
return EPass;
|
sl@0
|
886 |
|
sl@0
|
887 |
return EFail ;
|
sl@0
|
888 |
}
|
sl@0
|
889 |
|
sl@0
|
890 |
//------------------------------------------------------------------
|
sl@0
|
891 |
|
sl@0
|
892 |
/**
|
sl@0
|
893 |
* Constructor
|
sl@0
|
894 |
*/
|
sl@0
|
895 |
CTestMmfAclntToneLength::CTestMmfAclntToneLength(const TDesC& aTestName)
|
sl@0
|
896 |
:CTestMmfAclntToneDtmf(aTestName,KShortDTMFString)
|
sl@0
|
897 |
{}
|
sl@0
|
898 |
|
sl@0
|
899 |
CTestMmfAclntToneLength* CTestMmfAclntToneLength::NewL(const TDesC& aTestName)
|
sl@0
|
900 |
{
|
sl@0
|
901 |
CTestMmfAclntToneLength* self = new (ELeave) CTestMmfAclntToneLength(aTestName);
|
sl@0
|
902 |
return self;
|
sl@0
|
903 |
}
|
sl@0
|
904 |
|
sl@0
|
905 |
/**
|
sl@0
|
906 |
* Configure tone on length, tone off length, pause length of DTMF Tones
|
sl@0
|
907 |
*/
|
sl@0
|
908 |
TVerdict CTestMmfAclntToneLength::DoTestL(CMdaAudioToneUtility* aToneUtil)
|
sl@0
|
909 |
{
|
sl@0
|
910 |
INFO_PRINTF1( _L("TestTone : Length"));
|
sl@0
|
911 |
|
sl@0
|
912 |
iError = KErrTimedOut;
|
sl@0
|
913 |
TTimeIntervalMicroSeconds32 on(KOneSecond), off(KOneSecond), pause(0);
|
sl@0
|
914 |
|
sl@0
|
915 |
aToneUtil->SetDTMFLengths(on, off, pause);
|
sl@0
|
916 |
|
sl@0
|
917 |
iError = KErrTimedOut;
|
sl@0
|
918 |
INFO_PRINTF1( _L("Play CMdaAudioToneUtility"));
|
sl@0
|
919 |
aToneUtil->Play();
|
sl@0
|
920 |
|
sl@0
|
921 |
TTime start;
|
sl@0
|
922 |
start.HomeTime();
|
sl@0
|
923 |
CActiveScheduler::Start();
|
sl@0
|
924 |
TTime stop;
|
sl@0
|
925 |
stop.HomeTime();
|
sl@0
|
926 |
|
sl@0
|
927 |
TUint actualDuration = I64INT(stop.MicroSecondsFrom(start).Int64());
|
sl@0
|
928 |
|
sl@0
|
929 |
INFO_PRINTF6(_L("Error : %d Start = %d Stop = %d Duration = %d ActualDuration = %d"),
|
sl@0
|
930 |
iError, I64INT(start.Int64()), I64INT(stop.Int64()), KTwoSeconds, actualDuration);
|
sl@0
|
931 |
|
sl@0
|
932 |
if((iError == KErrNone) && (TimeComparison(actualDuration, KTwoSeconds, KExpectedDeviation)))
|
sl@0
|
933 |
return EPass;
|
sl@0
|
934 |
|
sl@0
|
935 |
return EFail ;
|
sl@0
|
936 |
}
|
sl@0
|
937 |
|
sl@0
|
938 |
//------------------------------------------------------------------
|
sl@0
|
939 |
|
sl@0
|
940 |
/**
|
sl@0
|
941 |
* Constructor
|
sl@0
|
942 |
*/
|
sl@0
|
943 |
CTestMmfAclntPriorityTones::CTestMmfAclntPriorityTones()
|
sl@0
|
944 |
{
|
sl@0
|
945 |
// store the name of this test case
|
sl@0
|
946 |
// this is the name that is used by the script file
|
sl@0
|
947 |
// Each test step initialises it's own name
|
sl@0
|
948 |
iTestStepName = _L("MM-MMF-ACLNT-I-0165-HP");
|
sl@0
|
949 |
}
|
sl@0
|
950 |
|
sl@0
|
951 |
void CTestMmfAclntPriorityTones::MchoComplete(TInt aID, TInt aError)
|
sl@0
|
952 |
{
|
sl@0
|
953 |
INFO_PRINTF1( _L("CTestMmfAclntPriorityTones : MMdaAudioToneObserver Callback for CMdaAudioToneUtility called"));
|
sl@0
|
954 |
iError = aError;
|
sl@0
|
955 |
INFO_PRINTF3( _L("iError %d ID %d"), iError, aID);
|
sl@0
|
956 |
|
sl@0
|
957 |
if(iFirstCallback == -1)
|
sl@0
|
958 |
iFirstCallback = aID;
|
sl@0
|
959 |
|
sl@0
|
960 |
if((--iCallbackCount) == 0)
|
sl@0
|
961 |
CActiveScheduler::Stop();
|
sl@0
|
962 |
}
|
sl@0
|
963 |
|
sl@0
|
964 |
/**
|
sl@0
|
965 |
* Set priorities of tones
|
sl@0
|
966 |
*/
|
sl@0
|
967 |
TVerdict CTestMmfAclntPriorityTones::DoTestStepL()
|
sl@0
|
968 |
{
|
sl@0
|
969 |
INFO_PRINTF1( _L("TestTone : Priorities"));
|
sl@0
|
970 |
|
sl@0
|
971 |
iError = KErrTimedOut;
|
sl@0
|
972 |
|
sl@0
|
973 |
CMdaAudioToneUtility* toneUtil[2];
|
sl@0
|
974 |
CToneCallbackHandler* callback[2];
|
sl@0
|
975 |
|
sl@0
|
976 |
for(TInt i=0; i<2; i++)
|
sl@0
|
977 |
{
|
sl@0
|
978 |
callback[i] = new (ELeave) CToneCallbackHandler(i,this);
|
sl@0
|
979 |
CleanupStack::PushL(callback[i]);
|
sl@0
|
980 |
}
|
sl@0
|
981 |
|
sl@0
|
982 |
toneUtil[0] = CMdaAudioToneUtility::NewL(*callback[0],NULL, -10, EMdaPriorityPreferenceTimeAndQuality);
|
sl@0
|
983 |
CleanupStack::PushL(toneUtil[0]);
|
sl@0
|
984 |
toneUtil[1] = CMdaAudioToneUtility::NewL(*callback[1],NULL, 0, EMdaPriorityPreferenceTimeAndQuality);
|
sl@0
|
985 |
CleanupStack::PushL(toneUtil[1]);
|
sl@0
|
986 |
|
sl@0
|
987 |
toneUtil[0]->PrepareToPlayDTMFString(KDTMFString);
|
sl@0
|
988 |
toneUtil[1]->PrepareToPlayDTMFString(KDTMFString);
|
sl@0
|
989 |
|
sl@0
|
990 |
// wait for initilisation callback
|
sl@0
|
991 |
iCallbackCount = 2;
|
sl@0
|
992 |
INFO_PRINTF1( _L("Initialise CMdaAudioToneUtility"));
|
sl@0
|
993 |
INFO_PRINTF1( _L("Initialise CMdaAudioToneUtility"));
|
sl@0
|
994 |
CActiveScheduler::Start();
|
sl@0
|
995 |
|
sl@0
|
996 |
if(iError == KErrNone)
|
sl@0
|
997 |
{
|
sl@0
|
998 |
iError = KErrTimedOut;
|
sl@0
|
999 |
|
sl@0
|
1000 |
toneUtil[0]->Play();
|
sl@0
|
1001 |
toneUtil[1]->Play();
|
sl@0
|
1002 |
|
sl@0
|
1003 |
INFO_PRINTF1( _L("Play CMdaAudioToneUtility"));
|
sl@0
|
1004 |
INFO_PRINTF1( _L("Play CMdaAudioToneUtility"));
|
sl@0
|
1005 |
|
sl@0
|
1006 |
// wait for play to complete
|
sl@0
|
1007 |
iCallbackCount = 2;
|
sl@0
|
1008 |
iFirstCallback = -1;
|
sl@0
|
1009 |
CActiveScheduler::Start();
|
sl@0
|
1010 |
|
sl@0
|
1011 |
if((iError == KErrNone) && (iFirstCallback == 0))
|
sl@0
|
1012 |
{
|
sl@0
|
1013 |
CleanupStack::PopAndDestroy(4);
|
sl@0
|
1014 |
return EPass;
|
sl@0
|
1015 |
}
|
sl@0
|
1016 |
}
|
sl@0
|
1017 |
|
sl@0
|
1018 |
ERR_PRINTF2( _L("CMdaAudioToneUtility failed with error %d"),iError );
|
sl@0
|
1019 |
|
sl@0
|
1020 |
CleanupStack::PopAndDestroy(4);
|
sl@0
|
1021 |
return EFail ;
|
sl@0
|
1022 |
}
|
sl@0
|
1023 |
|
sl@0
|
1024 |
//------------------------------------------------------------------
|
sl@0
|
1025 |
|
sl@0
|
1026 |
/**
|
sl@0
|
1027 |
* Constructor
|
sl@0
|
1028 |
*/
|
sl@0
|
1029 |
CTestMmfAclntToneBalance::CTestMmfAclntToneBalance(const TDesC& aTestName,const TInt aBalance)
|
sl@0
|
1030 |
:CTestMmfAclntTone(aTestName) ,iBalance(aBalance)
|
sl@0
|
1031 |
{}
|
sl@0
|
1032 |
|
sl@0
|
1033 |
CTestMmfAclntToneBalance* CTestMmfAclntToneBalance::NewL(const TDesC& aTestName,const TInt aBalance)
|
sl@0
|
1034 |
{
|
sl@0
|
1035 |
CTestMmfAclntToneBalance* self = new (ELeave) CTestMmfAclntToneBalance(aTestName,aBalance);
|
sl@0
|
1036 |
return self;
|
sl@0
|
1037 |
}
|
sl@0
|
1038 |
|
sl@0
|
1039 |
/**
|
sl@0
|
1040 |
* Set balance and enquire balance
|
sl@0
|
1041 |
*/
|
sl@0
|
1042 |
TVerdict CTestMmfAclntToneBalance::DoTestL(CMdaAudioToneUtility* aToneUtil)
|
sl@0
|
1043 |
{
|
sl@0
|
1044 |
INFO_PRINTF1( _L("TestTone : Balance"));
|
sl@0
|
1045 |
|
sl@0
|
1046 |
if (iBalance < KMinBalance)
|
sl@0
|
1047 |
{
|
sl@0
|
1048 |
TRAPD(err, aToneUtil->SetBalanceL(iBalance));
|
sl@0
|
1049 |
|
sl@0
|
1050 |
if (err != KErrNone)
|
sl@0
|
1051 |
{
|
sl@0
|
1052 |
INFO_PRINTF2(_L("SetBalanceL() returned unexpected error %d"), err);
|
sl@0
|
1053 |
return EFail;
|
sl@0
|
1054 |
}
|
sl@0
|
1055 |
|
sl@0
|
1056 |
if(aToneUtil->GetBalanceL() == KMinBalance)
|
sl@0
|
1057 |
return EPass;
|
sl@0
|
1058 |
}
|
sl@0
|
1059 |
else if (iBalance > KMaxBalance)
|
sl@0
|
1060 |
{
|
sl@0
|
1061 |
TRAPD(err, aToneUtil->SetBalanceL(iBalance));
|
sl@0
|
1062 |
|
sl@0
|
1063 |
if (err != KErrNone)
|
sl@0
|
1064 |
{
|
sl@0
|
1065 |
INFO_PRINTF2(_L("SetBalanceL() returned unexpected error %d"), err);
|
sl@0
|
1066 |
return EFail;
|
sl@0
|
1067 |
}
|
sl@0
|
1068 |
|
sl@0
|
1069 |
if(aToneUtil->GetBalanceL() == KMaxBalance)
|
sl@0
|
1070 |
return EPass;
|
sl@0
|
1071 |
}
|
sl@0
|
1072 |
else
|
sl@0
|
1073 |
{
|
sl@0
|
1074 |
TRAPD(err, aToneUtil->SetBalanceL(iBalance));
|
sl@0
|
1075 |
|
sl@0
|
1076 |
if (err != KErrNone)
|
sl@0
|
1077 |
{
|
sl@0
|
1078 |
INFO_PRINTF2(_L("SetBalanceL() returned unexpected error %d"), err);
|
sl@0
|
1079 |
return EFail;
|
sl@0
|
1080 |
}
|
sl@0
|
1081 |
|
sl@0
|
1082 |
if(aToneUtil->GetBalanceL() == iBalance)
|
sl@0
|
1083 |
return EPass;
|
sl@0
|
1084 |
}
|
sl@0
|
1085 |
|
sl@0
|
1086 |
return EFail;
|
sl@0
|
1087 |
}
|
sl@0
|
1088 |
|
sl@0
|
1089 |
//------------------------------------------------------------------
|
sl@0
|
1090 |
|
sl@0
|
1091 |
// NEGATIVE TESTING
|
sl@0
|
1092 |
|
sl@0
|
1093 |
//------------------------------------------------------------------
|
sl@0
|
1094 |
|
sl@0
|
1095 |
|
sl@0
|
1096 |
|
sl@0
|
1097 |
/**
|
sl@0
|
1098 |
* Constructor
|
sl@0
|
1099 |
*/
|
sl@0
|
1100 |
CTestMmfAclntOnOffPause::CTestMmfAclntOnOffPause()
|
sl@0
|
1101 |
{
|
sl@0
|
1102 |
// store the name of this test case
|
sl@0
|
1103 |
// this is the name that is used by the script file
|
sl@0
|
1104 |
// Each test step initialises it's own name
|
sl@0
|
1105 |
iTestStepName = _L("MM-MMF-ACLNT-I-1155-HP");
|
sl@0
|
1106 |
|
sl@0
|
1107 |
// this test does not inherit from CTestMmfAclntTone
|
sl@0
|
1108 |
// so we need to make the heap bigger here
|
sl@0
|
1109 |
// need a bigger heap size on EKA2 HW
|
sl@0
|
1110 |
#if !defined __WINS__
|
sl@0
|
1111 |
iHeapSize = KHeapSizeToneTestEKA2;
|
sl@0
|
1112 |
#endif // EKA2
|
sl@0
|
1113 |
}
|
sl@0
|
1114 |
|
sl@0
|
1115 |
void CTestMmfAclntOnOffPause::MatoPrepareComplete(TInt aError)
|
sl@0
|
1116 |
{
|
sl@0
|
1117 |
iError = aError;
|
sl@0
|
1118 |
INFO_PRINTF1( _L("CTestMmfAclntOnOffPause::MatoPrepareComplete MMdaAudioToneObserver Callback for CMdaAudioToneUtility complete"));
|
sl@0
|
1119 |
INFO_PRINTF2( _L("iError %d"), iError);
|
sl@0
|
1120 |
CActiveScheduler::Stop();
|
sl@0
|
1121 |
}
|
sl@0
|
1122 |
|
sl@0
|
1123 |
void CTestMmfAclntOnOffPause::MatoPlayComplete(TInt aError)
|
sl@0
|
1124 |
{
|
sl@0
|
1125 |
iError = aError;
|
sl@0
|
1126 |
INFO_PRINTF1( _L("CTestMmfAclntOnOffPause::MatoPlayComplete MMdaAudioToneObserver Callback for CMdaAudioToneUtility complete"));
|
sl@0
|
1127 |
INFO_PRINTF2( _L("iError %d"), iError);
|
sl@0
|
1128 |
CActiveScheduler::Stop();
|
sl@0
|
1129 |
}
|
sl@0
|
1130 |
|
sl@0
|
1131 |
/**
|
sl@0
|
1132 |
* Set up tone on, off and pause length to illegal values.
|
sl@0
|
1133 |
*/
|
sl@0
|
1134 |
TVerdict CTestMmfAclntOnOffPause::DoTestStepL( void )
|
sl@0
|
1135 |
{
|
sl@0
|
1136 |
INFO_PRINTF1( _L("TestTone : On/Off/Pause"));
|
sl@0
|
1137 |
TVerdict res = EFail;
|
sl@0
|
1138 |
|
sl@0
|
1139 |
iError = KErrTimedOut;
|
sl@0
|
1140 |
|
sl@0
|
1141 |
CMdaAudioToneUtility* toneUtil = CMdaAudioToneUtility::NewL(*this);
|
sl@0
|
1142 |
CleanupStack::PushL(toneUtil);
|
sl@0
|
1143 |
toneUtil->PrepareToPlayDTMFString(KDTMFString);
|
sl@0
|
1144 |
// Wait for prepare
|
sl@0
|
1145 |
INFO_PRINTF1( _L("Initialise CMdaAudioToneUtility"));
|
sl@0
|
1146 |
CActiveScheduler::Start();
|
sl@0
|
1147 |
|
sl@0
|
1148 |
if(iError == KErrNone)
|
sl@0
|
1149 |
{
|
sl@0
|
1150 |
iError = KErrTimedOut;
|
sl@0
|
1151 |
|
sl@0
|
1152 |
TTimeIntervalMicroSeconds32 on(-4), off(-3), pause(-5);
|
sl@0
|
1153 |
|
sl@0
|
1154 |
toneUtil->SetDTMFLengths(on, off, pause);
|
sl@0
|
1155 |
|
sl@0
|
1156 |
toneUtil->Play();
|
sl@0
|
1157 |
// wait for play to complete
|
sl@0
|
1158 |
INFO_PRINTF1( _L("Play CMdaAudioToneUtility"));
|
sl@0
|
1159 |
CActiveScheduler::Start();
|
sl@0
|
1160 |
|
sl@0
|
1161 |
// check this worked
|
sl@0
|
1162 |
if(iError == KErrNone)
|
sl@0
|
1163 |
res = EPass;
|
sl@0
|
1164 |
}
|
sl@0
|
1165 |
|
sl@0
|
1166 |
CleanupStack::Pop(); // toneUtil
|
sl@0
|
1167 |
ERR_PRINTF2( _L("CMdaAudioToneUtility completed with error %d"),iError );
|
sl@0
|
1168 |
delete toneUtil;
|
sl@0
|
1169 |
return res;
|
sl@0
|
1170 |
}
|
sl@0
|
1171 |
|