Module preset_manager

Module preset_manager 

Source
Expand description

Preset management and transitions.

Structs§

PresetManager
Preset manager handling library navigation, mode/lock/ratings, and crossfade transitions.
RatingsFile 🔒
On-disk format for ratings: a flat [ratings] table of path → integer. Stored as a String-keyed map so paths with non-UTF8 bytes degrade gracefully (skipped, never panic).

Enums§

SelectionMode
Random / sequential selection. Cycled by the GUI’s R key.
TransitionState
Transition state between presets.

Constants§

DEFAULT_HISTORY_SIZE
Cap for the history ring. Matches MilkDrop’s default.
DEFAULT_RATING
Default rating for an unrated preset. Picked at the middle of the [0, 5] window so unrated presets sit between user-disliked (0–2) and user-liked (4–5) when weighted-random sampling.

Functions§

load_ratings 🔒
quick_random_seed 🔒
Simple wall-clock seed for the navigation RNG. The visualiser doesn’t need cryptographic randomness — frame-to-frame variation from the nanosecond clock is plenty for preset shuffling.
save_ratings 🔒