comparison include/Bela.h @ 307:ff5f346a293e prerelease

Changed BelaContext fields to be const where appropriate; there's now an InternalBelaContext used for setting the values within the core code. These need to stay aligned.
author andrewm
date Fri, 27 May 2016 18:12:15 +0100
parents 421a69d42943
children 493a07f6ec09
comparison
equal deleted inserted replaced
306:132fc61893af 307:ff5f346a293e
179 /// \brief Buffer holding audio input samples 179 /// \brief Buffer holding audio input samples
180 /// 180 ///
181 /// This buffer may be in either interleaved or non-interleaved format, 181 /// This buffer may be in either interleaved or non-interleaved format,
182 /// depending on the contents of the BelaInitSettings structure. 182 /// depending on the contents of the BelaInitSettings structure.
183 /// \b Note: this element is available in render() only. 183 /// \b Note: this element is available in render() only.
184 float *audioIn; 184 const float * const audioIn;
185 185
186 /// \brief Buffer holding audio output samples 186 /// \brief Buffer holding audio output samples
187 /// 187 ///
188 /// This buffer may be in either interleaved or non-interleaved format, 188 /// This buffer may be in either interleaved or non-interleaved format,
189 /// depending on the contents of the BelaInitSettings structure. 189 /// depending on the contents of the BelaInitSettings structure.
190 /// \b Note: this element is available in render() only. 190 /// \b Note: this element is available in render() only.
191 float *audioOut; 191 float * const audioOut;
192 192
193 /// \brief Buffer holding analog input samples 193 /// \brief Buffer holding analog input samples
194 /// 194 ///
195 /// This buffer may be in either interleaved or non-interleaved format, 195 /// This buffer may be in either interleaved or non-interleaved format,
196 /// depending on the contents of the BelaInitSettings structure. 196 /// depending on the contents of the BelaInitSettings structure.
197 /// \b Note: this element is available in render() only. 197 /// \b Note: this element is available in render() only.
198 float *analogIn; 198 const float * const analogIn;
199 199
200 /// \brief Buffer holding analog output samples 200 /// \brief Buffer holding analog output samples
201 /// 201 ///
202 /// This buffer may be in either interleaved or non-interleaved format, 202 /// This buffer may be in either interleaved or non-interleaved format,
203 /// depending on the contents of the BelaInitSettings structure. 203 /// depending on the contents of the BelaInitSettings structure.
204 /// \b Note: this element is available in render() only. 204 /// \b Note: this element is available in render() only.
205 float *analogOut; 205 float * const analogOut;
206 206
207 /// \brief Buffer holding digital input/output samples 207 /// \brief Buffer holding digital input/output samples
208 /// 208 ///
209 /// \b Note: this element is available in render() only. 209 /// \b Note: this element is available in render() only.
210 uint32_t *digital; 210 uint32_t * const digital;
211 211
212 /// Number of audio frames per period 212 /// Number of audio frames per period
213 uint32_t audioFrames; 213 const uint32_t audioFrames;
214 /// Number of audio channels (currently always 2) 214 /// Number of audio channels (currently always 2)
215 uint32_t audioChannels; 215 const uint32_t audioChannels;
216 /// Audio sample rate in Hz (currently always 44100.0) 216 /// Audio sample rate in Hz (currently always 44100.0)
217 float audioSampleRate; 217 const float audioSampleRate;
218 218
219 /// \brief Number of analog frames per period 219 /// \brief Number of analog frames per period
220 /// 220 ///
221 /// This will be 0 if analog I/O is disabled. 221 /// This will be 0 if analog I/O is disabled.
222 uint32_t analogFrames; 222 const uint32_t analogFrames;
223 223
224 /// \brief Number of analog channels 224 /// \brief Number of analog channels
225 /// 225 ///
226 /// This could take a value of 8, 4 or 2. This will be 0 if analog I/O is disabled. 226 /// This could take a value of 8, 4 or 2. This will be 0 if analog I/O is disabled.
227 uint32_t analogChannels; 227 const uint32_t analogChannels;
228 228
229 /// \brief Analog sample rate in Hz 229 /// \brief Analog sample rate in Hz
230 /// 230 ///
231 /// The analog sample rate depends on the number of analog channels used. If 231 /// The analog sample rate depends on the number of analog channels used. If
232 /// 8 channels are used, the sample rate is 22050. If 4 channels are used, the sample 232 /// 8 channels are used, the sample rate is 22050. If 4 channels are used, the sample
233 /// rate is 44100. If 2 channels are used, the sample rate is 88200. If analog I/O 233 /// rate is 44100. If 2 channels are used, the sample rate is 88200. If analog I/O
234 /// is disabled, the sample rate is 0. 234 /// is disabled, the sample rate is 0.
235 float analogSampleRate; 235 const float analogSampleRate;
236 236
237 /// Number of digital frames per period 237 /// Number of digital frames per period
238 uint32_t digitalFrames; 238 const uint32_t digitalFrames;
239 /// \brief Number of digital channels 239 /// \brief Number of digital channels
240 /// 240 ///
241 /// Currently this will always be 16, unless digital I/O is disabled, in which case it will be 0. 241 /// Currently this will always be 16, unless digital I/O is disabled, in which case it will be 0.
242 uint32_t digitalChannels; 242 const uint32_t digitalChannels;
243 /// Digital sample rate in Hz (currently always 44100.0) 243 /// Digital sample rate in Hz (currently always 44100.0)
244 float digitalSampleRate; 244 const float digitalSampleRate;
245 245
246 /// \brief Number of elapsed audio samples since the start of rendering. 246 /// \brief Number of elapsed audio samples since the start of rendering.
247 /// 247 ///
248 /// This holds the total number of audio samples as of the beginning of the current period. To 248 /// This holds the total number of audio samples as of the beginning of the current period. To
249 /// find the current number of analog or digital samples elapsed, multiply by the ratio of the 249 /// find the current number of analog or digital samples elapsed, multiply by the ratio of the
250 /// sample rates (e.g. half the number of analog samples will have elapsed if the analog sample 250 /// sample rates (e.g. half the number of analog samples will have elapsed if the analog sample
251 /// rate is 22050). 251 /// rate is 22050).
252 uint64_t audioSampleCount; 252 const uint64_t audioSampleCount;
253 253
254 /// \brief Other audio/sensor settings 254 /// \brief Other audio/sensor settings
255 /// 255 ///
256 /// Binary combination of flags including: 256 /// Binary combination of flags including:
257 /// 257 ///
258 /// BELA_FLAG_INTERLEAVED: indicates the audio and analog buffers are interleaved 258 /// BELA_FLAG_INTERLEAVED: indicates the audio and analog buffers are interleaved
259 /// 259 ///
260 /// BELA_FLAG_ANALOG_OUTPUTS_PERSIST: indicates that writes to the analog outputs will 260 /// BELA_FLAG_ANALOG_OUTPUTS_PERSIST: indicates that writes to the analog outputs will
261 /// persist for future frames. If not set, writes affect one frame only. 261 /// persist for future frames. If not set, writes affect one frame only.
262 uint32_t flags; 262 const uint32_t flags;
263 } BelaContext; 263 } BelaContext;
264 264
265 /** \ingroup auxtask 265 /** \ingroup auxtask
266 * 266 *
267 * Auxiliary task variable. Auxiliary tasks are created using createAuxiliaryTask() and 267 * Auxiliary task variable. Auxiliary tasks are created using createAuxiliaryTask() and