feat(audio): add audioDevices state + loadAudioDevices/setAudioOutputDevice

This commit is contained in:
iamdoubz
2026-07-06 16:00:59 -05:00
parent 137605934c
commit 38b9cb2910
+16
View File
@@ -8,6 +8,7 @@ import {
errorMessage,
events,
type AppSettings,
type AudioDeviceInfo,
type SyncTargetInfo,
type SyncTargetConfig,
type HardwareStatus,
@@ -33,6 +34,7 @@ const DEFAULT_SETTINGS: AppSettings = {
retention_max_size_gb: null,
pst_last_path: null,
pst_auto_sync: false,
audio_output_device: null, // system default render device (FR-CAP-1)
};
class SettingsStore {
@@ -47,6 +49,7 @@ class SettingsStore {
// Hardware + model management (Phase 3, T3.6/T3.7).
hardware = $state<HardwareStatus | null>(null);
models = $state<ModelInfo[]>([]);
audioDevices = $state<AudioDeviceInfo[]>([]);
downloadProgress = $state<Record<string, { received: number; total: number | null }>>({});
// Privacy self-check (T7.6, FR-SEC-2).
@@ -71,6 +74,7 @@ class SettingsStore {
this.backendStub = true;
}
await this.loadHardware();
await this.loadAudioDevices();
await this.loadModels();
await this.loadPrivacy();
await this.loadLlmStatus();
@@ -125,6 +129,18 @@ class SettingsStore {
}
}
async loadAudioDevices() {
try {
this.audioDevices = await api.listAudioDevices();
} catch {
this.audioDevices = [];
}
}
async setAudioOutputDevice(deviceId: string | null) {
await this.patch({ audio_output_device: deviceId });
}
async loadModels() {
try {
this.models = await api.listModels();