fix(qt): restore the Exclusive mode row on macOS (#748)
System default on macOS is the CoreAudio exclusive backend: with
`exclusive_mode` set, qbz-audio takes Hog Mode, pins the device and switches
its nominal rate to the track (PR #391, shipped in 1.2.11 and never removed).
The Tauri settings gated the toggle on `ALSA || (macos && SystemDefault)`;
the Slint port copied only the ALSA half, and fc0d35e29 then hid the row on
macOS on the premise that no backend there could honour it. So 2.0.x showed
a grey row and 2.1.0 none, while the DB flag still engaged Hog Mode.
- SettingsDoc publishes `backendIsCoreAudio` (macOS && System default); the
row is visible and enabled on it. Linux and Windows are unchanged.
- The backend-switch cascade goes through one predicate
(`output_labels::backend_honours_exclusive`), so re-selecting Auto or
System default on macOS no longer clears the flag.
- The output LED reads EXCL on macOS System default + exclusive_mode instead
of DEFAULT while the device is hogged.
- Node test `scripts/test_qt_exclusive_gate.mjs` evaluates the row's real
gate expressions across platforms; added to qt-runtime-gate.sh. Rust tests
cover the predicate, the LED and the serde name QML reads.
Verified by smoke on the Mac mini with a USB DAC: the row appears, Hog Mode
is acquired, and browser audio moves to the built-in speakers while QBZ
plays. qbz-qt suite 782/782 on Linux; 13/13 with cfg(macos) on the Mac.
cc
This commit is contained in:
5 files changed
+265
-10
No files matched your search
@@ -272,10 +272,20 @@ Column {
|
||||
// =========================== BIT-PERFECT =============================
|
||||
GroupHeader { kioskHost: root.kioskHost; text: QbzSession.tr("BIT-PERFECT", QbzSession.trRev) }
|
||||
SettingRow { kioskHost: root.kioskHost;
|
||||
// Hidden where no backend can honour it: on Windows until WASAPI
|
||||
// exclusive lands (Phase B publishes backendIsWasapi), and on macOS,
|
||||
// whose only backend is System default. Linux is unchanged - visible
|
||||
// always, enabled only on ALSA.
|
||||
// Visible wherever a backend can honour it, enabled only on that
|
||||
// backend. Per platform:
|
||||
//
|
||||
// LINUX: unchanged since 2026-08-27 - always visible, enabled on ALSA.
|
||||
//
|
||||
// MACOS: System default IS the CoreAudio exclusive backend. With
|
||||
// `exclusive_mode` set, qbz-audio backend.rs
|
||||
// `create_output_stream_with_exclusive_guard` pins the device, takes
|
||||
// Hog Mode and switches its nominal rate to the track (PR #391,
|
||||
// shipped in 1.2.11 and never removed). fc0d35e29 hid this row on
|
||||
// macOS on the wrong premise that no backend there could honour it;
|
||||
// #748 restored it. `backendIsCoreAudio` is published by
|
||||
// settings_qt.rs only on macOS, so the `=== true` idiom keeps every
|
||||
// other platform exactly where it was.
|
||||
//
|
||||
// WINDOWS: hidden on purpose, even now that Phase B publishes
|
||||
// `backendIsWasapi`. The exclusive path is chosen by the BACKEND
|
||||
@@ -286,13 +296,13 @@ Column {
|
||||
// control at all when the thing being judged IS bit-perfect. Whether
|
||||
// Windows should instead mirror the Linux split (backend = transport,
|
||||
// toggle = hw/plughw) is an open design question for the owner.
|
||||
visible: QbzShell.isLinux
|
||||
visible: QbzShell.isLinux || root.doc.backendIsCoreAudio === true
|
||||
label: QbzSession.tr("Exclusive mode", QbzSession.trRev)
|
||||
description: QbzSession.tr("Lock the device so no other app can resample it.", QbzSession.trRev)
|
||||
rowEnabled: root.doc.backendIsAlsa === true || root.doc.backendIsWasapi === true
|
||||
rowEnabled: root.doc.backendIsAlsa === true || root.doc.backendIsWasapi === true || root.doc.backendIsCoreAudio === true
|
||||
QbzToggle { kioskHost: root.kioskHost;
|
||||
checked: root.doc.exclusiveMode === true
|
||||
enabled: root.doc.backendIsAlsa === true || root.doc.backendIsWasapi === true
|
||||
enabled: root.doc.backendIsAlsa === true || root.doc.backendIsWasapi === true || root.doc.backendIsCoreAudio === true
|
||||
onToggled: function (v) { QbzBridge.settingsBool("exclusive-mode", v) }
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user