Add grouped device dropdown for PipeWire with USB/HDMI categorization
Backend changes: - Add device_bus and is_hardware fields to AudioDevice - Parse PipeWire Flags (HARDWARE) and device.bus property from pactl output Frontend changes: - DeviceDropdown now supports both ALSA and PipeWire backends - ALSA grouping: Defaults, Bit-perfect, Plugin Hardware, Other - PipeWire grouping: Defaults, USB Audio (BP capable), HDMI/DisplayPort, Other HW, Virtual - BP badge shown for USB Audio devices in PipeWire mode
This commit is contained in:
1 parent
0ccdd9981f
commit
f67b13e27e
5 files changed
+110
-48
No files matched your search
@@ -462,10 +462,17 @@
|
||||
return map;
|
||||
});
|
||||
|
||||
// Device options for grouped dropdown (ALSA Direct only)
|
||||
// Device options for grouped dropdown (works for both ALSA and PipeWire)
|
||||
let groupedDeviceOptions = $derived.by(() => {
|
||||
// System Default is always first
|
||||
const options: { value: string; id: string; isDefault?: boolean; sampleRates?: number[] }[] = [
|
||||
const options: {
|
||||
value: string;
|
||||
id: string;
|
||||
isDefault?: boolean;
|
||||
sampleRates?: number[];
|
||||
deviceBus?: string;
|
||||
isHardware?: boolean;
|
||||
}[] = [
|
||||
{ value: 'System Default', id: 'system-default', isDefault: true }
|
||||
];
|
||||
|
||||
@@ -489,7 +496,9 @@
|
||||
value: displayName,
|
||||
id: device.id,
|
||||
isDefault: device.is_default,
|
||||
sampleRates: device.supported_sample_rates ?? undefined
|
||||
sampleRates: device.supported_sample_rates ?? undefined,
|
||||
deviceBus: device.device_bus ?? undefined,
|
||||
isHardware: device.is_hardware
|
||||
});
|
||||
});
|
||||
|
||||
@@ -1084,6 +1093,8 @@
|
||||
is_default: boolean;
|
||||
max_sample_rate: number | null;
|
||||
supported_sample_rates: number[] | null;
|
||||
device_bus: string | null; // "usb", "pci", "bluetooth", etc.
|
||||
is_hardware: boolean;
|
||||
}
|
||||
|
||||
interface AlsaPluginInfo {
|
||||
@@ -1924,6 +1935,16 @@
|
||||
value={outputDevice}
|
||||
devices={groupedDeviceOptions}
|
||||
onchange={handleBackendDeviceChange}
|
||||
backend="alsa"
|
||||
wide
|
||||
expandLeft
|
||||
/>
|
||||
{:else if selectedBackend === 'PipeWire'}
|
||||
<DeviceDropdown
|
||||
value={outputDevice}
|
||||
devices={groupedDeviceOptions}
|
||||
onchange={handleBackendDeviceChange}
|
||||
backend="pipewire"
|
||||
wide
|
||||
expandLeft
|
||||
/>
|
||||
|
||||
Reference in new issue
Block a user