pub struct Session<E> { /* private fields */ }Expand description
Implementations§
Source§impl<E: PreviewEngine> Session<E>
impl<E: PreviewEngine> Session<E>
Sourcepub fn new(engine: E, encode: Encoder, cache_mb: usize) -> Self
pub fn new(engine: E, encode: Encoder, cache_mb: usize) -> Self
cache_mb bounds the frame cache.
Sourcepub fn is_playing(&self) -> bool
pub fn is_playing(&self) -> bool
Whether playback is running.
Sourcepub fn render_size(&self) -> (u32, u32)
pub fn render_size(&self) -> (u32, u32)
Size of preview frames: the viewport, fitted to the project aspect and never larger than the project.
Sourcepub fn handle(&mut self, cmd: Command, now: f64) -> Vec<Output>
pub fn handle(&mut self, cmd: Command, now: f64) -> Vec<Output>
Handles one command. now is a monotonic clock in seconds, used to
pace playback.
Sourcepub fn tick(&mut self, now: f64) -> Vec<Output>
pub fn tick(&mut self, now: f64) -> Vec<Output>
Advances playback to wall-clock now; returns the new frame’s
outputs, or nothing if the frame did not change.
Sourcepub fn next_tick_in(&self, now: f64) -> Option<f64>
pub fn next_tick_in(&self, now: f64) -> Option<f64>
Seconds until the next playback frame is due, if playing.
Auto Trait Implementations§
impl<E> !RefUnwindSafe for Session<E>
impl<E> !Send for Session<E>
impl<E> !Sync for Session<E>
impl<E> !UnwindSafe for Session<E>
impl<E> Freeze for Session<E>where
E: Freeze,
impl<E> Unpin for Session<E>where
E: Unpin,
impl<E> UnsafeUnpin for Session<E>where
E: UnsafeUnpin,
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