FullscreenUI: Add new audio options

This commit is contained in:
Connor McLaughlin 2022-07-29 22:29:25 +10:00
parent 79c401740c
commit 25b17f1422
1 changed files with 27 additions and 7 deletions

View File

@ -3157,18 +3157,38 @@ void FullscreenUI::DrawAudioSettingsPage()
"The audio backend determines how frames produced by the emulator are submitted to the host.", "The audio backend determines how frames produced by the emulator are submitted to the host.",
"Audio", "Backend", Settings::DEFAULT_AUDIO_BACKEND, &Settings::ParseAudioBackend, "Audio", "Backend", Settings::DEFAULT_AUDIO_BACKEND, &Settings::ParseAudioBackend,
&Settings::GetAudioBackendName, &Settings::GetAudioBackendDisplayName, AudioBackend::Count); &Settings::GetAudioBackendName, &Settings::GetAudioBackendDisplayName, AudioBackend::Count);
DrawIntRangeSetting("Latency", DrawEnumSetting("Stretch Mode", "Determines quality of audio when not running at 100% speed.", "Audio", "StretchMode",
"The buffer size determines the size of the chunks of audio which will be pulled by the host.", Settings::DEFAULT_AUDIO_STRETCH_MODE, &AudioStream::ParseStretchMode,
"Audio", "Latency", Settings::DEFAULT_AUDIO_BUFFER_MS, 10, 500, "%d ms"); &AudioStream::GetStretchModeName, &AudioStream::GetStretchModeName, AudioStretchMode::Count);
DrawIntRangeSetting("Buffer Size", "Determines the amount of audio buffered before being pulled by the host API.",
"Audio", "BufferMS", Settings::DEFAULT_AUDIO_BUFFER_MS, 10, 500, "%d ms");
const u32 output_latency = GetEditingSettingsInterface()->GetUIntValue(
"Audio", "OutputLatencyMS",
IsEditingGameSettings() ? Settings::DEFAULT_AUDIO_OUTPUT_LATENCY_MS :
Host::Internal::GetBaseSettingsLayer()->GetUIntValue(
"Audio", "OutputLatencyMS", Settings::DEFAULT_AUDIO_OUTPUT_LATENCY_MS));
bool output_latency_minimal = (output_latency == 0);
if (ToggleButton("Minimal Output Latency",
"When enabled, the minimum supported output latency will be used for the host API.",
&output_latency_minimal))
{
GetEditingSettingsInterface()->SetUIntValue("Audio", "OutputLatencyMS",
output_latency_minimal ? 0 : Settings::DEFAULT_AUDIO_OUTPUT_LATENCY_MS);
SetSettingsChanged();
}
if (!output_latency_minimal)
{
DrawIntRangeSetting("Output Latency",
"Determines how much latency there is between the audio being picked up by the host API, and "
"played through speakers.",
"Audio", "OutputLatencyMS", Settings::DEFAULT_AUDIO_OUTPUT_LATENCY_MS, 1, 500, "%d ms");
}
DrawToggleSetting("Sync To Output", DrawToggleSetting("Sync To Output",
"Throttles the emulation speed based on the audio backend pulling audio " "Throttles the emulation speed based on the audio backend pulling audio "
"frames. Enable to reduce the chances of crackling.", "frames. Enable to reduce the chances of crackling.",
"Audio", "Sync", true); "Audio", "Sync", true);
DrawToggleSetting(
"Time Stretching",
"When running outside of 100% speed, adjusts tempo on audio from the target speed instead of dropping frames.",
"Audio", "TimeStretching", true);
EndMenuButtons(); EndMenuButtons();
} }