|
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: This is the definition of the audio visualization base class. |
|
15 * |
|
16 * |
|
17 */ |
|
18 |
|
19 |
|
20 #ifndef CVISUALIZATION_H |
|
21 #define CVISUALIZATION_H |
|
22 |
|
23 // INCLUDES |
|
24 #include <e32base.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 : 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 IMPORT_C static CVisualization* NewL( MVisualizationObserver& aObserver ); |
|
50 |
|
51 /** |
|
52 * Destructor |
|
53 */ |
|
54 virtual ~CVisualization(); |
|
55 |
|
56 public: // New functions |
|
57 |
|
58 /** |
|
59 * Get the data rate. |
|
60 * @since 3.0 |
|
61 * @return data rate in Hz. |
|
62 */ |
|
63 IMPORT_C 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 IMPORT_C 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 IMPORT_C 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 IMPORT_C void EnableWaveformData( TBool aIndicator ); |
|
86 |
|
87 /** |
|
88 * Get frequency band count. |
|
89 * @since 3.0 |
|
90 * @return frequency band count. |
|
91 */ |
|
92 IMPORT_C 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 IMPORT_C 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 IMPORT_C 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 IMPORT_C TBool IsWaveformDataEnabled( ) const; |
|
115 |
|
116 /** |
|
117 * Get the sampling rate. |
|
118 * @since 3.0 |
|
119 * @return The sampling rate. |
|
120 */ |
|
121 IMPORT_C TUint32 SamplingRate() const; |
|
122 |
|
123 /** |
|
124 * Set the data rate. |
|
125 * @since 3.0 |
|
126 * @param aDataRate The data rate. |
|
127 */ |
|
128 IMPORT_C 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 IMPORT_C 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 IMPORT_C void SetWaveformDataLengthL( TUint32 aWaveformDataLength ); |
|
145 |
|
146 /** |
|
147 * Starts visualization. Results in a call to MVisualizationObserver::VisualizationStarted() |
|
148 * @since 3.0 |
|
149 */ |
|
150 IMPORT_C void StartL( ); |
|
151 |
|
152 /** |
|
153 * Stops visualization. Results in a call to MVisualizationObserver::VisualizationStopped() |
|
154 * @since 3.0 |
|
155 */ |
|
156 IMPORT_C void StopL( ); |
|
157 |
|
158 /** |
|
159 * Get the waveform data length. |
|
160 * @since 3.0 |
|
161 * @return The waveform data length in samples. |
|
162 */ |
|
163 IMPORT_C 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 IMPORT_C void WaveformDataLengthRange( TUint32& aMin, TUint32& aMax ); |
|
172 |
|
173 |
|
174 private: |
|
175 |
|
176 /** |
|
177 * Private C++ constructor for this class. |
|
178 * @since 3.0 |
|
179 */ |
|
180 CVisualization(); |
|
181 |
|
182 /** |
|
183 * Second Phase Costructor |
|
184 * @since 3.0 |
|
185 * @param aObserver Visualization Observer |
|
186 */ |
|
187 void ConstructL( MVisualizationObserver& aObserver ); |
|
188 |
|
189 class CBody; |
|
190 |
|
191 /** |
|
192 CVisualization body |
|
193 */ |
|
194 CBody* iBody; |
|
195 }; |
|
196 |
|
197 #endif // of CVISUALIZATION_H |
|
198 |
|
199 // End of File |