decouple audio device setting property depending on player type (#1617)

This commit is contained in:
jeffvli
2026-01-30 17:55:25 -08:00
parent bdd5c78d39
commit ad83e95a46
4 changed files with 35 additions and 13 deletions
@@ -5,6 +5,7 @@ import { useTranslation } from 'react-i18next';
import { useAudioDevices } from '/@/renderer/features/settings/components/playback/audio-settings';
import { ListConfigTable } from '/@/renderer/features/shared/components/list-config-menu';
import {
usePlaybackType,
usePlayerActions,
usePlayerProperties,
usePlayerSongProperties,
@@ -233,23 +234,30 @@ const AudioPlayerTypeConfig = () => {
const AudioDeviceConfig = () => {
const status = usePlayerStatus();
const playbackType = usePlaybackType();
const playbackSettings = usePlaybackSettings();
const { setSettings } = useSettingsStoreActions();
const audioDevices = useAudioDevices();
const audioDevices = useAudioDevices(playbackType);
const audioDeviceId =
playbackType === PlayerType.LOCAL
? playbackSettings.mpvAudioDeviceId
: playbackSettings.audioDeviceId;
return (
<Select
clearable
comboboxProps={{ withinPortal: false }}
data={audioDevices}
defaultValue={playbackSettings.audioDeviceId}
defaultValue={audioDeviceId}
disabled={status === PlayerStatus.PLAYING}
onChange={(e) => {
setSettings({
playback: {
...playbackSettings,
audioDeviceId: e,
...(playbackType === PlayerType.LOCAL
? { mpvAudioDeviceId: e }
: { audioDeviceId: e }),
},
});
}}