pub trait NotificationHandler: Send {
// Provided methods
fn thread_init(&self, _: &Client) { ... }
unsafe fn shutdown(&mut self, _status: ClientStatus, _reason: &str) { ... }
fn freewheel(&mut self, _: &Client, _is_freewheel_enabled: bool) { ... }
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 { ... }
}Expand description
Specifies callbacks for JACK.
Provided Methods§
Sourcefn thread_init(&self, _: &Client)
fn thread_init(&self, _: &Client)
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.
Sourceunsafe fn shutdown(&mut self, _status: ClientStatus, _reason: &str)
unsafe fn shutdown(&mut self, _status: ClientStatus, _reason: &str)
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.
§Safety
See https://man7.org/linux/man-pages/man7/signal-safety.7.html for details about what is legal in an async-signal-safe callback.
Sourcefn freewheel(&mut self, _: &Client, _is_freewheel_enabled: bool)
fn freewheel(&mut self, _: &Client, _is_freewheel_enabled: bool)
Called whenever “freewheel” mode is entered or leaving.
Sourcefn sample_rate(&mut self, _: &Client, _srate: Frames) -> Control
fn sample_rate(&mut self, _: &Client, _srate: Frames) -> Control
Called whenever the system sample rate changes.
Sourcefn client_registration(&mut self, _: &Client, _name: &str, _is_registered: bool)
fn client_registration(&mut self, _: &Client, _name: &str, _is_registered: bool)
Called whenever a client is registered or unregistered
Sourcefn port_registration(
&mut self,
_: &Client,
_port_id: PortId,
_is_registered: bool,
)
fn port_registration( &mut self, _: &Client, _port_id: PortId, _is_registered: bool, )
Called whenever a port is registered or unregistered
Sourcefn port_rename(
&mut self,
_: &Client,
_port_id: PortId,
_old_name: &str,
_new_name: &str,
) -> Control
fn port_rename( &mut self, _: &Client, _port_id: PortId, _old_name: &str, _new_name: &str, ) -> Control
Called whenever a port is renamed.
Sourcefn ports_connected(
&mut self,
_: &Client,
_port_id_a: PortId,
_port_id_b: PortId,
_are_connected: bool,
)
fn ports_connected( &mut self, _: &Client, _port_id_a: PortId, _port_id_b: PortId, _are_connected: bool, )
Called whenever ports are connected/disconnected to/from each other.
Sourcefn graph_reorder(&mut self, _: &Client) -> Control
fn graph_reorder(&mut self, _: &Client) -> Control
Called whenever the processing graph is reordered.
Implementations on Foreign Types§
impl NotificationHandler for ()
A trivial handler that does nothing.