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