Struct jack::TransportPosition

source ·
#[repr(transparent)]
pub struct TransportPosition(_);
Expand description

A structure representing the transport position.

Implementations§

source§

impl TransportPosition

source

pub fn valid_bbt(&self) -> bool

Query to see if the BarBeatsTick data is valid.

source

pub fn valid_bbt_frame_offset(&self) -> bool

Query to see if the frame offset of BarBeatsTick data is valid.

source

pub fn frame(&self) -> Frames

Get the frame number on the transport timeline.

Remarks
  • This is not the same as what jack_frame_time returns.
source

pub fn set_frame(&mut self, frame: Frames)

Set the frame number on the transport timeline.

source

pub fn frame_rate(&self) -> Option<Frames>

Get the current frame rate, in frames per second.

Remarks
  • This is only set by the server so it will be None if this struct hasn’t come from the sever.
source

pub fn usecs(&self) -> Option<Time>

Get a microsecond timestamp.

Remarks
  • This is only set by the server so it will be None if this struct hasn’t come from the sever.
  • Guaranteed to be monotonic, but not necessarily linear.
  • The absolute value is implementation-dependent (i.e. it could be wall-clock, time since jack started, uptime, etc).
source

pub fn bbt(&self) -> Option<TransportBBT>

Get the BarBeatsTick data if it is valid.

source

pub fn set_bbt(
&mut self,
bbt: Option<TransportBBT>
) -> Result<(), TransportBBTValidationError>

Set the BarBeatsTick data in this position.

Arguments
  • bbt - The data to set in the position. None will invalidate the BarBeatsTick data.
Remarks
  • If the bbt does not validate, will leave the pre-existing data intact.
source

pub fn bbt_offset(&self) -> Option<Frames>

Get the frame offset for the BBT fields.

Remarks
  • Should be assumed to be 0 if None.
  • If this value is Some(0), the bbt time refers to the first frame of this cycle.
  • Otherwise, the bbt time refers to a frame that many frames before the start of the cycle.
source

pub fn set_bbt_offset(&mut self, frame: Option<Frames>) -> Result<(), Frames>

Set the frame offset for the BBT fields.

Arguments
  • frame - The value to set to the offset. None will invalidate the offset data.
Remarks
  • If this value is 0, the bbt time refers to the first frame of this cycle.
  • Otherwise, the bbt time refers to a frame that many frames before the start of the cycle.

Trait Implementations§

source§

impl Debug for TransportPosition

source§

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

Formats the value using the given formatter. Read more
source§

impl Default for TransportPosition

source§

fn default() -> Self

Returns the “default value” for a type. 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.