mirror of
https://git.743378673.xyz/MeloNX/MeloNX.git
synced 2025-08-02 17:07:11 +02:00
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
2b4936c1a1
commit
bd44fe1cf1
8 changed files with 152 additions and 54 deletions
|
@ -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>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue