persist chosen audio device in config file #353
Write `gopts.audio_dev` to the option `Sound/AudioDevice`. Clear `gopts.audio_dev` when resetting the driver, because we cannot assume anything about device enumeration order across sound drivers. Signed-off-by: Rafael Kitover <rkitover@gmail.com>
This commit is contained in:
parent
d94d6d5363
commit
4f9003112d
|
@ -1571,6 +1571,7 @@ public:
|
|||
if (newapi == lastapi)
|
||||
return;
|
||||
|
||||
gopts.audio_dev = "";
|
||||
FillDev(newapi);
|
||||
}
|
||||
} sound_config_handler;
|
||||
|
|
|
@ -261,6 +261,7 @@ opt_desc opts[] = {
|
|||
/// Sound
|
||||
|
||||
ENUMOPT("Sound/AudioAPI", "", wxTRANSLATE("Sound API; if unsupported, default API will be used"), gopts.audio_api, wxTRANSLATE("sdl|openal|directsound|xaudio2|faudio")),
|
||||
STROPT("Sound/AudioDevice", "", wxTRANSLATE("Device ID of chosen audio device for chosen driver"), gopts.audio_dev),
|
||||
INTOPT("Sound/Buffers", "", wxTRANSLATE("Number of sound buffers"), gopts.audio_buffers, 2, 10),
|
||||
INTOPT("Sound/Enable", "", wxTRANSLATE("Bit mask of sound channels to enable"), gopts.sound_en, 0, 0x30f),
|
||||
INTOPT("Sound/GBAFiltering", "", wxTRANSLATE("GBA sound filtering (%)"), gopts.gba_sound_filter, 0, 100),
|
||||
|
|
Loading…
Reference in New Issue