1 /* |
|
2 * Copyright (c) 2006 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: Definition of class which handles the playing of tones |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef VCTONEREADER_H |
|
20 #define VCTONEREADER_H |
|
21 |
|
22 // INCLUDES |
|
23 #include <e32base.h> |
|
24 #include <mmfbase.h> |
|
25 #include <barsread.h> |
|
26 #include <eikenv.h> |
|
27 #include <avkon.rsg> |
|
28 #include <mdaaudiotoneplayer.h> |
|
29 #include "vctoneplayer.h" |
|
30 |
|
31 // CONSTANTS |
|
32 |
|
33 // CLASS DECLARATION |
|
34 |
|
35 /** |
|
36 * Class that reads the tone sequence for the Voice commands UI |
|
37 */ |
|
38 class CAknSoundInfo; |
|
39 |
|
40 class CVCToneReader : public CBase, |
|
41 public MMdaAudioToneObserver |
|
42 { |
|
43 public: // Constructors and destructor |
|
44 |
|
45 /** |
|
46 * Symbian Two-phased constructor. |
|
47 */ |
|
48 static CVCToneReader* NewL(); |
|
49 |
|
50 /** |
|
51 * Destructor. |
|
52 */ |
|
53 virtual ~CVCToneReader(); |
|
54 |
|
55 public: // New functions |
|
56 |
|
57 /** |
|
58 * Sets the tone priority |
|
59 * @param aSid The sound ID |
|
60 * @return TInt |
|
61 */ |
|
62 TInt TonePriority(TInt aSid); |
|
63 |
|
64 /** |
|
65 * Sets the appropriate priority preference |
|
66 * @param aSid The sound ID |
|
67 * @return TMdaPriorityPreference |
|
68 */ |
|
69 TMdaPriorityPreference TonePriorityPreference(TInt aSid); |
|
70 |
|
71 /** |
|
72 * Sets the appropriate tone sequence |
|
73 * @param aSid The sound ID |
|
74 * @return HBufC8* |
|
75 */ |
|
76 HBufC8* ToneSequence(TInt aSid); |
|
77 |
|
78 /** |
|
79 * Sets the appropriate tone volume |
|
80 * @param aSid The sound ID |
|
81 * @return TInt |
|
82 */ |
|
83 TInt ToneVolume(TInt aSid); |
|
84 |
|
85 /** |
|
86 * Plays tone |
|
87 * @param aTonePlayer The class requesting the tone callbacks |
|
88 * @param aSid The sound ID |
|
89 */ |
|
90 void PlayTone(MVCTonePlayer* aTonePlayer,TInt aSid); |
|
91 |
|
92 public: // Functions from base classes |
|
93 |
|
94 /** |
|
95 * From MMdaAudioToneObserver Called when the tone preparation is complete |
|
96 */ |
|
97 void MatoPrepareComplete(TInt aError); |
|
98 |
|
99 /** |
|
100 * From MMdaAudioToneObserver Called when the tone playing is complete |
|
101 */ |
|
102 void MatoPlayComplete(TInt aError); |
|
103 |
|
104 protected: // New functions |
|
105 |
|
106 /** |
|
107 * Reads the tone sequence from the avkon resource file |
|
108 * @param aSid The sound ID |
|
109 * @param aTonePriority The tone priority |
|
110 * @param aTonePreference The tone priority preference |
|
111 * @param aToneVolume The tone volume |
|
112 * @return HBufC8* |
|
113 */ |
|
114 HBufC8* ReadToneSequenceL( CAknSoundInfo* aInfo, TInt aSid, TInt* aTonePriority, |
|
115 TMdaPriorityPreference* aTonePreference, TInt* aToneVolume ); |
|
116 |
|
117 private: // New functions |
|
118 |
|
119 /** |
|
120 * C++ default constructor. |
|
121 */ |
|
122 CVCToneReader(); |
|
123 |
|
124 /** |
|
125 * Default Symbian constructor |
|
126 */ |
|
127 void ConstructL(); |
|
128 |
|
129 private: // Data |
|
130 |
|
131 TInt iTonePriority; |
|
132 TMdaPriorityPreference iTonePreference; |
|
133 HBufC8* iToneSequence; |
|
134 TInt iToneVolume; |
|
135 |
|
136 TInt iAbortTonePriority; |
|
137 TMdaPriorityPreference iAbortTonePreference; |
|
138 HBufC8* iAbortToneSequence; |
|
139 TInt iAbortToneVolume; |
|
140 |
|
141 TInt iErrorTonePriority; |
|
142 TMdaPriorityPreference iErrorTonePreference; |
|
143 HBufC8* iErrorToneSequence; |
|
144 TInt iErrorToneVolume; |
|
145 |
|
146 TBool iPrepareCallback; |
|
147 MVCTonePlayer* iTonePlayer; |
|
148 CMdaAudioToneUtility* iToneUtility; |
|
149 |
|
150 CAknSoundInfo* iAbortInfo; |
|
151 CAknSoundInfo* iErrorInfo; |
|
152 }; |
|
153 |
|
154 #endif // VCTONEREADER_H |
|
155 |
|
156 // End of File |
|