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 rb = HeapRb::<f32>::new(128);
|
||||||
let (mut prod, mut cons) = rb.split();
|
let (mut prod, mut cons) = rb.split();
|
||||||
let process_callback = move |_: &jack::Client, ps: &jack::ProcessScope| -> jack::Control {
|
let process_callback = move |_: &jack::Client, ps: &jack::ProcessScope| -> jack::Control {
|
||||||
let mut out_a_p = out_a.as_mut_slice(ps);
|
let out = out_a.as_mut_slice(ps);
|
||||||
for v in cons.iter_mut() {
|
let available = cons.pop_slice(out);
|
||||||
println!("{:?}", v);
|
out[available..].fill(0.0);
|
||||||
out_a_p.fill(*v);
|
|
||||||
}
|
|
||||||
jack::Control::Continue
|
jack::Control::Continue
|
||||||
};
|
};
|
||||||
let process = jack::contrib::ClosureProcessHandler::new(process_callback);
|
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.
|
// 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.");
|
println!("Enter an integer value to change the frequency of the sine wave.");
|
||||||
while let Some(f) = read_freq() {
|
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
|
// 6. Optional deactivate. Not required since active_client will deactivate on
|
||||||
|
|||||||
Reference in New Issue
Block a user