Struct jack::client::Client
[−]
[src]
pub struct Client(_);
A client to interact with a JACK server.
Methods
impl Client
[src]
fn open(client_name: &str,
options: ClientOptions)
-> Result<(Self, ClientStatus), JackErr>
options: ClientOptions)
-> Result<(Self, ClientStatus), JackErr>
The maximum length of the JACK client name string. Unlike the "C" JACK
API, this does not take into account the final NULL
character and
instead corresponds directly to .len()
.
Opens a JACK client with the given name and options. If the client is
successfully opened, then Ok(client)
is returned. If there is a
failure, then Err(JackErr::ClientError(status))
will be returned.
Although the client may be successful in opening, there still may be
some errors minor errors when attempting to opening. To access these,
check the returned ClientStatus
.
fn activate<JH: JackHandler>(self,
handler: JH)
-> Result<ActiveClient<JH>, JackErr>
handler: JH)
-> Result<ActiveClient<JH>, JackErr>
Tell the JACK server that the program is ready to start processing
audio. JACK will call the methods specified by the JackHandler
trait, from handler
.
On failure, either Err(JackErr::CallbackRegistrationError)
or
Err(JackErr::ClientActivationError)
is returned.
handler
is consumed, but it is returned when Client::deactivate
is
called.
unsafe fn from_raw(p: *mut jack_client_t) -> Self
Create a Client
from an ffi pointer.
This is mostly for use within the jack crate itself.
Trait Implementations
impl Debug for Client
[src]
impl JackClient for Client
[src]
fn as_ptr(&self) -> *mut jack_client_t
Expose the underlying ffi pointer. Read more
fn sample_rate(&self) -> usize
The sample rate of the JACK system, as set by the user when jackd was started.
fn cpu_load(&self) -> c_float
The current CPU load estimated by JACK. Read more
fn name<'a>(&'a self) -> &'a str
Get the name of the current client. This may differ from the name requested by Client::open
as JACK will may rename a client if necessary (ie: name collision, name too long). The name will only the be different than the one passed to Client::open
if the ClientStatus
was NAME_NOT_UNIQUE
. Read more
fn buffer_size(&self) -> JackFrames
The current maximum size that will every be passed to the process callback.
fn set_buffer_size(&self, n_frames: JackFrames) -> Result<(), JackErr>
Change the buffer size passed to the process callback. Read more
fn ports(&self,
port_name_pattern: Option<&str>,
type_name_pattern: Option<&str>,
flags: PortFlags)
-> Vec<String>
port_name_pattern: Option<&str>,
type_name_pattern: Option<&str>,
flags: PortFlags)
-> Vec<String>
Returns a vector of port names that match the specified arguments Read more
fn register_port<PS: PortSpec>(&self,
port_name: &str,
port_spec: PS)
-> Result<Port<PS>, JackErr>
port_name: &str,
port_spec: PS)
-> Result<Port<PS>, JackErr>
Create a new port for the client. This is an object used for moving data of any type in or out of the client. Ports may be connected in various ways. Read more
fn port_by_id(&self, port_id: JackPortId) -> Option<UnownedPort>
fn port_by_name(&self, port_name: &str) -> Option<UnownedPort>
Get a Port
by its port name.
fn frames_since_cycle_start(&self) -> JackFrames
The estimated time in frames that has passed since the JACK server began the current process cycle. Read more
fn frame_time(&self) -> JackFrames
The estimated current time in frames. This function is intended for use in other threads (not the process callback). The return value can be compared with the value of last_frame_time
to relate time in other threads to JACK time. To obtain better time information from within the process callback, see ProcessScope
. Read more
fn frames_to_time(&self, n_frames: JackFrames) -> JackTime
The estimated time in microseconds of the specified frame time Read more
fn time_to_frames(&self, t: JackTime) -> JackFrames
The estimated time in frames for the specified system time. Read more
fn is_mine<PS: PortSpec>(&self, port: &Port<PS>) -> bool
Returns true
if the port port
belongs to this client.
fn request_monitor_by_name(&self,
port_name: &str,
enable_monitor: bool)
-> Result<(), JackErr>
port_name: &str,
enable_monitor: bool)
-> Result<(), JackErr>
Toggle input monitoring for the port with name port_name
. Read more
fn connect_ports_by_name(&self,
source_port: &str,
destination_port: &str)
-> Result<(), JackErr>
source_port: &str,
destination_port: &str)
-> Result<(), JackErr>
Establish a connection between two ports by their full name. Read more
fn connect_ports<A: PortSpec, B: PortSpec>(&self,
source_port: &Port<A>,
destination_port: &Port<B>)
-> Result<(), JackErr>
source_port: &Port<A>,
destination_port: &Port<B>)
-> Result<(), JackErr>
Establish a connection between two ports. Read more
fn disconnect_ports<A: PortSpec, B: PortSpec>(&self,
source: &Port<A>,
destination: &Port<B>)
-> Result<(), JackErr>
source: &Port<A>,
destination: &Port<B>)
-> Result<(), JackErr>
Remove a connection between two ports.
fn disconnect_ports_by_name(&self,
source_port: &str,
destination_port: &str)
-> Result<(), JackErr>
source_port: &str,
destination_port: &str)
-> Result<(), JackErr>
Remove a connection between two ports.
unsafe fn type_buffer_size(&self, port_type: &str) -> usize
The buffer size of a port type Read more
impl Drop for Client
[src]
Close the client, deactivating if necessary.