diff --git a/crates/qbz-ui/translations/de/LC_MESSAGES/qbz-ui.po b/crates/qbz-ui/translations/de/LC_MESSAGES/qbz-ui.po index ff56a07cb..b9c0091ea 100644 --- a/crates/qbz-ui/translations/de/LC_MESSAGES/qbz-ui.po +++ b/crates/qbz-ui/translations/de/LC_MESSAGES/qbz-ui.po @@ -4705,3 +4705,12 @@ msgstr "Kopiert!" msgid "Limited by your output device's limit" msgstr "Begrenzt durch das Limit Ihres Ausgabegeräts" + +msgid "Cap the requested streaming quality at your output device's limit. Applies to local playback only, never to casting." +msgstr "Begrenzt die angeforderte Streaming-Qualität auf das Limit Ihres Ausgabegeräts. Gilt nur für die lokale Wiedergabe, nie für das Casten." + +msgid "Your device's exact limits could not be read on this system, so a common set is assumed. The cap still applies, but may not match your hardware exactly." +msgstr "Die genauen Limits Ihres Geräts konnten auf diesem System nicht ausgelesen werden, daher wird ein gängiger Satz angenommen. Die Begrenzung gilt trotzdem, entspricht aber möglicherweise nicht exakt Ihrer Hardware." + +msgid "Detected device limit" +msgstr "Erkanntes Gerätelimit" diff --git a/crates/qbz-ui/translations/en/LC_MESSAGES/qbz-ui.po b/crates/qbz-ui/translations/en/LC_MESSAGES/qbz-ui.po index 7d1a0b739..1ed197aa0 100644 --- a/crates/qbz-ui/translations/en/LC_MESSAGES/qbz-ui.po +++ b/crates/qbz-ui/translations/en/LC_MESSAGES/qbz-ui.po @@ -510,3 +510,12 @@ msgstr "cached copy — cap not applied" msgid "Limited by your output device's limit" msgstr "Limited by your output device's limit" + +msgid "Cap the requested streaming quality at your output device's limit. Applies to local playback only, never to casting." +msgstr "Cap the requested streaming quality at your output device's limit. Applies to local playback only, never to casting." + +msgid "Your device's exact limits could not be read on this system, so a common set is assumed. The cap still applies, but may not match your hardware exactly." +msgstr "Your device's exact limits could not be read on this system, so a common set is assumed. The cap still applies, but may not match your hardware exactly." + +msgid "Detected device limit" +msgstr "Detected device limit" diff --git a/crates/qbz-ui/translations/es/LC_MESSAGES/qbz-ui.po b/crates/qbz-ui/translations/es/LC_MESSAGES/qbz-ui.po index 9e56d9584..c8b8a262b 100644 --- a/crates/qbz-ui/translations/es/LC_MESSAGES/qbz-ui.po +++ b/crates/qbz-ui/translations/es/LC_MESSAGES/qbz-ui.po @@ -4735,3 +4735,12 @@ msgstr "¡Copiado!" msgid "Limited by your output device's limit" msgstr "Limitado por el límite de tu dispositivo de salida" + +msgid "Cap the requested streaming quality at your output device's limit. Applies to local playback only, never to casting." +msgstr "Limita la calidad de streaming solicitada al límite de tu dispositivo de salida. Aplica solo a la reproducción local, nunca a la transmisión." + +msgid "Your device's exact limits could not be read on this system, so a common set is assumed. The cap still applies, but may not match your hardware exactly." +msgstr "No se pudieron leer los límites exactos de tu dispositivo en este sistema, así que se asume un conjunto común. El límite aplica de todos modos, pero puede no coincidir exactamente con tu hardware." + +msgid "Detected device limit" +msgstr "Límite detectado del dispositivo" diff --git a/crates/qbz-ui/translations/fr/LC_MESSAGES/qbz-ui.po b/crates/qbz-ui/translations/fr/LC_MESSAGES/qbz-ui.po index 86daafccd..4c65b8464 100644 --- a/crates/qbz-ui/translations/fr/LC_MESSAGES/qbz-ui.po +++ b/crates/qbz-ui/translations/fr/LC_MESSAGES/qbz-ui.po @@ -4705,3 +4705,12 @@ msgstr "Copié !" msgid "Limited by your output device's limit" msgstr "Limité par le plafond de votre périphérique de sortie" + +msgid "Cap the requested streaming quality at your output device's limit. Applies to local playback only, never to casting." +msgstr "Limite la qualité de streaming demandée au plafond de votre périphérique de sortie. S'applique uniquement à la lecture locale, jamais à la diffusion." + +msgid "Your device's exact limits could not be read on this system, so a common set is assumed. The cap still applies, but may not match your hardware exactly." +msgstr "Les limites exactes de votre périphérique n'ont pas pu être lues sur ce système, un ensemble courant est donc supposé. Le plafond s'applique quand même, mais peut ne pas correspondre exactement à votre matériel." + +msgid "Detected device limit" +msgstr "Limite détectée du périphérique" diff --git a/crates/qbz-ui/translations/ja/LC_MESSAGES/qbz-ui.po b/crates/qbz-ui/translations/ja/LC_MESSAGES/qbz-ui.po index 0ae147c56..20bea68ce 100644 --- a/crates/qbz-ui/translations/ja/LC_MESSAGES/qbz-ui.po +++ b/crates/qbz-ui/translations/ja/LC_MESSAGES/qbz-ui.po @@ -4693,3 +4693,12 @@ msgstr "コピーしました!" msgid "Limited by your output device's limit" msgstr "出力デバイスの上限により制限されています" + +msgid "Cap the requested streaming quality at your output device's limit. Applies to local playback only, never to casting." +msgstr "リクエストするストリーミング音質を出力デバイスの上限に制限します。ローカル再生のみに適用され、キャストには適用されません。" + +msgid "Your device's exact limits could not be read on this system, so a common set is assumed. The cap still applies, but may not match your hardware exactly." +msgstr "このシステムではデバイスの正確な上限を読み取れなかったため、一般的なセットを想定しています。制限は引き続き適用されますが、実際のハードウェアと完全には一致しない場合があります。" + +msgid "Detected device limit" +msgstr "検出されたデバイスの上限" diff --git a/crates/qbz-ui/translations/nl/LC_MESSAGES/qbz-ui.po b/crates/qbz-ui/translations/nl/LC_MESSAGES/qbz-ui.po index 22502f1c7..d9593b5b7 100644 --- a/crates/qbz-ui/translations/nl/LC_MESSAGES/qbz-ui.po +++ b/crates/qbz-ui/translations/nl/LC_MESSAGES/qbz-ui.po @@ -4717,3 +4717,12 @@ msgstr "Gekopieerd!" msgid "Limited by your output device's limit" msgstr "Beperkt door de limiet van je uitvoerapparaat" + +msgid "Cap the requested streaming quality at your output device's limit. Applies to local playback only, never to casting." +msgstr "Begrens de aangevraagde streamingkwaliteit op de limiet van je uitvoerapparaat. Geldt alleen voor lokale weergave, nooit voor casten." + +msgid "Your device's exact limits could not be read on this system, so a common set is assumed. The cap still applies, but may not match your hardware exactly." +msgstr "De exacte limieten van je apparaat konden op dit systeem niet worden uitgelezen, dus wordt een gangbare set aangenomen. De limiet geldt nog steeds, maar komt mogelijk niet exact overeen met je hardware." + +msgid "Detected device limit" +msgstr "Gedetecteerde apparaatlimiet" diff --git a/crates/qbz-ui/translations/pt/LC_MESSAGES/qbz-ui.po b/crates/qbz-ui/translations/pt/LC_MESSAGES/qbz-ui.po index 33da13af7..119770d98 100644 --- a/crates/qbz-ui/translations/pt/LC_MESSAGES/qbz-ui.po +++ b/crates/qbz-ui/translations/pt/LC_MESSAGES/qbz-ui.po @@ -4705,3 +4705,12 @@ msgstr "Copiado!" msgid "Limited by your output device's limit" msgstr "Limitado pelo limite do seu dispositivo de saída" + +msgid "Cap the requested streaming quality at your output device's limit. Applies to local playback only, never to casting." +msgstr "Limita a qualidade de streaming solicitada ao limite do seu dispositivo de saída. Aplica-se apenas à reprodução local, nunca à transmissão." + +msgid "Your device's exact limits could not be read on this system, so a common set is assumed. The cap still applies, but may not match your hardware exactly." +msgstr "Não foi possível ler os limites exatos do seu dispositivo neste sistema, por isso assume-se um conjunto comum. O limite aplica-se na mesma, mas pode não corresponder exatamente ao seu hardware." + +msgid "Detected device limit" +msgstr "Limite detetado do dispositivo" diff --git a/crates/qbz-ui/translations/ru/LC_MESSAGES/qbz-ui.po b/crates/qbz-ui/translations/ru/LC_MESSAGES/qbz-ui.po index 5c3d4f19c..2255f3a53 100644 --- a/crates/qbz-ui/translations/ru/LC_MESSAGES/qbz-ui.po +++ b/crates/qbz-ui/translations/ru/LC_MESSAGES/qbz-ui.po @@ -4719,3 +4719,12 @@ msgstr "Скопировано!" msgid "Limited by your output device's limit" msgstr "Ограничено пределом вашего устройства вывода" + +msgid "Cap the requested streaming quality at your output device's limit. Applies to local playback only, never to casting." +msgstr "Ограничивает запрашиваемое качество стриминга пределом вашего устройства вывода. Применяется только к локальному воспроизведению, никогда — к трансляции." + +msgid "Your device's exact limits could not be read on this system, so a common set is assumed. The cap still applies, but may not match your hardware exactly." +msgstr "Не удалось прочитать точные пределы вашего устройства в этой системе, поэтому используется типовой набор. Ограничение всё равно применяется, но может не совпадать точно с вашим оборудованием." + +msgid "Detected device limit" +msgstr "Обнаруженный предел устройства" diff --git a/crates/qbz-ui/ui/settings/AudioSettings.slint b/crates/qbz-ui/ui/settings/AudioSettings.slint index 697c2bb8a..adeffe2bf 100644 --- a/crates/qbz-ui/ui/settings/AudioSettings.slint +++ b/crates/qbz-ui/ui/settings/AudioSettings.slint @@ -54,7 +54,7 @@ export component AudioSettings inherits VerticalLayout { } SettingRow { label: @tr("Limit quality to device"); - description: @tr("Cap streaming quality at the output device's maximum sample rate."); + description: @tr("Cap the requested streaming quality at your output device's limit. Applies to local playback only, never to casting."); QbzToggle { checked: SettingsState.limit-quality-to-device; toggled(v) => { @@ -63,19 +63,30 @@ export component AudioSettings inherits VerticalLayout { } } } - if SettingsState.limit-quality-to-device: SettingRow { - label: @tr("Maximum sample rate"); - description: @tr("The highest sample rate streamed tracks may use."); - QbzSelect { - menu-width: 170px; - options: SettingsState.sample-rates; - current-index: SettingsState.sample-rate-index; - selected(i) => { - SettingsState.sample-rate-index = i; - root.settings-select("sample-rate", i); - } + // Read-only detected line — deliberately NOT a control (#638 fix 3): a Hz + // dropdown was the documented root-cause trap (it promised rates the app + // cannot request; Qobuz sells four tiers), and with real detection there + // is nothing left to pick. The value is Rust-composed from the probe + // ("192 kHz · Hi-Res+"); empty while nothing is cached yet. + if SettingsState.limit-quality-to-device && SettingsState.device-cap-summary != "": SettingRow { + label: @tr("Detected device limit"); + Text { + text: SettingsState.device-cap-summary; + color: Theme.text-primary; + font-size: Typography.body; + font-weight: Typography.medium; + vertical-alignment: center; } } + // Fallback disclosure (#638 Decision B): plain informative copy — no + // warning icon, no error styling. The cap still applies on the assumed + // common set; it just is not measured truth for this hardware. + if SettingsState.limit-quality-to-device && SettingsState.device-cap-summary != "" && !SettingsState.device-cap-detected: Text { + text: @tr("Your device's exact limits could not be read on this system, so a common set is assumed. The cap still applies, but may not match your hardware exactly."); + color: Theme.text-muted; + font-size: 12px; + wrap: word-wrap; + } Rectangle { height: 12px; } Divider { } diff --git a/crates/qbz-ui/ui/state.slint b/crates/qbz-ui/ui/state.slint index 524712061..bacca03af 100644 --- a/crates/qbz-ui/ui/state.slint +++ b/crates/qbz-ui/ui/state.slint @@ -2976,8 +2976,6 @@ export global SettingsState { // Rust controller owns the index -> value mapping. in-out property <[string]> streaming-qualities: []; in-out property streaming-quality-index: 0; - in-out property <[string]> sample-rates: []; - in-out property sample-rate-index: 0; in-out property <[string]> backends: []; in-out property backend-index: 0; in-out property <[string]> devices: []; diff --git a/crates/qbz/src/settings.rs b/crates/qbz/src/settings.rs index 6c4a52f76..f4e29ddf7 100644 --- a/crates/qbz/src/settings.rs +++ b/crates/qbz/src/settings.rs @@ -6,10 +6,10 @@ //! Slint global. //! //! Audio changes are persisted and then applied to the live `Player`: -//! routing-critical changes (backend, output device, max sample rate, -//! exclusive mode, DAC passthrough, ALSA plugin) trigger a device -//! re-init; the rest only reload the settings struct. Playback-preference -//! changes (autoplay, show-context, persist, resume) just persist. +//! routing-critical changes (backend, output device, exclusive mode, +//! DAC passthrough, ALSA plugin) trigger a device re-init; the rest only +//! reload the settings struct. Playback-preference changes (autoplay, +//! show-context, persist, resume) just persist. //! //! Neither domain store is exposed by `AppRuntime`, so this module opens //! them directly at the shared global path — the same path @@ -32,25 +32,11 @@ use crate::adapter::SlintAdapter; use crate::ui_prefs::{self, STREAMING_QUALITIES}; use crate::{AppWindow, NowPlayingState, SettingsExportState, SettingsState}; -/// Maximum-sample-rate dropdown options. Index 0 is "No limit" (`None`). -/// Backs `device_max_sample_rate`. -// Labels in these tables are `mark`ed so the extractor registers the English -// literals; they are translated once with `t(l)` where the snapshot is built. -const MAX_SAMPLE_RATES: &[(&str, Option)] = &[ - (qbz_i18n::mark("No limit"), None), - (qbz_i18n::mark("44.1 kHz"), Some(44_100)), - (qbz_i18n::mark("48 kHz"), Some(48_000)), - (qbz_i18n::mark("88.2 kHz"), Some(88_200)), - (qbz_i18n::mark("96 kHz"), Some(96_000)), - (qbz_i18n::mark("176.4 kHz"), Some(176_400)), - (qbz_i18n::mark("192 kHz"), Some(192_000)), - (qbz_i18n::mark("352.8 kHz"), Some(352_800)), - (qbz_i18n::mark("384 kHz"), Some(384_000)), -]; - /// ALSA-plugin dropdown options. /// DSD delivery modes (DSD plan Phases 2-3). Value strings are the /// AudioSettings.dsd_mode contract ("convert" | "dop" | "native"). +// Labels in these tables are `mark`ed so the extractor registers the English +// literals; they are translated once with `t(l)` where the snapshot is built. const DSD_MODES: &[(&str, &str)] = &[ (qbz_i18n::mark("Convert to PCM (works everywhere)"), "convert"), (qbz_i18n::mark("DoP — DSD over PCM (bit-perfect)"), "dop"), @@ -147,8 +133,6 @@ pub struct SettingsSnapshot { // Audio — dropdowns. streaming_qualities: Vec, streaming_quality_index: i32, - sample_rates: Vec, - sample_rate_index: i32, backends: Vec, backend_index: i32, devices: Vec, @@ -502,10 +486,6 @@ fn build_snapshot( Some(id) => device_list.ids.iter().position(|d| d == id).unwrap_or(0), }; - let sample_rate_index = MAX_SAMPLE_RATES - .iter() - .position(|(_, r)| *r == audio.device_max_sample_rate) - .unwrap_or(0); let alsa_plugin = audio.alsa_plugin.unwrap_or(AlsaPlugin::Hw); let alsa_plugin_index = ALSA_PLUGINS .iter() @@ -554,8 +534,6 @@ fn build_snapshot( .map(|q| q.label.to_string()) .collect(), streaming_quality_index: ui_prefs::streaming_quality_index(streaming_quality_key) as i32, - sample_rates: MAX_SAMPLE_RATES.iter().map(|(l, _)| qbz_i18n::t(l)).collect(), - sample_rate_index: sample_rate_index as i32, // Index 0 is "Auto" (a resolve-and-set action, #470); the concrete // backends follow. backend_type is always persisted concrete, so the // current selection is its position shifted by 1 past the Auto entry — @@ -644,8 +622,6 @@ pub fn apply_snapshot(window: &AppWindow, snap: SettingsSnapshot) { // Audio — dropdowns. st.set_streaming_qualities(string_model(snap.streaming_qualities)); st.set_streaming_quality_index(snap.streaming_quality_index); - st.set_sample_rates(string_model(snap.sample_rates)); - st.set_sample_rate_index(snap.sample_rate_index); st.set_backends(string_model(snap.backends)); st.set_backend_index(snap.backend_index); st.set_devices(string_model(snap.devices)); @@ -1197,14 +1173,6 @@ pub async fn handle_select( runtime.core().player().clear_audio_cache(); } } - "sample-rate" => { - let rate = MAX_SAMPLE_RATES.get(index).map(|(_, r)| *r).unwrap_or(None); - if let Err(e) = with_audio(&ctx.audio, |s| s.set_device_max_sample_rate(rate)) { - log::error!("[qbz-slint] persist max sample rate failed: {e}"); - return; - } - apply_audio(&ctx, &runtime, Apply::Reinit); - } "backend" => { // Dropdown index 0 is "Auto" — a resolve-and-set action (#470), not a // persisted mode. Pick the best available backend (PipeWire if present, @@ -1519,13 +1487,6 @@ pub fn export_settings(weak: slint::Weak, handle: tokio::runtime::Han mod tests { use super::*; - #[test] - fn max_sample_rate_table_starts_with_no_limit() { - assert_eq!(MAX_SAMPLE_RATES[0].1, None); - assert_eq!(MAX_SAMPLE_RATES.last().unwrap().1, Some(384_000)); - assert_eq!(MAX_SAMPLE_RATES.len(), 9); - } - #[test] fn alsa_plugin_table_first_is_hw() { assert_eq!(ALSA_PLUGINS[0].1, AlsaPlugin::Hw);