Qt/Android: Add help text for resampling, turn on by default

This commit is contained in:
Connor McLaughlin 2021-01-11 02:26:49 +10:00
parent fdeef65676
commit ce965e89ca
6 changed files with 17 additions and 5 deletions

View file

@ -189,4 +189,6 @@
<string name="game_properties_tab_summary">Summary</string> <string name="game_properties_tab_summary">Summary</string>
<string name="game_properties_tab_game_settings">Game Settings</string> <string name="game_properties_tab_game_settings">Game Settings</string>
<string name="game_properties_tab_controller_settings">Controller Settings</string> <string name="game_properties_tab_controller_settings">Controller Settings</string>
<string name="settings_audio_resampling">Audio Resampling</string>
<string name="settings_summary_audio_resampling">When running outside of 100% speed, resamples audio from the target speed instead of dropping frames. Produces much nicer fast forward/slowdown audio at a small cost to performance.</string>
</resources> </resources>

View file

@ -70,5 +70,11 @@
app:defaultValue="true" app:defaultValue="true"
app:summary="@string/settings_summary_audio_sync" app:summary="@string/settings_summary_audio_sync"
app:iconSpaceReserved="false" /> app:iconSpaceReserved="false" />
<SwitchPreferenceCompat
app:key="Audio/Resampling"
app:title="@string/settings_audio_resampling"
app:defaultValue="false"
app:summary="@string/settings_summary_resampling"
app:iconSpaceReserved="false" />
</PreferenceScreen> </PreferenceScreen>

View file

@ -544,7 +544,7 @@ void HostInterface::SetDefaultSettings(SettingsInterface& si)
si.SetIntValue("Audio", "OutputVolume", 100); si.SetIntValue("Audio", "OutputVolume", 100);
si.SetIntValue("Audio", "FastForwardVolume", 100); si.SetIntValue("Audio", "FastForwardVolume", 100);
si.SetIntValue("Audio", "BufferSize", DEFAULT_AUDIO_BUFFER_SIZE); si.SetIntValue("Audio", "BufferSize", DEFAULT_AUDIO_BUFFER_SIZE);
si.SetBoolValue("Audio", "Resampling", false); si.SetBoolValue("Audio", "Resampling", true);
si.SetIntValue("Audio", "OutputMuted", false); si.SetIntValue("Audio", "OutputMuted", false);
si.SetBoolValue("Audio", "Sync", true); si.SetBoolValue("Audio", "Sync", true);
si.SetBoolValue("Audio", "DumpOnBoot", false); si.SetBoolValue("Audio", "DumpOnBoot", false);

View file

@ -207,7 +207,7 @@ void Settings::Load(SettingsInterface& si)
audio_output_volume = si.GetIntValue("Audio", "OutputVolume", 100); audio_output_volume = si.GetIntValue("Audio", "OutputVolume", 100);
audio_fast_forward_volume = si.GetIntValue("Audio", "FastForwardVolume", 100); audio_fast_forward_volume = si.GetIntValue("Audio", "FastForwardVolume", 100);
audio_buffer_size = si.GetIntValue("Audio", "BufferSize", HostInterface::DEFAULT_AUDIO_BUFFER_SIZE); audio_buffer_size = si.GetIntValue("Audio", "BufferSize", HostInterface::DEFAULT_AUDIO_BUFFER_SIZE);
audio_resampling = si.GetBoolValue("Audio", "Resampling", false); audio_resampling = si.GetBoolValue("Audio", "Resampling", true);
audio_output_muted = si.GetBoolValue("Audio", "OutputMuted", false); audio_output_muted = si.GetBoolValue("Audio", "OutputMuted", false);
audio_sync_enabled = si.GetBoolValue("Audio", "Sync", true); audio_sync_enabled = si.GetBoolValue("Audio", "Sync", true);
audio_dump_on_boot = si.GetBoolValue("Audio", "DumpOnBoot", false); audio_dump_on_boot = si.GetBoolValue("Audio", "DumpOnBoot", false);

View file

@ -57,7 +57,7 @@
</layout> </layout>
</item> </item>
<item> <item>
<layout class="QFormLayout" name="formLayout_3"> <layout class="QGridLayout" name="gridLayout_2">
<item row="0" column="0"> <item row="0" column="0">
<widget class="QCheckBox" name="logToConsole"> <widget class="QCheckBox" name="logToConsole">
<property name="text"> <property name="text">
@ -174,7 +174,7 @@
</layout> </layout>
</widget> </widget>
<resources> <resources>
<include location="resources/icons.qrc"/> <include location="resources/resources.qrc"/>
</resources> </resources>
<connections/> <connections/>
</ui> </ui>

View file

@ -24,7 +24,7 @@ AudioSettingsWidget::AudioSettingsWidget(QtHostInterface* host_interface, QWidge
SettingWidgetBinder::BindWidgetToIntSetting(m_host_interface, m_ui.bufferSize, "Audio", "BufferSize"); SettingWidgetBinder::BindWidgetToIntSetting(m_host_interface, m_ui.bufferSize, "Audio", "BufferSize");
SettingWidgetBinder::BindWidgetToBoolSetting(m_host_interface, m_ui.startDumpingOnBoot, "Audio", "DumpOnBoot"); SettingWidgetBinder::BindWidgetToBoolSetting(m_host_interface, m_ui.startDumpingOnBoot, "Audio", "DumpOnBoot");
SettingWidgetBinder::BindWidgetToBoolSetting(m_host_interface, m_ui.muteCDAudio, "CDROM", "MuteCDAudio"); SettingWidgetBinder::BindWidgetToBoolSetting(m_host_interface, m_ui.muteCDAudio, "CDROM", "MuteCDAudio");
SettingWidgetBinder::BindWidgetToBoolSetting(m_host_interface, m_ui.resampling, "Audio", "Resampling", false); SettingWidgetBinder::BindWidgetToBoolSetting(m_host_interface, m_ui.resampling, "Audio", "Resampling", true);
m_ui.volume->setValue(m_host_interface->GetIntSettingValue("Audio", "OutputVolume", 100)); m_ui.volume->setValue(m_host_interface->GetIntSettingValue("Audio", "OutputVolume", 100));
m_ui.fastForwardVolume->setValue(m_host_interface->GetIntSettingValue("Audio", "FastForwardVolume", 100)); m_ui.fastForwardVolume->setValue(m_host_interface->GetIntSettingValue("Audio", "FastForwardVolume", 100));
@ -66,6 +66,10 @@ AudioSettingsWidget::AudioSettingsWidget(QtHostInterface* host_interface, QWidge
dialog->registerWidgetHelp(m_ui.muteCDAudio, tr("Mute CD Audio"), tr("Unchecked"), dialog->registerWidgetHelp(m_ui.muteCDAudio, tr("Mute CD Audio"), tr("Unchecked"),
tr("Forcibly mutes both CD-DA and XA audio from the CD-ROM. Can be used to disable " tr("Forcibly mutes both CD-DA and XA audio from the CD-ROM. Can be used to disable "
"background music in some games.")); "background music in some games."));
dialog->registerWidgetHelp(
m_ui.resampling, tr("Resampling"), tr("Unchecked"),
tr("When running outside of 100% speed, resamples audio from the target speed instead of dropping frames. Produces "
"much nicer fast forward/slowdown audio at a small cost to performance."));
} }
AudioSettingsWidget::~AudioSettingsWidget() = default; AudioSettingsWidget::~AudioSettingsWidget() = default;