sl@0
|
1 |
// Copyright (c) 2007-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 |
// Declarations of Integration test step classes for A3F DevSound Tone cases.
|
sl@0
|
15 |
//
|
sl@0
|
16 |
//
|
sl@0
|
17 |
|
sl@0
|
18 |
#ifndef TSI_A3F_DEVSOUND_TONE_H
|
sl@0
|
19 |
#define TSI_A3F_DEVSOUND_TONE_H
|
sl@0
|
20 |
|
sl@0
|
21 |
// User includes
|
sl@0
|
22 |
#include "tsi_a3f_devsound_teststep.h"
|
sl@0
|
23 |
|
sl@0
|
24 |
// Enumerations
|
sl@0
|
25 |
enum TDevSoundToneState
|
sl@0
|
26 |
{
|
sl@0
|
27 |
EStateToneStart = 0,
|
sl@0
|
28 |
EStateToneInitializing,
|
sl@0
|
29 |
EStateTonePlaying,
|
sl@0
|
30 |
EStateTonePaused
|
sl@0
|
31 |
};
|
sl@0
|
32 |
|
sl@0
|
33 |
enum TDevSoundToneEvents
|
sl@0
|
34 |
{
|
sl@0
|
35 |
EEventToneStart = 0,
|
sl@0
|
36 |
EEventInitCompleteTone,
|
sl@0
|
37 |
EEventToneTimerComplete
|
sl@0
|
38 |
};
|
sl@0
|
39 |
|
sl@0
|
40 |
class RTestStepA3FDevSoundToneBase : public RAsyncTestStep,
|
sl@0
|
41 |
public MDevSoundObserver
|
sl@0
|
42 |
{
|
sl@0
|
43 |
public:
|
sl@0
|
44 |
// From RAsyncTestStep
|
sl@0
|
45 |
virtual void KickoffTestL();
|
sl@0
|
46 |
void CloseTest();
|
sl@0
|
47 |
|
sl@0
|
48 |
protected:
|
sl@0
|
49 |
RTestStepA3FDevSoundToneBase(const TDesC& aTestName, const TDesC& aSectName);
|
sl@0
|
50 |
RTestStepA3FDevSoundToneBase(const TDesC& aTestName);
|
sl@0
|
51 |
|
sl@0
|
52 |
virtual void DoKickoffTestL() = 0;
|
sl@0
|
53 |
|
sl@0
|
54 |
// Executes the tone events of DevSound using a Finite State Machine
|
sl@0
|
55 |
virtual void Fsm(TDevSoundToneEvents aDevSoundEvent, TInt aError) = 0;
|
sl@0
|
56 |
|
sl@0
|
57 |
// From MDevSoundObserver
|
sl@0
|
58 |
virtual void InitializeComplete(TInt aError);
|
sl@0
|
59 |
virtual void ToneFinished(TInt aError);
|
sl@0
|
60 |
virtual void BufferToBeFilled(CMMFBuffer* aBuffer);
|
sl@0
|
61 |
virtual void PlayError(TInt aError);
|
sl@0
|
62 |
virtual void BufferToBeEmptied(CMMFBuffer* aBuffer);
|
sl@0
|
63 |
virtual void RecordError(TInt aError);
|
sl@0
|
64 |
virtual void ConvertError(TInt aError);
|
sl@0
|
65 |
virtual void DeviceMessage(TUid aMessageType, const TDesC8& aMsg);
|
sl@0
|
66 |
|
sl@0
|
67 |
// Timer Callback
|
sl@0
|
68 |
static TInt TimerCallback(TAny*);
|
sl@0
|
69 |
virtual void DoTimerCallback();
|
sl@0
|
70 |
|
sl@0
|
71 |
TUint ConvertDesToTMMFSampleRate(const TDesC& aSampleRateString);
|
sl@0
|
72 |
|
sl@0
|
73 |
protected:
|
sl@0
|
74 |
|
sl@0
|
75 |
CMMFDevSound* iMMFDevSound;
|
sl@0
|
76 |
TBuf<KNameSize> iSectName;
|
sl@0
|
77 |
CPeriodic* iTimer;
|
sl@0
|
78 |
TCallBack iCallBack;
|
sl@0
|
79 |
TDevSoundToneState iState;
|
sl@0
|
80 |
TPtrC iSampleRate;
|
sl@0
|
81 |
|
sl@0
|
82 |
};
|
sl@0
|
83 |
|
sl@0
|
84 |
/*
|
sl@0
|
85 |
*
|
sl@0
|
86 |
* RStepA3FDevSoundDTMFTonePlay
|
sl@0
|
87 |
* - Set DTMF lengths and play DTMF string
|
sl@0
|
88 |
*
|
sl@0
|
89 |
*/
|
sl@0
|
90 |
class RStepA3FDevSoundDTMFTonePlay : public RTestStepA3FDevSoundToneBase
|
sl@0
|
91 |
{
|
sl@0
|
92 |
public:
|
sl@0
|
93 |
static RStepA3FDevSoundDTMFTonePlay* NewL(const TDesC& aTestName);
|
sl@0
|
94 |
|
sl@0
|
95 |
private:
|
sl@0
|
96 |
RStepA3FDevSoundDTMFTonePlay(const TDesC& aTestName);
|
sl@0
|
97 |
|
sl@0
|
98 |
// From RTestStepA3FDevSoundToneBase
|
sl@0
|
99 |
virtual void DoKickoffTestL();
|
sl@0
|
100 |
virtual void Fsm(TDevSoundToneEvents aDevSoundEvent, TInt aError);
|
sl@0
|
101 |
|
sl@0
|
102 |
};
|
sl@0
|
103 |
|
sl@0
|
104 |
/*
|
sl@0
|
105 |
*
|
sl@0
|
106 |
* RStepA3FDevSoundNormalAndDualTonePlay
|
sl@0
|
107 |
* - Set tone repeats and play normal tone
|
sl@0
|
108 |
* - Set tone repeats and play dual tone
|
sl@0
|
109 |
*
|
sl@0
|
110 |
*/
|
sl@0
|
111 |
class RStepA3FDevSoundNormalAndDualTonePlay : public RTestStepA3FDevSoundToneBase
|
sl@0
|
112 |
{
|
sl@0
|
113 |
public:
|
sl@0
|
114 |
static RStepA3FDevSoundNormalAndDualTonePlay* NewL(const TDesC& aTestName, const TDesC& aSectName);
|
sl@0
|
115 |
|
sl@0
|
116 |
private:
|
sl@0
|
117 |
RStepA3FDevSoundNormalAndDualTonePlay(const TDesC& aTestName, const TDesC& aSectName);
|
sl@0
|
118 |
|
sl@0
|
119 |
// From RTestStepA3FDevSoundToneBase
|
sl@0
|
120 |
virtual void DoKickoffTestL();
|
sl@0
|
121 |
virtual void Fsm(TDevSoundToneEvents aDevSoundEvent, TInt aError);
|
sl@0
|
122 |
|
sl@0
|
123 |
private:
|
sl@0
|
124 |
TInt iRepeat;
|
sl@0
|
125 |
TBool iDualTone;
|
sl@0
|
126 |
|
sl@0
|
127 |
};
|
sl@0
|
128 |
|
sl@0
|
129 |
/*
|
sl@0
|
130 |
*
|
sl@0
|
131 |
* RStepA3FDevSoundInitializeWhileTonePlaying
|
sl@0
|
132 |
*
|
sl@0
|
133 |
*/
|
sl@0
|
134 |
class RStepA3FDevSoundInitializeWhileTonePlaying : public RTestStepA3FDevSoundToneBase
|
sl@0
|
135 |
{
|
sl@0
|
136 |
public:
|
sl@0
|
137 |
static RStepA3FDevSoundInitializeWhileTonePlaying* NewL(const TDesC& aTestName);
|
sl@0
|
138 |
|
sl@0
|
139 |
private:
|
sl@0
|
140 |
RStepA3FDevSoundInitializeWhileTonePlaying(const TDesC& aTestName);
|
sl@0
|
141 |
|
sl@0
|
142 |
// From RTestStepA3FDevSoundToneBase
|
sl@0
|
143 |
virtual void DoKickoffTestL();
|
sl@0
|
144 |
virtual void Fsm(TDevSoundToneEvents aDevSoundEvent, TInt aError);
|
sl@0
|
145 |
|
sl@0
|
146 |
};
|
sl@0
|
147 |
|
sl@0
|
148 |
/*
|
sl@0
|
149 |
*
|
sl@0
|
150 |
* RStepA3FDevSoundNotSupportedPlayFixedSeq
|
sl@0
|
151 |
*
|
sl@0
|
152 |
*/
|
sl@0
|
153 |
class RStepA3FDevSoundNotSupportedPlayFixedSeq : public RTestStepA3FDevSoundToneBase
|
sl@0
|
154 |
{
|
sl@0
|
155 |
public:
|
sl@0
|
156 |
static RStepA3FDevSoundNotSupportedPlayFixedSeq* NewL(const TDesC& aTestName);
|
sl@0
|
157 |
|
sl@0
|
158 |
private:
|
sl@0
|
159 |
RStepA3FDevSoundNotSupportedPlayFixedSeq(const TDesC& aTestName);
|
sl@0
|
160 |
|
sl@0
|
161 |
// From RTestStepA3FDevSoundToneBase
|
sl@0
|
162 |
virtual void DoKickoffTestL();
|
sl@0
|
163 |
virtual void Fsm(TDevSoundToneEvents aDevSoundEvent, TInt aError);
|
sl@0
|
164 |
|
sl@0
|
165 |
};
|
sl@0
|
166 |
|
sl@0
|
167 |
/*
|
sl@0
|
168 |
*
|
sl@0
|
169 |
* RStepA3FDevSoundInvalidInitializeForTone
|
sl@0
|
170 |
*
|
sl@0
|
171 |
*/
|
sl@0
|
172 |
class RStepA3FDevSoundInvalidInitializeForTone : public RTestStepA3FDevSoundToneBase
|
sl@0
|
173 |
{
|
sl@0
|
174 |
public:
|
sl@0
|
175 |
static RStepA3FDevSoundInvalidInitializeForTone* NewL(const TDesC& aTestName);
|
sl@0
|
176 |
|
sl@0
|
177 |
private:
|
sl@0
|
178 |
RStepA3FDevSoundInvalidInitializeForTone(const TDesC& aTestName);
|
sl@0
|
179 |
|
sl@0
|
180 |
// From RTestStepA3FDevSoundToneBase
|
sl@0
|
181 |
virtual void DoKickoffTestL();
|
sl@0
|
182 |
virtual void Fsm(TDevSoundToneEvents aDevSoundEvent, TInt aError);
|
sl@0
|
183 |
|
sl@0
|
184 |
};
|
sl@0
|
185 |
|
sl@0
|
186 |
/*
|
sl@0
|
187 |
*
|
sl@0
|
188 |
* RStepA3FDevSoundCancelInitializeTone
|
sl@0
|
189 |
*
|
sl@0
|
190 |
*/
|
sl@0
|
191 |
class RStepA3FDevSoundCancelInitializeTone : public RTestStepA3FDevSoundToneBase
|
sl@0
|
192 |
{
|
sl@0
|
193 |
public:
|
sl@0
|
194 |
static RStepA3FDevSoundCancelInitializeTone* NewL(const TDesC& aTestName, const TDesC& aSectName);
|
sl@0
|
195 |
|
sl@0
|
196 |
private:
|
sl@0
|
197 |
RStepA3FDevSoundCancelInitializeTone(const TDesC& aTestName, const TDesC& aSectName);
|
sl@0
|
198 |
|
sl@0
|
199 |
// From RTestStepA3FDevSoundToneBase
|
sl@0
|
200 |
virtual void DoKickoffTestL();
|
sl@0
|
201 |
virtual void Fsm(TDevSoundToneEvents aDevSoundEvent, TInt aError);
|
sl@0
|
202 |
|
sl@0
|
203 |
// From TimerCallback
|
sl@0
|
204 |
virtual void DoTimerCallback();
|
sl@0
|
205 |
|
sl@0
|
206 |
// From MDevSoundObserver
|
sl@0
|
207 |
virtual void InitializeComplete(TInt aError);
|
sl@0
|
208 |
|
sl@0
|
209 |
};
|
sl@0
|
210 |
|
sl@0
|
211 |
/*
|
sl@0
|
212 |
*
|
sl@0
|
213 |
* RStepA3FDevSoundEmptyBuffersInitializedForTone
|
sl@0
|
214 |
*
|
sl@0
|
215 |
*/
|
sl@0
|
216 |
class RStepA3FDevSoundEmptyBuffersInitializedForTone : public RTestStepA3FDevSoundToneBase
|
sl@0
|
217 |
{
|
sl@0
|
218 |
public:
|
sl@0
|
219 |
static RStepA3FDevSoundEmptyBuffersInitializedForTone* NewL(const TDesC& aTestName, const TDesC& aSectName);
|
sl@0
|
220 |
|
sl@0
|
221 |
private:
|
sl@0
|
222 |
RStepA3FDevSoundEmptyBuffersInitializedForTone(const TDesC& aTestName, const TDesC& aSectName);
|
sl@0
|
223 |
|
sl@0
|
224 |
// From RTestStepA3FDevSoundToneBase
|
sl@0
|
225 |
virtual void DoKickoffTestL();
|
sl@0
|
226 |
virtual void Fsm(TDevSoundToneEvents aDevSoundEvent, TInt aError);
|
sl@0
|
227 |
|
sl@0
|
228 |
};
|
sl@0
|
229 |
|
sl@0
|
230 |
/*
|
sl@0
|
231 |
*
|
sl@0
|
232 |
* RStepA3FDevSoundEmptyBuffersWhileTonePlaying
|
sl@0
|
233 |
*
|
sl@0
|
234 |
*/
|
sl@0
|
235 |
class RStepA3FDevSoundEmptyBuffersWhileTonePlaying : public RTestStepA3FDevSoundToneBase
|
sl@0
|
236 |
{
|
sl@0
|
237 |
public:
|
sl@0
|
238 |
static RStepA3FDevSoundEmptyBuffersWhileTonePlaying* NewL(const TDesC& aTestName);
|
sl@0
|
239 |
|
sl@0
|
240 |
private:
|
sl@0
|
241 |
RStepA3FDevSoundEmptyBuffersWhileTonePlaying(const TDesC& aTestName);
|
sl@0
|
242 |
|
sl@0
|
243 |
// From RTestStepA3FDevSoundToneBase
|
sl@0
|
244 |
virtual void DoKickoffTestL();
|
sl@0
|
245 |
virtual void Fsm(TDevSoundToneEvents aDevSoundEvent, TInt aError);
|
sl@0
|
246 |
|
sl@0
|
247 |
};
|
sl@0
|
248 |
|
sl@0
|
249 |
#endif // TSI_A3F_DEVSOUND_TONE_H
|