|
1 /* |
|
2 * Copyright (c) 2004 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: Audio Stubs - Implementation of class Audio Visualiztion. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 // INCLUDE FILES |
|
20 |
|
21 #ifdef _DEBUG |
|
22 #include <e32svr.h> |
|
23 #endif |
|
24 #include <Visualization.h> |
|
25 #include <MVisualizationObserver.h> |
|
26 #include "VisualizationBody.h" |
|
27 |
|
28 // ============================ MEMBER FUNCTIONS =============================== |
|
29 |
|
30 // ----------------------------------------------------------------------------- |
|
31 // CVisualization::CVisualization |
|
32 // C++ default constructor can NOT contain any code, that |
|
33 // might leave. |
|
34 // ----------------------------------------------------------------------------- |
|
35 // |
|
36 CVisualization::CVisualization() |
|
37 { |
|
38 } |
|
39 |
|
40 |
|
41 // Destructor |
|
42 CVisualization::~CVisualization() |
|
43 { |
|
44 delete iBody; |
|
45 } |
|
46 |
|
47 // ----------------------------------------------------------------------------- |
|
48 // CVisualization::ConstructL |
|
49 // Symbian 2nd phase constructor can leave. |
|
50 // ----------------------------------------------------------------------------- |
|
51 // |
|
52 void CVisualization::ConstructL(MVisualizationObserver& aObserver) |
|
53 { |
|
54 #ifdef _DEBUG |
|
55 RDebug::Print(_L("CVisualization::ConstructL")); |
|
56 #endif |
|
57 iBody = CVisualization::CBody::NewL(aObserver); |
|
58 } |
|
59 |
|
60 // ----------------------------------------------------------------------------- |
|
61 // CVisualization::NewL |
|
62 // Two-phased constructor. |
|
63 // ----------------------------------------------------------------------------- |
|
64 // |
|
65 EXPORT_C CVisualization* CVisualization::NewL( |
|
66 MVisualizationObserver& aObserver ) |
|
67 { |
|
68 #ifdef _DEBUG |
|
69 RDebug::Print(_L("CVisualization::NewL")); |
|
70 #endif |
|
71 CVisualization* self = new (ELeave) CVisualization(); |
|
72 CleanupStack::PushL(self); |
|
73 self->ConstructL(aObserver); |
|
74 CleanupStack::Pop(); |
|
75 return self; |
|
76 } |
|
77 |
|
78 // ----------------------------------------------------------------------------- |
|
79 // CVisualization::DataRate |
|
80 // ----------------------------------------------------------------------------- |
|
81 // |
|
82 EXPORT_C TUint32 CVisualization::DataRate() const |
|
83 { |
|
84 return iBody->DataRate(); |
|
85 } |
|
86 |
|
87 // ----------------------------------------------------------------------------- |
|
88 // CVisualization::DataRateRange |
|
89 // ----------------------------------------------------------------------------- |
|
90 // |
|
91 EXPORT_C void CVisualization::DataRateRange( |
|
92 TUint32& aMin, |
|
93 TUint32& aMax ) |
|
94 { |
|
95 iBody->DataRateRange(aMin, aMax); |
|
96 } |
|
97 |
|
98 // ----------------------------------------------------------------------------- |
|
99 // CVisualization::EnableFrequencyData |
|
100 // ----------------------------------------------------------------------------- |
|
101 // |
|
102 EXPORT_C void CVisualization::EnableFrequencyData( |
|
103 TBool aIndicator ) |
|
104 { |
|
105 iBody->EnableFrequencyData(aIndicator); |
|
106 } |
|
107 |
|
108 // ----------------------------------------------------------------------------- |
|
109 // CVisualization::EnableWaveformData |
|
110 // ----------------------------------------------------------------------------- |
|
111 // |
|
112 EXPORT_C void CVisualization::EnableWaveformData( |
|
113 TBool aIndicator ) |
|
114 { |
|
115 iBody->EnableWaveformData(aIndicator); |
|
116 } |
|
117 |
|
118 // ----------------------------------------------------------------------------- |
|
119 // CVisualization::FreqencyBandCount |
|
120 // ----------------------------------------------------------------------------- |
|
121 // |
|
122 EXPORT_C TUint32 CVisualization::FreqencyBandCount() const |
|
123 { |
|
124 return iBody->FreqencyBandCount(); |
|
125 } |
|
126 |
|
127 // ----------------------------------------------------------------------------- |
|
128 // CVisualization::FrequencyBandCountRange |
|
129 // ----------------------------------------------------------------------------- |
|
130 // |
|
131 EXPORT_C void CVisualization::FrequencyBandCountRange( |
|
132 TUint32& aMin, |
|
133 TUint32& aMax ) |
|
134 { |
|
135 iBody->FrequencyBandCountRange(aMin, aMax); |
|
136 } |
|
137 |
|
138 // ----------------------------------------------------------------------------- |
|
139 // CVisualization::IsFrequencyDataEnabled |
|
140 // ----------------------------------------------------------------------------- |
|
141 // |
|
142 EXPORT_C TBool CVisualization::IsFrequencyDataEnabled() const |
|
143 { |
|
144 return iBody->IsFrequencyDataEnabled(); |
|
145 } |
|
146 |
|
147 // ----------------------------------------------------------------------------- |
|
148 // CVisualization::IsWaveformDataEnabled |
|
149 // ----------------------------------------------------------------------------- |
|
150 // |
|
151 EXPORT_C TBool CVisualization::IsWaveformDataEnabled() const |
|
152 { |
|
153 return iBody->IsWaveformDataEnabled(); |
|
154 } |
|
155 |
|
156 // ----------------------------------------------------------------------------- |
|
157 // CVisualization::SamplingRate |
|
158 // ----------------------------------------------------------------------------- |
|
159 // |
|
160 EXPORT_C TUint32 CVisualization::SamplingRate() const |
|
161 { |
|
162 return iBody->SamplingRate(); |
|
163 } |
|
164 |
|
165 // ----------------------------------------------------------------------------- |
|
166 // CVisualization::SetDataRateL |
|
167 // ----------------------------------------------------------------------------- |
|
168 // |
|
169 EXPORT_C void CVisualization::SetDataRateL( |
|
170 TUint32 aDataRate ) |
|
171 { |
|
172 iBody->SetDataRateL(aDataRate); |
|
173 } |
|
174 |
|
175 // ----------------------------------------------------------------------------- |
|
176 // CVisualization::SetFrequencyBandCount |
|
177 // ----------------------------------------------------------------------------- |
|
178 // |
|
179 EXPORT_C void CVisualization::SetFrequencyBandCountL( |
|
180 TUint32 aFrequencyBandCount ) |
|
181 { |
|
182 iBody->SetFrequencyBandCountL(aFrequencyBandCount); |
|
183 } |
|
184 |
|
185 // ----------------------------------------------------------------------------- |
|
186 // CVisualization::SetWaveformDataLength |
|
187 // ----------------------------------------------------------------------------- |
|
188 // |
|
189 EXPORT_C void CVisualization::SetWaveformDataLengthL( |
|
190 TUint32 aWaveformDataLength ) |
|
191 { |
|
192 iBody->SetWaveformDataLengthL(aWaveformDataLength ); |
|
193 } |
|
194 |
|
195 // ----------------------------------------------------------------------------- |
|
196 // CVisualization::StartL |
|
197 // ----------------------------------------------------------------------------- |
|
198 // |
|
199 EXPORT_C void CVisualization::StartL() |
|
200 { |
|
201 User::Leave(KErrNotSupported); |
|
202 } |
|
203 |
|
204 // ----------------------------------------------------------------------------- |
|
205 // CVisualization::StopL |
|
206 // ----------------------------------------------------------------------------- |
|
207 // |
|
208 EXPORT_C void CVisualization::StopL() |
|
209 { |
|
210 User::Leave(KErrNotSupported); |
|
211 } |
|
212 |
|
213 // ----------------------------------------------------------------------------- |
|
214 // CVisualization::WaveformDataLength |
|
215 // ----------------------------------------------------------------------------- |
|
216 // |
|
217 EXPORT_C TUint32 CVisualization::WaveformDataLength() const |
|
218 { |
|
219 return iBody->WaveformDataLength(); |
|
220 } |
|
221 |
|
222 // ----------------------------------------------------------------------------- |
|
223 // CVisualization::WaveformDataLengthRange |
|
224 // ----------------------------------------------------------------------------- |
|
225 // |
|
226 EXPORT_C void CVisualization::WaveformDataLengthRange( |
|
227 TUint32& aMin, |
|
228 TUint32& aMax ) |
|
229 { |
|
230 iBody->WaveformDataLengthRange(aMin,aMax); |
|
231 } |
|
232 |