Trait jack::JackClient
[−]
[src]
pub unsafe trait JackClient: Sized { fn client_ptr(&self) -> *mut jack_client_t; fn close(self) { ... } fn sample_rate(&self) -> usize { ... } fn cpu_load(&self) -> f32 { ... } unsafe fn type_buffer_size(&self, port_type: &str) -> usize { ... } fn name<'a>(&'a self) -> &'a str { ... } fn uuid<'a>(&'a self) -> &'a str { ... } fn name_by_uuid<'a>(&'a self, uuid: &str) -> Option<&'a str> { ... } fn uuid_by_name<'a>(&'a self, name: &str) -> Option<&'a str> { ... } fn ports(&self,
port_name_pattern: Option<&str>,
type_name_pattern: Option<&str>,
flags: PortFlags)
-> Vec<String> { ... } fn port_by_id(&self, port_id: u32) -> Option<UnownedPort> { ... } fn port_by_name(&self, port_name: &str) -> Option<UnownedPort> { ... } fn frames_since_cycle_start(&self) -> u32 { ... } fn frame_time(&self) -> u32 { ... } fn last_frame_time(&self) -> u32 { ... } fn cycle_times(&self) -> Result<CycleTimes, JackErr> { ... } fn frames_to_time(&self, n_frames: u32) -> u64 { ... } fn time_to_frames(&self, t: u64) -> u32 { ... } fn is_mine<PD: PortData>(&self, port: &Port<PD>) -> bool { ... } }
Required Methods
fn client_ptr(&self) -> *mut jack_client_t
Provided Methods
fn close(self)
Manually close the client, deactivating if necessary. This will happen automatically on drop.
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) -> f32
The current CPU load estimated by Jack.
This is a running average of the time it takes to execute a full process cycle for all clients as a percentage of the real time available per cycle determined by the buffer size and sample rate.
unsafe fn type_buffer_size(&self, port_type: &str) -> usize
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
.
fn uuid<'a>(&'a self) -> &'a str
Get the uuid of the current client.
fn name_by_uuid<'a>(&'a self, uuid: &str) -> Option<&'a str>
Get the name of the client with the UUID specified by uuid
. If the
client is found then Some(name)
is returned, if not, then None
is
returned.
fn uuid_by_name<'a>(&'a self, name: &str) -> Option<&'a str>
Get the uuid of the client with the name specified by name
. If the
client is found then Some(uuid)
is returned, if not, then None
is
returned.
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
port_name_pattern
- A regular expression used to select ports by
name. If None
or zero lengthed, no selection based on name will be
carried out.
type_name_pattern
- A regular expression used to select ports by
type. If None
or zero lengthed, no selection based on type will be
carried out.
flags
- A value used to select ports by their flags. Use
PortFlags::empty()
for no flag selection.
fn port_by_id(&self, port_id: u32) -> Option<UnownedPort>
Get a Port
by its port id.
fn port_by_name(&self, port_name: &str) -> Option<UnownedPort>
Get a Port
by its port name.
fn frames_since_cycle_start(&self) -> u32
The estimated time in frames that has passed since the Jack server began the current process cycle.
fn frame_time(&self) -> u32
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.
fn last_frame_time(&self) -> u32
The precise time at the start of the current process cycle. This
function may only be used from the process callback, and can be used to
interpret timestamps generated by self.frame_time()
in other threads,
with respect to the current process cycle.
fn cycle_times(&self) -> Result<CycleTimes, JackErr>
This function may only be used from the process callback. It provides the internal cycle timing information as used by most of the other time related functions. This allows the caller to map between frame counts and microseconds with full precision (i.e. without rounding frame times to integers), and also provides e.g. the microseconds time of the start of the current cycle directly (it has to be computed otherwise).
Err(JackErr::TimeError)
is returned on failure.
fn frames_to_time(&self, n_frames: u32) -> u64
The estimated time in microseconds of the specified frame time
fn time_to_frames(&self, t: u64) -> u32
The estimated time in frames for the specified system time.
fn is_mine<PD: PortData>(&self, port: &Port<PD>) -> bool
Returns true
if the port port
belongs to this client.
Implementors
impl JackClient for Client
impl<JH: JackHandler> JackClient for ActiveClient<JH>