FullscreenUI: Fix minimal output latency toggle

This commit is contained in:
Stenzek 2024-05-15 07:12:24 +10:00 committed by Connor McLaughlin
parent a0bc8e0ff8
commit 4b1a4fdbb9
1 changed files with 4 additions and 13 deletions

View File

@ -3980,19 +3980,7 @@ void FullscreenUI::DrawAudioSettingsPage()
DrawIntRangeSetting(bsi, FSUI_CSTR("Buffer Size"),
FSUI_CSTR("Determines the amount of audio buffered before being pulled by the host API."),
"SPU2/Output", "BufferMS", AudioStreamParameters::DEFAULT_BUFFER_MS, 10, 500, FSUI_CSTR("%d ms"));
const u32 output_latency =
GetEffectiveUIntSetting(bsi, "SPU2/Output", "OutputLatencyMS", AudioStreamParameters::DEFAULT_OUTPUT_LATENCY_MS);
bool output_latency_minimal = (output_latency == 0);
if (ToggleButton(FSUI_CSTR("Minimal Output Latency"),
FSUI_CSTR("When enabled, the minimum supported output latency will be used for the host API."),
&output_latency_minimal))
{
bsi->SetUIntValue("SPU2/Output", "OutputLatencyMS",
output_latency_minimal ? 0 : AudioStreamParameters::DEFAULT_OUTPUT_LATENCY_MS);
SetSettingsChanged(bsi);
}
if (!output_latency_minimal)
if (!GetEffectiveBoolSetting(bsi, "Audio", "OutputLatencyMinimal", AudioStreamParameters::DEFAULT_OUTPUT_LATENCY_MINIMAL))
{
DrawIntRangeSetting(
bsi, FSUI_CSTR("Output Latency"),
@ -4000,6 +3988,9 @@ void FullscreenUI::DrawAudioSettingsPage()
"played through speakers."),
"SPU2/Output", "OutputLatencyMS", AudioStreamParameters::DEFAULT_OUTPUT_LATENCY_MS, 1, 500, FSUI_CSTR("%d ms"));
}
DrawToggleSetting(bsi, FSUI_CSTR("Minimal Output Latency"),
FSUI_CSTR("When enabled, the minimum supported output latency will be used for the host API."),
"SPU2/Output", "OutputLatencyMinimal", AudioStreamParameters::DEFAULT_OUTPUT_LATENCY_MINIMAL);
EndMenuButtons();
}