Skip to main content

Event

Enum Event 

Source
pub enum Event {
    Ready {
        protocol_version: u32,
        engine_version: String,
        fps: u32,
        size: [u32; 2],
        scenes: Vec<SceneInfo>,
    },
    Reloaded,
    Building,
    Error {
        kind: ErrorKind,
        message: String,
        spans: Vec<Span>,
    },
    Frame {
        index: u32,
    },
    Timeline {
        frames: u32,
        markers: Vec<MarkerInfo>,
        scenes: Vec<SceneInfo>,
        audio_waveform: Option<Vec<f32>>,
        audio_clips: Vec<AudioClipInfo>,
        slides: Vec<SlideInfo>,
    },
    Tree {
        nodes: Vec<NodeInfo>,
    },
    Signals {
        node_id: u32,
        values: Vec<SignalValue>,
        bounds: Option<[f64; 8]>,
    },
    Selected {
        node_id: Option<u32>,
    },
    Playback {
        playing: bool,
        frame: u32,
    },
    MetaChanged {
        scene: String,
        meta: Meta,
    },
}
Expand description

Engine → UI.

Variants§

§

Ready

Answer to Hello: the engine and the project.

Fields

§protocol_version: u32

PROTOCOL_VERSION of the engine.

§engine_version: String

Version of the oxframe crate.

§fps: u32

Frames per second.

§size: [u32; 2]

Project size in pixels, [width, height].

§scenes: Vec<SceneInfo>

Scenes in order.

§

Reloaded

A new build is running (sent after a hot reload).

§

Building

The CLI started rebuilding the project.

§

Error

Something failed; the last good state stays visible.

Fields

§kind: ErrorKind

What failed.

§message: String

Human-readable message.

§spans: Vec<Span>

Source locations, for compile errors.

§

Frame

Followed by a binary frame (see FrameHeader).

Fields

§index: u32

Global frame index.

§

Timeline

Timeline layout; sent on start and when it changes.

Fields

§frames: u32

Total number of frames.

§markers: Vec<MarkerInfo>

All markers of all scenes.

§scenes: Vec<SceneInfo>

Scenes in order.

§audio_waveform: Option<Vec<f32>>

Peak amplitudes of the soundtrack in 0..=1, one per frame (at most 4096).

§audio_clips: Vec<AudioClipInfo>

Sound effects on the timeline.

§slides: Vec<SlideInfo>

Stops for oxframe present, in order: every slide_break and the end of every scene.

§

Tree

The node tree of the current frame’s scene.

Fields

§nodes: Vec<NodeInfo>

Nodes in tree order (parents before children).

§

Signals

Current values of the selected node; sent after each frame while something is selected.

Fields

§node_id: u32

The selected node.

§values: Vec<SignalValue>

One entry per property.

§bounds: Option<[f64; 8]>

Selection box as four corners [x0, y0, x1, y1, x2, y2, x3, y3] in frame pixels (rotated nodes give a rotated box).

§

Selected

Selection changed (answer to Pick and Select).

Fields

§node_id: Option<u32>

Selected node, if any.

§

Playback

Playback state changed (also sent while playing).

Fields

§playing: bool

Whether playback is running.

§frame: u32

Current global frame.

§

MetaChanged

A scene’s meta changed and was saved.

Fields

§scene: String

Scene name.

§meta: Meta

New contents.

Trait Implementations§

Source§

impl Clone for Event

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Event

Source§

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

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

impl<'de> Deserialize<'de> for Event

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl PartialEq for Event

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Serialize for Event

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for Event

Auto Trait Implementations§

§

impl Freeze for Event

§

impl RefUnwindSafe for Event

§

impl Send for Event

§

impl Sync for Event

§

impl Unpin for Event

§

impl UnsafeUnpin for Event

§

impl UnwindSafe for Event

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

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

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

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

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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

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

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

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

Source§

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

The type returned in the event of a conversion error.
Source§

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

Performs the conversion.