os/mm/mmlibs/mmfw/tsrc/mmfintegrationtest/SDevSound/SDSCapTestServer/src/CapTestStep.h
First public contribution.
1 // Copyright (c) 2004-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.
16 #ifndef __CAPTESTSTEP_H__
17 #define __CAPTESTSTEP_H__
19 #include <mdaaudiosampleeditor.h>
20 #include <simulprocserver.h>
21 #include <mmf/server/sounddevice.h>
23 const TInt KDevSoundPriorityLow=0;
24 const TInt KDevSoundPriorityHigh=100;
28 * CActiveListener provides the asynchronous operation
31 * @lib "TSI_MMF_SDEVSOUND_SUITE.lib"
35 class CActiveListener : public CActive
38 CActiveListener() : CActive(CActive::EPriorityStandard)
40 CActiveScheduler::Add(this);
42 void InitialiseActiveListener()
44 iStatus = KRequestPending;
50 CActiveScheduler::Stop();
52 virtual void DoCancel()
54 CActiveScheduler::Stop();
58 class CDevSoundTestStepBase : public CSimulProcTestStep, public MDevSoundObserver
61 static CDevSoundTestStepBase* NewL();
63 virtual void StartProcessing(TRequestStatus& aStatus);
64 virtual TVerdict EndProcessingAndReturnResult(TDes8& aMessage);
65 virtual ~CDevSoundTestStepBase();
80 void InitializeComplete (TInt aError);
81 void ToneFinished (TInt aError);
82 void BufferToBeFilled (CMMFBuffer* aBuffer);
83 void PlayError (TInt aError);
84 void BufferToBeEmptied (CMMFBuffer* aBuffer);
85 void RecordError (TInt aError);
86 void ConvertError (TInt aError);
87 void DeviceMessage (TUid aMessageType, const TDesC8& aMsg);
89 TVerdict ConstructDevSound();
90 TVerdict DoTestStepPreambleL();
91 TVerdict TestInitialize(TMMFState aMode);
92 TVerdict TestPlayTone(TInt aFreq, TTimeIntervalMicroSeconds aDur);
93 void TestSetVolume(TInt aVol);
94 void TestSetPriority(TInt aPriority);
95 void TestSetGain(TInt aGain);
98 CDevSoundTestStepBase();
100 TRequestStatus* iStatus;
103 TFixedArray<TInt, 7> iCallbackArray;
104 void ResetCallbacks();
105 TInt GetCallbackTotal();
109 CMMFDevSound* iMMFDevSound;
115 //class CTestStep1 : public CSimulProcTestStep, /*public MMdaObjectStateChangeObserver,*/ public MDevSoundObserver
116 class CTestStep1 : public CDevSoundTestStepBase
119 static CTestStep1* NewL();
121 virtual void StartProcessing(TRequestStatus& aStatus);
122 virtual TVerdict EndProcessingAndReturnResult(TDes8& aMessage);
123 virtual ~CTestStep1();
126 void InitializeComplete (TInt aError);
127 void ToneFinished (TInt aError);
129 TVerdict DoPlaySimpleTone();
130 TVerdict TestInitialize(TMMFState aMode);
131 TVerdict TestPlayTone(TInt aFreq, TTimeIntervalMicroSeconds aDur);
134 TBool iIsFirstPlayed;