Struct jack::Port
[−]
[src]
pub struct Port<PD: PortData> { /* fields omitted */ }
An endpoint to interact with Jack data streams, for audio, midi, etc...
Most jack functionality is exposed, including the raw pointers,
but it should be possible to create a client without the need for
calling unsafe
Port
methods.
Methods
impl<PD: PortData> Port<PD>
[src]
fn data(&mut self, ps: &ProcessScope) -> &mut PD
fn name<'a>(&'a self) -> &'a str
Returns the full name of the port, including the "client_name:" prefix.
fn short_name<'a>(&'a self) -> &'a str
Returns the short name of the port, it excludes the "client_name:" prefix.
fn uuid(&self) -> u64
Returns the uuid of the port as a u64.
fn flags(&self) -> PortFlags
The flags for the port. These are set when the port is registered with its client.
fn port_type<'a>(&self) -> &'a str
The port type. Jack's built in types include "32 bit float mono audio" and "8 bit raw midi". Custom types may also be used.
fn connected_count(&self) -> usize
Number of ports connected to/from
fn is_connected_to(&self, port_name: &str) -> bool
Returns true
if the port is directly connected to a port with the name
port_name
.
fn aliases(&self) -> Vec<String>
fn is_monitoring_input(&self) -> bool
Returns true
if monitoring has been requested for self
.
fn ensure_monitor(&self, enable_monitor: bool) -> Result<(), JackErr>
If the CAN_MONITOR
flag is set for the port, then input monitoring is
turned on if it was off, and turns it off if only one request has been
made to turn it on. Otherwise it does nothing.
fn set_name(&mut self, short_name: &str) -> Result<(), JackErr>
Set's the short name of the port. If the full name is longer than
Port::name_size()
, then it will be truncated.
fn set_alias(&mut self, alias: &str) -> Result<(), JackErr>
Sets alias
as an alias for self
.
May be called at any time. If the alias is longer than
Client::name_size()
, it will be truncated.
After a successful call, and until Jack exists, or the alias is unset,
alias
may be used as an alternate name for the port.
Ports can have up to two aliases - if both are already set, this function will return an error.
fn unset_alias(&mut self, alias: &str) -> Result<(), JackErr>
Remove alias
as an alias for port. May be called at any time.
After a successful call, alias
can no longer be used as an alternate
name for self
.
fn request_monitor(&mut self, enable_monitor: bool) -> Result<(), JackErr>
Turn input monitoring for the port on or off.
This only works if the port has the CAN_MONITOR
flag set.
fn unregister(self) -> Result<(), JackErr>
Remove the port from the client, disconnecting any existing connections. The port must have been created with the provided client.
unsafe fn from_raw(client_ptr: *mut jack_client_t,
port_ptr: *mut jack_port_t)
-> Self
port_ptr: *mut jack_port_t)
-> Self
Create a Port from raw jack pointers.