pub struct MatrixCellChain {
    chain: Vec<MatrixChainLink>,
    error: Option<ChainError>,
    dir: CellDir,
    param_idx: usize,
}
Expand description

A DSP chain builder for the crate::Matrix.

This is an extremely easy API to create and place new DSP chains into the crate::Matrix. It can be used by frontends to place DSP chains on user request or it can be used by test cases to quickly fill the hexagonal Matrix.

 use hexodsp::*;
 let mut chain = MatrixCellChain::new(CellDir::BR);
 chain.node_out("sin", "sig")
     .set_denorm("freq", 220.0)
     .node_io("amp", "inp", "sig")
     .set_denorm("att", 0.5)
     .node_inp("out", "ch1");

 // use crate::nodes::new_node_engine;
 let (node_conf, _node_exec) = new_node_engine();
 let mut matrix = Matrix::new(node_conf, 7, 7);

 chain.place(&mut matrix, 2, 2).expect("no error in this case");

Fields

chain: Vec<MatrixChainLink>error: Option<ChainError>dir: CellDirparam_idx: usize

Implementations

Create a new MatrixCellChain with the given placement direction.

The direction is used to guide the placement of the cells.

Sets the current parameter cell by chain index.

Sets the denormalized value of the current parameter cell’s parameter.

The current parameter cell is set automatically when a new node is added. Alternatively you can use MatrixCellChain::params_for_idx to set the current parameter cell.

Sets the normalized value of the current parameter cell’s parameter.

The current parameter cell is set automatically when a new node is added. Alternatively you can use MatrixCellChain::params_for_idx to set the current parameter cell.

Sets the atom value of the current parameter cell’s parameter.

The current parameter cell is set automatically when a new node is added. Alternatively you can use MatrixCellChain::params_for_idx to set the current parameter cell.

Utility function for creating crate::Cell for this chain.

Utility function to add a pre-built crate::Cell as next link.

This also sets the current parameter cell.

Place a new node in the chain without any inputs or outputs. This is of limited use in this API, but might makes a few corner cases easier in test cases.

Place a new node in the chain with the given output assigned.

Place a new node in the chain with the given input assigned.

Place a new node in the chain with the given input and output assigned.

Places the chain into the matrix at the given position.

If any error occured while building the chain (such as bad input/output names or unknown parameters), it will be returned here.

Trait Implementations

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

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

The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.