Skip to main content

BelaInitSettings

Struct BelaInitSettings 

Source
#[repr(C)]
pub struct BelaInitSettings {
Show 42 fields pub periodSize: c_int, pub useAnalog: c_int, pub useDigital: c_int, pub numAudioInChannels: c_int, pub numAudioOutChannels: c_int, pub numAnalogInChannels: c_int, pub numAnalogOutChannels: c_int, pub numDigitalChannels: c_int, pub beginMuted: c_int, pub dacLevel: f32, pub adcLevel: f32, pub pgaGain: [f32; 2], pub headphoneLevel: f32, pub numMuxChannels: c_int, pub audioExpanderInputs: c_uint, pub audioExpanderOutputs: c_uint, pub pruNumber: c_int, pub pruFilename: [c_char; 256], pub detectUnderruns: c_int, pub verbose: c_int, pub enableLED: c_int, pub stopButtonPin: c_int, pub highPerformanceMode: c_int, pub interleave: c_int, pub analogOutputsPersist: c_int, pub uniformSampleRate: c_int, pub audioThreadStackSize: c_uint, pub auxiliaryTaskStackSize: c_uint, pub setup: Option<unsafe extern "C" fn(arg1: *mut BelaContext, arg2: *mut c_void) -> bool>, pub render: Option<unsafe extern "C" fn(arg1: *mut BelaContext, arg2: *mut c_void)>, pub cleanup: Option<unsafe extern "C" fn(arg1: *mut BelaContext, arg2: *mut c_void)>, pub ampMutePin: c_int, pub audioThreadDone: Option<unsafe extern "C" fn(arg1: *mut BelaContext, arg2: *mut c_void)>, pub codecMode: *mut c_char, pub audioInputGains: BelaChannelGainArray, pub headphoneGains: BelaChannelGainArray, pub adcGains: BelaChannelGainArray, pub lineOutGains: BelaChannelGainArray, pub disabledDigitalChannels: u32, pub unused: [c_char; 220], pub board: BelaHw, pub projectName: *mut c_char,
}
Expand description

\ingroup control \brief Structure containing initialisation parameters for the real-time audio control system.

This structure is initialised using Bela_defaultSettings(). Its contents are used up through the point of calling Bela_initAudio() at which point it is no longer needed.

Fields§

§periodSize: c_int

\brief Number of audio frames per period (“blocksize”).

The number of analog frames depends on relative sample rates of the two. By default, audio is twice the sample rate, so has twice the period size.

§useAnalog: c_int

Whether to use the analog input and output

§useDigital: c_int

Whether to use the 16 programmable GPIOs

§numAudioInChannels: c_int

How many audio input channels [ignored]

§numAudioOutChannels: c_int

How many audio out channels [ignored]

§numAnalogInChannels: c_int

How many analog input channels

§numAnalogOutChannels: c_int

How many analog output channels

§numDigitalChannels: c_int

How many channels for the GPIOs

§beginMuted: c_int

Whether to begin with the speakers muted

§dacLevel: f32

Level for the audio DAC output. DEPRECATED: ues lineOutGains

§adcLevel: f32

Level for the audio ADC input. DEPRECATED: use audioInputGains

§pgaGain: [f32; 2]

Gains for the PGA, left and right channels. DEPRECATED: use audioInputGains

§headphoneLevel: f32

Level for the headphone output. DEPRECATED: use headphoneGains

§numMuxChannels: c_int

How many channels to use on the multiplexer capelet, if enabled

§audioExpanderInputs: c_uint

Which audio expander settings to use on the input

§audioExpanderOutputs: c_uint

Which audio expander settings to use on the input

§pruNumber: c_int

Which PRU (0 or 1) the code should run on

§pruFilename: [c_char; 256]

The external .bin file to load. If empty will use PRU code from pru_rtaudio_bin.h

§detectUnderruns: c_int

Whether to detect and log underruns

§verbose: c_int

Whether to use verbose logging

§enableLED: c_int

Whether to use the blinking LED to indicate Bela is running

§stopButtonPin: c_int

What GPIO pin to monitor for stopping the program. Defaults to 115 (button on P9.27/P2.34/GPIO3[19]). Pass -1 to disable monitoring.

§highPerformanceMode: c_int

Whether to use high-performance mode: gives more CPU to the Bela task. The Linux part of the board and the IDE may freeze while the program is running. Use the button on the Bela cape to forcefully stop the running program

§interleave: c_int

Whether audio/analog data should be interleaved

§analogOutputsPersist: c_int

\brief Whether analog outputs should persist to future frames.

n.b. digital pins always persist, audio never does

§uniformSampleRate: c_int

\brief Whether the analog channels should be resampled to audio sampling rate.

§audioThreadStackSize: c_uint

\brief The requested stack size for the audio thread. Defaults

§auxiliaryTaskStackSize: c_uint

\brief The requested stack size for each AuxilaryTask. Defaults

§setup: Option<unsafe extern "C" fn(arg1: *mut BelaContext, arg2: *mut c_void) -> bool>§render: Option<unsafe extern "C" fn(arg1: *mut BelaContext, arg2: *mut c_void)>§cleanup: Option<unsafe extern "C" fn(arg1: *mut BelaContext, arg2: *mut c_void)>§ampMutePin: c_int

Pin where amplifier mute can be found

§audioThreadDone: Option<unsafe extern "C" fn(arg1: *mut BelaContext, arg2: *mut c_void)>

Pointer to an optional function to be called when the audio thread is done. This function is called from the audio thread itself just before it returns.

§codecMode: *mut c_char

A codec-specific intialisation parameter

§audioInputGains: BelaChannelGainArray

audio input gains

§headphoneGains: BelaChannelGainArray

level for headphone outputs

§adcGains: BelaChannelGainArray

Level for the audio ADC input DEPRECATED: use audioInputGains

§lineOutGains: BelaChannelGainArray

Level for the audio line level output

§disabledDigitalChannels: u32

A bitmask of disabled digital channels

§unused: [c_char; 220]§board: BelaHw

User selected board to work with (as opposed to detected hardware).

§projectName: *mut c_char

Name of running project.

Trait Implementations§

Source§

impl Clone for BelaInitSettings

Source§

fn clone(&self) -> BelaInitSettings

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for BelaInitSettings

Source§

impl Debug for BelaInitSettings

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for BelaInitSettings

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.