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

@ -205,6 +205,11 @@ namespace Ryujinx.Configuration
/// </summary>
public ReactiveObject<int> FsGlobalAccessLogMode { get; private set; }
/// <summary>
/// The selected audio backend
/// </summary>
public ReactiveObject<AudioBackend> AudioBackend { get; private set; }
/// <summary>
/// Enable or disable ignoring missing services
/// </summary>
@ -221,6 +226,7 @@ namespace Ryujinx.Configuration
EnablePtc = new ReactiveObject<bool>();
EnableFsIntegrityChecks = new ReactiveObject<bool>();
FsGlobalAccessLogMode = new ReactiveObject<int>();
AudioBackend = new ReactiveObject<AudioBackend>();
IgnoreMissingServices = new ReactiveObject<bool>();
}
}
@ -370,6 +376,7 @@ namespace Ryujinx.Configuration
EnablePtc = System.EnablePtc,
EnableFsIntegrityChecks = System.EnableFsIntegrityChecks,
FsGlobalAccessLogMode = System.FsGlobalAccessLogMode,
AudioBackend = System.AudioBackend,
IgnoreMissingServices = System.IgnoreMissingServices,
GuiColumns = new GuiColumns
{
@ -425,6 +432,7 @@ namespace Ryujinx.Configuration
System.EnablePtc.Value = false;
System.EnableFsIntegrityChecks.Value = true;
System.FsGlobalAccessLogMode.Value = 0;
System.AudioBackend.Value = AudioBackend.OpenAl;
System.IgnoreMissingServices.Value = false;
Ui.GuiColumns.FavColumn.Value = true;
Ui.GuiColumns.IconColumn.Value = true;
@ -547,7 +555,8 @@ namespace Ryujinx.Configuration
Common.Logging.Logger.PrintWarning(LogClass.Application, $"Outdated configuration version {configurationFileFormat.Version}, migrating to version 6.");
configurationFileFormat.ControllerConfig = new List<ControllerConfig>();
configurationFileFormat.KeyboardConfig = new List<KeyboardConfig>{
configurationFileFormat.KeyboardConfig = new List<KeyboardConfig>
{
new KeyboardConfig
{
Index = 0,
@ -634,15 +643,18 @@ namespace Ryujinx.Configuration
configurationFileUpdated = true;
}
if (configurationFileFormat.Version < 10)
{
Common.Logging.Logger.PrintWarning(LogClass.Application, $"Outdated configuration version {configurationFileFormat.Version}, migrating to version 10.");
configurationFileFormat.AudioBackend = AudioBackend.OpenAl;
configurationFileUpdated = true;
}
List<InputConfig> inputConfig = new List<InputConfig>();
foreach (ControllerConfig controllerConfig in configurationFileFormat.ControllerConfig)
{
inputConfig.Add(controllerConfig);
}
foreach (KeyboardConfig keyboardConfig in configurationFileFormat.KeyboardConfig)
{
inputConfig.Add(keyboardConfig);
}
inputConfig.AddRange(configurationFileFormat.ControllerConfig);
inputConfig.AddRange(configurationFileFormat.KeyboardConfig);
Graphics.MaxAnisotropy.Value = configurationFileFormat.MaxAnisotropy;
Graphics.ShadersDumpPath.Value = configurationFileFormat.GraphicsShadersDumpPath;
@ -660,13 +672,13 @@ namespace Ryujinx.Configuration
System.TimeZone.Value = configurationFileFormat.SystemTimeZone;
System.SystemTimeOffset.Value = configurationFileFormat.SystemTimeOffset;
System.EnableDockedMode.Value = configurationFileFormat.DockedMode;
System.EnableDockedMode.Value = configurationFileFormat.DockedMode;
EnableDiscordIntegration.Value = configurationFileFormat.EnableDiscordIntegration;
Graphics.EnableVsync.Value = configurationFileFormat.EnableVsync;
System.EnableMulticoreScheduling.Value = configurationFileFormat.EnableMulticoreScheduling;
System.EnablePtc.Value = configurationFileFormat.EnablePtc;
System.EnableFsIntegrityChecks.Value = configurationFileFormat.EnableFsIntegrityChecks;
System.FsGlobalAccessLogMode.Value = configurationFileFormat.FsGlobalAccessLogMode;
System.AudioBackend.Value = configurationFileFormat.AudioBackend;
System.IgnoreMissingServices.Value = configurationFileFormat.IgnoreMissingServices;
Ui.GuiColumns.FavColumn.Value = configurationFileFormat.GuiColumns.FavColumn;
Ui.GuiColumns.IconColumn.Value = configurationFileFormat.GuiColumns.IconColumn;