1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/mm/devsound/a3fintegrationtest/src/tsi_a3f_devsound_tone.h Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,249 @@
1.4 +// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
1.5 +// All rights reserved.
1.6 +// This component and the accompanying materials are made available
1.7 +// under the terms of "Eclipse Public License v1.0"
1.8 +// which accompanies this distribution, and is available
1.9 +// at the URL "http://www.eclipse.org/legal/epl-v10.html".
1.10 +//
1.11 +// Initial Contributors:
1.12 +// Nokia Corporation - initial contribution.
1.13 +//
1.14 +// Contributors:
1.15 +//
1.16 +// Description:
1.17 +// Declarations of Integration test step classes for A3F DevSound Tone cases.
1.18 +//
1.19 +//
1.20 +
1.21 +#ifndef TSI_A3F_DEVSOUND_TONE_H
1.22 +#define TSI_A3F_DEVSOUND_TONE_H
1.23 +
1.24 +// User includes
1.25 +#include "tsi_a3f_devsound_teststep.h"
1.26 +
1.27 +// Enumerations
1.28 +enum TDevSoundToneState
1.29 + {
1.30 + EStateToneStart = 0,
1.31 + EStateToneInitializing,
1.32 + EStateTonePlaying,
1.33 + EStateTonePaused
1.34 + };
1.35 +
1.36 +enum TDevSoundToneEvents
1.37 + {
1.38 + EEventToneStart = 0,
1.39 + EEventInitCompleteTone,
1.40 + EEventToneTimerComplete
1.41 + };
1.42 +
1.43 +class RTestStepA3FDevSoundToneBase : public RAsyncTestStep,
1.44 + public MDevSoundObserver
1.45 + {
1.46 +public:
1.47 + // From RAsyncTestStep
1.48 + virtual void KickoffTestL();
1.49 + void CloseTest();
1.50 +
1.51 +protected:
1.52 + RTestStepA3FDevSoundToneBase(const TDesC& aTestName, const TDesC& aSectName);
1.53 + RTestStepA3FDevSoundToneBase(const TDesC& aTestName);
1.54 +
1.55 + virtual void DoKickoffTestL() = 0;
1.56 +
1.57 + // Executes the tone events of DevSound using a Finite State Machine
1.58 + virtual void Fsm(TDevSoundToneEvents aDevSoundEvent, TInt aError) = 0;
1.59 +
1.60 + // From MDevSoundObserver
1.61 + virtual void InitializeComplete(TInt aError);
1.62 + virtual void ToneFinished(TInt aError);
1.63 + virtual void BufferToBeFilled(CMMFBuffer* aBuffer);
1.64 + virtual void PlayError(TInt aError);
1.65 + virtual void BufferToBeEmptied(CMMFBuffer* aBuffer);
1.66 + virtual void RecordError(TInt aError);
1.67 + virtual void ConvertError(TInt aError);
1.68 + virtual void DeviceMessage(TUid aMessageType, const TDesC8& aMsg);
1.69 +
1.70 + // Timer Callback
1.71 + static TInt TimerCallback(TAny*);
1.72 + virtual void DoTimerCallback();
1.73 +
1.74 + TUint ConvertDesToTMMFSampleRate(const TDesC& aSampleRateString);
1.75 +
1.76 +protected:
1.77 +
1.78 + CMMFDevSound* iMMFDevSound;
1.79 + TBuf<KNameSize> iSectName;
1.80 + CPeriodic* iTimer;
1.81 + TCallBack iCallBack;
1.82 + TDevSoundToneState iState;
1.83 + TPtrC iSampleRate;
1.84 +
1.85 + };
1.86 +
1.87 +/*
1.88 + *
1.89 + * RStepA3FDevSoundDTMFTonePlay
1.90 + * - Set DTMF lengths and play DTMF string
1.91 + *
1.92 + */
1.93 +class RStepA3FDevSoundDTMFTonePlay : public RTestStepA3FDevSoundToneBase
1.94 + {
1.95 +public:
1.96 + static RStepA3FDevSoundDTMFTonePlay* NewL(const TDesC& aTestName);
1.97 +
1.98 +private:
1.99 + RStepA3FDevSoundDTMFTonePlay(const TDesC& aTestName);
1.100 +
1.101 + // From RTestStepA3FDevSoundToneBase
1.102 + virtual void DoKickoffTestL();
1.103 + virtual void Fsm(TDevSoundToneEvents aDevSoundEvent, TInt aError);
1.104 +
1.105 + };
1.106 +
1.107 +/*
1.108 + *
1.109 + * RStepA3FDevSoundNormalAndDualTonePlay
1.110 + * - Set tone repeats and play normal tone
1.111 + * - Set tone repeats and play dual tone
1.112 + *
1.113 + */
1.114 +class RStepA3FDevSoundNormalAndDualTonePlay : public RTestStepA3FDevSoundToneBase
1.115 + {
1.116 +public:
1.117 + static RStepA3FDevSoundNormalAndDualTonePlay* NewL(const TDesC& aTestName, const TDesC& aSectName);
1.118 +
1.119 +private:
1.120 + RStepA3FDevSoundNormalAndDualTonePlay(const TDesC& aTestName, const TDesC& aSectName);
1.121 +
1.122 + // From RTestStepA3FDevSoundToneBase
1.123 + virtual void DoKickoffTestL();
1.124 + virtual void Fsm(TDevSoundToneEvents aDevSoundEvent, TInt aError);
1.125 +
1.126 +private:
1.127 + TInt iRepeat;
1.128 + TBool iDualTone;
1.129 +
1.130 + };
1.131 +
1.132 +/*
1.133 + *
1.134 + * RStepA3FDevSoundInitializeWhileTonePlaying
1.135 + *
1.136 + */
1.137 +class RStepA3FDevSoundInitializeWhileTonePlaying : public RTestStepA3FDevSoundToneBase
1.138 + {
1.139 +public:
1.140 + static RStepA3FDevSoundInitializeWhileTonePlaying* NewL(const TDesC& aTestName);
1.141 +
1.142 +private:
1.143 + RStepA3FDevSoundInitializeWhileTonePlaying(const TDesC& aTestName);
1.144 +
1.145 + // From RTestStepA3FDevSoundToneBase
1.146 + virtual void DoKickoffTestL();
1.147 + virtual void Fsm(TDevSoundToneEvents aDevSoundEvent, TInt aError);
1.148 +
1.149 + };
1.150 +
1.151 +/*
1.152 + *
1.153 + * RStepA3FDevSoundNotSupportedPlayFixedSeq
1.154 + *
1.155 + */
1.156 +class RStepA3FDevSoundNotSupportedPlayFixedSeq : public RTestStepA3FDevSoundToneBase
1.157 + {
1.158 +public:
1.159 + static RStepA3FDevSoundNotSupportedPlayFixedSeq* NewL(const TDesC& aTestName);
1.160 +
1.161 +private:
1.162 + RStepA3FDevSoundNotSupportedPlayFixedSeq(const TDesC& aTestName);
1.163 +
1.164 + // From RTestStepA3FDevSoundToneBase
1.165 + virtual void DoKickoffTestL();
1.166 + virtual void Fsm(TDevSoundToneEvents aDevSoundEvent, TInt aError);
1.167 +
1.168 + };
1.169 +
1.170 +/*
1.171 + *
1.172 + * RStepA3FDevSoundInvalidInitializeForTone
1.173 + *
1.174 + */
1.175 +class RStepA3FDevSoundInvalidInitializeForTone : public RTestStepA3FDevSoundToneBase
1.176 + {
1.177 +public:
1.178 + static RStepA3FDevSoundInvalidInitializeForTone* NewL(const TDesC& aTestName);
1.179 +
1.180 +private:
1.181 + RStepA3FDevSoundInvalidInitializeForTone(const TDesC& aTestName);
1.182 +
1.183 + // From RTestStepA3FDevSoundToneBase
1.184 + virtual void DoKickoffTestL();
1.185 + virtual void Fsm(TDevSoundToneEvents aDevSoundEvent, TInt aError);
1.186 +
1.187 + };
1.188 +
1.189 +/*
1.190 + *
1.191 + * RStepA3FDevSoundCancelInitializeTone
1.192 + *
1.193 + */
1.194 +class RStepA3FDevSoundCancelInitializeTone : public RTestStepA3FDevSoundToneBase
1.195 + {
1.196 +public:
1.197 + static RStepA3FDevSoundCancelInitializeTone* NewL(const TDesC& aTestName, const TDesC& aSectName);
1.198 +
1.199 +private:
1.200 + RStepA3FDevSoundCancelInitializeTone(const TDesC& aTestName, const TDesC& aSectName);
1.201 +
1.202 + // From RTestStepA3FDevSoundToneBase
1.203 + virtual void DoKickoffTestL();
1.204 + virtual void Fsm(TDevSoundToneEvents aDevSoundEvent, TInt aError);
1.205 +
1.206 + // From TimerCallback
1.207 + virtual void DoTimerCallback();
1.208 +
1.209 + // From MDevSoundObserver
1.210 + virtual void InitializeComplete(TInt aError);
1.211 +
1.212 + };
1.213 +
1.214 +/*
1.215 + *
1.216 + * RStepA3FDevSoundEmptyBuffersInitializedForTone
1.217 + *
1.218 + */
1.219 +class RStepA3FDevSoundEmptyBuffersInitializedForTone : public RTestStepA3FDevSoundToneBase
1.220 + {
1.221 +public:
1.222 + static RStepA3FDevSoundEmptyBuffersInitializedForTone* NewL(const TDesC& aTestName, const TDesC& aSectName);
1.223 +
1.224 +private:
1.225 + RStepA3FDevSoundEmptyBuffersInitializedForTone(const TDesC& aTestName, const TDesC& aSectName);
1.226 +
1.227 + // From RTestStepA3FDevSoundToneBase
1.228 + virtual void DoKickoffTestL();
1.229 + virtual void Fsm(TDevSoundToneEvents aDevSoundEvent, TInt aError);
1.230 +
1.231 + };
1.232 +
1.233 +/*
1.234 + *
1.235 + * RStepA3FDevSoundEmptyBuffersWhileTonePlaying
1.236 + *
1.237 + */
1.238 +class RStepA3FDevSoundEmptyBuffersWhileTonePlaying : public RTestStepA3FDevSoundToneBase
1.239 + {
1.240 +public:
1.241 + static RStepA3FDevSoundEmptyBuffersWhileTonePlaying* NewL(const TDesC& aTestName);
1.242 +
1.243 +private:
1.244 + RStepA3FDevSoundEmptyBuffersWhileTonePlaying(const TDesC& aTestName);
1.245 +
1.246 + // From RTestStepA3FDevSoundToneBase
1.247 + virtual void DoKickoffTestL();
1.248 + virtual void Fsm(TDevSoundToneEvents aDevSoundEvent, TInt aError);
1.249 +
1.250 + };
1.251 +
1.252 +#endif // TSI_A3F_DEVSOUND_TONE_H