reformatting

This commit is contained in:
Weird Constructor 2022-07-24 12:19:49 +02:00
parent 480aa8d9c5
commit 51453bae16
5 changed files with 24 additions and 16 deletions

View file

@ -22,7 +22,6 @@ The [crate::MatrixCellChain] abstractions allows very easy placement of DSP sign
```
*/
use crate::{Cell, CellDir, Matrix, NodeId, ParamId, SAtom};
use std::collections::HashMap;
@ -75,12 +74,7 @@ impl MatrixCellChain {
///
/// The direction is used to guide the placement of the cells.
pub fn new(dir: CellDir) -> Self {
Self {
dir,
chain: vec![],
error: None,
param_idx: 0,
}
Self { dir, chain: vec![], error: None, param_idx: 0 }
}
fn output_dir(&self) -> CellDir {
@ -226,7 +220,12 @@ impl MatrixCellChain {
///
/// If any error occured while building the chain (such as bad input/output names
/// or unknown parameters), it will be returned here.
pub fn place(&mut self, matrix: &mut Matrix, at_x: usize, at_y: usize) -> Result<(), ChainError> {
pub fn place(
&mut self,
matrix: &mut Matrix,
at_x: usize,
at_y: usize,
) -> Result<(), ChainError> {
if let Some(err) = self.error.take() {
return Err(err);
}

View file

@ -301,6 +301,7 @@ projects and authors, I can't relicense it.
*/
pub mod cell_dir;
pub mod chain_builder;
#[allow(unused_macros, non_snake_case)]
pub mod dsp;
pub mod log;
@ -309,10 +310,10 @@ pub mod matrix_repr;
pub mod monitor;
pub mod nodes;
pub mod sample_lib;
pub mod chain_builder;
mod util;
pub use cell_dir::CellDir;
pub use chain_builder::MatrixCellChain;
pub use dsp::{NodeId, NodeInfo, ParamId, SAtom};
pub use log::log;
pub use matrix::{Cell, Matrix};
@ -320,7 +321,6 @@ pub use matrix_repr::load_patch_from_file;
pub use matrix_repr::save_patch_to_file;
pub use nodes::{new_node_engine, NodeConfigurator, NodeExecutor};
pub use sample_lib::{SampleLibrary, SampleLoadError};
pub use chain_builder::MatrixCellChain;
pub struct Context<'a, 'b, 'c, 'd> {
pub nframes: usize,

View file

@ -5,8 +5,8 @@
pub use hexodsp::dsp::*;
pub use hexodsp::matrix::*;
pub use hexodsp::nodes::new_node_engine;
pub use hexodsp::NodeExecutor;
pub use hexodsp::MatrixCellChain;
pub use hexodsp::NodeExecutor;
use hound;

View file

@ -11,9 +11,7 @@ fn check_node_ad_1() {
let mut matrix = Matrix::new(node_conf, 3, 3);
let mut chain = MatrixCellChain::new(CellDir::B);
chain.node_out("ad", "sig")
.node_inp("out", "ch1")
.place(&mut matrix, 0, 0).unwrap();
chain.node_out("ad", "sig").node_inp("out", "ch1").place(&mut matrix, 0, 0).unwrap();
matrix.sync().unwrap();
let ad = NodeId::Ad(0);

View file

@ -119,9 +119,20 @@ fn check_node_delay_2() {
vec![
// 10ms smoothing time for "inp"
0.001133, // 30ms delaytime just mixing the 0.5:
0.5, 0.5, 0.5, // the delayed smoothing ramp (10ms):
0.5,
0.5,
0.5, // the delayed smoothing ramp (10ms):
0.950001113, // the delay + input signal:
1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0
1.0,
1.0,
1.0,
1.0,
1.0,
1.0,
1.0,
1.0,
1.0,
1.0
]
);
}