Qt: Add inline help to audio settings

This commit is contained in:
Connor McLaughlin 2020-06-07 01:30:05 +10:00
parent 531c3ad5fa
commit bc9246b444
3 changed files with 25 additions and 3 deletions

View file

@ -1,8 +1,9 @@
#include "audiosettingswidget.h" #include "audiosettingswidget.h"
#include "common/audio_stream.h" #include "common/audio_stream.h"
#include "settingsdialog.h"
#include "settingwidgetbinder.h" #include "settingwidgetbinder.h"
AudioSettingsWidget::AudioSettingsWidget(QtHostInterface* host_interface, QWidget* parent /* = nullptr */) AudioSettingsWidget::AudioSettingsWidget(QtHostInterface* host_interface, QWidget* parent, SettingsDialog* dialog)
: QWidget(parent), m_host_interface(host_interface) : QWidget(parent), m_host_interface(host_interface)
{ {
m_ui.setupUi(this); m_ui.setupUi(this);
@ -23,6 +24,26 @@ AudioSettingsWidget::AudioSettingsWidget(QtHostInterface* host_interface, QWidge
updateBufferingLabel(); updateBufferingLabel();
updateVolumeLabel(); updateVolumeLabel();
dialog->registerWidgetHelp(
m_ui.audioBackend, "Audio Backend", "Cubeb",
"The audio backend determines how frames produced by the emulator are submitted to the host. Cubeb provides the "
"lowest latency, if you encounter issues, try the SDL backend. The null backend disables all host audio output.");
dialog->registerWidgetHelp(m_ui.bufferSize, "Buffer Size", "2048",
"The buffer size determines the size of the chunks of audio which will be pulled by the "
"host. Smaller values reduce the output latency, but may cause hitches if the emulation "
"speed is inconsistent. Note that the Cubeb backend uses smaller chunks regardless of "
"this value, so using a low value here may not significantly change latency.");
dialog->registerWidgetHelp(m_ui.syncToOutput, "Sync To Output", "Checked",
"Throttles the emulation speed based on the audio backend pulling audio frames. Sync will "
"automatically be disabled if not running at 100% speed.");
dialog->registerWidgetHelp(
m_ui.startDumpingOnBoot, "Start Dumping On Boot", "Unchecked",
"Start dumping audio to file as soon as the emulator is started. Mainly useful as a debug option.");
dialog->registerWidgetHelp(m_ui.volume, "Volume", "100",
"Controls the volume of the audio played on the host. Values are in percentage.");
dialog->registerWidgetHelp(m_ui.muted, "Mute", "Unchecked",
"Prevents the emulator from producing any audible sound.");
} }
AudioSettingsWidget::~AudioSettingsWidget() = default; AudioSettingsWidget::~AudioSettingsWidget() = default;

View file

@ -5,13 +5,14 @@
#include "ui_audiosettingswidget.h" #include "ui_audiosettingswidget.h"
class QtHostInterface; class QtHostInterface;
class SettingsDialog;
class AudioSettingsWidget : public QWidget class AudioSettingsWidget : public QWidget
{ {
Q_OBJECT Q_OBJECT
public: public:
explicit AudioSettingsWidget(QtHostInterface* host_interface, QWidget* parent = nullptr); explicit AudioSettingsWidget(QtHostInterface* host_interface, QWidget* parent, SettingsDialog* dialog);
~AudioSettingsWidget(); ~AudioSettingsWidget();
private Q_SLOTS: private Q_SLOTS:

View file

@ -52,7 +52,7 @@ SettingsDialog::SettingsDialog(QtHostInterface* host_interface, QWidget* parent
m_controller_settings = new ControllerSettingsWidget(host_interface, m_ui.settingsContainer); m_controller_settings = new ControllerSettingsWidget(host_interface, m_ui.settingsContainer);
m_memory_card_settings = new MemoryCardSettingsWidget(host_interface, m_ui.settingsContainer); m_memory_card_settings = new MemoryCardSettingsWidget(host_interface, m_ui.settingsContainer);
m_gpu_settings = new GPUSettingsWidget(host_interface, m_ui.settingsContainer, this); m_gpu_settings = new GPUSettingsWidget(host_interface, m_ui.settingsContainer, this);
m_audio_settings = new AudioSettingsWidget(host_interface, m_ui.settingsContainer); m_audio_settings = new AudioSettingsWidget(host_interface, m_ui.settingsContainer, this);
m_advanced_settings = new AdvancedSettingsWidget(host_interface, m_ui.settingsContainer, this); m_advanced_settings = new AdvancedSettingsWidget(host_interface, m_ui.settingsContainer, this);
m_ui.settingsContainer->insertWidget(static_cast<int>(Category::GeneralSettings), m_general_settings); m_ui.settingsContainer->insertWidget(static_cast<int>(Category::GeneralSettings), m_general_settings);