Trait jack::NotificationHandler[][src]

pub trait NotificationHandler: Send {
    fn thread_init(&self, _: &Client) { ... }
fn shutdown(&mut self, _status: ClientStatus, _reason: &str) { ... }
fn freewheel(&mut self, _: &Client, _is_freewheel_enabled: bool) { ... }
fn buffer_size(&mut self, _: &Client, _size: Frames) -> Control { ... }
fn sample_rate(&mut self, _: &Client, _srate: Frames) -> Control { ... }
fn client_registration(
        &mut self,
        _: &Client,
        _name: &str,
        _is_registered: bool
    ) { ... }
fn port_registration(
        &mut self,
        _: &Client,
        _port_id: PortId,
        _is_registered: bool
    ) { ... }
fn port_rename(
        &mut self,
        _: &Client,
        _port_id: PortId,
        _old_name: &str,
        _new_name: &str
    ) -> Control { ... }
fn ports_connected(
        &mut self,
        _: &Client,
        _port_id_a: PortId,
        _port_id_b: PortId,
        _are_connected: bool
    ) { ... }
fn graph_reorder(&mut self, _: &Client) -> Control { ... }
fn xrun(&mut self, _: &Client) -> Control { ... }
fn latency(&mut self, _: &Client, _mode: LatencyType) { ... } }

Specifies callbacks for JACK.

Provided methods

fn thread_init(&self, _: &Client)[src]

Called just once after the creation of the thread in which all other callbacks will be handled.

It does not need to be suitable for real-time execution.

fn shutdown(&mut self, _status: ClientStatus, _reason: &str)[src]

Called when the JACK server shuts down the client thread. The function must be written as if it were an asynchronous POSIX signal handler — use only async-safe functions, and remember that it is executed from another thread. A typical funcion might set a flag or write to a pipe so that the rest of the application knows that the JACK client thread has shut down.

fn freewheel(&mut self, _: &Client, _is_freewheel_enabled: bool)[src]

Called whenever “freewheel” mode is entered or leaving.

fn buffer_size(&mut self, _: &Client, _size: Frames) -> Control[src]

Called whenever the size of the buffer that will be passed to process is about to change.

fn sample_rate(&mut self, _: &Client, _srate: Frames) -> Control[src]

Called whenever the system sample rate changes.

fn client_registration(&mut self, _: &Client, _name: &str, _is_registered: bool)[src]

Called whenever a client is registered or unregistered

fn port_registration(
    &mut self,
    _: &Client,
    _port_id: PortId,
    _is_registered: bool
)
[src]

Called whenever a port is registered or unregistered

fn port_rename(
    &mut self,
    _: &Client,
    _port_id: PortId,
    _old_name: &str,
    _new_name: &str
) -> Control
[src]

Called whenever a port is renamed.

fn ports_connected(
    &mut self,
    _: &Client,
    _port_id_a: PortId,
    _port_id_b: PortId,
    _are_connected: bool
)
[src]

Called whenever ports are connected/disconnected to/from each other.

fn graph_reorder(&mut self, _: &Client) -> Control[src]

Called whenever the processing graph is reordered.

fn xrun(&mut self, _: &Client) -> Control[src]

Called whenever an xrun occurs.

An xrun is a buffer under or over run, which means some data has been missed.

fn latency(&mut self, _: &Client, _mode: LatencyType)[src]

Called whenever it is necessary to recompute the latencies for some or all JACK ports.

It will be called twice each time it is needed, once being passed CaptureLatency and once with `PlayBackLatency. See managing and determining latency for the definition of each type of latency and related functions. TODO: clear up the “see managing and …” in the docstring.

IMPORTANT: Most JACK clients do NOT need to register a latency callback.

Clients that meed any of the following conditions do NOT need to register a latency callback:

  • have only input ports

  • have only output ports

  • their output is totally unrelated to their input

  • their output is not delayed relative to their input (i.e. data that arrives in a process is processed and output again in the same callback)

Clients NOT registering a latency callback MUST also satisfy this condition

  • have no multiple distinct internal signal pathways

This means that if your client has more than 1 input and output port, and considers them always “correlated” (e.g. as a stereo pair), then there is only 1 (e.g. stereo) signal pathway through the client. This would be true, for example, of a stereo FX rack client that has a left/right input pair and a left/right output pair.

However, this is somewhat a matter of perspective. The same FX rack client could be connected so that its two input ports were connected to entirely separate sources. Under these conditions, the fact that the client does not register a latency callback MAY result in port latency values being incorrect.

Clients that do not meet any of those conditions SHOULD register a latency callback.

See the documentation for jack_port_set_latency_range() on how the callback should operate. Remember that the mode argument given to the latency callback will need to be passed into jack_port_set_latency_range()

Loading content...

Implementations on Foreign Types

impl NotificationHandler for ()[src]

A trivial handler that does nothing.

Loading content...

Implementors

Loading content...