pub struct Player { /* private fields */ }Expand description
Plays one saved scene, one frame at a time.
Implementations§
Source§impl Player
impl Player
Sourcepub fn new(pkg: Arc<ScenePackage>, theme: Theme, buddy: bool) -> Option<Player>
pub fn new(pkg: Arc<ScenePackage>, theme: Theme, buddy: bool) -> Option<Player>
None if the scene has no such theme.
Sourcepub fn new_view(
pkg: Arc<ScenePackage>,
theme: Theme,
buddy: bool,
view: PixelRect,
) -> Option<Player>
pub fn new_view( pkg: Arc<ScenePackage>, theme: Theme, buddy: bool, view: PixelRect, ) -> Option<Player>
A player showing only view of the scene’s frame (span mode: each
monitor shows its part of one scene). Every method then works in the
view’s own coordinates. None if the scene has no such theme or the
view isn’t inside the frame.
Sourcepub fn set_smooth(&mut self, on: bool)
pub fn set_smooth(&mut self, on: bool)
Particles at sub-cell positions (Clock::Smooth), for presenters on
a GPU: a higher frame rate then moves them smoothly. Off by default,
so the first frame is the still exactly; the CPU fallback keeps it
off (PLAN.md section 4.4).
Sourcepub fn with_view(&self, view: PixelRect) -> Option<Player>
pub fn with_view(&self, view: PixelRect) -> Option<Player>
Another player of the same scene at the same moment, showing view
of it (one scene on several screens, each showing its part). None
if the view isn’t inside the frame.
Sourcepub fn is_journey(&self) -> bool
pub fn is_journey(&self) -> bool
Whether the scene is a journey (its whole frame moves every tick).
Sourcepub fn image(&self) -> &IndexedImage
pub fn image(&self) -> &IndexedImage
The whole current frame as palette indices (not just the view).
Sourcepub fn index_row(&self, x: u32, y: u32, w: u32) -> &[u8] ⓘ
pub fn index_row(&self, x: u32, y: u32, w: u32) -> &[u8] ⓘ
Palette indices of w pixels of row y from column x, in the
view’s coordinates.
Sourcepub fn now_ms(&self) -> u64
pub fn now_ms(&self) -> u64
Scene time now: the hero time plus the time since playback started. A pause only stops drawing; the next frame shows the time it is.
Sourcepub fn advance(&mut self, t_ms: u64) -> Vec<PixelRect>
pub fn advance(&mut self, t_ms: u64) -> Vec<PixelRect>
Moves to t_ms; returns the rectangles that changed, in the view’s
coordinates (changes outside the view are left out).
Sourcepub fn write(&self, buf: &mut [u32], rects: &[PixelRect])
pub fn write(&self, buf: &mut [u32], rects: &[PixelRect])
Writes those rectangles (view coordinates) of the current frame into a 0RGB buffer of the view’s size.
Sourcepub fn rect_pixels(&self, r: &PixelRect, out: &mut Vec<u32>)
pub fn rect_pixels(&self, r: &PixelRect, out: &mut Vec<u32>)
One rectangle (view coordinates) of the current frame as 0RGB pixels, row by row.
Auto Trait Implementations§
impl Forget for Player
impl Freeze for Player
impl Move for Player
impl RefUnwindSafe for Player
impl Send for Player
impl Sync for Player
impl Unpin for Player
impl UnsafeUnpin for Player
impl UnwindSafe for Player
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.