fix(qbz-slint): group and order ALSA output devices like the Tauri app

The Output Device dropdown, on the ALSA backend, listed devices flat,
unordered, with the BP badge on too many rows. Port the Tauri
DeviceDropdown.svelte ALSA behaviour:

- Regroup devices into Defaults / Bit-perfect (Hardware / Digital) /
  Plugin Hardware / Other Outputs, in that order, with a section header
  above the first row of each non-empty section.
- Align device_is_bit_perfect (the BP badge rule) with the Tauri ALSA
  bit-perfect group: hw: / front:CARD= / iec958: only. hdmi: and
  sysdefault: route through plugins and no longer get the badge.
- The regrouped ids stay index-aligned with SettingsMaps.devices, so the
  settings-select("device", i) callback still resolves to the right id
  and selected-device persistence is unaffected.

cc
This commit is contained in:
vicrodh committed 2026-05-19 02:28:24 -06:00
1 parent 9f86197f60
commit e49899755a
3 files changed
+245 -18

No files matched your search

@@ -100,6 +100,7 @@ export component AudioSettings inherits VerticalLayout {
popup-width: 480px;
options: SettingsState.devices;
badges: SettingsState.device-bp;
groups: SettingsState.device-groups;
current-index: SettingsState.device-index;
selected(i) => {
SettingsState.device-index = i;
+3
View File
@@ -106,6 +106,9 @@ export global SettingsState {
in-out property <[string]> devices: [];
// Parallel to `devices`: true marks a bit-perfect-capable device.
in-out property <[bool]> device-bp: [];
// Parallel to `devices`: a non-empty entry is a section-header label
// shown above that device row (empty = no header).
in-out property <[string]> device-groups: [];
in-out property <int> device-index: 0;
in-out property <[string]> alsa-plugins: [];
in-out property <int> alsa-plugin-index: 0;