Update contrib.
2 * Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies).
4 * This component and the accompanying materials are made available
5 * under the terms of "Eclipse Public License v1.0"
6 * which accompanies this distribution, and is available
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
9 * Initial Contributors:
10 * Nokia Corporation - initial contribution.
14 * Description: Effects console test
21 #ifndef EFFECTSCONSOLETEST
22 #define EFFECTSCONSOLETEST
28 #include <mdaaudiosampleplayer.h>
29 #include <MdaAudioSampleEditor.h>
31 #include <AudioEffectBase.h>
32 #include <MAudioEffectObserver.h>
33 #include <AudioEqualizerBase.h>
34 #include <MAudioEqualizerObserver.h>
35 #include <EnvironmentalReverbBase.h>
36 #include <MEnvironmentalReverbObserver.h>
37 #include <StereoWideningBase.h>
38 #include <MStereoWideningObserver.h>
40 #include <customInterfaceUtility.h>
42 _LIT(KAMRTestFile,"c:\\test.amr");
43 _LIT(KWAVTestFile,"c:\\test.wav");
46 //////////////////////////////////////////////////////////////////////////////
48 // -----> CmyActiveScheduler (definition)
50 //////////////////////////////////////////////////////////////////////////////
51 class CmyActiveScheduler : public CActiveScheduler
54 void Error (TInt aError) const;
58 //////////////////////////////////////////////////////////////////////////////
60 // -----> CActiveConsole (definition)
62 // An abstract class which provides the facility to issue key requests.
64 //////////////////////////////////////////////////////////////////////////////
65 class CActiveConsole : public CActive
69 CActiveConsole(CConsoleBase* aConsole);
71 static CActiveConsole* NewLC(CConsoleBase* aConsole) ;
75 void RequestCharacter();
78 // Defined as pure virtual by CActive;
79 // implementation provided by this class.
82 // Service completed request.
83 // Defined as pure virtual by CActive;
84 // implementation provided by this class,
87 // Called from RunL() - an implementation must be provided
88 // by derived classes to handle the completed request
89 virtual void ProcessKeyPress(TChar aChar) = 0;
92 // Data members defined by this class
93 CConsoleBase* iConsole; // A console for reading from
96 //////////////////////////////////////////////////////////////////////////////
98 // -----> CConsoleTest (definition)
100 // This class is derived from CActiveConsole.
101 // Request handling: accepts input from the keyboard and outputs the
102 // test result through test harness.
104 //////////////////////////////////////////////////////////////////////////////
105 class CConsoleTest : public CActiveConsole,
106 public MMdaAudioPlayerCallback,
107 public MMdaObjectStateChangeObserver,
108 public MAudioEffectObserver
109 //public MAudioEqualizerObserver
122 EEnvironmentalReverb1,
123 EEnvironmentalReverb2,
133 // Static constuction
134 static CConsoleTest *NewLC (CConsoleBase* aConsole);
135 static CConsoleTest *NewL(CConsoleBase* aConsole);
137 virtual void MapcInitComplete(TInt aError, const TTimeIntervalMicroSeconds& aDuration);
138 virtual void MapcPlayComplete(TInt aError);
139 virtual void MoscoStateChangeEvent(CBase* aObject, TInt aPreviousState, TInt aCurrentState, TInt aErrorcCode);
140 virtual void EffectChanged( const CAudioEffect* aAudioEffect, TUint8 aEvent );
144 void ProcessKeyPress(TChar aChar);
150 CConsoleTest(CConsoleBase* aConsole);
151 void ProcessMain(TChar aChar);
152 void ProcessPlayL(TChar aChar);
153 void ProcessEqualizerL(TChar aChar);
154 void ProcessBandId(TChar aChar);
155 void ProcessBandLevelL(TChar aChar);
156 void InitializeTestData();
157 void ProcessEnvironmentalReverbL(TChar aChar);
161 void ProcessStereoWideningL(TChar aChar);
162 void ProcessStereoWideningLevelL(TChar aChar);
174 CCustomInterfaceUtility* iCIUtility;
176 CMdaAudioPlayerUtility* iAudioPlayer;
177 CAudioEqualizer* iPlayerAudioEqualizer;
178 CEnvironmentalReverb* iPlayerEnvironmentalReverb;
179 CStereoWidening* iPlayerStereoWidening;
181 CMdaAudioRecorderUtility* iAudioRecorder;
182 CAudioEqualizer* iRecorderAudioEqualizer;
183 CEnvironmentalReverb* iRecorderEnvironmentalReverb;
184 CStereoWidening* iRecorderStereoWidening;
186 CMdaAudioConvertUtility* iAudioConverter;
188 CAudioEqualizer* iEqualizer;
189 CEnvironmentalReverb* iEnvironmentalReverb;
190 CStereoWidening* iStereoWidening;
193 CAudioEqualizer* iAudioEqualizer;
195 TBuf<100> iSampleFilePath;
199 RArray<TInt> iGoodData;
200 RArray<TInt> iBadData;
204 //////////////////////////////////////////////////////////////////////////////
208 //////////////////////////////////////////////////////////////////////////////
210 _LIT(KTxtDBTest, "Effects Console Test");
212 LOCAL_C void doTestL();
214 GLDEF_C TInt E32Main() // main function called by E32
217 CTrapCleanup* cleanup=CTrapCleanup::New(); // get clean-up stack
218 TRAPD(error, doTestL());
219 __ASSERT_ALWAYS(!error,User::Panic(KTxtDBTest, error));
220 delete cleanup; // destroy clean-up stack
222 return 0; // and return