Crate jack [] [src]

Rust bindings for JACK, a real-time audio and midi library.

Server

JACK provides a high priority server to manipulate audio and midi across applications. The rust jack crate does not provide server creation functionality, so a server has to be set up with the jackd commandline tool, qjackctl the gui tool, or another method.

Client

Typically, applications connect clients to the server. For the rust jack crate, a connection can be made with client::Client::new, which returns a client::Client.

The Client can query the server for information, register ports, and manage connections for ports.

To commence processing audio/midi and other information in real-time, rust jack provides the client::AsyncClient::new, which consumes a Client an object that implements NotificationHandler and an object that implements ProcessHandler and returns a AsyncClient. AsyncClient processes the data in real-time with the provided handlers.

Port

A Client may obtain port information through the Client::port_by_id and Client::port_by_name methods. These ports can be used to manage connections or to obtain port metadata, though their port data (audio buffers and midi buffers) cannot be accessed safely.

Ports can be registered with the Client::register_port method. This requires a PortSpec. The jack crate comes with common specs such as AudioInSpec, AudioOutSpec, MidiInSpec, and MidiOutSpec under the port mod.

To access the data of registered ports, use wrappers that are valid when a ProcessScope is present. The ones provided by the rust jack crate are AudioInPort, AudioOutPort, MidiInPort, and MidiOutPort, all of which are under the port mod. It is also possible to access the data without wrapping the newly registered Port<PortSpec> by using the Port::buffer method, but this returns a void pointer and is unsafe.

Modules

client

Create and manage client connections to a JACK server.

jack_enums

Enum types in jack.

logging

Control error and info logging from JACK.

port

Types for safely interacting with port data from JACK.

prelude

Contains most functionality needed to interact with JACK.

primitive_types

Platform independent types.

ringbuffer

Create and manage JACK ring buffers.

traits

Contains every trait defined in the jack crate.

Functions

get_time

Return JACK's current system time in microseconds, using the JACK clock source.