Trait jack::JackClient [] [src]

pub unsafe trait JackClient: Sized {
    fn id(&self) -> ClientId;
    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 thread_id<P>(&self) -> P { ... }
    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<Port<Unowned>> { ... } fn port_by_name(&self, port_name: &str) -> Option<Port<Unowned>> { ... } 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<PKind: PortOwnershipKind>(&self, port: &Port<PKind>) -> bool { ... } }

Required Methods

Provided Methods

Manually close the client, deactivating if necessary. This will happen automatically on drop.

The sample rate of the jack system, as set by the user when jackd was started.

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.

The buffer size of a port type

Unsafe

  • This function may only be called in a buffer size callback.

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.

Get the uuid of the current client.

Get the pthread ID of the thread running the Jack client side code.

TODO

  • Integrate a pthread library
  • Implement, do people need this though?

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.

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.

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.

Get a Port by its port id.

Get a Port by its port name.

The estimated time in frames that has passed since the Jack server began the current process cycle.

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.

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.

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.

The estimated time in microseconds of the specified frame time

The estimated time in frames for the specified system time.

Returns true if the port port belongs to this client.

Implementors