|
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 - This is the definition of the audio visualization body class. |
|
15 * |
|
16 * |
|
17 */ |
|
18 |
|
19 |
|
20 #ifndef CVISUALIZATIONBODY_H |
|
21 #define CVISUALIZATIONBODY_H |
|
22 |
|
23 // INCLUDES |
|
24 #include <Visualization.h> |
|
25 |
|
26 // FORWARD DECLARATION |
|
27 class MVisualizationObserver; |
|
28 |
|
29 // CLASS DECLARATION |
|
30 |
|
31 /** |
|
32 * This is the base class for audio visualization. |
|
33 * |
|
34 * @lib Visualization.lib |
|
35 * @since 3.0 |
|
36 */ |
|
37 |
|
38 class CVisualization::CBody: public CBase |
|
39 { |
|
40 |
|
41 public: // Constructors and destructor |
|
42 |
|
43 /** |
|
44 * Factory function for creating the volume object. |
|
45 * @since 3.0 |
|
46 * @param aObserver A visualization observer. |
|
47 * @return pointer to CVisualization object |
|
48 */ |
|
49 static CBody* NewL( MVisualizationObserver& aObserver); |
|
50 |
|
51 /** |
|
52 * Destructor |
|
53 */ |
|
54 virtual ~CBody(); |
|
55 |
|
56 public: // New functions |
|
57 |
|
58 /** |
|
59 * Get the data rate. |
|
60 * @since 3.0 |
|
61 * @return data rate in Hz. |
|
62 */ |
|
63 TUint32 DataRate() const; |
|
64 |
|
65 /** |
|
66 * Get the upper and lower limits of the supported data rate range |
|
67 * @since 3.0 |
|
68 * @param aMin The lower limit of the data rate range |
|
69 * @param aMax The upper limit of the data rate range |
|
70 */ |
|
71 void DataRateRange( TUint32& aMin, TUint32& aMax ); |
|
72 |
|
73 /** |
|
74 * Used by application enable or disable frequency data. |
|
75 * @since 3.0 |
|
76 * @param aIndicator Set to ETrue to enable frequency, EFalse to disable frequency data. |
|
77 */ |
|
78 void EnableFrequencyData( TBool aIndicator ); |
|
79 |
|
80 /** |
|
81 * Used by application to enable or disable waveform data. |
|
82 * @since 3.0 |
|
83 * @param aIndicator Set to ETrue to enable waveform data, EFalse to disable waveform data. |
|
84 */ |
|
85 void EnableWaveformData( TBool aIndicator ); |
|
86 |
|
87 /** |
|
88 * Get frequency band count. |
|
89 * @since 3.0 |
|
90 * @return frequency band count. |
|
91 */ |
|
92 TUint32 FreqencyBandCount( ) const; |
|
93 |
|
94 /** |
|
95 * Get frequency band count range. |
|
96 * @since 3.0 |
|
97 * @param aMin Lower limit of the frequency band count range |
|
98 * @param aMax Upper limit of the frequency band count range |
|
99 */ |
|
100 void FrequencyBandCountRange( TUint32& aMin, TUint32& aMax ); |
|
101 |
|
102 /** |
|
103 * Determine whether frequency data is enabled. |
|
104 * @since 3.0 |
|
105 * @return ETrue, if frequency data is enabled. EFalse, if frequency data is disabled. |
|
106 */ |
|
107 TBool IsFrequencyDataEnabled( ) const; |
|
108 |
|
109 /** |
|
110 * Determine whether waveform data is enabled. |
|
111 * @since 3.0 |
|
112 * @return ETrue, if waveform data is enabled. EFalse, if waveform data is disabled. |
|
113 */ |
|
114 TBool IsWaveformDataEnabled( ) const; |
|
115 |
|
116 /** |
|
117 * Get the sampling rate. |
|
118 * @since 3.0 |
|
119 * @return The sampling rate. |
|
120 */ |
|
121 TUint32 SamplingRate() const; |
|
122 |
|
123 /** |
|
124 * Set the data rate. |
|
125 * @since 3.0 |
|
126 * @param aDataRate The data rate. |
|
127 */ |
|
128 void SetDataRateL( TUint32 aDataRate ); |
|
129 |
|
130 /** |
|
131 * Sets the frequency band count. Results in a call to |
|
132 * MVisualizationObserver::FrequencyBandCountChanged(). |
|
133 * @since 3.0 |
|
134 * @param aFrequencyBandCount The frequency band count. |
|
135 */ |
|
136 void SetFrequencyBandCountL( TUint32 aFrequencyBandCount ); |
|
137 |
|
138 /** |
|
139 * Sets the waveform band count. Results in a call to |
|
140 * MVisualizationObserver::WaveformDataLengthChanged(). |
|
141 * @since 3.0 |
|
142 * @param aWaveformDataLength The waveform data length in samples. |
|
143 */ |
|
144 void SetWaveformDataLengthL( TUint32 aWaveformDataLength ); |
|
145 |
|
146 /** |
|
147 * Starts visualization. Results in a call to MVisualizationObserver::VisualizationStarted() |
|
148 * @since 3.0 |
|
149 */ |
|
150 void StartL( ); |
|
151 |
|
152 /** |
|
153 * Stops visualization. Results in a call to MVisualizationObserver::VisualizationStopped() |
|
154 * @since 3.0 |
|
155 */ |
|
156 void StopL( ); |
|
157 |
|
158 /** |
|
159 * Get the waveform data length. |
|
160 * @since 3.0 |
|
161 * @return The waveform data length in samples. |
|
162 */ |
|
163 TUint32 WaveformDataLength() const; |
|
164 |
|
165 /** |
|
166 * Get the waveform data length range in samples. |
|
167 * @since 3.0 |
|
168 * @param aMin The lower limit of the waveform data length range |
|
169 * @param aMax The upper limit of the waveform data length range |
|
170 */ |
|
171 void WaveformDataLengthRange( TUint32& aMin, TUint32& aMax ); |
|
172 |
|
173 private: |
|
174 |
|
175 /** |
|
176 * Private C++ constructor for this class. |
|
177 * @since 3.0 |
|
178 */ |
|
179 CBody(); |
|
180 |
|
181 /** |
|
182 * Second Phase Costructor |
|
183 * @since 3.0 |
|
184 * @param aObserver Visualization Observer |
|
185 */ |
|
186 void ConstructL(MVisualizationObserver& aObserver ); |
|
187 |
|
188 private: // Data |
|
189 |
|
190 // Indicate whether frequency data is enabled or not |
|
191 TBool iFrequencyDataEnabled; |
|
192 |
|
193 // Indicate whether waveform data is enabled or not |
|
194 TBool iWaveFormDataEnabled; |
|
195 |
|
196 // Data rate |
|
197 TUint32 iDataRate; |
|
198 TUint32 iDataRateMin; |
|
199 TUint32 iDataRateMax; |
|
200 |
|
201 // Frequency Data |
|
202 TUint32 iFreqencyBandCount; |
|
203 TUint32 iFreqencyBandCountMin; |
|
204 TUint32 iFreqencyBandCountMax; |
|
205 |
|
206 // Sampling rate |
|
207 TUint32 iSamplingRate; |
|
208 |
|
209 // Waveform Data |
|
210 TUint32 iWaveformDataLength; |
|
211 TUint32 iWaveformDataLengthMin; |
|
212 TUint32 iWaveformDataLengthMax; |
|
213 |
|
214 RArray<TInt16> iFrequencyData; |
|
215 RArray<TInt16> iWaveFormData; |
|
216 |
|
217 // Pointer to Observer |
|
218 MVisualizationObserver* iObserver; |
|
219 }; |
|
220 |
|
221 #endif // of CVISUALIZATIONCBODY_H |
|
222 |
|
223 // End of File |