sl@0
|
1 |
// Copyright (c) 2008-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 |
//
|
sl@0
|
15 |
|
sl@0
|
16 |
#ifndef CHAR_A3F_DEVSOUND_COMPLIANCESUITECONSTANTS_H
|
sl@0
|
17 |
#define CHAR_A3F_DEVSOUND_COMPLIANCESUITECONSTANTS_H
|
sl@0
|
18 |
|
sl@0
|
19 |
|
sl@0
|
20 |
// constant declarations
|
sl@0
|
21 |
const TInt KMaxStringLength = 255; // Used to define DTMF length
|
sl@0
|
22 |
const TInt KSizeBuf = 256;
|
sl@0
|
23 |
const TInt KMicrosecsInTenSec = 10000000;
|
sl@0
|
24 |
const TInt KMicroSecsInOneSec = 1000000;
|
sl@0
|
25 |
const TInt KMicroSecsTwoSec = 2000000;
|
sl@0
|
26 |
const TInt KMinimumPriority = -100;
|
sl@0
|
27 |
const TInt KMaximumPriority = 100;
|
sl@0
|
28 |
const TInt KFourCCMaxBitDisplacement = 24;
|
sl@0
|
29 |
const TInt K8Bits = 8;
|
sl@0
|
30 |
const TInt KTFourCC = 4;
|
sl@0
|
31 |
const TInt KMaxSampleRateStringLength = 21;
|
sl@0
|
32 |
const TInt KMaxChannelsStringLength = 10;
|
sl@0
|
33 |
const TInt KExtraVolume = 50;
|
sl@0
|
34 |
// To compute elapsed time for some timed test cases
|
sl@0
|
35 |
const TInt64 KPlayVarianceTime = 1500000; // 1.5 seconds
|
sl@0
|
36 |
const TInt KMaxSpeakerBalanceValue = 100;
|
sl@0
|
37 |
const TInt KMinSpeakerBalanceValue = 0;
|
sl@0
|
38 |
const TInt KMaxRecordBalanceValue = 100;
|
sl@0
|
39 |
|
sl@0
|
40 |
|
sl@0
|
41 |
_LIT(KMsgDeleteDevsound, "---- Deleting DevSound object ----");
|
sl@0
|
42 |
_LIT(KMsgErrorGetParameter,"Error in getting parameter %S from INI file");
|
sl@0
|
43 |
_LIT(KMsgErrorDevSoundCallback,"DevSound called %S() callback with error = %d");
|
sl@0
|
44 |
_LIT(KMsgErrorFourccLength,"Error in getting parameter length from INI file %d");
|
sl@0
|
45 |
|
sl@0
|
46 |
_LIT(KInitializeCompleteText, "InitializeComplete");
|
sl@0
|
47 |
_LIT(KPlayErrorText, "PlayError");
|
sl@0
|
48 |
_LIT(KRecordErrorText, "RecordError");
|
sl@0
|
49 |
_LIT(KToneFinishedText, "ToneFinished");
|
sl@0
|
50 |
|
sl@0
|
51 |
// Section error name keys
|
sl@0
|
52 |
_LIT(KExpectedError, "ExpectedError");
|
sl@0
|
53 |
|
sl@0
|
54 |
_LIT(KEMMFSampleRate8000Hz,"EMMFSampleRate8000Hz");
|
sl@0
|
55 |
_LIT(KEMMFSampleRate11025Hz,"EMMFSampleRate11025Hz");
|
sl@0
|
56 |
_LIT(KEMMFSampleRate16000Hz,"EMMFSampleRate16000Hz");
|
sl@0
|
57 |
_LIT(KEMMFSampleRate22050Hz,"EMMFSampleRate22050Hz");
|
sl@0
|
58 |
_LIT(KEMMFSampleRate32000Hz,"EMMFSampleRate32000Hz");
|
sl@0
|
59 |
_LIT(KEMMFSampleRate44100Hz,"EMMFSampleRate44100Hz");
|
sl@0
|
60 |
_LIT(KEMMFSampleRate48000Hz,"EMMFSampleRate48000Hz");
|
sl@0
|
61 |
_LIT(KEMMFSampleRate88200Hz,"EMMFSampleRate88200Hz");
|
sl@0
|
62 |
_LIT(KEMMFSampleRate96000Hz,"EMMFSampleRate96000Hz");
|
sl@0
|
63 |
_LIT(KEMMFSampleRate12000Hz,"EMMFSampleRate12000Hz");
|
sl@0
|
64 |
_LIT(KEMMFSampleRate24000Hz,"EMMFSampleRate24000Hz");
|
sl@0
|
65 |
_LIT(KEMMFSampleRate64000Hz,"EMMFSampleRate64000Hz");
|
sl@0
|
66 |
|
sl@0
|
67 |
_LIT(KEMMFMono,"EMMFMono");
|
sl@0
|
68 |
_LIT(KEMMFStereo,"EMMFStereo");
|
sl@0
|
69 |
|
sl@0
|
70 |
// Section name keys
|
sl@0
|
71 |
_LIT(KSampleRate, "SampleRate");
|
sl@0
|
72 |
_LIT(KChannel, "Channel");
|
sl@0
|
73 |
_LIT(KPriority, "Priority");
|
sl@0
|
74 |
_LIT(KVolume, "Volume");
|
sl@0
|
75 |
_LIT(KExVolume, "ExVolume");
|
sl@0
|
76 |
_LIT(KGain, "Gain");
|
sl@0
|
77 |
_LIT(KExGain, "ExGain");
|
sl@0
|
78 |
_LIT(KVolumeRamp, "VolumeRamp");
|
sl@0
|
79 |
_LIT(KRepeatCount, "RepeatCount");
|
sl@0
|
80 |
_LIT(KRepeatTrailingSilence, "RepeatTrailingSilence");
|
sl@0
|
81 |
_LIT(KToneOnLength, "ToneOnLength");
|
sl@0
|
82 |
_LIT(KToneOffLength, "ToneOffLength");
|
sl@0
|
83 |
_LIT(KPauseLength, "PauseLength");
|
sl@0
|
84 |
_LIT(KFilename, "Filename");
|
sl@0
|
85 |
_LIT(KOtherFilename, "OtherFilename");
|
sl@0
|
86 |
_LIT(KDuration, "Duration");
|
sl@0
|
87 |
_LIT(KFrequencyTone1, "FrequencyTone1");
|
sl@0
|
88 |
_LIT(KFrequencyTone2, "FrequencyTone2");
|
sl@0
|
89 |
_LIT(KDTMFString, "DTMFString");
|
sl@0
|
90 |
_LIT(KInvalidToneSequence,"InvalidToneSequence");
|
sl@0
|
91 |
_LIT(KLSpeakerBalance, "LSpeakerBalance");
|
sl@0
|
92 |
_LIT(KRSpeakerBalance, "RSpeakerBalance");
|
sl@0
|
93 |
_LIT(KLRecordBalance, "LRecordBalance");
|
sl@0
|
94 |
_LIT(KRRecordBalance, "RRecordBalance");
|
sl@0
|
95 |
_LIT(KExLSpeakerBalance, "ExLSpeakerBalance");
|
sl@0
|
96 |
_LIT(KExRSpeakerBalance, "ExRSpeakerBalance");
|
sl@0
|
97 |
_LIT(KExLRecordBalance, "ExLRecordBalance");
|
sl@0
|
98 |
_LIT(KExRRecordBalance, "ExRRecordBalance");
|
sl@0
|
99 |
_LIT(KFourccCode, "FourccCode");
|
sl@0
|
100 |
_LIT(KExSamplesPlayed, "ExSamplesPlayed");
|
sl@0
|
101 |
_LIT(KExSamplesRecorded, "ExSamplesRecorded");
|
sl@0
|
102 |
_LIT(KExCapChannels, "ExCapChannels");
|
sl@0
|
103 |
_LIT(KExCapRate, "ExCapRate");
|
sl@0
|
104 |
|
sl@0
|
105 |
|
sl@0
|
106 |
enum TPanicCodes
|
sl@0
|
107 |
{
|
sl@0
|
108 |
EFsmIncorrectErrorPassed = 0,
|
sl@0
|
109 |
EInvalidCallbackCall
|
sl@0
|
110 |
};
|
sl@0
|
111 |
|
sl@0
|
112 |
// DevSound events
|
sl@0
|
113 |
enum TMmfDevSoundEvent
|
sl@0
|
114 |
{
|
sl@0
|
115 |
EEventInitialize = 0,
|
sl@0
|
116 |
EEventInitComplete,
|
sl@0
|
117 |
EEventBTBF,
|
sl@0
|
118 |
EEventBTBE,
|
sl@0
|
119 |
EResourceAvailable,
|
sl@0
|
120 |
EEventTimerComplete
|
sl@0
|
121 |
};
|
sl@0
|
122 |
|
sl@0
|
123 |
// DevSound states
|
sl@0
|
124 |
enum TMmfDevSoundState
|
sl@0
|
125 |
{
|
sl@0
|
126 |
EStateInitial = 0,
|
sl@0
|
127 |
EStateCreated,
|
sl@0
|
128 |
EStateInitializing,
|
sl@0
|
129 |
EStatePlaying,
|
sl@0
|
130 |
EStateRecording,
|
sl@0
|
131 |
EStatePause,
|
sl@0
|
132 |
EStateResumePlaying
|
sl@0
|
133 |
};
|
sl@0
|
134 |
|
sl@0
|
135 |
// User defined "devSound client" error codes
|
sl@0
|
136 |
enum TMmfDevSoundClientErrorCodes
|
sl@0
|
137 |
{
|
sl@0
|
138 |
EInvalidClientFSMEvent = 1,
|
sl@0
|
139 |
EInvalidClientFSMState,
|
sl@0
|
140 |
EReadFileErrorInClient,
|
sl@0
|
141 |
EWriteFileErrorInClient
|
sl@0
|
142 |
};
|
sl@0
|
143 |
|
sl@0
|
144 |
// Panic function
|
sl@0
|
145 |
static void Panic(const TDesC &aCategory, TInt aReason)
|
sl@0
|
146 |
{
|
sl@0
|
147 |
User::Panic(aCategory, aReason);
|
sl@0
|
148 |
}
|
sl@0
|
149 |
|
sl@0
|
150 |
#ifdef MM_TB101_L
|
sl@0
|
151 |
// Valid data for tone sequence. This code should be used for non-ref tests. This is a valid tone sequence for HW
|
sl@0
|
152 |
const TUint8 KFixedSequenceTestSequenceDataX[]=
|
sl@0
|
153 |
{
|
sl@0
|
154 |
0x02, 0x4A, 0x3A, 0x69, 0x39, 0xBD, 0xAD, 0xA5,
|
sl@0
|
155 |
0x84, 0x81, 0xD1, 0xD5, 0xB9, 0x94, 0x04, 0x00,
|
sl@0
|
156 |
0x27, 0x34, 0x41, 0x0B, 0x2A, 0x82, 0x68, 0x51,
|
sl@0
|
157 |
0x72, 0x19, 0x22, 0xC9, 0x21, 0x47, 0x10, 0x4C,
|
sl@0
|
158 |
0x85, 0x48, 0x71, 0x06, 0x90, 0x48, 0x85, 0x48,
|
sl@0
|
159 |
0x68, 0x20, 0x00
|
sl@0
|
160 |
};
|
sl@0
|
161 |
#else
|
sl@0
|
162 |
// Valid data for tone sequence for reference platform. Below tone data may not work for HW devices
|
sl@0
|
163 |
const TUint8 KFixedSequenceTestSequenceDataX[]=
|
sl@0
|
164 |
{
|
sl@0
|
165 |
0x53, 0x51, 0x4E, 0x43, // HEADER
|
sl@0
|
166 |
0xFE, 0xFF, // -2 STARTLOOP INDICATOR
|
sl@0
|
167 |
0x0A, 0x00, // Number of times that the sequence will be played
|
sl@0
|
168 |
/* Tone Data constitutes the following:
|
sl@0
|
169 |
ToneDur, Freq1, Vol1, Freq2 Vol2
|
sl@0
|
170 |
The sequence is arranged in blocks of 8 bits to represent 16 bit values,
|
sl@0
|
171 |
which allows more dynamic range, frequency and time values.
|
sl@0
|
172 |
The tag Low and High mean low and high byte block.
|
sl@0
|
173 |
Low Hi Low Hi Low Hi Low Hi Low Hi
|
sl@0
|
174 |
*/
|
sl@0
|
175 |
0x64, 0x00, 0xB8, 0x01, 0xFF, 0x7F, 0x00, 0x00, 0x00, 0x00,
|
sl@0
|
176 |
0x64, 0x00, 0xD2, 0x01, 0xFF, 0x7F, 0x00, 0x00, 0x00, 0x00,
|
sl@0
|
177 |
0x64, 0x00, 0xEE, 0x01, 0xFF, 0x7F, 0x00, 0x00, 0x00, 0x00,
|
sl@0
|
178 |
0x64, 0x00, 0x0B, 0x02, 0xFF, 0x7F, 0x00, 0x00, 0x00, 0x00,
|
sl@0
|
179 |
0x64, 0x00, 0x2A, 0x02, 0xFF, 0x7F, 0x00, 0x00, 0x00, 0x00,
|
sl@0
|
180 |
0x64, 0x00, 0x4B, 0x02, 0xFF, 0x7F, 0x00, 0x00, 0x00, 0x00,
|
sl@0
|
181 |
0x64, 0x00, 0x6E, 0x02, 0xFF, 0x7F, 0x00, 0x00, 0x00, 0x00,
|
sl@0
|
182 |
0x64, 0x00, 0x93, 0x02, 0xFF, 0x7F, 0x00, 0x00, 0x00, 0x00,
|
sl@0
|
183 |
0x64, 0x00, 0xBA, 0x02, 0xFF, 0x7F, 0x00, 0x00, 0x00, 0x00,
|
sl@0
|
184 |
0x64, 0x00, 0xE4, 0x02, 0xFF, 0x7F, 0x00, 0x00, 0x00, 0x00,
|
sl@0
|
185 |
0x64, 0x00, 0x3F, 0x03, 0xFF, 0x7F, 0x00, 0x00, 0x00, 0x00,
|
sl@0
|
186 |
0x64, 0x00, 0x70, 0x03, 0xFF, 0x7F, 0x00, 0x00, 0x00, 0x00,
|
sl@0
|
187 |
0x64, 0x00, 0xA4, 0x03, 0xFF, 0x7F, 0x00, 0x00, 0x00, 0x00,
|
sl@0
|
188 |
0x64, 0x00, 0xDC, 0x03, 0xFF, 0x7F, 0x00, 0x00, 0x00, 0x00,
|
sl@0
|
189 |
0x64, 0x00, 0x17, 0x04, 0xFF, 0x7F, 0x00, 0x00, 0x00, 0x00,
|
sl@0
|
190 |
// Silence
|
sl@0
|
191 |
// ToneDur, Freq1, Vol1, Freq2 Vol2
|
sl@0
|
192 |
0x70, 0x17, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
sl@0
|
193 |
0xFD, 0xFF, // -3 ENDOFLOOP INDICATOR
|
sl@0
|
194 |
// Another silence
|
sl@0
|
195 |
// ToneDur, Freq1, Vol1, Freq2 Vol2
|
sl@0
|
196 |
0x70, 0x17, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
sl@0
|
197 |
0xFF, 0xFF // -1 SEQ_CMD_RET INDICATOR
|
sl@0
|
198 |
};
|
sl@0
|
199 |
|
sl@0
|
200 |
|
sl@0
|
201 |
#endif//#if defined(MM_TB101_L)
|
sl@0
|
202 |
|
sl@0
|
203 |
|
sl@0
|
204 |
#endif // CHAR_A3F_DEVSOUND_COMPLIANCESUITECONSTANTS_H
|
sl@0
|
205 |
|