feat(qbz): cap local playback requests at the detected output-device limit
Wires limit_quality_to_device to a real consumer on the LOCAL output path (#638 fix 3, spec Phase C). New crate::device_cap module caches the DAC's detected rate ceiling mapped to a Qobuz tier (spec C.3: >96k -> Hi-Res+ = no effective cap; 96/88.2k -> Hi-Res; <=48k -> CD 16/44.1, bit depth included since no 48 kHz tier exists). Detection is the proven read-only query_dac_capabilities probe; it runs in spawn_blocking on EXPLICIT triggers only (startup, the Settings toggle, output-device change, backend change, reset-to-defaults) — never on the playback hot path or poll tick. A stale cap after a hot-unplug until the next device change is the accepted trade, same class as the HiFi wizard. playback::local_playback_quality() returns (tier, QualityLimit): the preference clamped by the cap, with the request-time cause for the badge tooltip (tie reports LocalDeviceCap — the more specific constraint, mirroring the spec's cast tie rule). All LOCAL request sites switch to it: play_track_resolved, prefetch (fetch + throttle estimate), the gapless pre-fetch, and the now-playing badge seed (which can now name the device as the downgrade cause, msgid x8 locales). PRECEDENCE (owner decision): the device actually playing governs. playback_quality() stays the PURE preference and the cast path keeps calling it — cast_service is untouched and the play_audible cast branch returns before any local resolve, so the local DAC cap is structurally unreachable from a cast. The two settings stay independent; nothing is auto-synced. No downsampling anywhere: the cap only changes which tier is REQUESTED; cached/offline bytes still play as-is. Settings plumbing: SettingsState gains device-cap-summary/-detected (property additions to an existing global — no app.slint export change); build_snapshot fills them from the cache; refresh_device_cap re-probes and re-pushes on the explicit triggers. Protected-crate note: no protected file is touched — qbz-audio is only READ through the dac_capabilities probe; qbz-player, playback_engine.rs, alsa_direct.rs, alsa_backend.rs and the backends are untouched; no sample-rate handling changes. cc
This commit is contained in:
13 files changed
+330
-16
No files matched your search
@@ -4714,3 +4714,6 @@ msgstr "Kopiëren"
|
||||
|
||||
msgid "Copied!"
|
||||
msgstr "Gekopieerd!"
|
||||
|
||||
msgid "Limited by your output device's limit"
|
||||
msgstr "Beperkt door de limiet van je uitvoerapparaat"
|
||||
Reference in new issue
Block a user