sl@0
|
1 |
//tonedata.cpp
|
sl@0
|
2 |
|
sl@0
|
3 |
// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
|
sl@0
|
4 |
// All rights reserved.
|
sl@0
|
5 |
// This component and the accompanying materials are made available
|
sl@0
|
6 |
// under the terms of "Eclipse Public License v1.0"
|
sl@0
|
7 |
// which accompanies this distribution, and is available
|
sl@0
|
8 |
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
sl@0
|
9 |
//
|
sl@0
|
10 |
// Initial Contributors:
|
sl@0
|
11 |
// Nokia Corporation - initial contribution.
|
sl@0
|
12 |
//
|
sl@0
|
13 |
// Contributors:
|
sl@0
|
14 |
//
|
sl@0
|
15 |
// Description:
|
sl@0
|
16 |
//
|
sl@0
|
17 |
|
sl@0
|
18 |
|
sl@0
|
19 |
|
sl@0
|
20 |
#include <a3f/tonedata.h>
|
sl@0
|
21 |
#include <a3f/a3f_trace_utils.h>
|
sl@0
|
22 |
|
sl@0
|
23 |
|
sl@0
|
24 |
// ---------------------------------------------------------------------------
|
sl@0
|
25 |
// TToneData::TToneData
|
sl@0
|
26 |
// ---------------------------------------------------------------------------
|
sl@0
|
27 |
//
|
sl@0
|
28 |
EXPORT_C TToneData::TToneData()
|
sl@0
|
29 |
{
|
sl@0
|
30 |
DP_CONTEXT(TToneData::TToneData *CD1*, CtxDevSound, DPLOCAL);
|
sl@0
|
31 |
DP_IN();
|
sl@0
|
32 |
// Default values
|
sl@0
|
33 |
iRepeatCount = 0;
|
sl@0
|
34 |
iType = ESimple;
|
sl@0
|
35 |
DP_OUT();
|
sl@0
|
36 |
}
|
sl@0
|
37 |
|
sl@0
|
38 |
// ---------------------------------------------------------------------------
|
sl@0
|
39 |
// TToneData::SetType
|
sl@0
|
40 |
// ---------------------------------------------------------------------------
|
sl@0
|
41 |
//
|
sl@0
|
42 |
EXPORT_C void TToneData::SetType(TToneType aType)
|
sl@0
|
43 |
{
|
sl@0
|
44 |
DP_CONTEXT(TToneData::SetType *CD1*, CtxDevSound, DPLOCAL);
|
sl@0
|
45 |
DP1_IN("aType=%d", aType);
|
sl@0
|
46 |
iType = aType;
|
sl@0
|
47 |
DP_OUT();
|
sl@0
|
48 |
}
|
sl@0
|
49 |
|
sl@0
|
50 |
// ---------------------------------------------------------------------------
|
sl@0
|
51 |
// TToneData::SetDuration
|
sl@0
|
52 |
// ---------------------------------------------------------------------------
|
sl@0
|
53 |
//
|
sl@0
|
54 |
EXPORT_C void TToneData::SetDuration(TTimeIntervalMicroSeconds aDuration)
|
sl@0
|
55 |
{
|
sl@0
|
56 |
DP_CONTEXT(TToneData::SetDuration *CD1*, CtxDevSound, DPLOCAL);
|
sl@0
|
57 |
DP_IN();
|
sl@0
|
58 |
iDuration = aDuration;
|
sl@0
|
59 |
DP_OUT();
|
sl@0
|
60 |
}
|
sl@0
|
61 |
|
sl@0
|
62 |
// ---------------------------------------------------------------------------
|
sl@0
|
63 |
// TToneData::SetFrequencyOne
|
sl@0
|
64 |
// ---------------------------------------------------------------------------
|
sl@0
|
65 |
//
|
sl@0
|
66 |
EXPORT_C void TToneData::SetFrequencyOne(TInt aFrequencyOne)
|
sl@0
|
67 |
{
|
sl@0
|
68 |
DP_CONTEXT(TToneData::SetFrequencyOne *CD1*, CtxDevSound, DPLOCAL);
|
sl@0
|
69 |
DP1_IN("aFrequencyOne=%d", aFrequencyOne);
|
sl@0
|
70 |
iFrequencyOne = aFrequencyOne;
|
sl@0
|
71 |
DP_OUT();
|
sl@0
|
72 |
}
|
sl@0
|
73 |
|
sl@0
|
74 |
// ---------------------------------------------------------------------------
|
sl@0
|
75 |
// TToneData::SetFrequencyTwo
|
sl@0
|
76 |
// ---------------------------------------------------------------------------
|
sl@0
|
77 |
//
|
sl@0
|
78 |
EXPORT_C void TToneData::SetFrequencyTwo(TInt aFrequencyTwo)
|
sl@0
|
79 |
{
|
sl@0
|
80 |
DP_CONTEXT(TToneData::SetFrequencyTwo *CD1*, CtxDevSound, DPLOCAL);
|
sl@0
|
81 |
DP1_IN("aFrequencyTwo=%d", aFrequencyTwo);
|
sl@0
|
82 |
iFrequencyTwo = aFrequencyTwo;
|
sl@0
|
83 |
DP_OUT();
|
sl@0
|
84 |
}
|
sl@0
|
85 |
|
sl@0
|
86 |
// ---------------------------------------------------------------------------
|
sl@0
|
87 |
// TToneData::SetSequenceNumber
|
sl@0
|
88 |
// ---------------------------------------------------------------------------
|
sl@0
|
89 |
//
|
sl@0
|
90 |
EXPORT_C void TToneData::SetSequenceNumber(TInt aSequenceNumber)
|
sl@0
|
91 |
{
|
sl@0
|
92 |
DP_CONTEXT(TToneData::SetSequenceNumber *CD1*, CtxDevSound, DPLOCAL);
|
sl@0
|
93 |
DP1_IN("aSequenceNumber=%d", aSequenceNumber);
|
sl@0
|
94 |
iSequenceNumber = aSequenceNumber;
|
sl@0
|
95 |
DP_OUT();
|
sl@0
|
96 |
}
|
sl@0
|
97 |
|
sl@0
|
98 |
// ---------------------------------------------------------------------------
|
sl@0
|
99 |
// TToneData::SetSequenceData
|
sl@0
|
100 |
// ---------------------------------------------------------------------------
|
sl@0
|
101 |
//
|
sl@0
|
102 |
EXPORT_C void TToneData::SetSequenceData(TDesC8& aSequenceData)
|
sl@0
|
103 |
{
|
sl@0
|
104 |
DP_CONTEXT(TToneData::SetSequenceData *CD1*, CtxDevSound, DPLOCAL);
|
sl@0
|
105 |
DP_IN();
|
sl@0
|
106 |
iSequenceData = &aSequenceData;
|
sl@0
|
107 |
DP_OUT();
|
sl@0
|
108 |
}
|
sl@0
|
109 |
|
sl@0
|
110 |
// ---------------------------------------------------------------------------
|
sl@0
|
111 |
// TToneData::SetRepeatCount
|
sl@0
|
112 |
// ---------------------------------------------------------------------------
|
sl@0
|
113 |
//
|
sl@0
|
114 |
EXPORT_C void TToneData::SetRepeatCount(TInt aRepeatCount)
|
sl@0
|
115 |
{
|
sl@0
|
116 |
DP_CONTEXT(TToneData::SetRepeatCount *CD1*, CtxDevSound, DPLOCAL);
|
sl@0
|
117 |
DP1_IN("aRepeatCount=%d", aRepeatCount);
|
sl@0
|
118 |
iRepeatCount = aRepeatCount;
|
sl@0
|
119 |
DP_OUT();
|
sl@0
|
120 |
}
|
sl@0
|
121 |
|
sl@0
|
122 |
// ---------------------------------------------------------------------------
|
sl@0
|
123 |
// TToneData::SetRepeatTrailingSilence
|
sl@0
|
124 |
// ---------------------------------------------------------------------------
|
sl@0
|
125 |
//
|
sl@0
|
126 |
EXPORT_C void TToneData::SetRepeatTrailingSilence(TTimeIntervalMicroSeconds aRepeatTrainglingSilence)
|
sl@0
|
127 |
{
|
sl@0
|
128 |
DP_CONTEXT(TToneData::SetRepeatTrailingSilence *CD1*, CtxDevSound, DPLOCAL);
|
sl@0
|
129 |
DP_IN();
|
sl@0
|
130 |
iRepeatTrainglingSilence = aRepeatTrainglingSilence;
|
sl@0
|
131 |
DP_OUT();
|
sl@0
|
132 |
}
|
sl@0
|
133 |
|
sl@0
|
134 |
// ---------------------------------------------------------------------------
|
sl@0
|
135 |
// TToneData::SetDtmfLengths
|
sl@0
|
136 |
// ---------------------------------------------------------------------------
|
sl@0
|
137 |
//
|
sl@0
|
138 |
EXPORT_C void TToneData::SetDtmfLengths(TTimeIntervalMicroSeconds32 aToneOnLength,
|
sl@0
|
139 |
TTimeIntervalMicroSeconds32 aToneOffLength, TTimeIntervalMicroSeconds32 aPauseLength)
|
sl@0
|
140 |
{
|
sl@0
|
141 |
DP_CONTEXT(TToneData::SetDtmfLengths *CD1*, CtxDevSound, DPLOCAL);
|
sl@0
|
142 |
DP_IN();
|
sl@0
|
143 |
iToneOnLength = aToneOnLength;
|
sl@0
|
144 |
iToneOffLength = aToneOffLength;
|
sl@0
|
145 |
iPauseLength = aPauseLength;
|
sl@0
|
146 |
DP_OUT();
|
sl@0
|
147 |
}
|
sl@0
|
148 |
|
sl@0
|
149 |
// ---------------------------------------------------------------------------
|
sl@0
|
150 |
// TToneData::SetDTMFString
|
sl@0
|
151 |
// ---------------------------------------------------------------------------
|
sl@0
|
152 |
//
|
sl@0
|
153 |
EXPORT_C void TToneData::SetDTMFString(TDesC& aDTMFString)
|
sl@0
|
154 |
{
|
sl@0
|
155 |
DP_CONTEXT(TToneData::SetDTMFString *CD1*, CtxDevSound, DPLOCAL);
|
sl@0
|
156 |
DP_IN();
|
sl@0
|
157 |
iDTMFString = &aDTMFString;
|
sl@0
|
158 |
DP_OUT();
|
sl@0
|
159 |
}
|
sl@0
|
160 |
|
sl@0
|
161 |
// ---------------------------------------------------------------------------
|
sl@0
|
162 |
// TToneData::GetType
|
sl@0
|
163 |
// ---------------------------------------------------------------------------
|
sl@0
|
164 |
//
|
sl@0
|
165 |
EXPORT_C void TToneData::GetType(TToneType& aType)
|
sl@0
|
166 |
{
|
sl@0
|
167 |
DP_CONTEXT(TToneData::GetType *CD1*, CtxDevSound, DPLOCAL);
|
sl@0
|
168 |
DP_IN();
|
sl@0
|
169 |
aType = iType;
|
sl@0
|
170 |
DP_OUT();
|
sl@0
|
171 |
}
|
sl@0
|
172 |
|
sl@0
|
173 |
// ---------------------------------------------------------------------------
|
sl@0
|
174 |
// TToneData::GetDuration
|
sl@0
|
175 |
// ---------------------------------------------------------------------------
|
sl@0
|
176 |
//
|
sl@0
|
177 |
EXPORT_C void TToneData::GetDuration(TTimeIntervalMicroSeconds& aDuration)
|
sl@0
|
178 |
{
|
sl@0
|
179 |
DP_CONTEXT(TToneData::GetDuration *CD1*, CtxDevSound, DPLOCAL);
|
sl@0
|
180 |
DP_IN();
|
sl@0
|
181 |
aDuration = iDuration;
|
sl@0
|
182 |
DP_OUT();
|
sl@0
|
183 |
}
|
sl@0
|
184 |
|
sl@0
|
185 |
// ---------------------------------------------------------------------------
|
sl@0
|
186 |
// TToneData::GetFrequencyOne
|
sl@0
|
187 |
// ---------------------------------------------------------------------------
|
sl@0
|
188 |
//
|
sl@0
|
189 |
EXPORT_C TInt TToneData::GetFrequencyOne()
|
sl@0
|
190 |
{
|
sl@0
|
191 |
DP_CONTEXT(TToneData::GetFrequencyOne *CD1*, CtxDevSound, DPLOCAL);
|
sl@0
|
192 |
DP_IN();
|
sl@0
|
193 |
DP0_RET(iFrequencyOne, "%d");
|
sl@0
|
194 |
}
|
sl@0
|
195 |
|
sl@0
|
196 |
// ---------------------------------------------------------------------------
|
sl@0
|
197 |
// TToneData::GetFrequencyTwo
|
sl@0
|
198 |
// ---------------------------------------------------------------------------
|
sl@0
|
199 |
//
|
sl@0
|
200 |
EXPORT_C TInt TToneData::GetFrequencyTwo()
|
sl@0
|
201 |
{
|
sl@0
|
202 |
DP_CONTEXT(TToneData::GetFrequencyTwo *CD1*, CtxDevSound, DPLOCAL);
|
sl@0
|
203 |
DP_IN();
|
sl@0
|
204 |
DP0_RET(iFrequencyTwo, "%d");
|
sl@0
|
205 |
}
|
sl@0
|
206 |
|
sl@0
|
207 |
// ---------------------------------------------------------------------------
|
sl@0
|
208 |
// TToneData::GetSequenceNumber
|
sl@0
|
209 |
// ---------------------------------------------------------------------------
|
sl@0
|
210 |
//
|
sl@0
|
211 |
EXPORT_C TInt TToneData::GetSequenceNumber()
|
sl@0
|
212 |
{
|
sl@0
|
213 |
DP_CONTEXT(TToneData::GetSequenceNumber *CD1*, CtxDevSound, DPLOCAL);
|
sl@0
|
214 |
DP_IN();
|
sl@0
|
215 |
DP0_RET(iSequenceNumber, "%d");
|
sl@0
|
216 |
}
|
sl@0
|
217 |
|
sl@0
|
218 |
|
sl@0
|
219 |
// ---------------------------------------------------------------------------
|
sl@0
|
220 |
// TToneData::GetSequenceData
|
sl@0
|
221 |
// ---------------------------------------------------------------------------
|
sl@0
|
222 |
//
|
sl@0
|
223 |
EXPORT_C TDesC8* TToneData::GetSequenceData()
|
sl@0
|
224 |
{
|
sl@0
|
225 |
DP_CONTEXT(TToneData::GetSequenceData *CD1*, CtxDevSound, DPLOCAL);
|
sl@0
|
226 |
DP_IN();
|
sl@0
|
227 |
DP_OUT();
|
sl@0
|
228 |
return iSequenceData;
|
sl@0
|
229 |
}
|
sl@0
|
230 |
|
sl@0
|
231 |
// ---------------------------------------------------------------------------
|
sl@0
|
232 |
// TToneData::GetRepeatCount
|
sl@0
|
233 |
// ---------------------------------------------------------------------------
|
sl@0
|
234 |
//
|
sl@0
|
235 |
EXPORT_C TInt TToneData::GetRepeatCount()
|
sl@0
|
236 |
{
|
sl@0
|
237 |
DP_CONTEXT(TToneData::GetRepeatCount *CD1*, CtxDevSound, DPLOCAL);
|
sl@0
|
238 |
DP_IN();
|
sl@0
|
239 |
DP0_RET(iRepeatCount, "%d");
|
sl@0
|
240 |
}
|
sl@0
|
241 |
|
sl@0
|
242 |
// ---------------------------------------------------------------------------
|
sl@0
|
243 |
// TToneData::GetRepeatTrailingSilence
|
sl@0
|
244 |
// ---------------------------------------------------------------------------
|
sl@0
|
245 |
//
|
sl@0
|
246 |
EXPORT_C void TToneData::GetRepeatTrailingSilence(TTimeIntervalMicroSeconds& aRepeatTrainglingSilence)
|
sl@0
|
247 |
{
|
sl@0
|
248 |
DP_CONTEXT(TToneData::GetRepeatTrailingSilence *CD1*, CtxDevSound, DPLOCAL);
|
sl@0
|
249 |
DP_IN();
|
sl@0
|
250 |
aRepeatTrainglingSilence = iRepeatTrainglingSilence;
|
sl@0
|
251 |
DP_OUT();
|
sl@0
|
252 |
}
|
sl@0
|
253 |
|
sl@0
|
254 |
// ---------------------------------------------------------------------------
|
sl@0
|
255 |
// TToneData::GetDtmfLenghts
|
sl@0
|
256 |
// ---------------------------------------------------------------------------
|
sl@0
|
257 |
//
|
sl@0
|
258 |
EXPORT_C void TToneData::GetDtmfLenghts(TTimeIntervalMicroSeconds32& aToneOnLength,
|
sl@0
|
259 |
TTimeIntervalMicroSeconds32& aToneOffLength, TTimeIntervalMicroSeconds32& aPauseLength)
|
sl@0
|
260 |
{
|
sl@0
|
261 |
DP_CONTEXT(TToneData::GetDtmfLenghts *CD1*, CtxDevSound, DPLOCAL);
|
sl@0
|
262 |
DP_IN();
|
sl@0
|
263 |
aToneOnLength = iToneOnLength;
|
sl@0
|
264 |
aToneOffLength = iToneOffLength;
|
sl@0
|
265 |
aPauseLength = iPauseLength;
|
sl@0
|
266 |
DP_OUT();
|
sl@0
|
267 |
}
|
sl@0
|
268 |
|
sl@0
|
269 |
// ---------------------------------------------------------------------------
|
sl@0
|
270 |
// TToneData::GetDTMFString
|
sl@0
|
271 |
// ---------------------------------------------------------------------------
|
sl@0
|
272 |
//
|
sl@0
|
273 |
EXPORT_C TDesC* TToneData::GetDTMFString()
|
sl@0
|
274 |
{
|
sl@0
|
275 |
DP_CONTEXT(TToneData::GetDTMFString *CD1*, CtxDevSound, DPLOCAL);
|
sl@0
|
276 |
DP_IN();
|
sl@0
|
277 |
DP_OUT();
|
sl@0
|
278 |
return iDTMFString;
|
sl@0
|
279 |
}
|