diff include/Bela.h @ 314:611306d840b3 prerelease

Merge
author Giulio Moro <giuliomoro@yahoo.it>
date Fri, 27 May 2016 19:00:43 +0100
parents 00725dfc1b87
children 5c8f46fcd4d0
line wrap: on
line diff
--- a/include/Bela.h	Fri May 27 18:55:34 2016 +0100
+++ b/include/Bela.h	Fri May 27 19:00:43 2016 +0100
@@ -37,12 +37,7 @@
 // Useful constants
 
 /** \cond PRIVATE */
-#define DBOX_CAPE					// New custom cape
-#ifdef DBOX_CAPE
 #define CODEC_I2C_ADDRESS  0x18		// Address of TLV320AIC3104 codec
-#else
-#define CODEC_I2C_ADDRESS  0x1B		// Address of TLV320AIC3106 codec
-#endif
 
 #define MAX_PRU_FILENAME_LENGTH 256
 #define MAX_SERVERNAME_LENGTH 256
@@ -181,50 +176,50 @@
 	/// This buffer may be in either interleaved or non-interleaved format,
 	/// depending on the contents of the BelaInitSettings structure.
 	/// \b Note: this element is available in render() only.
-	float *audioIn;
+	const float * const audioIn;
 
 	/// \brief Buffer holding audio output samples
 	///
 	/// This buffer may be in either interleaved or non-interleaved format,
 	/// depending on the contents of the BelaInitSettings structure.
 	/// \b Note: this element is available in render() only.
-	float *audioOut;
+	float * const audioOut;
 
 	/// \brief Buffer holding analog input samples
 	///
 	/// This buffer may be in either interleaved or non-interleaved format,
 	/// depending on the contents of the BelaInitSettings structure.
 	/// \b Note: this element is available in render() only.
-	float *analogIn;
+	const float * const analogIn;
 
 	/// \brief Buffer holding analog output samples
 	///
 	/// This buffer may be in either interleaved or non-interleaved format,
 	/// depending on the contents of the BelaInitSettings structure.
 	/// \b Note: this element is available in render() only.
-	float *analogOut;
+	float * const analogOut;
 
 	/// \brief Buffer holding digital input/output samples
 	///
 	/// \b Note: this element is available in render() only.
-	uint32_t *digital;
+	uint32_t * const digital;
 
 	/// Number of audio frames per period
-	uint32_t audioFrames;
+	const uint32_t audioFrames;
 	/// Number of audio channels (currently always 2)
-	uint32_t audioChannels;
+	const uint32_t audioChannels;
 	/// Audio sample rate in Hz (currently always 44100.0)
-	float audioSampleRate;
+	const float audioSampleRate;
 
 	/// \brief Number of analog frames per period
 	///
 	/// This will be 0 if analog I/O is disabled.
-	uint32_t analogFrames;
+	const uint32_t analogFrames;
 
 	/// \brief Number of analog channels
 	///
 	/// This could take a value of 8, 4 or 2. This will be 0 if analog I/O is disabled.
-	uint32_t analogChannels;
+	const uint32_t analogChannels;
 
 	/// \brief Analog sample rate in Hz
 	///
@@ -232,24 +227,24 @@
 	/// 8 channels are used, the sample rate is 22050. If 4 channels are used, the sample
 	/// rate is 44100. If 2 channels are used, the sample rate is 88200. If analog I/O
 	/// is disabled, the sample rate is 0.
-	float analogSampleRate;
+	const float analogSampleRate;
 
 	/// Number of digital frames per period
-	uint32_t digitalFrames;
+	const uint32_t digitalFrames;
 	/// \brief Number of digital channels
 	///
 	/// Currently this will always be 16, unless digital I/O is disabled, in which case it will be 0.
-	uint32_t digitalChannels;
+	const uint32_t digitalChannels;
 	/// Digital sample rate in Hz (currently always 44100.0)
-	float digitalSampleRate;
+	const float digitalSampleRate;
 
-	/// \brief Number of elapsed audio samples since the start of rendering.
+	/// \brief Number of elapsed audio frames since the start of rendering.
 	///
-	/// This holds the total number of audio samples as of the beginning of the current period. To
-	/// find the current number of analog or digital samples elapsed, multiply by the ratio of the
-	/// sample rates (e.g. half the number of analog samples will have elapsed if the analog sample
+	/// This holds the total number of audio frames as of the beginning of the current period. To
+	/// find the current number of analog or digital frames elapsed, multiply by the ratio of the
+	/// sample rates (e.g. half the number of analog frames will have elapsed if the analog sample
 	/// rate is 22050).
-	uint64_t audioSampleCount;
+	const uint64_t audioFramesElapsed;
 
 	/// \brief Other audio/sensor settings
 	///
@@ -259,7 +254,7 @@
 	///
 	/// BELA_FLAG_ANALOG_OUTPUTS_PERSIST: indicates that writes to the analog outputs will
 	/// persist for future frames. If not set, writes affect one frame only.
-	uint32_t flags;
+	const uint32_t flags;
 } BelaContext;
 
 /** \ingroup auxtask