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

@@ -33,6 +33,15 @@ public class UpdateUserSettingsRequestFixture
/// <param name="isGaplessPlaybackEnabled">Whether the player transitions between consecutive tracks without a gap.</param>
/// <param name="replayGainMode">The way ReplayGain normalization is applied to the tracks the user plays.</param>
/// <param name="streamingQuality">The quality cap applied to the audio the server normalizes for the user.</param>
/// <param name="vuMeterOrientation">The direction in which each channel of the VU meter of the audio player grows.</param>
/// <param name="vuMeterSegmentCount">The number of segments each channel of the VU meter is divided into.</param>
/// <param name="vuMeterSegmentGap">The gap, in pixels, between the segments and the channels of the VU meter.</param>
/// <param name="vuMeterMediumThreshold">The level above which a segment of the VU meter is drawn with its medium state.</param>
/// <param name="vuMeterHighThreshold">The level above which a segment of the VU meter is drawn with its high state.</param>
/// <param name="vuMeterShowPeak">Whether the VU meter holds the peak level of each channel after it falls.</param>
/// <param name="vuMeterPeakHoldDurationInMilliseconds">The time a peak of the VU meter is held before it starts falling.</param>
/// <param name="vuMeterReleasePerSecond">The number of level units the display of the VU meter falls per second when the input level drops.</param>
/// <param name="vuMeterPeakReleasePerSecond">The number of level units the peak of the VU meter falls per second after its hold time elapsed.</param>
/// <returns>The created <see cref="UpdateUserSettingsRequest"/>.</returns>
public UpdateUserSettingsRequest Create(
bool? isPaginationEnabled = null,
@@ -47,8 +56,20 @@ public class UpdateUserSettingsRequestFixture
bool? shouldAutoplay = null,
bool? isGaplessPlaybackEnabled = null,
ReplayGainMode? replayGainMode = null,
PlaybackStreamingQuality? streamingQuality = null)
PlaybackStreamingQuality? streamingQuality = null,
VuMeterOrientation? vuMeterOrientation = null,
int? vuMeterSegmentCount = null,
int? vuMeterSegmentGap = null,
double? vuMeterMediumThreshold = null,
double? vuMeterHighThreshold = null,
bool? vuMeterShowPeak = null,
int? vuMeterPeakHoldDurationInMilliseconds = null,
double? vuMeterReleasePerSecond = null,
double? vuMeterPeakReleasePerSecond = null)
{
// The high threshold is generated from the medium one, so a randomized request always describes a valid meter.
double mediumThreshold = vuMeterMediumThreshold ?? _faker.Random.Double(0, 1);
double highThreshold = vuMeterHighThreshold ?? _faker.Random.Double(mediumThreshold, 1);
return new UpdateUserSettingsRequest(
isPaginationEnabled ?? _faker.Random.Bool(),
itemsPerPage ?? _faker.Random.Int(1, 100),
@@ -62,7 +83,16 @@ public class UpdateUserSettingsRequestFixture
shouldAutoplay ?? _faker.Random.Bool(),
isGaplessPlaybackEnabled ?? _faker.Random.Bool(),
replayGainMode ?? _faker.PickRandom<ReplayGainMode>(),
streamingQuality ?? _faker.PickRandom<PlaybackStreamingQuality>());
streamingQuality ?? _faker.PickRandom<PlaybackStreamingQuality>(),
vuMeterOrientation ?? _faker.PickRandom<VuMeterOrientation>(),
vuMeterSegmentCount ?? _faker.Random.Int(1, 128),
vuMeterSegmentGap ?? _faker.Random.Int(0, 32),
mediumThreshold,
highThreshold,
vuMeterShowPeak ?? _faker.Random.Bool(),
vuMeterPeakHoldDurationInMilliseconds ?? _faker.Random.Int(0, 10000),
vuMeterReleasePerSecond ?? _faker.Random.Double(0, 100),
vuMeterPeakReleasePerSecond ?? _faker.Random.Double(0, 100));
}
/// <summary>
@@ -35,6 +35,15 @@ public class UserSettingsResponseFixture
/// <param name="isGaplessPlaybackEnabled">Optional. Whether the player transitions between consecutive tracks without a gap.</param>
/// <param name="replayGainMode">Optional. The way ReplayGain normalization is applied to the tracks the user plays.</param>
/// <param name="streamingQuality">Optional. The quality cap applied to the audio the server normalizes for the user.</param>
/// <param name="vuMeterOrientation">Optional. The direction in which each channel of the VU meter of the audio player grows.</param>
/// <param name="vuMeterSegmentCount">Optional. The number of segments each channel of the VU meter is divided into.</param>
/// <param name="vuMeterSegmentGap">Optional. The gap, in pixels, between the segments and the channels of the VU meter.</param>
/// <param name="vuMeterMediumThreshold">Optional. The level above which a segment of the VU meter is drawn with its medium state.</param>
/// <param name="vuMeterHighThreshold">Optional. The level above which a segment of the VU meter is drawn with its high state.</param>
/// <param name="vuMeterShowPeak">Optional. Whether the VU meter holds the peak level of each channel after it falls.</param>
/// <param name="vuMeterPeakHoldDurationInMilliseconds">Optional. The time a peak of the VU meter is held before it starts falling.</param>
/// <param name="vuMeterReleasePerSecond">Optional. The number of level units the display of the VU meter falls per second when the input level drops.</param>
/// <param name="vuMeterPeakReleasePerSecond">Optional. The number of level units the peak of the VU meter falls per second after its hold time elapsed.</param>
/// <returns>The created <see cref="UserSettingsResponse"/>.</returns>
public UserSettingsResponse Create(
Guid? userId = null,
@@ -50,8 +59,20 @@ public class UserSettingsResponseFixture
bool? shouldAutoplay = null,
bool? isGaplessPlaybackEnabled = null,
ReplayGainMode? replayGainMode = null,
PlaybackStreamingQuality? streamingQuality = null)
PlaybackStreamingQuality? streamingQuality = null,
VuMeterOrientation? vuMeterOrientation = null,
int? vuMeterSegmentCount = null,
int? vuMeterSegmentGap = null,
double? vuMeterMediumThreshold = null,
double? vuMeterHighThreshold = null,
bool? vuMeterShowPeak = null,
int? vuMeterPeakHoldDurationInMilliseconds = null,
double? vuMeterReleasePerSecond = null,
double? vuMeterPeakReleasePerSecond = null)
{
// The high threshold is generated from the medium one, so a randomized response always describes a valid meter.
double mediumThreshold = vuMeterMediumThreshold ?? _faker.Random.Double(0, 1);
double highThreshold = vuMeterHighThreshold ?? _faker.Random.Double(mediumThreshold, 1);
return new UserSettingsResponse(
userId ?? Guid.NewGuid(),
isPaginationEnabled ?? _faker.Random.Bool(),
@@ -66,7 +87,16 @@ public class UserSettingsResponseFixture
shouldAutoplay ?? _faker.Random.Bool(),
isGaplessPlaybackEnabled ?? _faker.Random.Bool(),
replayGainMode ?? _faker.PickRandom<ReplayGainMode>(),
streamingQuality ?? _faker.PickRandom<PlaybackStreamingQuality>());
streamingQuality ?? _faker.PickRandom<PlaybackStreamingQuality>(),
vuMeterOrientation ?? _faker.PickRandom<VuMeterOrientation>(),
vuMeterSegmentCount ?? _faker.Random.Int(1, 128),
vuMeterSegmentGap ?? _faker.Random.Int(0, 32),
mediumThreshold,
highThreshold,
vuMeterShowPeak ?? _faker.Random.Bool(),
vuMeterPeakHoldDurationInMilliseconds ?? _faker.Random.Int(0, 10000),
vuMeterReleasePerSecond ?? _faker.Random.Double(0, 100),
vuMeterPeakReleasePerSecond ?? _faker.Random.Double(0, 100));
}
/// <summary>