Struct easyjack::Client
[−]
[src]
pub struct Client<'a> { /* fields omitted */ }
A jack client connected to a jack server
TODO example
Methods
impl<'a> Client<'a>
[src]
fn open(name: &str, opts: Options) -> Result<(Self, String), Status>
Creates a new client and connects it to the default jack server. The
client will use the name given. If the name is not unique, the behavior
depends on the options provided via opts
.
If the option to force a unique name is given (USE_EXACT_NAME) and the exact name can not be given, Err will be returned. Otherwise Returns the client and the name assigned to the client.
TODO client_name_size details in docs and in code
fn open_connection_to(
clientname: &str,
servername: &str,
opts: Options
) -> Result<(Self, String), Status>
clientname: &str,
servername: &str,
opts: Options
) -> Result<(Self, String), Status>
Attempts to open a client connecting to a server with a specified name
fn get_name(&self) -> String
Returns the actual name of the client. This is useful when USE_EXACT_NAME is not specified, because the jack server might assign some other name to your client to ensure that it is unique.
Returns a copy of the actual string returned the JACK C API
fn register_input_audio_port(
&mut self,
name: &str
) -> Result<InputPortHandle<DefaultAudioSample>, Status>
&mut self,
name: &str
) -> Result<InputPortHandle<DefaultAudioSample>, Status>
Helper function which registers an input audio port with a given name.
fn register_input_midi_port(
&mut self,
name: &str
) -> Result<InputPortHandle<MidiEvent>, Status>
&mut self,
name: &str
) -> Result<InputPortHandle<MidiEvent>, Status>
Helper function which registers an input midi port with a given name.
fn register_output_audio_port(
&mut self,
name: &str
) -> Result<OutputPortHandle<DefaultAudioSample>, Status>
&mut self,
name: &str
) -> Result<OutputPortHandle<DefaultAudioSample>, Status>
Helper function which registers an output audio port with a given name.
fn unregister_port<T: Port>(&mut self, port: T) -> Result<(), Status>
Removes the port from the client and invalidates the port and all Handles relating to the port.
The server disconnects everything that was previously connected to the port.
fn get_port_by_name(&self, name: &str) -> Option<UnknownPortHandle>
fn get_port_by_id(&self, id: PortId) -> Option<UnknownPortHandle>
fn connect_ports(&mut self, port1: &str, port2: &str) -> Result<(), Status>
Attempts to connect the ports with the given names Note that this method calls directly into the jack api. It does not perform lookups for the names before making the call
fn disconnect_ports(&mut self, port1: &str, port2: &str) -> Result<(), Status>
Attempts to disconnect the ports with the given names Note that this method calls directly into the jack api. It does not perform lookups for the names before making the call
fn set_process_handler<T: ProcessHandler + 'a>(
&mut self,
handler: T
) -> Result<(), Status>
&mut self,
handler: T
) -> Result<(), Status>
Set the client's process callback handler.
The client takes ownership of the handler, so be sure to set up any
messaging queues before passing the handler off to the client
See the docs for the ProcessHandler
struct for more details
fn set_metadata_handler<T: MetadataHandler + 'a>(
&mut self,
handler: T
) -> Result<(), Status>
&mut self,
handler: T
) -> Result<(), Status>
Set the client's sample rate change handler.
fn activate(&self) -> Result<(), Status>
tells the JACK server that the client is read to start processing audio
This will initiate
callbacks into the CallbackHandler
provided.
fn close(&mut self) -> Result<(), &str>
Disconnects the client from the JACK server. This will also disconnect and destroy any of the ports which the client registered