pub struct NodeProg {
pub inp: Vec<ProcBuf>,
pub cur_inp: Vec<ProcBuf>,
pub out: Vec<ProcBuf>,
pub params: Vec<f32>,
pub atoms: Vec<SAtom>,
pub prog: Vec<NodeOp>,
pub modops: Vec<ModOp>,
pub locked_buffers: bool,
pub out_feedback: Input<Vec<f32>>,
pub out_fb_cons: Option<Output<Vec<f32>>>,
pub unique_id: usize,
}
Expand description
A node graph execution program. It comes with buffers for the inputs, outputs and node parameters (knob values).
Fields
inp: Vec<ProcBuf>
The input vector stores the smoothed values of the params.
It is not used directly, but will be merged into the cur_inp
field together with the assigned outputs.
cur_inp: Vec<ProcBuf>
The temporary input vector that is initialized from inp
and is then merged with the associated outputs.
out: Vec<ProcBuf>
The output vector, holding all the node outputs.
params: Vec<f32>
The param vector, holding all parameter inputs of the nodes, such as knob settings.
atoms: Vec<SAtom>
The atom vector, holding all non automatable parameter inputs of the nodes, such as samples or integer settings.
prog: Vec<NodeOp>
The node operations that are executed in the order they appear in this vector.
modops: Vec<ModOp>
The modulators for the input parameters.
locked_buffers: bool
A marker, that checks if we can still swap buffers with
with other NodeProg instances. This is usally set if the ProcBuf pointers
have been copied into cur_inp
. You can call unlock_buffers
to
clear locked_buffers
:
out_feedback: Input<Vec<f32>>
Holds the input end of a triple buffer that is used to publish the most recent output values to the frontend.
out_fb_cons: Option<Output<Vec<f32>>>
Temporary hold for the producer for the out_feedback
:
unique_id: usize
A unique ID assigned to the node prog. Mostly for debugging purposes. You should only read this field.
Implementations
sourceimpl NodeProg
impl NodeProg
pub fn empty() -> Self
pub fn new(out_len: usize, inp_len: usize, at_len: usize, mod_len: usize) -> Self
pub fn take_feedback_consumer(&mut self) -> Option<Output<Vec<f32>>>
pub fn params_mut(&mut self) -> &mut [f32]
pub fn atoms_mut(&mut self) -> &mut [SAtom]
pub fn modops_mut(&mut self) -> &mut [ModOp]
pub fn append_op(&mut self, node_op: NodeOp)
pub fn append_edge(
&mut self,
node_op: NodeOp,
inp_index: usize,
out_index: usize,
mod_index: Option<usize>
)
sourcepub fn initialize_input_buffers(&mut self)
pub fn initialize_input_buffers(&mut self)
This is called right after the crate::nodes::NodeExecutor received this NodeProg from the crate::nodes::NodeConfigurator. It initializes internal buffers with parameter data.