[−][src]Struct jack::AsyncClient
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();
Methods
impl<N, P> AsyncClient<N, P> where
N: 'static + Send + NotificationHandler,
P: 'static + Send + ProcessHandler, [src]
N: 'static + Send + NotificationHandler,
P: 'static + Send + ProcessHandler,
pub fn new(
client: Client,
notification_handler: N,
process_handler: P
) -> Result<Self, Error>[src]
client: Client,
notification_handler: N,
process_handler: P
) -> Result<Self, Error>
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.
impl<N, P> AsyncClient<N, P>[src]
pub fn as_client<'a>(&'a self) -> &'a Client[src]
Return the underlying jack::Client.
pub fn deactivate(self) -> Result<(Client, N, P), Error>[src]
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
impl<N, P> Drop for AsyncClient<N, P>[src]
Closes the client.
impl<N, P> Debug for AsyncClient<N, P>[src]
Auto Trait Implementations
impl<N, P> Send for AsyncClient<N, P> where
N: Send,
P: Send,
N: Send,
P: Send,
impl<N, P> Unpin for AsyncClient<N, P>
impl<N, P> !Sync for AsyncClient<N, P>
impl<N, P> UnwindSafe for AsyncClient<N, P> where
N: UnwindSafe,
P: UnwindSafe,
N: UnwindSafe,
P: UnwindSafe,
impl<N, P> RefUnwindSafe for AsyncClient<N, P> where
N: RefUnwindSafe,
P: RefUnwindSafe,
N: RefUnwindSafe,
P: RefUnwindSafe,
Blanket Implementations
impl<T> From<T> for T[src]
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>, [src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T[src]
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,