Adds VU meter to the audio player bar

Adds a segmented spectrum VU meter to the condensed player bar, fed by an analyser tapped after ReplayGain and before the volume, so the meter does not depend on the output volume.

Adds per-user VU meter settings (orientation, segment count and gap, thresholds, peak marker, hold and falloff rates) across the domain, persistence, API contracts, validation and the settings page, with a migration and localized resources.

Sizes the meter cells in whole pixels and keeps the frame clock steady on browsers that round timers.

Updates the theming guide, API documentation, request samples and the user manual.
This commit is contained in:
BinaryAlley committed 2026-10-21 20:30:51 +03:00
1 parent 9889c86c76
commit 2e9f7d8496
66 files changed
+7844 -81

No files matched your search

+3 -1
View File
@@ -73,7 +73,7 @@ Each artist is a card; selecting it opens the artist's page, and the card's acti
The artist page is also where you edit the artist. It lists the artist's albums as cards, each leading to its own album page, followed by the artist's general information, contributors, ratings, genres, tags, aliases, areas and identifiers. The album page holds the album's information and its tracks, and the track page holds the track's details. The album page also shows the artwork Lumina stored for the album as a strip of thumbnails beside the main image, and selecting a thumbnail displays that image in place of the cover. Deleting an artist, album or track removes it from Lumina's catalogue; your files are not touched.
The music pages also play what they show. The artist page has a **Play all** control that plays the artist's releases in the order the page presents them, one release after another. The actions menu of a music library card on the home page, of an artist card, and of an album card offers **Play** and **Shuffle**. Play starts the library at its first artist and continues through the remaining artists in artist page order, starts the artist's discography in the order the artist page presents it, or starts the release in disc and track order. Shuffle starts the library, the artist's discography or the release with a list of up to 100 tracks sampled uniformly at random from every track of that scope, and continues in random order without repeating a track that is already queued. The album page has a **Play album** control that plays the release in disc and track order, and every track row has its own play control that plays just that track. The track page has a **Play track** control for the track it shows. Every track row on the album page also has an actions menu: **Add to playlist** opens the playlist picker for that track, **Add to play queue** appends it to the end of the player queue or starts it when the queue is empty, and **Play all from here** replaces the queue with that track and the rest of the album and starts playing. Starting playback opens the player bar at the bottom of the window. It keeps playing while you move between pages, and the bar shows the track name, with the album name underneath when the track belongs to a named album, the progress of the current track and the volume, together with previous, play or pause, stop, next and repeat controls. When you expand it, it also shows the cover art, the current track name, the release type, the release name and year, the artist name, and a carousel of the album's stored artwork, next to the queue, where every entry carries its album cover, including when only one track is queued. Selecting an artwork in the carousel shows it as the main cover. The expanded queue moves the current track to the top whenever playback advances, so it stays visible even in a long list. The double chevron at the right points up to expand the bar and down to collapse it. Stop is the square control next to play or pause; in the condensed bar it stops playback and slides the bar out of view.
The music pages also play what they show. The artist page has a **Play all** control that plays the artist's releases in the order the page presents them, one release after another. The actions menu of a music library card on the home page, of an artist card, and of an album card offers **Play** and **Shuffle**. Play starts the library at its first artist and continues through the remaining artists in artist page order, starts the artist's discography in the order the artist page presents it, or starts the release in disc and track order. Shuffle starts the library, the artist's discography or the release with a list of up to 100 tracks sampled uniformly at random from every track of that scope, and continues in random order without repeating a track that is already queued. The album page has a **Play album** control that plays the release in disc and track order, and every track row has its own play control that plays just that track. The track page has a **Play track** control for the track it shows. Every track row on the album page also has an actions menu: **Add to playlist** opens the playlist picker for that track, **Add to play queue** appends it to the end of the player queue or starts it when the queue is empty, and **Play all from here** replaces the queue with that track and the rest of the album and starts playing. Starting playback opens the player bar at the bottom of the window. It keeps playing while you move between pages, and the bar shows the track name, with the album name underneath when the track belongs to a named album, the progress of the current track, a segmented VU meter that follows the level of the track, and the volume, together with previous, play or pause, stop, next and repeat controls. When you expand it, it also shows the cover art, the current track name, the release type, the release name and year, the artist name, and a carousel of the album's stored artwork, next to the queue, where every entry carries its album cover, including when only one track is queued. Selecting an artwork in the carousel shows it as the main cover. The expanded queue moves the current track to the top whenever playback advances, so it stays visible even in a long list. The double chevron at the right points up to expand the bar and down to collapse it. Stop is the square control next to play or pause; in the condensed bar it stops playback and slides the bar out of view.
## Playlists
@@ -106,4 +106,6 @@ The tools section holds your settings and the language picker.
Your **settings** decide how lists and books behave for you. Enable pagination and the number of items per page control how browsing is split. The alpha picker option decides whether titles beginning with "The" are filed under the next word. Theme caching decides whether the theme is fetched fresh each time. Rendering PDFs as images and preserving book styles shape how books are shown, and the metadata and artwork aggregation options decide whether missing fields are completed from your other providers. A final group of options shapes playback: whether the player keeps downloading while it is paused (for a track the server has to normalize, this keeps its bounded one-segment lookahead filled rather than downloading the whole file), whether it continues automatically at the end of an album or artist, whether consecutive tracks play without a gap, how ReplayGain normalizes loudness, and the quality cap used when the server has to normalize a track. That cap applies only when the server re-encodes a track into a lossy format; a remux only repackages the stored audio, and a lossless delivery is not reduced. The ones that touch libraries are described in more detail in [Managing Libraries](../managing-libraries/index.md).
The **VU meter** group shapes the meter of the player bar. Orientation lays its channels out as columns that grow upwards or rows that grow to the right. Segments per channel sets how finely each channel is divided, and Segment gap sets the space between segments and channels. The medium and high thresholds decide the level at which a segment changes color; the high threshold cannot be lower than the medium one. Show peak keeps a mark at the loudest recent level of each channel. Peak hold is how long that mark stays in place before it falls, in milliseconds, and Level falloff and Peak falloff are how quickly the bars and the peak marks drop once the sound gets quieter, in level units per second. Larger falloff values drop faster. The meter follows the level of the track itself, so muting the player or moving the volume slider does not change the height of the bars, and saving these settings applies them to the player without reloading the page.
The **language** picker switches the interface between the languages Lumina ships with, and remembers your choice.
@@ -47,7 +47,16 @@ Returns the settings of the currently authenticated user.
"shouldAutoplay": true,
"isGaplessPlaybackEnabled": true,
"replayGainMode": "Off",
"streamingQuality": "Auto"
"streamingQuality": "Auto",
"vuMeterOrientation": "Vertical",
"vuMeterSegmentCount": 12,
"vuMeterSegmentGap": 1,
"vuMeterMediumThreshold": 0.6,
"vuMeterHighThreshold": 0.8,
"vuMeterShowPeak": true,
"vuMeterPeakHoldDurationInMilliseconds": 650,
"vuMeterReleasePerSecond": 3,
"vuMeterPeakReleasePerSecond": 0.65
}
```
@@ -61,6 +70,8 @@ PUT api/v1/users/me/settings
Updates the settings of the currently authenticated user.
The VU meter settings configure the segmented meter of the player bar: `vuMeterOrientation` is `Vertical` or `Horizontal`, `vuMeterSegmentCount` is between 1 and 128, `vuMeterSegmentGap` is between 0 and 32 pixels, `vuMeterMediumThreshold` and `vuMeterHighThreshold` are between 0 and 1 and the high threshold must not be lower than the medium one, `vuMeterPeakHoldDurationInMilliseconds` is between 0 and 10000, and `vuMeterReleasePerSecond` and `vuMeterPeakReleasePerSecond` are between 0 and 100 level units per second. All of them are required.
```json
{
"isPaginationEnabled": true,
@@ -74,7 +85,16 @@ Updates the settings of the currently authenticated user.
"shouldAutoplay": true,
"isGaplessPlaybackEnabled": true,
"replayGainMode": "Off",
"streamingQuality": "Auto"
"streamingQuality": "Auto",
"vuMeterOrientation": "Vertical",
"vuMeterSegmentCount": 12,
"vuMeterSegmentGap": 1,
"vuMeterMediumThreshold": 0.6,
"vuMeterHighThreshold": 0.8,
"vuMeterShowPeak": true,
"vuMeterPeakHoldDurationInMilliseconds": 650,
"vuMeterReleasePerSecond": 3,
"vuMeterPeakReleasePerSecond": 0.65
}
```
@@ -14,5 +14,14 @@ Content-Type: application/json
"shouldAutoplay": true,
"isGaplessPlaybackEnabled": true,
"replayGainMode": "Off",
"streamingQuality": "Auto"
"streamingQuality": "Auto",
"vuMeterOrientation": "Vertical",
"vuMeterSegmentCount": 12,
"vuMeterSegmentGap": 1,
"vuMeterMediumThreshold": 0.6,
"vuMeterHighThreshold": 0.8,
"vuMeterShowPeak": true,
"vuMeterPeakHoldDurationInMilliseconds": 650,
"vuMeterReleasePerSecond": 3,
"vuMeterPeakReleasePerSecond": 0.65
}
+30
View File
@@ -14,6 +14,7 @@ The web client of Lumina is a themed shell: every page is rendered inside the te
- [Template Resolution](#template-resolution)
- [The Layout Template (shared/layout)](#the-layout-template-sharedlayout)
- [The Audio Player Bar](#the-audio-player-bar)
- [The VU Meter](#the-vu-meter)
- [Play Affordances on the Music Pages](#play-affordances-on-the-music-pages)
- [The audio player sub templates](#the-audio-player-sub-templates)
- [The Navigation Template (shared/nav-menu)](#the-navigation-template-sharednav-menu)
@@ -306,6 +307,7 @@ The markup inside the bar exposes the hook attributes the audio player script bi
| `data-audio-player-now-playing-artist` | The artist name of the current track's album in the expanded player. It is left empty until the album details are available. |
| `data-audio-player-artwork-carousel` | The carousel of the stored artwork of the current track's album. The player appends one `button.artwork-carousel-item` per stored image, carrying `data-artwork-path`, and toggles the `selected` class and `aria-pressed` on the chosen item. The element is hidden with the `hidden` attribute while the album has no stored artwork. |
| `data-audio-player-cover-thumbnail`, `data-audio-player-cover-image` | The cover art of the condensed bar and of the expanded bar. Choosing an album artwork in the carousel replaces both images until the next track. |
| `data-audio-player-vu-meter` | The root of the VU meter of the condensed bar, between the album art and the current time label. The player fills it with its channels, segments and peak markers, exactly as described in [The VU Meter](#the-vu-meter). A theme that does not render the hook gets the built-in meter inserted in that place. |
| `data-audio-player-volume` | The volume slider, a `role="slider"` element with `tabindex="0"` that the player scrubs and whose ARIA value attributes it writes. The fill is published as `--audio-player-volume-start` and `--audio-player-volume-width`. |
| `data-audio-player-volume-level` | The volume fill. It carries no geometry of its own: the stylesheet drives it from the custom properties above. |
| `data-audio-player-mute` | The mute toggle. The player toggles the `is-muted` class and the `aria-pressed` state on it. |
@@ -313,6 +315,34 @@ The markup inside the bar exposes the hook attributes the audio player script bi
Each progress layer also carries `data-audio-player-progress-layer` (`played`, `downloaded` or `undownloaded`) in the markup, so a theme can select a layer by its state as well as by its class. The player writes no inline geometry on any of the bar elements: it publishes the geometry of each state as the custom properties above, which the application stylesheet consumes, so a theme restyles or reorients either bar by consuming the same properties.
#### The VU Meter
The condensed bar shows a segmented VU meter that follows the level of the track itself. The renderer taps it after the track's ReplayGain normalization and before the output volume and mute stage, so lowering the volume or muting the player never changes the height of the meter for the same moment of audio. The meter is a spectrum meter with one channel per frequency band, with 24 logarithmically spaced bands between 40 Hz and 16 kHz, each drawn as a stack of segments. The number of segments, the gap between them, the two threshold zones, the peak marker and its hold and falloff times, and the orientation are per-user settings, so the meter reflects the values the user saved on the settings page.
The meter is built from elements rather than a canvas, exactly like the three state progress bar, so a theme restyles every part of it. The root carries the `audio-player-vu-meter` class and the `data-audio-player-vu-meter` hook, and the player fills it with:
| Element | Class and hook | State the player writes |
| --- | --- | --- |
| A channel, one per band | `audio-player-vu-channel`, `data-audio-player-vu-channel` (the zero based band index) | None. The channel is a layout container. |
| A segment, one per configured segment of a channel | `audio-player-vu-segment`, `data-audio-player-vu-segment` | `data-audio-player-vu-segment-state` (`active` or `inactive`) and `data-audio-player-vu-segment-zone` (`normal`, `medium` or `high`). The zone is derived from the position of the segment and the two thresholds of the settings. |
| A peak marker, one per channel | `audio-player-vu-peak`, `data-audio-player-vu-peak` | `data-audio-player-vu-peak-state` (`active` or `inactive`). The marker is removed with the `hidden` attribute while the show peak setting is off. |
The segments are rendered in ascending level order, so the first segment of a channel is the quietest one. The root also carries `data-audio-player-vu-meter-orientation` (`vertical` or `horizontal`), `data-audio-player-vu-meter-segments` (the configured segment count) and `data-audio-player-vu-meter-show-peak` (`true` or `false`), so a theme can select a state or a layout from the root as well.
The player publishes no geometry other than two custom properties, which a theme maps to whichever axis its own layout uses:
| Custom property | Published on | Meaning |
| --- | --- | --- |
| `--audio-player-vu-segment-gap` | The meter root | The configured gap between segments and between channels, as a CSS length in pixels. |
| `--audio-player-vu-segment-count` | The meter root | The configured number of segments per channel, as a plain number, so a stylesheet can size the meter from it. |
| `--audio-player-vu-peak-position` | Each peak marker | The held peak of its channel, as a percentage of the channel axis, from `0%` at the quiet end to `100%` at the loud end. |
The fallback stylesheet sizes the vertical meter from whole pixel square cells rather than stretching it over a box, because a box divided into rows gives fractional heights that browsers snap unevenly. The cell is the largest whole pixel size that fits the configured segments in `--audio-player-vu-extent` (48px by default), capped by `--audio-player-vu-max-cell` (4px), and a theme can override either property. With the default 12 segments and a 1px gap the cells are 3px squares.
The application fallback stylesheet gives the meter its own default look: 24 columns of segments whose active state uses one of three colors, with the inactive segments transparent, and a peak line that spans the short axis of the channel. A theme can replace all of it. The colors are custom properties declared on the bar container (`--audio-player-vu-normal-color`, `--audio-player-vu-medium-color`, `--audio-player-vu-high-color`, `--audio-player-vu-inactive-color`, `--audio-player-vu-peak-color` and `--audio-player-vu-background-color`), so a theme recolors the meter without touching the markup, and it can give each zone, each state and each orientation its own shape, image or animation.
The meter is decorative for assistive technology and carries `aria-hidden="true"`, because the same information is available through the now playing labels and the progress bar. It reads the analyzer that the player renderer taps after the track's ReplayGain normalization and before the output volume, so it needs no extra request and no extra decode, it is unaffected by the volume and mute controls, and it never affects playback. When the player is paused, stopped, ended or failed, the displayed levels fall to zero instead of freezing.
#### Play Affordances on the Music Pages
The artist page, the album page and the track page render play triggers, and the card actions menus render play and shuffle triggers, all handled by the global audio player script through event delegation. The music library cards on the home page, the artist cards and the album cards offer both actions, so the whole library, an artist or a release can be started in order or shuffled. A theme template that replaces one of those pages or menus opts in by rendering the same trigger attributes: the player binds one listener on the document, so a trigger works anywhere in the swapped page content and the page needs no script of its own.