Struct jack::AsyncClient [−][src]
pub struct AsyncClient<N, P> { /* fields omitted */ }
Expand description
A JACK client that is processing data asynchronously, in real-time.
To create input or output (either sound or midi), a Port
can be used within the process
callback. See Client::register_port
on creating ports. Also, see Port
for documentation on
the API for port.
Example
// Create a client and a handler
let (client, _status) =
jack::Client::new("my_client", jack::ClientOptions::NO_START_SERVER).unwrap();
let process_handler = jack::ClosureProcessHandler::new(
move |_: &jack::Client, _: &jack::ProcessScope| jack::Control::Continue,
);
// An active async client is created, `client` is consumed.
let active_client = client.activate_async((), process_handler).unwrap();
// When done, deactivate the client.
active_client.deactivate().unwrap();
Implementations
impl<N, P> AsyncClient<N, P> where
N: 'static + Send + Sync + NotificationHandler,
P: 'static + Send + ProcessHandler,
impl<N, P> AsyncClient<N, P> where
N: 'static + Send + Sync + NotificationHandler,
P: 'static + Send + ProcessHandler,
Tell the JACK server that the program is ready to start processing audio. JACK will call the
methods specified by the NotificationHandler
and ProcessHandler
objects.
On failure, either Err(Error::CallbackRegistrationError)
or
Err(Error::ClientActivationError)
is returned.
notification_handler
and process_handler
are consumed, but they are returned when
Client::deactivate
is called.
Tell the JACK server to remove this client from the process graph. Also, disconnect all ports belonging to it since inactive clients have no port connections.
The handler
that was used for Client::activate
is returned on success. Its state may
have changed due to JACK calling its methods.
In the case of error, the Client
is destroyed because its state is unknown, and it is
therefore unsafe to continue using.
Trait Implementations
Closes the client.