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:
parent
af72875bee
commit
7cb6532971
8 changed files with 152 additions and 54 deletions
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"version": 9,
|
||||
"version": 10,
|
||||
"max_anisotropy": -1,
|
||||
"graphics_shaders_dump_path": "",
|
||||
"logging_enable_debug": false,
|
||||
|
@ -22,6 +22,7 @@
|
|||
"enable_ptc": false,
|
||||
"enable_fs_integrity_checks": true,
|
||||
"fs_global_access_log_mode": 0,
|
||||
"audio_backend": "OpenAl",
|
||||
"ignore_missing_services": false,
|
||||
"gui_columns": {
|
||||
"fav_column": true,
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
using Gtk;
|
||||
using Ryujinx.Audio;
|
||||
using Ryujinx.Configuration;
|
||||
using Ryujinx.Common.Configuration.Hid;
|
||||
using Ryujinx.Configuration.System;
|
||||
using Ryujinx.HLE.HOS.Services.Time.TimeZone;
|
||||
using Ryujinx.HLE.FileSystem;
|
||||
|
@ -9,7 +11,7 @@ using System.Diagnostics;
|
|||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using Ryujinx.Common.Configuration.Hid;
|
||||
|
||||
using GUI = Gtk.Builder.ObjectAttribute;
|
||||
|
||||
namespace Ryujinx.Ui
|
||||
|
@ -42,6 +44,7 @@ namespace Ryujinx.Ui
|
|||
[GUI] ComboBoxText _systemLanguageSelect;
|
||||
[GUI] ComboBoxText _systemRegionSelect;
|
||||
[GUI] ComboBoxText _systemTimeZoneSelect;
|
||||
[GUI] ComboBoxText _audioBackendSelect;
|
||||
[GUI] SpinButton _systemTimeYearSpin;
|
||||
[GUI] SpinButton _systemTimeMonthSpin;
|
||||
[GUI] SpinButton _systemTimeDaySpin;
|
||||
|
@ -191,8 +194,15 @@ namespace Ryujinx.Ui
|
|||
_systemTimeZoneSelect.Append(locationName, locationName);
|
||||
}
|
||||
|
||||
_audioBackendSelect.Append(AudioBackend.Dummy.ToString(), AudioBackend.Dummy.ToString());
|
||||
if (SoundIoAudioOut.IsSupported)
|
||||
_audioBackendSelect.Append(AudioBackend.SoundIo.ToString(), "SoundIO");
|
||||
if (OpenALAudioOut.IsSupported)
|
||||
_audioBackendSelect.Append(AudioBackend.OpenAl.ToString(), "OpenAL");
|
||||
|
||||
_systemLanguageSelect.SetActiveId(ConfigurationState.Instance.System.Language.Value.ToString());
|
||||
_systemRegionSelect.SetActiveId(ConfigurationState.Instance.System.Region.Value.ToString());
|
||||
_audioBackendSelect.SetActiveId(ConfigurationState.Instance.System.AudioBackend.Value.ToString());
|
||||
_systemTimeZoneSelect.SetActiveId(timeZoneContentManager.SanityCheckDeviceLocationName());
|
||||
_anisotropy.SetActiveId(ConfigurationState.Instance.Graphics.MaxAnisotropy.Value.ToString());
|
||||
|
||||
|
@ -417,6 +427,7 @@ namespace Ryujinx.Ui
|
|||
ConfigurationState.Instance.Ui.EnableCustomTheme.Value = _custThemeToggle.Active;
|
||||
ConfigurationState.Instance.System.Language.Value = Enum.Parse<Language>(_systemLanguageSelect.ActiveId);
|
||||
ConfigurationState.Instance.System.Region.Value = Enum.Parse<Configuration.System.Region>(_systemRegionSelect.ActiveId);
|
||||
ConfigurationState.Instance.System.AudioBackend.Value = Enum.Parse<AudioBackend>(_audioBackendSelect.ActiveId);
|
||||
ConfigurationState.Instance.System.TimeZone.Value = _systemTimeZoneSelect.ActiveId;
|
||||
ConfigurationState.Instance.System.SystemTimeOffset.Value = _systemTimeOffset;
|
||||
ConfigurationState.Instance.Ui.CustomThemePath.Value = _custThemePath.Buffer.Text;
|
||||
|
|
|
@ -7,13 +7,41 @@
|
|||
<property name="step_increment">1</property>
|
||||
<property name="page_increment">10</property>
|
||||
</object>
|
||||
<object class="GtkAdjustment" id="_systemTimeDaySpinAdjustment">
|
||||
<property name="lower">1</property>
|
||||
<property name="upper">31</property>
|
||||
<property name="step_increment">1</property>
|
||||
<property name="page_increment">5</property>
|
||||
</object>
|
||||
<object class="GtkAdjustment" id="_systemTimeHourSpinAdjustment">
|
||||
<property name="upper">23</property>
|
||||
<property name="step_increment">1</property>
|
||||
<property name="page_increment">5</property>
|
||||
</object>
|
||||
<object class="GtkAdjustment" id="_systemTimeMinuteSpinAdjustment">
|
||||
<property name="upper">59</property>
|
||||
<property name="step_increment">1</property>
|
||||
<property name="page_increment">5</property>
|
||||
</object>
|
||||
<object class="GtkAdjustment" id="_systemTimeMonthSpinAdjustment">
|
||||
<property name="lower">1</property>
|
||||
<property name="upper">12</property>
|
||||
<property name="step_increment">1</property>
|
||||
<property name="page_increment">5</property>
|
||||
</object>
|
||||
<object class="GtkAdjustment" id="_systemTimeYearSpinAdjustment">
|
||||
<property name="lower">2000</property>
|
||||
<property name="upper">2060</property>
|
||||
<property name="step_increment">1</property>
|
||||
<property name="page_increment">10</property>
|
||||
</object>
|
||||
<object class="GtkWindow" id="_settingsWin">
|
||||
<property name="can_focus">False</property>
|
||||
<property name="title" translatable="yes">Ryujinx - Settings</property>
|
||||
<property name="modal">True</property>
|
||||
<property name="window_position">center</property>
|
||||
<property name="default_width">650</property>
|
||||
<property name="default_height">520</property>
|
||||
<property name="default_height">550</property>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
|
@ -1441,6 +1469,46 @@
|
|||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkBox" id="AudioBackendBox">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="tooltip_text" translatable="yes">Change System Region</property>
|
||||
<property name="halign">end</property>
|
||||
<property name="label" translatable="yes">Audio Backend: </property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="padding">5</property>
|
||||
<property name="position">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkComboBoxText" id="_audioBackendSelect">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="tooltip_text" translatable="yes">Change Audio Backend</property>
|
||||
<property name="margin_left">5</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">3</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="padding">5</property>
|
||||
<property name="position">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
|
@ -2121,32 +2189,4 @@
|
|||
</object>
|
||||
</child>
|
||||
</object>
|
||||
<object class="GtkAdjustment" id="_systemTimeDaySpinAdjustment">
|
||||
<property name="lower">1</property>
|
||||
<property name="upper">31</property>
|
||||
<property name="step_increment">1</property>
|
||||
<property name="page_increment">5</property>
|
||||
</object>
|
||||
<object class="GtkAdjustment" id="_systemTimeHourSpinAdjustment">
|
||||
<property name="upper">23</property>
|
||||
<property name="step_increment">1</property>
|
||||
<property name="page_increment">5</property>
|
||||
</object>
|
||||
<object class="GtkAdjustment" id="_systemTimeMinuteSpinAdjustment">
|
||||
<property name="upper">59</property>
|
||||
<property name="step_increment">1</property>
|
||||
<property name="page_increment">5</property>
|
||||
</object>
|
||||
<object class="GtkAdjustment" id="_systemTimeMonthSpinAdjustment">
|
||||
<property name="lower">1</property>
|
||||
<property name="upper">12</property>
|
||||
<property name="step_increment">1</property>
|
||||
<property name="page_increment">5</property>
|
||||
</object>
|
||||
<object class="GtkAdjustment" id="_systemTimeYearSpinAdjustment">
|
||||
<property name="lower">2000</property>
|
||||
<property name="upper">2060</property>
|
||||
<property name="step_increment">1</property>
|
||||
<property name="page_increment">10</property>
|
||||
</object>
|
||||
</interface>
|
||||
|
|
|
@ -1003,6 +1003,18 @@
|
|||
3
|
||||
]
|
||||
},
|
||||
"audio_backend": {
|
||||
"$id": "#/properties/audio_backend",
|
||||
"type": "string",
|
||||
"title": "The selected audio backend",
|
||||
"description": "The selected audio backend",
|
||||
"default": "OpenAl",
|
||||
"enum": [
|
||||
"Dummy",
|
||||
"SoundIo",
|
||||
"OpenAl"
|
||||
]
|
||||
},
|
||||
"ignore_missing_services": {
|
||||
"$id": "#/properties/ignore_missing_services",
|
||||
"type": "boolean",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue