|
1 /* |
|
2 * Copyright (c) 2004-2005 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
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". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: CDevTTS method implementations. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 // INCLUDE FILES |
|
20 #include "srsfbldvariant.hrh" |
|
21 #include "nssdevtts.h" |
|
22 #include "devttsalgorithmmanager.h" |
|
23 |
|
24 |
|
25 // ============================ MEMBER FUNCTIONS =============================== |
|
26 |
|
27 // ----------------------------------------------------------------------------- |
|
28 // CDevTTS::CDevTTS |
|
29 // C++ default constructor can NOT contain any code, that |
|
30 // might leave. |
|
31 // ----------------------------------------------------------------------------- |
|
32 // |
|
33 CDevTTS::CDevTTS() : iImpl(NULL) |
|
34 { |
|
35 // Nothing |
|
36 } |
|
37 |
|
38 // ----------------------------------------------------------------------------- |
|
39 // CDevTTS::ConstructL |
|
40 // Symbian 2nd phase constructor can leave. |
|
41 // ----------------------------------------------------------------------------- |
|
42 // |
|
43 void CDevTTS::ConstructL( MDevTTSObserver& aObserver/*, CConsoleBase* console*/ ) |
|
44 { |
|
45 iImpl = CTTSAlgorithmManager::NewL( aObserver/*, console*/ ); |
|
46 } |
|
47 |
|
48 // ----------------------------------------------------------------------------- |
|
49 // CDevTTS::NewL |
|
50 // Two-phased constructor. |
|
51 // ----------------------------------------------------------------------------- |
|
52 // |
|
53 EXPORT_C CDevTTS* CDevTTS::NewL( MDevTTSObserver& aObserver/*, CConsoleBase* console*/ ) |
|
54 { |
|
55 CDevTTS* self = new( ELeave ) CDevTTS; |
|
56 |
|
57 CleanupStack::PushL( self ); |
|
58 self->ConstructL( aObserver/*, console*/ ); |
|
59 CleanupStack::Pop(); |
|
60 |
|
61 return self; |
|
62 } |
|
63 |
|
64 // ----------------------------------------------------------------------------- |
|
65 // CDevTTS::~CDevTTS |
|
66 // Destructor. |
|
67 // ----------------------------------------------------------------------------- |
|
68 // |
|
69 EXPORT_C CDevTTS::~CDevTTS() |
|
70 { |
|
71 if (iImpl != NULL) |
|
72 { |
|
73 delete iImpl; |
|
74 iImpl = NULL; |
|
75 } |
|
76 } |
|
77 |
|
78 // ----------------------------------------------------------------------------- |
|
79 // CDevTTS::AddStyleL |
|
80 // Forwards call to the actual implementation object. |
|
81 // ----------------------------------------------------------------------------- |
|
82 // |
|
83 EXPORT_C TTtsStyleID CDevTTS::AddStyleL( const TTtsStyle& aStyle ) |
|
84 { |
|
85 return iImpl->AddStyleL( aStyle ); |
|
86 } |
|
87 |
|
88 // ----------------------------------------------------------------------------- |
|
89 // CDevTTS::Balance |
|
90 // Forwards call to the actual implementation object. |
|
91 // ----------------------------------------------------------------------------- |
|
92 // |
|
93 EXPORT_C TInt CDevTTS::Balance() |
|
94 { |
|
95 return iImpl->Balance(); |
|
96 } |
|
97 |
|
98 // ----------------------------------------------------------------------------- |
|
99 // CDevTTS::BufferProcessed |
|
100 // Forwards call to the actual implementation object. |
|
101 // ----------------------------------------------------------------------------- |
|
102 // |
|
103 EXPORT_C void CDevTTS::BufferProcessed( const TDesC8& aBuffer ) |
|
104 { |
|
105 iImpl->BufferProcessed( aBuffer ); |
|
106 } |
|
107 |
|
108 // ----------------------------------------------------------------------------- |
|
109 // CDevTTS::CustomInterface |
|
110 // Forwards call to the actual implementation object. |
|
111 // ----------------------------------------------------------------------------- |
|
112 // |
|
113 EXPORT_C TAny* CDevTTS::CustomInterface( TUid aInterfaceID ) |
|
114 { |
|
115 return iImpl->CustomInterface( aInterfaceID ); |
|
116 } |
|
117 |
|
118 // ----------------------------------------------------------------------------- |
|
119 // CDevTTS::DeleteStyleL |
|
120 // Forwards call to the actual implementation object. |
|
121 // ----------------------------------------------------------------------------- |
|
122 // |
|
123 EXPORT_C void CDevTTS::DeleteStyleL( TTtsStyleID aStyleID ) |
|
124 { |
|
125 iImpl->DeleteStyleL( aStyleID ); |
|
126 } |
|
127 |
|
128 // ----------------------------------------------------------------------------- |
|
129 // CDevTTS::GetPositionL |
|
130 // Forwards call to the actual implementation object. |
|
131 // ----------------------------------------------------------------------------- |
|
132 // |
|
133 EXPORT_C void CDevTTS::GetPositionL( TTimeIntervalMicroSeconds& aTime ) const |
|
134 { |
|
135 iImpl->GetPositionL( aTime ); |
|
136 } |
|
137 |
|
138 // ----------------------------------------------------------------------------- |
|
139 // CDevTTS::GetPositionL |
|
140 // Forwards call to the actual implementation object. |
|
141 // ----------------------------------------------------------------------------- |
|
142 // |
|
143 EXPORT_C void CDevTTS::GetPositionL( TTtsSegment& aSegment, TInt& aWordIndex ) const |
|
144 { |
|
145 iImpl->GetPositionL( aSegment, aWordIndex ); |
|
146 } |
|
147 |
|
148 // ----------------------------------------------------------------------------- |
|
149 // CDevTTS::IsLanguageSupported |
|
150 // Forwards call to the actual implementation object. |
|
151 // ----------------------------------------------------------------------------- |
|
152 // |
|
153 EXPORT_C TBool CDevTTS::IsLanguageSupported( TLanguage aLanguage ) const |
|
154 { |
|
155 return iImpl->IsLanguageSupported( aLanguage ); |
|
156 } |
|
157 |
|
158 // ----------------------------------------------------------------------------- |
|
159 // CDevTTS::MaxVolume |
|
160 // Forwards call to the actual implementation object. |
|
161 // ----------------------------------------------------------------------------- |
|
162 // |
|
163 EXPORT_C TInt CDevTTS::MaxVolume() |
|
164 { |
|
165 return iImpl->MaxVolume(); |
|
166 } |
|
167 |
|
168 // ----------------------------------------------------------------------------- |
|
169 // CDevTTS::StyleL |
|
170 // Forwards call to the actual implementation object. |
|
171 // ----------------------------------------------------------------------------- |
|
172 // |
|
173 EXPORT_C TTtsStyle& CDevTTS::StyleL( TTtsStyleID aStyleID ) const |
|
174 { |
|
175 return iImpl->StyleL( aStyleID ); |
|
176 } |
|
177 |
|
178 // ----------------------------------------------------------------------------- |
|
179 // CDevTTS::StyleL |
|
180 // Forwards call to the actual implementation object. |
|
181 // ----------------------------------------------------------------------------- |
|
182 // |
|
183 EXPORT_C TTtsStyle& CDevTTS::StyleL( TUint16 aIndex ) const |
|
184 { |
|
185 return iImpl->StyleL( aIndex ); |
|
186 } |
|
187 |
|
188 // ----------------------------------------------------------------------------- |
|
189 // CDevTTS::NumberOfStyles |
|
190 // Forwards call to the actual implementation object. |
|
191 // ----------------------------------------------------------------------------- |
|
192 // |
|
193 EXPORT_C TUint16 CDevTTS::NumberOfStyles() const |
|
194 { |
|
195 return iImpl->NumberOfStyles(); |
|
196 } |
|
197 |
|
198 // ----------------------------------------------------------------------------- |
|
199 // CDevTTS::Pause |
|
200 // Forwards call to the actual implementation object. |
|
201 // ----------------------------------------------------------------------------- |
|
202 // |
|
203 EXPORT_C void CDevTTS::Pause() |
|
204 { |
|
205 iImpl->Pause(); |
|
206 } |
|
207 |
|
208 // ----------------------------------------------------------------------------- |
|
209 // CDevTTS::PrimeSynthesisL |
|
210 // Forwards call to the actual implementation object. |
|
211 // ----------------------------------------------------------------------------- |
|
212 // |
|
213 EXPORT_C void CDevTTS::PrimeSynthesisL( MTtsSegmentStream& aStream ) |
|
214 { |
|
215 iImpl->PrimeSynthesisL( aStream ); |
|
216 } |
|
217 |
|
218 // ----------------------------------------------------------------------------- |
|
219 // CDevTTS::PrimeSynthesisL |
|
220 // Forwards call to the actual implementation object. |
|
221 // ----------------------------------------------------------------------------- |
|
222 // |
|
223 EXPORT_C void CDevTTS::PrimeSynthesisL( CTtsParsedText& aText ) |
|
224 { |
|
225 iImpl->PrimeSynthesisL( aText ); |
|
226 } |
|
227 |
|
228 // ----------------------------------------------------------------------------- |
|
229 // CDevTTS::SetAudioPriority |
|
230 // Forwards call to the actual implementation object. |
|
231 // ----------------------------------------------------------------------------- |
|
232 // |
|
233 EXPORT_C void CDevTTS::SetAudioPriority( TInt aPriority, TDevTTSAudioPreference aPref ) |
|
234 { |
|
235 iImpl->SetAudioPriority( aPriority, aPref ); |
|
236 } |
|
237 |
|
238 // ----------------------------------------------------------------------------- |
|
239 // CDevTTS::SetAudioOutputL |
|
240 // Forwards call to the actual implementation object. |
|
241 // ----------------------------------------------------------------------------- |
|
242 // |
|
243 EXPORT_C void CDevTTS::SetAudioOutputL( TInt aAudioOutput ) |
|
244 { |
|
245 iImpl->SetAudioOutputL( aAudioOutput ); |
|
246 } |
|
247 |
|
248 // ----------------------------------------------------------------------------- |
|
249 // CDevTTS::SetBalance |
|
250 // Forwards call to the actual implementation object. |
|
251 // ----------------------------------------------------------------------------- |
|
252 // |
|
253 EXPORT_C void CDevTTS::SetBalance( TInt aBalance ) |
|
254 { |
|
255 iImpl->SetBalance( aBalance ); |
|
256 } |
|
257 |
|
258 // ----------------------------------------------------------------------------- |
|
259 // CDevTTS::SetPositionL |
|
260 // Forwards call to the actual implementation object. |
|
261 // ----------------------------------------------------------------------------- |
|
262 // |
|
263 EXPORT_C void CDevTTS::SetPositionL( const TTimeIntervalMicroSeconds& aTime ) |
|
264 { |
|
265 iImpl->SetPositionL( aTime ); |
|
266 } |
|
267 |
|
268 // ----------------------------------------------------------------------------- |
|
269 // CDevTTS::SetPositionL |
|
270 // Forwards call to the actual implementation object. |
|
271 // ----------------------------------------------------------------------------- |
|
272 // |
|
273 EXPORT_C void CDevTTS::SetPositionL( const TTtsSegment& aSegment, TInt aWordIndex ) |
|
274 { |
|
275 iImpl->SetPositionL( aSegment, aWordIndex ); |
|
276 } |
|
277 |
|
278 // ----------------------------------------------------------------------------- |
|
279 // CDevTTS::SetVolume |
|
280 // Forwards call to the actual implementation object. |
|
281 // ----------------------------------------------------------------------------- |
|
282 // |
|
283 EXPORT_C void CDevTTS::SetVolume( TInt aVolume ) |
|
284 { |
|
285 iImpl->SetVolume( aVolume ); |
|
286 } |
|
287 |
|
288 // ----------------------------------------------------------------------------- |
|
289 // CDevTTS::SetVolumeRamp |
|
290 // Forwards call to the actual implementation object. |
|
291 // ----------------------------------------------------------------------------- |
|
292 // |
|
293 EXPORT_C void CDevTTS::SetVolumeRamp( const TTimeIntervalMicroSeconds& aRampDuration ) |
|
294 { |
|
295 iImpl->SetVolumeRamp( aRampDuration ); |
|
296 } |
|
297 |
|
298 // ----------------------------------------------------------------------------- |
|
299 // CDevTTS::Stop |
|
300 // Forwards call to the actual implementation object. |
|
301 // ----------------------------------------------------------------------------- |
|
302 // |
|
303 EXPORT_C void CDevTTS::Stop() |
|
304 { |
|
305 iImpl->Stop(); |
|
306 } |
|
307 |
|
308 // ----------------------------------------------------------------------------- |
|
309 // CDevTTS::SynthesizeL |
|
310 // Forwards call to the actual implementation object. |
|
311 // ----------------------------------------------------------------------------- |
|
312 // |
|
313 EXPORT_C void CDevTTS::SynthesizeL( TDevTTSOutputMode aOutputMode ) |
|
314 { |
|
315 iImpl->SynthesizeL( aOutputMode ); |
|
316 } |
|
317 |
|
318 // ----------------------------------------------------------------------------- |
|
319 // CDevTTS::Volume |
|
320 // Forwards call to the actual implementation object. |
|
321 // ----------------------------------------------------------------------------- |
|
322 // |
|
323 EXPORT_C TInt CDevTTS::Volume() |
|
324 { |
|
325 return iImpl->Volume(); |
|
326 } |
|
327 |
|
328 |
|
329 // ----------------------------------------------------------------------------- |
|
330 // CDevTTS::LanguageIdentificationL |
|
331 // Forwards call to the actual implementation object. |
|
332 // ----------------------------------------------------------------------------- |
|
333 // |
|
334 EXPORT_C void CDevTTS::LanguageIdentificationL( CTtsParsedText& aText, |
|
335 TInt aNumberOfGuesses, |
|
336 RArray<TLanguage>& aLanguages, |
|
337 RArray<TInt>& aScores ) |
|
338 { |
|
339 iImpl->LanguageIdentificationL( aText, aNumberOfGuesses, aLanguages, aScores ); |
|
340 } |
|
341 |
|
342 // ----------------------------------------------------------------------------- |
|
343 // CDevTTS::NormalizeTextL |
|
344 // Forwards call to the actual implementation object. |
|
345 // ----------------------------------------------------------------------------- |
|
346 // |
|
347 EXPORT_C void CDevTTS::NormalizeTextL( CTtsParsedText& aText ) |
|
348 { |
|
349 iImpl->NormalizeTextL( aText ); |
|
350 } |
|
351 |
|
352 // ----------------------------------------------------------------------------- |
|
353 // CDevTTS::NormalizeAndSegmentTextL |
|
354 // Forwards call to the actual implementation object. |
|
355 // ----------------------------------------------------------------------------- |
|
356 // |
|
357 EXPORT_C void CDevTTS::NormalizeAndSegmentTextL( CTtsParsedText& aText ) |
|
358 { |
|
359 iImpl->NormalizeAndSegmentTextL( aText ); |
|
360 } |
|
361 |
|
362 |
|
363 // End of File |