feat(slint): ImmersiveView base - reusable atmosphere + compact player + audio-transport lift

Foundation for the ImmersiveView Slint port. Authored by Codex and accepted by
the owner after live visual iteration; committed here so the panel work builds
on top of it. The Album Reactive foreground was intentionally left out (a prior
attempt was rejected) so it can be rebuilt cleanly on this base.

Audio-transport lift (slice 1):
- qbz-audio: VizFrame/VizSink trait + spawn_visualizer_thread; FFT producer
  lifted off tauri::AppHandle. Protected audio path untouched (seam =
  RingBuffer.snapshot).
- src-tauri: fft_processor gutted to a thin TauriVizSink emitting byte-identical
  viz:* events.
- qbz-app: AppRuntime::with_visualizer + visualizer_tap accessor.
- qbz-slint: SlintVizSink + install() publishing VisualizerState
  bars/spectral/energy/waveform/transient at 30fps, zero IPC.

Immersive base (slice 2a):
- immersive.rs: host-side atmosphere generation from decoded artwork
  (8x8 sample -> upscale -> blur -> saturate/contrast/normalize -> vignette),
  mirroring Tauri texture-loader.ts::generateAtmosphere; plus glow_color.
- ImmersiveAtmosphere.slint: reusable animated atmosphere (4 counter-drifting
  copies via animation-tick); usable static for Album/Artist headers later.
- ImmersiveView.slint: base overlay (atmosphere + auto-hide Tauri-shaped compact
  player only). Foreground panels are rebuilt on this base.
- AppShell mounts the overlay; ViewMode menu opens Immersive in PlayerBar/Small.

cc
This commit is contained in:
vicrodh committed 2026-06-13 04:11:53 -06:00
1 parent 4e8703d660
commit 3adb517236
18 files changed
+1275 -341

No files matched your search

+15 -1
View File
@@ -31,6 +31,7 @@ mod favorites_prefs;
mod foryou;
mod genre_filter;
mod home;
mod immersive;
mod info_modals;
mod label;
mod location_view;
@@ -72,6 +73,7 @@ mod tag_editor;
mod offline;
mod offline_cache;
mod offline_favorites;
mod visualizer;
mod offline_manager;
mod offline_mode;
mod playlist;
@@ -3966,7 +3968,13 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
.global::<AppearanceState>()
.set_is_macos(cfg!(target_os = "macos"));
let app_runtime = Arc::new(AppRuntime::new(SlintAdapter::new(window.as_weak())));
let app_runtime = Arc::new(AppRuntime::with_visualizer(SlintAdapter::new(window.as_weak())));
// ImmersiveView audio visualizers: spawn the frontend-agnostic FFT producer
// against the runtime's tap and start the 30fps drain into VisualizerState.
// Inert (tap disabled, no capture / no FFT cost) until the immersive view
// opens. Must run on the UI thread before window.run().
visualizer::install(&window, &app_runtime);
// MusicBrainz cache — opens a SQLite store at
// <data-dir>/qbz/cache/musicbrainz_cache.db so artist metadata
@@ -4921,6 +4929,12 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
// Persisted to ui_prefs so the choice survives restarts.
// Large/window modes are disabled in the menu until those
// layouts land.
("npb-view", "immersive") => {
if let Some(w) = weak.upgrade() {
w.global::<ImmersiveState>().set_open(true);
w.global::<VisualizerState>().invoke_set_enabled(true);
}
}
("npb-view", mode @ ("new" | "classic" | "small")) => {
if let Some(w) = weak.upgrade() {
w.global::<ShellState>()