Struct jack::ProcessScope

source ·
pub struct ProcessScope { /* private fields */ }
Expand description

ProcessScope provides information on the client and frame time information within a process callback.

Implementations§

source§

impl ProcessScope

source

pub fn n_frames(&self) -> Frames

The number of frames in the current process cycle.

source

pub fn last_frame_time(&self) -> Frames

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.

source

pub fn frames_since_cycle_start(&self) -> Frames

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

source

pub fn cycle_times(&self) -> Result<CycleTimes, Error>

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(Error::TimeError) is returned on failure. Err(Error::WeakFunctionNotFound) if the function does not exist.

source

pub fn client_ptr(&self) -> *mut jack_client_t

Expose the client_ptr for low level purposes.

This is mostly for use within the jack crate itself.

source

pub unsafe fn from_raw(n_frames: Frames, client_ptr: *mut jack_client_t) -> Self

Create a ProcessScope for the client with the given pointer and the specified amount of frames.

This is mostly for use within the jack crate itself.

Safety

It is unsafe to create a ProcessScope since it may not be valid. For library user’s, the ProcessScope is usually passed in as a parameter to a trait’s method.

Trait Implementations§

source§

impl Debug for ProcessScope

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere
T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere
T: ?Sized,

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere
T: ?Sized,

const: unstable · source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere
U: From<T>,

const: unstable · source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for Twhere
U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere
U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
const: unstable · source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.