diff --git a/src/main.rs b/src/main.rs index 893d0602325dd52cfbf52c76fa2d6de3d77c659b..23ee874f381550cea9e3e761695ac54998f27ffc 100644 --- a/src/main.rs +++ b/src/main.rs @@ -19,7 +19,7 @@ TODO: - [ ] f32.mul_add() or f32.to_bits() / f32.from_bits() - [ ] only calculate connected ports https://docs.rs/jack/0.7.1/jack/struct.Port.html#method.connected_count - [ ] Flag volume modulations as dirty -- [ ] Support other Buffers than 1024 +- [x] Support other Buffers than 1024 - [ ] Features: - [ ] Flags to control printing (--quiet etc) - [ ] Option to set initial values @@ -125,6 +125,8 @@ fn main() { jack::AudioOut::default()) .unwrap(); 16]; + + let buffersize = client.buffer_size() as usize; // Is called asynchronously. Moves/mixes the actual audio samples from A to be let process_callback = move |_: &jack::Client, ps: &jack::ProcessScope| -> jack::Control { @@ -141,9 +143,11 @@ fn main() { // Sum each input to output buffer output_buffers.iter_mut() + .take(buffersize) .enumerate() .for_each(|(output_index, b)| { b.iter_mut() + .take(buffersize) .enumerate() .for_each(|(sample_index, sample)| { // For each input get the corrsponding atomic value for the volume control