Skip to content
Permalink
Browse files
Merge pull request #8926 from JosJuice/sysconf-sound
DolphinQt: Expose SYSCONF sound setting
  • Loading branch information
lioncash committed Jul 8, 2020
2 parents 0bff77d + e1e57fc commit b9ae7c3
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 2 deletions.
@@ -14,6 +14,7 @@ const Info<u32> SYSCONF_COUNTRY{{System::SYSCONF, "IPL", "SADR"}, 0x6c};
const Info<bool> SYSCONF_WIDESCREEN{{System::SYSCONF, "IPL", "AR"}, true};
const Info<bool> SYSCONF_PROGRESSIVE_SCAN{{System::SYSCONF, "IPL", "PGS"}, true};
const Info<bool> SYSCONF_PAL60{{System::SYSCONF, "IPL", "E60"}, 0x01};
const Info<u32> SYSCONF_SOUND_MODE{{System::SYSCONF, "IPL", "SND"}, 0x01};

// SYSCONF.BT

@@ -22,13 +23,14 @@ const Info<u32> SYSCONF_SENSOR_BAR_SENSITIVITY{{System::SYSCONF, "BT", "SENS"},
const Info<u32> SYSCONF_SPEAKER_VOLUME{{System::SYSCONF, "BT", "SPKV"}, 0x58};
const Info<bool> SYSCONF_WIIMOTE_MOTOR{{System::SYSCONF, "BT", "MOT"}, true};

const std::array<SYSCONFSetting, 10> SYSCONF_SETTINGS{
const std::array<SYSCONFSetting, 11> SYSCONF_SETTINGS{
{{SYSCONF_SCREENSAVER, SysConf::Entry::Type::Byte},
{SYSCONF_LANGUAGE, SysConf::Entry::Type::Byte},
{SYSCONF_COUNTRY, SysConf::Entry::Type::BigArray},
{SYSCONF_WIDESCREEN, SysConf::Entry::Type::Byte},
{SYSCONF_PROGRESSIVE_SCAN, SysConf::Entry::Type::Byte},
{SYSCONF_PAL60, SysConf::Entry::Type::Byte},
{SYSCONF_SOUND_MODE, SysConf::Entry::Type::Byte},
{SYSCONF_SENSOR_BAR_POSITION, SysConf::Entry::Type::Byte},
{SYSCONF_SENSOR_BAR_SENSITIVITY, SysConf::Entry::Type::Long},
{SYSCONF_SPEAKER_VOLUME, SysConf::Entry::Type::Byte},
@@ -22,6 +22,7 @@ extern const Info<u32> SYSCONF_COUNTRY;
extern const Info<bool> SYSCONF_WIDESCREEN;
extern const Info<bool> SYSCONF_PROGRESSIVE_SCAN;
extern const Info<bool> SYSCONF_PAL60;
extern const Info<u32> SYSCONF_SOUND_MODE;

// SYSCONF.BT

@@ -36,6 +37,6 @@ struct SYSCONFSetting
SysConf::Entry::Type type;
};

extern const std::array<SYSCONFSetting, 10> SYSCONF_SETTINGS;
extern const std::array<SYSCONFSetting, 11> SYSCONF_SETTINGS;

} // namespace Config
@@ -69,6 +69,8 @@ void WiiPane::ConnectLayout()
&WiiPane::OnSaveConfig);
connect(m_system_language_choice, qOverload<int>(&QComboBox::currentIndexChanged), this,
&WiiPane::OnSaveConfig);
connect(m_sound_mode_choice, qOverload<int>(&QComboBox::currentIndexChanged), this,
&WiiPane::OnSaveConfig);
connect(m_screensaver_checkbox, &QCheckBox::toggled, this, &WiiPane::OnSaveConfig);
connect(m_pal60_mode_checkbox, &QCheckBox::toggled, this, &WiiPane::OnSaveConfig);
connect(m_sd_card_checkbox, &QCheckBox::toggled, this, &WiiPane::OnSaveConfig);
@@ -109,10 +111,12 @@ void WiiPane::CreateMisc()
m_sd_card_checkbox = new QCheckBox(tr("Insert SD Card"));
m_allow_sd_writes_checkbox = new QCheckBox(tr("Allow Writes to SD Card"));
m_connect_keyboard_checkbox = new QCheckBox(tr("Connect USB Keyboard"));

m_aspect_ratio_choice_label = new QLabel(tr("Aspect Ratio:"));
m_aspect_ratio_choice = new QComboBox();
m_aspect_ratio_choice->addItem(tr("4:3"));
m_aspect_ratio_choice->addItem(tr("16:9"));

m_system_language_choice_label = new QLabel(tr("System Language:"));
m_system_language_choice = new QComboBox();
m_system_language_choice->addItem(tr("Japanese"));
@@ -126,6 +130,12 @@ void WiiPane::CreateMisc()
m_system_language_choice->addItem(tr("Traditional Chinese"));
m_system_language_choice->addItem(tr("Korean"));

m_sound_mode_choice_label = new QLabel(tr("Sound:"));
m_sound_mode_choice = new QComboBox();
m_sound_mode_choice->addItem(tr("Mono"));
m_sound_mode_choice->addItem(tr("Stereo"));
m_sound_mode_choice->addItem(tr("Surround"));

m_pal60_mode_checkbox->setToolTip(tr("Sets the Wii display mode to 60Hz (480i) instead of 50Hz "
"(576i) for PAL games.\nMay not work for all games."));
m_screensaver_checkbox->setToolTip(tr("Dims the screen after five minutes of inactivity."));
@@ -142,6 +152,8 @@ void WiiPane::CreateMisc()
misc_settings_group_layout->addWidget(m_aspect_ratio_choice, 3, 1, 1, 1);
misc_settings_group_layout->addWidget(m_system_language_choice_label, 4, 0, 1, 1);
misc_settings_group_layout->addWidget(m_system_language_choice, 4, 1, 1, 1);
misc_settings_group_layout->addWidget(m_sound_mode_choice_label, 5, 0, 1, 1);
misc_settings_group_layout->addWidget(m_sound_mode_choice, 5, 1, 1, 1);
}

void WiiPane::CreateWhitelistedUSBPassthroughDevices()
@@ -203,6 +215,7 @@ void WiiPane::OnEmulationStateChanged(bool running)
m_pal60_mode_checkbox->setEnabled(!running);
m_system_language_choice->setEnabled(!running);
m_aspect_ratio_choice->setEnabled(!running);
m_sound_mode_choice->setEnabled(!running);
m_wiimote_motor->setEnabled(!running);
m_wiimote_speaker_volume->setEnabled(!running);
m_wiimote_ir_sensitivity->setEnabled(!running);
@@ -218,6 +231,7 @@ void WiiPane::LoadConfig()
m_connect_keyboard_checkbox->setChecked(Settings::Instance().IsUSBKeyboardConnected());
m_aspect_ratio_choice->setCurrentIndex(Config::Get(Config::SYSCONF_WIDESCREEN));
m_system_language_choice->setCurrentIndex(Config::Get(Config::SYSCONF_LANGUAGE));
m_sound_mode_choice->setCurrentIndex(Config::Get(Config::SYSCONF_SOUND_MODE));

PopulateUSBPassthroughListWidget();

@@ -244,6 +258,7 @@ void WiiPane::OnSaveConfig()
Config::SetBase<u32>(Config::SYSCONF_SPEAKER_VOLUME, m_wiimote_speaker_volume->value());
Config::SetBase<u32>(Config::SYSCONF_LANGUAGE, m_system_language_choice->currentIndex());
Config::SetBase<bool>(Config::SYSCONF_WIDESCREEN, m_aspect_ratio_choice->currentIndex());
Config::SetBase<u32>(Config::SYSCONF_SOUND_MODE, m_sound_mode_choice->currentIndex());
Config::SetBase(Config::SYSCONF_WIIMOTE_MOTOR, m_wiimote_motor->isChecked());
}

@@ -50,6 +50,8 @@ class WiiPane : public QWidget
QLabel* m_system_language_choice_label;
QComboBox* m_aspect_ratio_choice;
QLabel* m_aspect_ratio_choice_label;
QComboBox* m_sound_mode_choice;
QLabel* m_sound_mode_choice_label;

// Whitelisted USB Passthrough Devices
QListWidget* m_whitelist_usb_list;

0 comments on commit b9ae7c3

Please sign in to comment.