gled 2.29.0

gled is an application for creating animations and effects on artnet or dmx installations
//! Messages exchanged between the UI thread and the render thread.

use crate::{
    pipeline::extract_output::OutputConfig,
    storage::{
        asset::{animation::Animation, project::Project},
        asset_id::AssetId,
    },
};

/// Everything the render thread needs to render one frame, cloned by the UI
/// thread once per UI frame. Snapshots are dropped when the render thread is
/// behind; the next one supersedes them anyway.
#[derive(Debug)]
pub(crate) struct RenderSnapshot {
    pub(crate) project: Option<Project>,
    pub(crate) blackout: bool,
    pub(crate) output_config: OutputConfig,
    pub(crate) fps_limit: f32,
}

/// One-shot requests that must not be dropped.
#[derive(Debug)]
pub(crate) enum RenderCommand {
    /// Rebuild the output pipelines of all effects using this animation, or of
    /// all effects for `None`. Sent after the animation was saved to the collections.
    ReloadShaderCode(Option<AssetId<Animation>>),
    /// Upload LED positions again, e.g. after a new SVG was parsed.
    SendPositions,
}

/// Reports from the render thread to the UI thread.
#[derive(Debug)]
pub(crate) enum RenderFeedback {
    /// Average render frame rate over the last second.
    FrameStats { fps: f32 },
}