Crate jack [−] [src]
extern crate jack; use std::io; fn main() { // Create client let (mut client, _status) = jack::Client::open("rust_jack_simple", jack::client_options::NO_START_SERVER) .unwrap(); // Register ports, that will be used in a callback when new data is available. let in_a = client.register_port("rust_in_l", jack::AudioInSpec).unwrap(); let in_b = client.register_port("rust_in_r", jack::AudioInSpec).unwrap(); let mut out_a = client.register_port("rust_out_l", jack::AudioOutSpec).unwrap(); let mut out_b = client.register_port("rust_out_r", jack::AudioOutSpec).unwrap(); let process_callback = move |ps: &jack::ProcessScope| -> jack::JackControl { let mut out_a_p = jack::AudioOutPort::new(&mut out_a, ps); let mut out_b_p = jack::AudioOutPort::new(&mut out_b, ps); let in_a_p = jack::AudioInPort::new(&in_a, ps); let in_b_p = jack::AudioInPort::new(&in_b, ps); out_a_p.clone_from_slice(&in_a_p); out_b_p.clone_from_slice(&in_b_p); jack::JackControl::Continue }; // Activate the client, which starts the processing. let active_client = client.activate(process_callback).unwrap(); // Wait for user input println!("Press enter/return to quit..."); let mut user_input = String::new(); io::stdin().read_line(&mut user_input).ok(); active_client.deactivate().unwrap(); }
Modules
client_options |
Contains |
client_status |
Contains |
port_flags |
Contains |
Structs
ActiveClient |
A |
AudioInPort |
Safetly wrap a |
AudioInSpec |
|
AudioOutPort |
Safetly wrap a |
AudioOutSpec |
|
CLIENT_NAME_SIZE |
The maximum string length for port names. |
Client |
A client to interact with a JACK server. |
ClientOptions |
Option flags for opening a JACK client. |
ClientStatus |
Status flags for JACK clients. File an issue if you can get it to appear. |
CycleTimes |
Internal cycle timing information. |
PORT_NAME_SIZE |
The maximum string length for port names. |
PORT_TYPE_SIZE |
The maximum string length for jack type names. |
Port |
An endpoint to interact with JACK data streams, for audio, midi, etc... |
PortFlags |
Flags for specifying port options. |
ProcessScope |
|
Unowned |
Port that holds no data from JACK, though it can be used for obtaining information about external ports. |
Enums
JackControl |
Specify an option. |
JackErr |
The Error type that can occur within JACK. |
Traits
JackClient |
Common |
JackHandler |
Specifies callbacks for JACK. |
PortSpec |
Represents the data of a Port within a |
Functions
get_time |
Return JACK's current system time in microseconds, using the JACK clock source. |
set_error_callback |
Set the global JACK error callback. |
set_info_callback |
Set the global JACK info callback. |
Type Definitions
UnownedPort |
Port that holds no data from Jack, though it can be used to query information. |