pub struct EngineConfig {
pub render_config: RenderConfig,
pub sample_rate: f32,
pub enable_per_frame: bool,
pub enable_per_pixel: bool,
pub transition_duration_s: f32,
pub preset_display_duration_s: f32,
pub profile: bool,
pub waveform_split_lr: bool,
pub md1_mesh_override: Option<(u32, u32)>,
pub progress_source: ProgressSource,
}Expand description
Engine configuration.
Fields§
§render_config: RenderConfigRender configuration
sample_rate: f32Audio sample rate
enable_per_frame: boolEnable per-frame equations
enable_per_pixel: boolEnable per-pixel equations
transition_duration_s: f32Duration of the crossfade between two presets. 0.0 disables
transitions (instant cut). Default mirrors MD2’s
f_transition_time = 2.7 s.
preset_display_duration_s: f32Length of a preset’s display window in seconds. Drives MD2’s
progress uniform: progress = (time - preset_loaded_time) / preset_display_duration_s, clamped to [0, 1]. Presets
read progress for fade-ins, build-ups, and once-per-window
effects. Default mirrors MD2’s nPresetDisplayLengthSeconds = 16. Set 0.0 to disable (clamps progress to 0).
profile: boolRecord per-phase wall-clock breakdown of every update call into
MilkEngine::last_profile. Used by the bench tool. Off in the
real GUI/CLI path.
waveform_split_lr: boolWaveform L/R top-vs-bottom split. When true, the static
waveform pass renders the LEFT channel on the upper screen
half and the RIGHT channel on the lower half (two dispatches
with a ±0.25 wave_y offset). Default false (single
mono trace). Surfaced at engine level rather than preset
level — MD2 had a player-side option for this, not a preset
variable.
md1_mesh_override: Option<(u32, u32)>MD1-style per-pixel warp mode: when the loaded preset’s version
is < 200 (MilkDrop 1), auto-upgrade the warp mesh to this
resolution. MD1 presets routinely encode high-frequency warp
formulas (dx = sin(40*y), …) that MD2’s mesh-based approach
smooths over at coarse resolutions; densifying the mesh for the
lifetime of the preset restores the “looks evaluated per pixel”
feel without an actual full-resolution CPU eval (which would
run EEL2 millions of times per frame).
MD2+ presets revert to the user’s baseline
RenderConfig::mesh_cols/mesh_rows on the next load. None
disables the override (every preset uses the baseline).
Default Some((96, 72)) — a sweet spot for a true per-pixel
feel on classic MD1 presets without thrashing the warp
executor’s per-vertex evaluator. Cap is WarpMesh::new’s
192×96; lower if MD1 presets feel choppier than expected on
underpowered hardware.
progress_source: ProgressSourceSource for MD2’s progress uniform. Default
ProgressSource::LocalWindow derives progress from
preset_display_duration_s (the per-preset slot timer).
ProgressSource::MprisAutoTrack asks the engine to query
the freedesktop MPRIS2 bus on a background thread and use
Position / mpris:length of the active player instead — so
presets that fade with progress track the song rather than
the slot. When the mpris cargo feature is off, the variant
is still accepted but the engine silently falls back to
LocalWindow.
Implementations§
Source§impl EngineConfig
impl EngineConfig
Sourcepub fn from_preset(preset: QualityPreset) -> Self
pub fn from_preset(preset: QualityPreset) -> Self
Create configuration from a quality preset.
Trait Implementations§
Source§impl Clone for EngineConfig
impl Clone for EngineConfig
Source§fn clone(&self) -> EngineConfig
fn clone(&self) -> EngineConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for EngineConfig
impl Debug for EngineConfig
Auto Trait Implementations§
impl Freeze for EngineConfig
impl RefUnwindSafe for EngineConfig
impl Send for EngineConfig
impl Sync for EngineConfig
impl Unpin for EngineConfig
impl UnwindSafe for EngineConfig
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
ReadEndian::read_from_little_endian().