Skins and visualizations
Spotifast gives the player two layers of visual choice. App themes control the main interface, while Winamp and Windows Media Player skins shape the classic player view. Audio visualizations then use the active skin for local bars and scope views, or run MilkDrop in a separate rendering process for richer effects.
Appearance model
The appearance system keeps general app styling separate from classic player styling. A palette controls shared interface elements such as surfaces, text, accents, icons, and fonts. A skin controls the layout, images, colors, and pixel text of the classic player. This separation lets a user change the main app theme without changing the selected player skin.
The system also supports appearance that follows the desktop. It can use the desktop light or dark preference and its animation preference, while album art can add a controlled tint to a page header. The result is a consistent app surface around a player that may use a very different visual language.
Theme palettes
Theme palettes define the colors and shared visual rules used by the main app. Built-in light and dark palettes provide the base, while custom palette files and supported desktop palettes extend the choices without changing player skins.
The palette is applied to both standard interface widgets and custom views. This keeps dialogs, menus, controls, text, icons, shadows, and selection states aligned. A palette may also provide a tint that lets album art influence the page without replacing the readable base colors.
Skin selection
The skin system treats the built-in player and user skins as one set of choices. Skins can come from archives or unpacked folders in the skins folder, and a dropped skin file can be installed from the player window. Settings presents the choices as a selectable gallery, then the active choice is loaded for the classic player.
The player keeps a usable skin available while a new choice loads. The built-in skin is the fallback, and missing assets in an otherwise valid skin can use compatible fallback artwork. This makes partial or old skins useful without making the player lose its controls.
Skin formats and compatibility
The loader identifies classic Winamp skins and Windows Media Player skins so the player can choose the matching presentation. Classic skins supply sprite sheets, layout data, pixel colors, and optional window shapes. Windows Media Player skins supply a view definition and themed image assets that the player can run in its compatible view.
Winamp skin behavior is described in Skin engine and Winamp compatibility. That page is the detailed guide for supported formats, fallback behavior, and the classic player contract.
References: src/…/mod.rs• L1-17 src/…/mod.rs• L104-115 src/winamp.rs• L49-80 src/winamp.rs• L523-598
Skin previews
The Settings gallery gives each skin a picture before the user opens it. Classic skins are composed into a representative player view. Windows Media Player skins are allowed to run their view for a short, bounded preview so scripts and animated layout choices can affect the picture.
Preview work stays away from the window's drawing thread. Pictures are cached and refreshed when a skin file changes, then decoded and uploaded only for cards that are on screen. A failed preview leaves the skin choice available by showing its name instead of blocking the gallery.
flowchart LR
A[Skin choice] --> B[Representative preview]
B --> C[Cached picture]
C --> D[Visible Settings card]
D --> E[User selects skin]
E --> F[Player loads active skin]
References: src/…/preview.rs• L1-9 src/…/preview.rs• L71-106 src/…/preview.rs• L316-345 src/skin_previews.rs• L1-10 src/skin_previews.rs• L248-317 src/…/skin_cards.rs• L102-175
Winamp visualizations
The classic player offers a spectrum analyser, an oscilloscope, or no local visualization. The analyser and scope read audio from the local playback path, so their motion follows the sound that Spotifast sends to the local output rather than a remote device.
The active skin supplies the visualization colors. The analyser turns recent audio into moving bars and peaks. The oscilloscope turns the recent waveform into a line. Both stop requesting animation when there is no visible motion, which keeps the player still when the visual result is settled.
The mini player also provides a MilkDrop panel framed by the active classic skin. The panel stays part of the player surface, so it moves and resizes with the player instead of becoming a separate attached window.
References: src/…/mod.rs• L972-1092 src/…/milkdrop.rs• L1-9 src/…/milkdrop.rs• L27-94 src/vis.rs• L52-65 src/vis.rs• L433-501
MilkDrop visualization
MilkDrop is the high-cost visualization path. Spotifast uses projectM to read .milk presets and render audio-reactive frames, but keeps that renderer outside the main app process so a shader or graphics problem does not freeze the player interface.
MilkDrop can run in two forms:
- A separate window gives the full MilkDrop experience with its own preset controls, song text, status overlays, resizing, and full-screen mode.
- A windowless child publishes frames into a shared frame buffer for the in-player panel or a Windows Media Player skin pane.
The app sends stereo audio to the child through a shared audio buffer. The child reports window actions and state back to the app. When a pane no longer shows the picture, the child stops after a short linger period. If it fails or stops producing frames, the pane returns to the skin's ordinary bars and retries later.
sequenceDiagram
participant P as Player audio path
participant A as Spotifast app
participant M as MilkDrop child
participant V as Player pane or window
P->>A: Audio samples
A->>M: Shared audio buffer
A->>M: Preset and display settings
M->>M: projectM renders preset
M->>V: New visualization frame
M-->>A: Window state and user commands
A->>M: Song text and updated settings
Preset files are found in the user configuration area and may be grouped in folders. The app can download optional preset packs into that area, but it does not bundle presets. Presets can play in random or folder order, can be kept on screen, and change with a crossfade unless the user requests a cut.
See Milkdrop visualization runtime for the child process, preset lifecycle, frame exchange, and failure handling in detail.
References: src/milkdrop.rs• L1-14 src/milkdrop.rs• L106-125 src/milkdrop.rs• L134-154 src/milkdrop.rs• L240-313 src/…/host.rs• L1-5 src/…/pane.rs• L1-9 src/…/pane.rs• L132-185 src/…/child.rs• L1-7 src/…/engine.rs• L68-115
Visualization timing
The visualization paths share audio timing but not the same frame policy. Local bars use a fixed motion step so their falloff stays consistent when the window draws faster or slower. MilkDrop uses a configurable frame rate, including the display's rate or an uncapped choice, while hidden or unused views stop asking for new frames.
This relationship keeps the visual response tied to playback while allowing each renderer to use the rate it can support. It also limits work when the user cannot see the result.
References: src/vis.rs• L19-44 src/theme.rs• L878-909 src/milkdrop.rs• L43-66 src/…/child.rs• L267-293 src/…/pane.rs• L213-245
Change checklist
When these files or sections are changed, remember to consider these:
- Keep the skin kind detected by winamp.rs aligned with the reader and the player view selected by
ui/winamp. - Keep preview rendering aligned with the assets and runtime behavior used by the live skin, or Settings can show a picture that does not match the player.
- Keep skin visualization color indexes aligned with the analyser and scope drawing paths.
- Keep MilkDrop child arguments, JSON events, shared audio input, and shared frame output compatible on both the full window and pane paths.
- Keep the visibility and frame-rate rules aligned so hidden visualizations do not keep a renderer or repaint loop active.
Important failure modes
| Trigger | Consequence | Guard |
|---|---|---|
| A skin archive has no usable classic assets or no valid media-player view | The skin cannot produce a live view or preview | Keep the built-in skin as the usable fallback and show a failed preview as a name-only card |
| A Windows Media Player skin script hides or closes its view | The preview has no meaningful picture | Treat the preview as unavailable instead of waiting for a visible result |
| MilkDrop has no presets | The pane stays with the skin's bars and does not count the case as a renderer failure | Recheck the preset folder later |
| projectM cannot start or stops producing frames | The MilkDrop picture disappears while the rest of the player continues | Isolate the child process, return None to the pane, and retry with backoff |
| A visualization is not visible or has settled | Unneeded repaint and renderer work can continue | Request frames only while a visible visualization needs them |
Key files
| File | Why to read it |
|---|---|
| src/theme.rs | Defines the shared palette model and applies app-wide visual styling. |
| src/appearance.rs | Connects the app's appearance choices to desktop color-scheme and animation preferences. |
| src/winamp.rs | Coordinates skin discovery, loading, selection, and preview state. |
| src/…/mod.rs | Defines the common skin model and the boundary between classic and Windows Media Player skins. |
| src/…/preview.rs | Shows how a skin becomes a representative preview picture. |
| src/skin_previews.rs | Coordinates cached preview work and visible gallery textures. |
| src/…/skin_cards.rs | Presents skin previews as a selectable Settings gallery. |
| src/…/mod.rs | Connects skins, local visualizations, and the classic player surface. |
| src/vis.rs | Supplies the audio view and Winamp-style analyser and scope behavior. |
| src/milkdrop.rs | Defines preset discovery, selection, timing, and the MilkDrop product-level contract. |
| src/…/host.rs | Describes the full MilkDrop window's process boundary and app communication. |
| src/…/pane.rs | Describes the windowless MilkDrop stream used inside player panes. |
| src/…/child.rs | Describes the isolated renderer's window, controls, overlays, and frame loop. |
| src/…/engine.rs | Describes the projectM rendering boundary and preset frame production. |