pub struct PlaybackClock { /* private fields */ }Expand description
The playback clock of one run of playback: asked each display refresh which timeline time to show.
Implementations§
Source§impl PlaybackClock
impl PlaybackClock
Sourcepub fn new(
policy: PlaybackPolicy,
frame_rate: FrameRate,
rate: f64,
tick: i64,
now_ms: f64,
) -> Self
pub fn new( policy: PlaybackPolicy, frame_rate: FrameRate, rate: f64, tick: i64, now_ms: f64, ) -> Self
A clock starting at tick at wall time now_ms, playing at rate
(negative plays backwards) under policy.
Sourcepub const fn policy(&self) -> PlaybackPolicy
pub const fn policy(&self) -> PlaybackPolicy
The policy it enforces.
Sourcepub fn step(
&mut self,
now_ms: f64,
heard: Option<i64>,
presented: bool,
) -> ClockStep
pub fn step( &mut self, now_ms: f64, heard: Option<i64>, presented: bool, ) -> ClockStep
The time to show at wall time now_ms. heard is the audio output’s
position in ticks while it runs (a position before the clock’s start
is its start); presented says whether the frame the clock last asked
for has been shown.
Trait Implementations§
Source§impl Clone for PlaybackClock
impl Clone for PlaybackClock
Auto Trait Implementations§
impl Freeze for PlaybackClock
impl RefUnwindSafe for PlaybackClock
impl Send for PlaybackClock
impl Sync for PlaybackClock
impl Unpin for PlaybackClock
impl UnsafeUnpin for PlaybackClock
impl UnwindSafe for PlaybackClock
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more