Last active
October 13, 2019 16:45
-
-
Save drozdziak1/23a518c4196f8526edaeeefb489a986c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fn jack_sanity<F>() -> Result<AsyncClient<(), ClosureProcessHandler<F>>, Error> | |
where | |
F: 'static + Send + FnMut(&Client, &ProcessScope) -> Control, | |
{ | |
let (client, _status) = Client::new("anal", ClientOptions::NO_START_SERVER)?; | |
let in_1 = client.register_port("in_1", AudioIn::default())?; | |
let in_2 = client.register_port("in_2", AudioIn::default())?; | |
let process_callback = move |_client: &Client, ps: &jack::ProcessScope| -> Control { | |
let data_1 = in_1.as_slice(ps); | |
let data_2 = in_2.as_slice(ps); | |
dbg!(data_1); | |
Control::Continue | |
}; | |
let process = ClosureProcessHandler::new(process_callback); | |
let active_client = client.activate_async((), process)?; | |
Ok(active_client) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment