#[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_intWhether to use the analog input and output
useDigital: c_intWhether to use the 16 programmable GPIOs
numAudioInChannels: c_intHow many audio input channels [ignored]
numAudioOutChannels: c_intHow many audio out channels [ignored]
numAnalogInChannels: c_intHow many analog input channels
numAnalogOutChannels: c_intHow many analog output channels
numDigitalChannels: c_intHow many channels for the GPIOs
beginMuted: c_intWhether to begin with the speakers muted
dacLevel: f32Level for the audio DAC output. DEPRECATED: ues lineOutGains
adcLevel: f32Level for the audio ADC input. DEPRECATED: use audioInputGains
pgaGain: [f32; 2]Gains for the PGA, left and right channels. DEPRECATED: use audioInputGains
headphoneLevel: f32Level for the headphone output. DEPRECATED: use headphoneGains
numMuxChannels: c_intHow many channels to use on the multiplexer capelet, if enabled
audioExpanderInputs: c_uintWhich audio expander settings to use on the input
audioExpanderOutputs: c_uintWhich audio expander settings to use on the input
pruNumber: c_intWhich 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_intWhether to detect and log underruns
verbose: c_intWhether to use verbose logging
enableLED: c_intWhether to use the blinking LED to indicate Bela is running
stopButtonPin: c_intWhat 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_intWhether 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_intWhether 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_intPin 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_charA codec-specific intialisation parameter
audioInputGains: BelaChannelGainArrayaudio input gains
headphoneGains: BelaChannelGainArraylevel for headphone outputs
adcGains: BelaChannelGainArrayLevel for the audio ADC input DEPRECATED: use audioInputGains
lineOutGains: BelaChannelGainArrayLevel for the audio line level output
disabledDigitalChannels: u32A bitmask of disabled digital channels
unused: [c_char; 220]§board: BelaHwUser selected board to work with (as opposed to detected hardware).
projectName: *mut c_charName of running project.
Trait Implementations§
Source§impl Clone for BelaInitSettings
impl Clone for BelaInitSettings
Source§fn clone(&self) -> BelaInitSettings
fn clone(&self) -> BelaInitSettings
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more