Implement audio backend configuration option (#1325)

* Implement audio backend configuration option

* Use OpenAL by default

* Increment version number in config.json

and add 30px to the height of the settings window

* nits

* capitalise audio backend names
This commit is contained in:
Xpl0itR 2020-07-04 00:16:49 +01:00 committed by GitHub
parent af72875bee
commit 7cb6532971
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 152 additions and 54 deletions

View file

@ -647,24 +647,32 @@ namespace Ryujinx.Ui
return new Renderer();
}
/// <summary>
/// Picks an <see cref="IAalOutput"/> audio output renderer supported on this machine
/// </summary>
/// <returns>An <see cref="IAalOutput"/> supported by this machine</returns>
private static IAalOutput InitializeAudioEngine()
{
if (OpenALAudioOut.IsSupported)
if (ConfigurationState.Instance.System.AudioBackend.Value == AudioBackend.SoundIo)
{
return new OpenALAudioOut();
if (SoundIoAudioOut.IsSupported)
{
return new SoundIoAudioOut();
}
else
{
Logger.PrintWarning(LogClass.Audio, "SoundIO is not supported, falling back to dummy audio out.");
}
}
else if (SoundIoAudioOut.IsSupported)
else if (ConfigurationState.Instance.System.AudioBackend.Value == AudioBackend.OpenAl)
{
return new SoundIoAudioOut();
}
else
{
return new DummyAudioOut();
if (OpenALAudioOut.IsSupported)
{
return new OpenALAudioOut();
}
else
{
Logger.PrintWarning(LogClass.Audio, "OpenAL is not supported, falling back to dummy audio out.");
}
}
return new DummyAudioOut();
}
//Events