Struct hexodsp::NodeExecutor
source · pub struct NodeExecutor { /* private fields */ }Expand description
Holds the complete allocation of nodes and the program. New Nodes or the program is not newly allocated in the audio backend, but it is copied from the input ring buffer. If this turns out to be too slow, we might have to push buffers of the program around.
Implementations
sourceimpl NodeExecutor
impl NodeExecutor
pub fn no_logging(&mut self)
pub fn process_graph_updates(&mut self)
pub fn set_external_params(&mut self, ext_param: Arc<dyn ExternalParams>)
pub fn set_sample_rate(&mut self, sample_rate: f32)
pub fn feed_midi_events_from<F: FnMut() -> Option<HxTimedEvent>>(&mut self, f: F)
pub fn get_prog(&self) -> &NodeProg
pub fn get_nodes(&self) -> Vec<Node>
pub fn process<T: NodeAudioContext>(&mut self, ctx: &mut T)
sourcepub fn test_run_input(
&mut self,
input: &[f32],
realtime: bool,
events: &[HxTimedEvent]
) -> (Vec<f32>, Vec<f32>)
pub fn test_run_input(
&mut self,
input: &[f32],
realtime: bool,
events: &[HxTimedEvent]
) -> (Vec<f32>, Vec<f32>)
This is a convenience function used for testing the DSP graph output in automated tests for this crate.
The sample rate that is used to run the DSP code is 44100 Hz.
Relying on the behvaiour of this function for production code is not it’s intended usecase and changes might break your code.
realtime: If this is set, the function will sleep.
You can use it’s source as reference for your own audio DSP thread processing function.
sourcepub fn test_run(
&mut self,
seconds: f32,
realtime: bool,
events: &[HxTimedEvent]
) -> (Vec<f32>, Vec<f32>)
pub fn test_run(
&mut self,
seconds: f32,
realtime: bool,
events: &[HxTimedEvent]
) -> (Vec<f32>, Vec<f32>)
This is a convenience function used for testing the DSP graph input and output in automated tests for this crate.
The sample rate that is used to run the DSP code is 44100 Hz.
Relying on the behvaiour of this function for production code is not it’s intended usecase and changes might break your code.
seconds: The number of seconds to run the DSP thread for.realtime: If this is set, the function will sleep.
You can use it’s source as reference for your own audio DSP thread processing function.