Update contrib.
1 // Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
2 // All rights reserved.
3 // This component and the accompanying materials are made available
4 // under the terms of "Eclipse Public License v1.0"
5 // which accompanies this distribution, and is available
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
14 // Declarations of Integration test step classes for A3F DevSound Play cases.
18 #ifndef TSI_A3F_DEVSOUND_PLAY_H
19 #define TSI_A3F_DEVSOUND_PLAY_H
22 #include "tsi_a3f_devsound_teststep.h"
26 * RTestStepA3FDevSoundPlayBase
29 class RTestStepA3FDevSoundPlayBase : public RAsyncTestStep,
30 public MDevSoundObserver
33 // From RAsyncTestStep
34 virtual void KickoffTestL();
35 virtual void CloseTest();
38 RTestStepA3FDevSoundPlayBase(const TDesC& aTestName, const TDesC& aSectName, const TFourCC& aInputDataType);
39 RTestStepA3FDevSoundPlayBase(const TDesC& aTestName, const TDesC& aSectName);
40 RTestStepA3FDevSoundPlayBase(const TDesC& aTestName, const TFourCC& aInputDataType);
41 RTestStepA3FDevSoundPlayBase(const TDesC& aTestName);
43 virtual void DoKickoffTestL();
45 // Executes the playing events of DevSound using a Finite State Machine
46 virtual void Fsm(TDevSoundPlayEvents aDevSoundEvent, TInt aError);
48 // From MDevSoundObserver
49 virtual void InitializeComplete(TInt aError);
50 virtual void ToneFinished(TInt aError);
51 virtual void BufferToBeFilled(CMMFBuffer* aBuffer);
52 virtual void PlayError(TInt aError);
53 virtual void BufferToBeEmptied(CMMFBuffer* aBuffer);
54 virtual void RecordError(TInt aError);
55 virtual void ConvertError(TInt aError);
56 virtual void DeviceMessage(TUid aMessageType, const TDesC8& aMsg);
59 static TInt TimerCallback(TAny*);
60 virtual void DoTimerCallback();
62 TUint ConvertDesToTMMFSampleRate(const TDesC& aSampleRateString);
63 TUint ConvertDesToTMMFMonoStereo(const TDesC& aMonoStereoString);
64 void DisplayCodecInfo();
65 void SetSampleRateAndChannelMode();
66 void CheckConfigAndFourCCUsage();
71 CMMFDevSound* iMMFDevSound;
75 TFourCC iInputDataType; // datatype (FourCC) of the Decoder
76 TBuf<KNameSize> iSectName;
80 TDevSoundPlayState iPlayState;
90 * RStepA3FDevSoundPlaySimple
93 class RStepA3FDevSoundPlaySimple : public RTestStepA3FDevSoundPlayBase
96 static RStepA3FDevSoundPlaySimple* NewL(const TDesC& aTestName, const TDesC& aSectName, const TFourCC& aInputDataType);
97 static RStepA3FDevSoundPlaySimple* NewL(const TDesC& aTestName, const TDesC& aSectName);
100 RStepA3FDevSoundPlaySimple(const TDesC& aTestName, const TDesC& aSectName, const TFourCC& aInputDataType);
101 RStepA3FDevSoundPlaySimple(const TDesC& aTestName, const TDesC& aSectName);
107 * RStepA3FDevSoundPlayEmpty
110 class RStepA3FDevSoundPlayEmpty : public RTestStepA3FDevSoundPlayBase
113 static RStepA3FDevSoundPlayEmpty* NewL(const TDesC& aTestName, const TDesC& aSectName, const TFourCC& aInputDataType);
116 RStepA3FDevSoundPlayEmpty(const TDesC& aTestName, const TDesC& aSectName, const TFourCC& aInputDataType);
118 // From RTestStepA3FDevSoundPlayBase
119 virtual void Fsm(TDevSoundPlayEvents aDevSoundEvent, TInt aError);
125 * RStepA3FDevSoundPlayInvalidConfig
128 class RStepA3FDevSoundPlayInvalidConfig : public RTestStepA3FDevSoundPlayBase
131 static RStepA3FDevSoundPlayInvalidConfig* NewL(const TDesC& aTestName, const TDesC& aSectName, const TFourCC& aInputDataType);
134 RStepA3FDevSoundPlayInvalidConfig(const TDesC& aTestName, const TDesC& aSectName, const TFourCC& aInputDataType);
136 // From RAsyncTestStep
137 virtual void KickoffTestL();
139 // From MDevSoundObserver
140 virtual void PlayError(TInt aError);
146 * RStepA3FDevSoundPlayInvalidFourCC
149 class RStepA3FDevSoundPlayInvalidFourCC : public RTestStepA3FDevSoundPlayBase
152 static RStepA3FDevSoundPlayInvalidFourCC* NewL(const TDesC& aTestName, const TFourCC& aInputDataType);
155 RStepA3FDevSoundPlayInvalidFourCC(const TDesC& aTestName, const TFourCC& aInputDataType);
157 // From RAsyncTestStep
158 virtual void KickoffTestL();
160 // From RTestStepA3FDevSoundPlayBase
161 virtual void Fsm(TDevSoundPlayEvents aDevSoundEvent, TInt aError);
167 * RStepA3FDevSoundInitializeWithHwDeviceUID
170 class RStepA3FDevSoundInitializeWithHwDeviceUID : public RTestStepA3FDevSoundPlayBase
173 static RStepA3FDevSoundInitializeWithHwDeviceUID* NewL(const TDesC& aTestName);
176 RStepA3FDevSoundInitializeWithHwDeviceUID(const TDesC& aTestName);
178 // From RAsyncTestStep
179 virtual void KickoffTestL();
181 // From RTestStepA3FDevSoundPlayBase
182 virtual void Fsm(TDevSoundPlayEvents aDevSoundEvent, TInt aError);
188 * RStepA3FDevSoundReadConfigDuringPlay
190 class RStepA3FDevSoundReadConfigDuringPlay : public RTestStepA3FDevSoundPlayBase
193 static RStepA3FDevSoundReadConfigDuringPlay* NewL(const TDesC& aTestName, const TDesC& aSectName, const TFourCC& aInputDataType);
196 RStepA3FDevSoundReadConfigDuringPlay(const TDesC& aTestName, const TDesC& aSectName, const TFourCC& aInputDataType);
198 // From MDevSoundObserver
199 virtual void BufferToBeFilled(CMMFBuffer* aBuffer);
205 * RStepA3FDevSoundSetVolPlayStopGetVol
208 class RStepA3FDevSoundSetVolPlayStopGetVol : public RTestStepA3FDevSoundPlayBase
211 static RStepA3FDevSoundSetVolPlayStopGetVol* NewL(const TDesC& aTestName, const TDesC& aSectName, const TFourCC& aInputDataType);
214 RStepA3FDevSoundSetVolPlayStopGetVol(const TDesC& aTestName, const TDesC& aSectName, const TFourCC& aInputDataType);
216 // From RTestStepA3FDevSoundPlayBase
217 virtual void DoKickoffTestL();
218 virtual void Fsm(TDevSoundPlayEvents aEventCode, TInt aError);
219 virtual void DoTimerCallback();
223 TInt iVolDuringStopped;
230 * RStepA3FDevSoundFlushBuffersPaused
233 class RStepA3FDevSoundFlushBuffersPaused : public RTestStepA3FDevSoundPlayBase
236 static RStepA3FDevSoundFlushBuffersPaused* NewL(const TDesC& aTestName, const TDesC& aSectName, const TFourCC& aInputDataType);
239 RStepA3FDevSoundFlushBuffersPaused(const TDesC& aTestName, const TDesC& aSectName, const TFourCC& aInputDataType);
241 // From RTestStepA3FDevSoundPlayBase
242 virtual void Fsm(TDevSoundPlayEvents aEventCode, TInt aError);
243 virtual void DoTimerCallback();
245 // From MDevSoundObserver
246 void BufferToBeFilled(CMMFBuffer* aBuffer);
255 * RStepA3FDevSoundInvalidStatePlay
258 class RStepA3FDevSoundInvalidStatePlay : public RTestStepA3FDevSoundPlayBase
261 static RStepA3FDevSoundInvalidStatePlay* NewL(const TDesC& aTestName, const TDesC& aSectName, const TFourCC& aInputDataType);
264 RStepA3FDevSoundInvalidStatePlay(const TDesC& aTestName, const TDesC& aSectName, const TFourCC& aInputDataType);
266 // From RAsyncTestStep
267 virtual void KickoffTestL();
269 // From RTestStepA3FDevSoundPlayBase
270 virtual void Fsm(TDevSoundPlayEvents aEventCode, TInt aError);
272 // From MDevSoundObserver
273 virtual void BufferToBeFilled(CMMFBuffer* aBuffer);
274 virtual void PlayError(TInt aError);
280 * RStepA3FDevSoundFlushBuffersPlaying
283 class RStepA3FDevSoundFlushBuffersPlaying : public RTestStepA3FDevSoundPlayBase
286 static RStepA3FDevSoundFlushBuffersPlaying* NewL(const TDesC& aTestName, const TDesC& aSectName, const TFourCC& aInputDataType);
289 RStepA3FDevSoundFlushBuffersPlaying(const TDesC& aTestName, const TDesC& aSectName, const TFourCC& aInputDataType);
291 // From RTestStepA3FDevSoundPlayBase
292 virtual void Fsm(TDevSoundPlayEvents aEventCode, TInt aError);
298 * RStepA3FDevSoundInitializeWhilePlaying
301 class RStepA3FDevSoundInitializeWhilePlaying : public RTestStepA3FDevSoundPlayBase
304 static RStepA3FDevSoundInitializeWhilePlaying* NewL(const TDesC& aTestName, const TDesC& aSectName, const TFourCC& aInputDataType);
307 RStepA3FDevSoundInitializeWhilePlaying(const TDesC& aTestName, const TDesC& aSectName, const TFourCC& aInputDataType);
309 // From RTestStepA3FDevSoundPlayBase
310 void Fsm(TDevSoundPlayEvents aEventCode, TInt aError);
311 void DoTimerCallback();
320 * RStepA3FDevSoundSetBalanceDuringPlay
323 class RStepA3FDevSoundSetBalanceDuringPlay : public RTestStepA3FDevSoundPlayBase
326 static RStepA3FDevSoundSetBalanceDuringPlay* NewL(const TDesC& aTestName, const TDesC& aSectName, const TFourCC& aInputDataType);
329 RStepA3FDevSoundSetBalanceDuringPlay(const TDesC& aTestName, const TDesC& aSectName, const TFourCC& aInputDataType);
331 // From RTestStepA3FDevSoundPlayBase
332 virtual void DoKickoffTestL();
334 // From MDevSoundObserver
335 virtual void BufferToBeFilled(CMMFBuffer* aBuffer);
338 TInt iPlaybalanceLeft;
339 TInt iPlaybalanceRight;
345 * RStepA3FDevSoundPlayStopMultipleTimes
348 class RStepA3FDevSoundPlayStopMultipleTimes : public RTestStepA3FDevSoundPlayBase
351 static RStepA3FDevSoundPlayStopMultipleTimes* NewL(const TDesC& aTestName, const TDesC& aSectName, const TFourCC& aInputDataType);
355 RStepA3FDevSoundPlayStopMultipleTimes(const TDesC& aTestName, const TDesC& aSectName, const TFourCC& aInputDataType);
357 // From RTestStepA3FDevSoundPlayBase
358 virtual void DoKickoffTestL();
359 virtual void Fsm(TDevSoundPlayEvents aEventCode, TInt aError);
360 virtual void DoTimerCallback();
371 * RStepA3FDevSoundPlayEOFPlayMultipleTimes
374 class RStepA3FDevSoundPlayEOFPlayMultipleTimes : public RTestStepA3FDevSoundPlayBase
377 static RStepA3FDevSoundPlayEOFPlayMultipleTimes* NewL(const TDesC& aTestName, const TDesC& aSectName);
380 RStepA3FDevSoundPlayEOFPlayMultipleTimes(const TDesC& aTestName, const TDesC& aSectName);
382 // From RTestStepA3FDevSoundPlayBase
383 virtual void DoKickoffTestL();
385 // From MDevSoundObserver
386 virtual void PlayError(TInt aError);
396 * RStepA3FDevSoundInititalizeDuringInitialize
399 class RStepA3FDevSoundInititalizeDuringInitialize : public RTestStepA3FDevSoundPlayBase
402 static RStepA3FDevSoundInititalizeDuringInitialize* NewL(const TDesC& aTestName, const TDesC& aSectName, const TFourCC& aInputDataType);
405 RStepA3FDevSoundInititalizeDuringInitialize(const TDesC& aTestName, const TDesC& aSectName, const TFourCC& aInputDataType);
407 // From RAsyncTestStep
408 virtual void KickoffTestL();
410 // From RTestStepA3FDevSoundPlayBase
411 virtual void Fsm(TDevSoundPlayEvents aEventCode, TInt aError);
413 // From MDevSoundObserver
414 virtual void InitializeComplete(TInt aError);
423 * RStepA3FDevSoundPlayInitDuringPlayInit
426 class RStepA3FDevSoundPlayInitDuringPlayInit : public RTestStepA3FDevSoundPlayBase
429 static RStepA3FDevSoundPlayInitDuringPlayInit* NewL(const TDesC& aTestName, const TDesC& aSectName, const TFourCC& aInputDataType);
432 RStepA3FDevSoundPlayInitDuringPlayInit(const TDesC& aTestName, const TDesC& aSectName, const TFourCC& aInputDataType);
434 // From RASyncTestStep
435 virtual void KickoffTestL();
437 // From RTestStepA3FDevSoundPlayBase
438 virtual void Fsm(TDevSoundPlayEvents aEventCode, TInt aError);
440 // From MDevSoundObserver
441 virtual void BufferToBeFilled(CMMFBuffer* aBuffer);
444 TInt iFirstPlayInitErr;
445 TInt iSecondPlayInitErr;
451 * RStepA3FDevSoundVolumeCrop
454 class RStepA3FDevSoundVolumeCrop : public RTestStepA3FDevSoundPlayBase
457 static RStepA3FDevSoundVolumeCrop* NewL(const TDesC& aTestName, const TDesC& aSectName, const TFourCC& aInputDataType);
460 RStepA3FDevSoundVolumeCrop(const TDesC& aTestName, const TDesC& aSectName, const TFourCC& aInputDataType);
462 // From RAsyncTestStep
463 virtual void KickoffTestL();
465 // From RTestStepA3FDevSoundPlayBase
466 virtual void Fsm(TDevSoundPlayEvents aEventCode, TInt aError);
469 TInt iIncreaseMaxVolume;
476 * RStepA3FDevSoundInitializeForConverting
479 class RStepA3FDevSoundInitializeForConverting : public RTestStepA3FDevSoundPlayBase
482 static RStepA3FDevSoundInitializeForConverting* NewL(const TDesC& aTestName, const TDesC& aSectName, const TFourCC& aInputDataType);
485 RStepA3FDevSoundInitializeForConverting(const TDesC& aTestName, const TDesC& aSectName, const TFourCC& aInputDataType);
487 // From RAsyncTestStep
488 virtual void KickoffTestL();
490 // From RTestStepA3FDevSoundPlayBase
491 virtual void Fsm(TDevSoundPlayEvents aEventCode, TInt aError);
497 * RStepA3FDevSoundGetSampleNumsDuringPlayStop
500 class RStepA3FDevSoundGetSampleNumsAfterStop : public RTestStepA3FDevSoundPlayBase
503 static RStepA3FDevSoundGetSampleNumsAfterStop* NewL(const TDesC& aTestName, const TDesC& aSectName, const TFourCC& aInputDataType);
506 RStepA3FDevSoundGetSampleNumsAfterStop(const TDesC& aTestName, const TDesC& aSectName, const TFourCC& aInputDataType);
508 // From RTestStepA3FDevSoundPlayBase
509 virtual void Fsm(TDevSoundPlayEvents aEventCode, TInt aError);
510 virtual void DoTimerCallback();
519 * RStepA3FDevSoundCancelInitializePlay
522 class RStepA3FDevSoundCancelInitializePlay : public RTestStepA3FDevSoundPlayBase
525 static RStepA3FDevSoundCancelInitializePlay* NewL(const TDesC& aTestName, const TDesC& aSectName, const TFourCC& aInputDataType);
528 RStepA3FDevSoundCancelInitializePlay(const TDesC& aTestName, const TDesC& aSectName, const TFourCC& aInputDataType);
530 // From RTestStepA3FDevSoundPlayBase
531 virtual void Fsm(TDevSoundPlayEvents aEventCode, TInt aError);
532 virtual void DoTimerCallback();
533 virtual void KickoffTestL();
535 // From MDevSoundObserver
536 virtual void InitializeComplete(TInt aError);
542 * RStepA3FDevSoundNegCancelInitializePlay
545 class RStepA3FDevSoundNegCancelInitializePlay : public RTestStepA3FDevSoundPlayBase
548 static RStepA3FDevSoundNegCancelInitializePlay* NewL(const TDesC& aTestName, const TDesC& aSectName, const TFourCC& aInputDataType);
551 RStepA3FDevSoundNegCancelInitializePlay(const TDesC& aTestName, const TDesC& aSectName, const TFourCC& aInputDataType);
553 // From RTestStepA3FDevSoundPlayBase
554 virtual void Fsm(TDevSoundPlayEvents aEventCode, TInt aError);
555 virtual void KickoffTestL();
557 // From MDevSoundObserver
558 virtual void InitializeComplete(TInt aError);
564 * RStepA3FDevSoundEmptyBuffersInCreatedState
567 class RStepA3FDevSoundEmptyBuffersInCreatedState : public RTestStepA3FDevSoundPlayBase
570 static RStepA3FDevSoundEmptyBuffersInCreatedState* NewL(const TDesC& aTestName);
573 RStepA3FDevSoundEmptyBuffersInCreatedState(const TDesC& aTestName);
575 // From RTestStepA3FDevSoundPlayBase
576 virtual void Fsm(TDevSoundPlayEvents aEventCode, TInt aError);
577 virtual void KickoffTestL();
583 * RStepA3FDevSoundEmptyBuffersInInitializedState
586 class RStepA3FDevSoundEmptyBuffersInInitializedState : public RTestStepA3FDevSoundPlayBase
589 static RStepA3FDevSoundEmptyBuffersInInitializedState* NewL(const TDesC& aTestName, const TDesC& aSectName, const TFourCC& aInputDataType);
592 RStepA3FDevSoundEmptyBuffersInInitializedState(const TDesC& aTestName, const TDesC& aSectName, const TFourCC& aInputDataType);
594 // From RTestStepA3FDevSoundPlayBase
595 virtual void Fsm(TDevSoundPlayEvents aEventCode, TInt aError);
596 virtual void KickoffTestL();
602 * RStepA3FDevSoundEmptyBuffersInInitializingState
605 class RStepA3FDevSoundEmptyBuffersInInitializingState : public RTestStepA3FDevSoundPlayBase
608 static RStepA3FDevSoundEmptyBuffersInInitializingState* NewL(const TDesC& aTestName, const TDesC& aSectName, const TFourCC& aInputDataType);
611 RStepA3FDevSoundEmptyBuffersInInitializingState(const TDesC& aTestName, const TDesC& aSectName, const TFourCC& aInputDataType);
613 // From RTestStepA3FDevSoundPlayBase
614 virtual void Fsm(TDevSoundPlayEvents aEventCode, TInt aError);
615 virtual void KickoffTestL();
617 // From MDevSoundObserver
618 virtual void InitializeComplete(TInt aError);
622 #endif // TSI_A3F_DEVSOUND_PLAY_H