Trying to get into jack
This commit is contained in:
10
src/main.rs
10
src/main.rs
@@ -18,11 +18,9 @@ fn main() {
|
||||
let rb = HeapRb::<f32>::new(128);
|
||||
let (mut prod, mut cons) = rb.split();
|
||||
let process_callback = move |_: &jack::Client, ps: &jack::ProcessScope| -> jack::Control {
|
||||
let mut out_a_p = out_a.as_mut_slice(ps);
|
||||
for v in cons.iter_mut() {
|
||||
println!("{:?}", v);
|
||||
out_a_p.fill(*v);
|
||||
}
|
||||
let out = out_a.as_mut_slice(ps);
|
||||
let available = cons.pop_slice(out);
|
||||
out[available..].fill(0.0);
|
||||
jack::Control::Continue
|
||||
};
|
||||
let process = jack::contrib::ClosureProcessHandler::new(process_callback);
|
||||
@@ -42,7 +40,7 @@ fn main() {
|
||||
// 5. wait or do some processing while your handler is running in real time.
|
||||
println!("Enter an integer value to change the frequency of the sine wave.");
|
||||
while let Some(f) = read_freq() {
|
||||
prod.try_push(f);
|
||||
prod.try_push(1203.0).unwrap();
|
||||
}
|
||||
|
||||
// 6. Optional deactivate. Not required since active_client will deactivate on
|
||||
|
||||
Reference in New Issue
Block a user