EngineConfig

Struct EngineConfig 

Source
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: RenderConfig

Render configuration

§sample_rate: f32

Audio sample rate

§enable_per_frame: bool

Enable per-frame equations

§enable_per_pixel: bool

Enable per-pixel equations

§transition_duration_s: f32

Duration 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: f32

Length 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: bool

Record 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: bool

Waveform 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: ProgressSource

Source 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

Source

pub fn from_preset(preset: QualityPreset) -> Self

Create configuration from a quality preset.

Trait Implementations§

Source§

impl Clone for EngineConfig

Source§

fn clone(&self) -> EngineConfig

Returns a duplicate of the value. Read more
1.0.0 · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for EngineConfig

Source§

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

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

impl Default for EngineConfig

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

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
§

impl<T> Downcast<T> for T

§

fn downcast(&self) -> &T

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<S> FromSample<S> for S

§

fn from_sample_(s: S) -> S

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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<R, P> ReadPrimitive<R> for P
where R: Read + ReadEndian<P>, P: Default,

Source§

fn read_from_little_endian(read: &mut R) -> Result<Self, Error>

Read this value from the supplied reader. Same as ReadEndian::read_from_little_endian().
Source§

fn read_from_big_endian(read: &mut R) -> Result<Self, Error>

Read this value from the supplied reader. Same as ReadEndian::read_from_big_endian().
Source§

fn read_from_native_endian(read: &mut R) -> Result<Self, Error>

Read this value from the supplied reader. Same as ReadEndian::read_from_native_endian().
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
§

impl<T, U> ToSample<U> for T
where U: FromSample<T>,

§

fn to_sample_(self) -> U

Source§

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

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.
§

impl<T> Upcast<T> for T

§

fn upcast(&self) -> Option<&T>

§

impl<S, T> Duplex<S> for T
where T: FromSample<S> + ToSample<S>,

§

impl<T> WasmNotSend for T
where T: Send,

§

impl<T> WasmNotSendSync for T
where T: WasmNotSend + WasmNotSync,

§

impl<T> WasmNotSync for T
where T: Sync,