1 /* |
|
2 * Copyright (c) 2006-2007 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: |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef SPEECHSYNTHESISTESTER_H |
|
20 #define SPEECHSYNTHESISTESTER_H |
|
21 |
|
22 #include <e32base.h> |
|
23 #include <speechsynthesis.h> |
|
24 |
|
25 // CLASS DECLARATIONS |
|
26 |
|
27 NONSHARABLE_CLASS( MTesterObserver ) |
|
28 { |
|
29 |
|
30 public: |
|
31 |
|
32 virtual void SynthesisInitComplete( TInt aError ) = 0; |
|
33 virtual void SynthesisComplete( TInt aError ) = 0; |
|
34 |
|
35 }; |
|
36 |
|
37 |
|
38 /** |
|
39 * This class encapsulates resource file handling functions |
|
40 */ |
|
41 NONSHARABLE_CLASS( CSpeechSynthesisTester ) : public CActive |
|
42 { |
|
43 public: // Constructors and destructor |
|
44 |
|
45 /** |
|
46 * Two-phased constructor. |
|
47 */ |
|
48 static CSpeechSynthesisTester* NewL( MTesterObserver& aObserver ); |
|
49 |
|
50 /** |
|
51 * Destructor. |
|
52 */ |
|
53 virtual ~CSpeechSynthesisTester(); |
|
54 |
|
55 public: |
|
56 |
|
57 TInt Open(); |
|
58 void Close(); |
|
59 |
|
60 void SynthesisInit( TDesC& aText, const TDesC& aFileName = KNullDesC ); |
|
61 void Synthesise(); |
|
62 void StopL(); |
|
63 void PauseL(); |
|
64 |
|
65 void GetSupportedLanguagesL( RArray<TLanguage>& aLanguages ); |
|
66 |
|
67 void GetSupportedVoicesL( RArray<TVoice>& aVoices, TLanguage aLanguage ); |
|
68 TVoice VoiceL( ); |
|
69 void SetVoiceL( TVoice& aVoice ); |
|
70 |
|
71 TInt MaxSpeakingRateL(); |
|
72 TInt SpeakingRateL(); |
|
73 void SetSpeakingRateL( TInt aRate ); |
|
74 |
|
75 TInt MaxVolumeL(); |
|
76 TInt VolumeL(); |
|
77 void SetVolumeL( TInt aVolume ); |
|
78 |
|
79 void SetAudioPriorityL( TInt aPriority, TInt aPreference ); |
|
80 |
|
81 void CustomCommandL( TInt aCommand, TInt aValue ); |
|
82 |
|
83 protected: // From CActive |
|
84 |
|
85 /** |
|
86 * CActive::RunL |
|
87 */ |
|
88 void RunL(); |
|
89 |
|
90 /** |
|
91 * CActive::DoCancel() |
|
92 */ |
|
93 void DoCancel(); |
|
94 |
|
95 private: |
|
96 |
|
97 /** |
|
98 * C++ default constructor. |
|
99 */ |
|
100 CSpeechSynthesisTester( MTesterObserver& aObserver ); |
|
101 |
|
102 /** |
|
103 * By default Symbian 2nd phase constructor is private. |
|
104 */ |
|
105 void ConstructL(); |
|
106 |
|
107 |
|
108 private: // Data |
|
109 |
|
110 RSpeechSynthesis iSpeechSynthesis; |
|
111 |
|
112 enum TTestStatus |
|
113 { |
|
114 EIdle, |
|
115 EPriming, |
|
116 EPlaying |
|
117 }; |
|
118 |
|
119 TTestStatus iTestStatus; |
|
120 |
|
121 MTesterObserver& iObserver; |
|
122 }; |
|
123 |
|
124 #endif // SPEECHSYNTHESISTESTER_H |
|
125 |
|
126 // End of File |
|