Files
deepdrft/DeepDrftPublic.Client/Controls/NowPlayingCard.razor
T
daniel-c-harvey 05486a61af feat(now-playing): mount real waveform visualizer in NowPlaying card (mode C) + Fill container-sizing mode
Replace the 20 synthetic bars with a contained WaveformVisualizer driven by the live player, pointed at the current track; add a Fill mode (CSS-only, defaults off) sizing the canvas to its container; place the lava-lamp icon to popover on the card.
2026-06-17 12:15:49 -04:00

32 lines
1.7 KiB
Plaintext

@using DeepDrftPublic.Client.Services
<div class="now-playing">
<div class="np-label"><span class="np-dot"></span>Now Playing</div>
<div class="np-title">@(Player?.CurrentTrack?.TrackName ?? "Nothing playing")</div>
<div class="np-sub">
@(Player?.CurrentTrack != null
? $"{Player.CurrentTrack.Release?.Artist} · {Player.CurrentTrack.Release?.Title ?? "Single"}"
: "Select a track to begin")
</div>
@* Mode C (§3f, §6c): the real waveform visualizer, contained to this card and driven by the live
cascaded player. Fill="true" sizes the canvas to this positioned box instead of the viewport.
The bridge follows whatever is playing — keyed on the current track via ReleaseEntryKey/TrackId/
TrackEntryKey — so it scrolls to the real signal and sits at-rest when nothing plays. Read-only:
the card visualizes, it never seeks. The lava-lamp popover sits in the corner (full parity, §8e). *@
<div class="np-visualizer">
<WaveformVisualizer Fill="true"
ReleaseEntryKey="@(Player?.CurrentTrack?.Release?.EntryKey ?? string.Empty)"
TrackId="@Player?.CurrentTrack?.Id"
TrackEntryKey="@Player?.CurrentTrack?.EntryKey" />
<div class="np-visualizer-controls">
<WaveformVisualizerControlPopover IconSize="Size.Small"
AnchorOrigin="Origin.BottomRight"
TransformOrigin="Origin.TopLeft" />
</div>
</div>
</div>
@code {
[CascadingParameter] public IStreamingPlayerService? Player { get; set; }
}