diff options
| author | 2023-03-11 20:04:36 -0600 | |
|---|---|---|
| committer | 2023-03-11 20:04:36 -0600 | |
| commit | e090a1c6bdcfc7515c66fc49b0028b161dbe80eb (patch) | |
| tree | f6ded70b81330bb1b11ece568f03fde6bf0e0b8a | |
| parent | yuzu: Remove console id setting (diff) | |
| download | yuzu-e090a1c6bdcfc7515c66fc49b0028b161dbe80eb.tar.gz yuzu-e090a1c6bdcfc7515c66fc49b0028b161dbe80eb.tar.xz yuzu-e090a1c6bdcfc7515c66fc49b0028b161dbe80eb.zip | |
yuzu: Move audio settings to audio section
| -rw-r--r-- | src/yuzu/configuration/configure_audio.cpp | 13 | ||||
| -rw-r--r-- | src/yuzu/configuration/configure_audio.ui | 45 | ||||
| -rw-r--r-- | src/yuzu/configuration/configure_general.cpp | 2 | ||||
| -rw-r--r-- | src/yuzu/configuration/configure_general.ui | 7 | ||||
| -rw-r--r-- | src/yuzu/configuration/configure_system.cpp | 8 | ||||
| -rw-r--r-- | src/yuzu/configuration/configure_system.ui | 26 |
6 files changed, 56 insertions, 45 deletions
diff --git a/src/yuzu/configuration/configure_audio.cpp b/src/yuzu/configuration/configure_audio.cpp index 70cc6f84b..4bec51260 100644 --- a/src/yuzu/configuration/configure_audio.cpp +++ b/src/yuzu/configuration/configure_audio.cpp | |||
| @@ -10,6 +10,7 @@ | |||
| 10 | #include "ui_configure_audio.h" | 10 | #include "ui_configure_audio.h" |
| 11 | #include "yuzu/configuration/configuration_shared.h" | 11 | #include "yuzu/configuration/configuration_shared.h" |
| 12 | #include "yuzu/configuration/configure_audio.h" | 12 | #include "yuzu/configuration/configure_audio.h" |
| 13 | #include "yuzu/uisettings.h" | ||
| 13 | 14 | ||
| 14 | ConfigureAudio::ConfigureAudio(const Core::System& system_, QWidget* parent) | 15 | ConfigureAudio::ConfigureAudio(const Core::System& system_, QWidget* parent) |
| 15 | : QWidget(parent), ui(std::make_unique<Ui::ConfigureAudio>()), system{system_} { | 16 | : QWidget(parent), ui(std::make_unique<Ui::ConfigureAudio>()), system{system_} { |
| @@ -47,17 +48,22 @@ void ConfigureAudio::SetConfiguration() { | |||
| 47 | 48 | ||
| 48 | const auto volume_value = static_cast<int>(Settings::values.volume.GetValue()); | 49 | const auto volume_value = static_cast<int>(Settings::values.volume.GetValue()); |
| 49 | ui->volume_slider->setValue(volume_value); | 50 | ui->volume_slider->setValue(volume_value); |
| 51 | ui->toggle_background_mute->setChecked(UISettings::values.mute_when_in_background.GetValue()); | ||
| 50 | 52 | ||
| 51 | if (!Settings::IsConfiguringGlobal()) { | 53 | if (!Settings::IsConfiguringGlobal()) { |
| 52 | if (Settings::values.volume.UsingGlobal()) { | 54 | if (Settings::values.volume.UsingGlobal()) { |
| 53 | ui->volume_combo_box->setCurrentIndex(0); | 55 | ui->volume_combo_box->setCurrentIndex(0); |
| 54 | ui->volume_slider->setEnabled(false); | 56 | ui->volume_slider->setEnabled(false); |
| 57 | ui->combo_sound->setCurrentIndex(Settings::values.sound_index.GetValue()); | ||
| 55 | } else { | 58 | } else { |
| 56 | ui->volume_combo_box->setCurrentIndex(1); | 59 | ui->volume_combo_box->setCurrentIndex(1); |
| 57 | ui->volume_slider->setEnabled(true); | 60 | ui->volume_slider->setEnabled(true); |
| 61 | ConfigurationShared::SetPerGameSetting(ui->combo_sound, &Settings::values.sound_index); | ||
| 58 | } | 62 | } |
| 59 | ConfigurationShared::SetHighlight(ui->volume_layout, | 63 | ConfigurationShared::SetHighlight(ui->volume_layout, |
| 60 | !Settings::values.volume.UsingGlobal()); | 64 | !Settings::values.volume.UsingGlobal()); |
| 65 | ConfigurationShared::SetHighlight(ui->mode_label, | ||
| 66 | !Settings::values.sound_index.UsingGlobal()); | ||
| 61 | } | 67 | } |
| 62 | SetVolumeIndicatorText(ui->volume_slider->sliderPosition()); | 68 | SetVolumeIndicatorText(ui->volume_slider->sliderPosition()); |
| 63 | } | 69 | } |
| @@ -109,6 +115,8 @@ void ConfigureAudio::SetVolumeIndicatorText(int percentage) { | |||
| 109 | } | 115 | } |
| 110 | 116 | ||
| 111 | void ConfigureAudio::ApplyConfiguration() { | 117 | void ConfigureAudio::ApplyConfiguration() { |
| 118 | ConfigurationShared::ApplyPerGameSetting(&Settings::values.sound_index, ui->combo_sound); | ||
| 119 | |||
| 112 | if (Settings::IsConfiguringGlobal()) { | 120 | if (Settings::IsConfiguringGlobal()) { |
| 113 | Settings::values.sink_id = | 121 | Settings::values.sink_id = |
| 114 | ui->sink_combo_box->itemText(ui->sink_combo_box->currentIndex()).toStdString(); | 122 | ui->sink_combo_box->itemText(ui->sink_combo_box->currentIndex()).toStdString(); |
| @@ -116,6 +124,7 @@ void ConfigureAudio::ApplyConfiguration() { | |||
| 116 | ui->output_combo_box->itemText(ui->output_combo_box->currentIndex()).toStdString()); | 124 | ui->output_combo_box->itemText(ui->output_combo_box->currentIndex()).toStdString()); |
| 117 | Settings::values.audio_input_device_id.SetValue( | 125 | Settings::values.audio_input_device_id.SetValue( |
| 118 | ui->input_combo_box->itemText(ui->input_combo_box->currentIndex()).toStdString()); | 126 | ui->input_combo_box->itemText(ui->input_combo_box->currentIndex()).toStdString()); |
| 127 | UISettings::values.mute_when_in_background = ui->toggle_background_mute->isChecked(); | ||
| 119 | 128 | ||
| 120 | // Guard if during game and set to game-specific value | 129 | // Guard if during game and set to game-specific value |
| 121 | if (Settings::values.volume.UsingGlobal()) { | 130 | if (Settings::values.volume.UsingGlobal()) { |
| @@ -174,10 +183,14 @@ void ConfigureAudio::RetranslateUI() { | |||
| 174 | void ConfigureAudio::SetupPerGameUI() { | 183 | void ConfigureAudio::SetupPerGameUI() { |
| 175 | if (Settings::IsConfiguringGlobal()) { | 184 | if (Settings::IsConfiguringGlobal()) { |
| 176 | ui->volume_slider->setEnabled(Settings::values.volume.UsingGlobal()); | 185 | ui->volume_slider->setEnabled(Settings::values.volume.UsingGlobal()); |
| 186 | // ui->combo_sound->setEnabled(Settings::values.sound_index.UsingGlobal()); | ||
| 177 | 187 | ||
| 178 | return; | 188 | return; |
| 179 | } | 189 | } |
| 180 | 190 | ||
| 191 | // ConfigurationShared::SetColoredComboBox(ui->combo_sound, ui->label_sound, | ||
| 192 | // Settings::values.sound_index.GetValue(true)); | ||
| 193 | |||
| 181 | connect(ui->volume_combo_box, qOverload<int>(&QComboBox::activated), this, [this](int index) { | 194 | connect(ui->volume_combo_box, qOverload<int>(&QComboBox::activated), this, [this](int index) { |
| 182 | ui->volume_slider->setEnabled(index == 1); | 195 | ui->volume_slider->setEnabled(index == 1); |
| 183 | ConfigurationShared::SetHighlight(ui->volume_layout, index == 1); | 196 | ConfigurationShared::SetHighlight(ui->volume_layout, index == 1); |
diff --git a/src/yuzu/configuration/configure_audio.ui b/src/yuzu/configuration/configure_audio.ui index 6034d8581..bcd5d8c2b 100644 --- a/src/yuzu/configuration/configure_audio.ui +++ b/src/yuzu/configuration/configure_audio.ui | |||
| @@ -39,7 +39,7 @@ | |||
| 39 | <item> | 39 | <item> |
| 40 | <widget class="QLabel" name="output_label"> | 40 | <widget class="QLabel" name="output_label"> |
| 41 | <property name="text"> | 41 | <property name="text"> |
| 42 | <string>Output Device</string> | 42 | <string>Output Device:</string> |
| 43 | </property> | 43 | </property> |
| 44 | </widget> | 44 | </widget> |
| 45 | </item> | 45 | </item> |
| @@ -53,7 +53,7 @@ | |||
| 53 | <item> | 53 | <item> |
| 54 | <widget class="QLabel" name="input_label"> | 54 | <widget class="QLabel" name="input_label"> |
| 55 | <property name="text"> | 55 | <property name="text"> |
| 56 | <string>Input Device</string> | 56 | <string>Input Device:</string> |
| 57 | </property> | 57 | </property> |
| 58 | </widget> | 58 | </widget> |
| 59 | </item> | 59 | </item> |
| @@ -62,6 +62,36 @@ | |||
| 62 | </item> | 62 | </item> |
| 63 | </layout> | 63 | </layout> |
| 64 | </item> | 64 | </item> |
| 65 | <item> | ||
| 66 | <layout class="QHBoxLayout" name="mode_layout"> | ||
| 67 | <item> | ||
| 68 | <widget class="QLabel" name="mode_label"> | ||
| 69 | <property name="text"> | ||
| 70 | <string>Sound Ouput Mode:</string> | ||
| 71 | </property> | ||
| 72 | </widget> | ||
| 73 | </item> | ||
| 74 | <item> | ||
| 75 | <widget class="QComboBox" name="combo_sound"> | ||
| 76 | <item> | ||
| 77 | <property name="text"> | ||
| 78 | <string>Mono</string> | ||
| 79 | </property> | ||
| 80 | </item> | ||
| 81 | <item> | ||
| 82 | <property name="text"> | ||
| 83 | <string>Stereo</string> | ||
| 84 | </property> | ||
| 85 | </item> | ||
| 86 | <item> | ||
| 87 | <property name="text"> | ||
| 88 | <string>Surround</string> | ||
| 89 | </property> | ||
| 90 | </item> | ||
| 91 | </widget> | ||
| 92 | </item> | ||
| 93 | </layout> | ||
| 94 | </item> | ||
| 65 | <item> | 95 | <item> |
| 66 | <widget class="QWidget" name="volume_layout" native="true"> | 96 | <widget class="QWidget" name="volume_layout" native="true"> |
| 67 | <layout class="QHBoxLayout" name="horizontalLayout_2"> | 97 | <layout class="QHBoxLayout" name="horizontalLayout_2"> |
| @@ -149,6 +179,17 @@ | |||
| 149 | </layout> | 179 | </layout> |
| 150 | </widget> | 180 | </widget> |
| 151 | </item> | 181 | </item> |
| 182 | <item> | ||
| 183 | <layout class="QHBoxLayout" name="mute_layout"> | ||
| 184 | <item> | ||
| 185 | <widget class="QCheckBox" name="toggle_background_mute"> | ||
| 186 | <property name="text"> | ||
| 187 | <string>Mute audio when in background</string> | ||
| 188 | </property> | ||
| 189 | </widget> | ||
| 190 | </item> | ||
| 191 | </layout> | ||
| 192 | </item> | ||
| 152 | </layout> | 193 | </layout> |
| 153 | </widget> | 194 | </widget> |
| 154 | </item> | 195 | </item> |
diff --git a/src/yuzu/configuration/configure_general.cpp b/src/yuzu/configuration/configure_general.cpp index 7ade01ba6..207bcdc4d 100644 --- a/src/yuzu/configuration/configure_general.cpp +++ b/src/yuzu/configuration/configure_general.cpp | |||
| @@ -42,7 +42,6 @@ void ConfigureGeneral::SetConfiguration() { | |||
| 42 | ui->toggle_check_exit->setChecked(UISettings::values.confirm_before_closing.GetValue()); | 42 | ui->toggle_check_exit->setChecked(UISettings::values.confirm_before_closing.GetValue()); |
| 43 | ui->toggle_user_on_boot->setChecked(UISettings::values.select_user_on_boot.GetValue()); | 43 | ui->toggle_user_on_boot->setChecked(UISettings::values.select_user_on_boot.GetValue()); |
| 44 | ui->toggle_background_pause->setChecked(UISettings::values.pause_when_in_background.GetValue()); | 44 | ui->toggle_background_pause->setChecked(UISettings::values.pause_when_in_background.GetValue()); |
| 45 | ui->toggle_background_mute->setChecked(UISettings::values.mute_when_in_background.GetValue()); | ||
| 46 | ui->toggle_hide_mouse->setChecked(UISettings::values.hide_mouse.GetValue()); | 45 | ui->toggle_hide_mouse->setChecked(UISettings::values.hide_mouse.GetValue()); |
| 47 | 46 | ||
| 48 | ui->toggle_speed_limit->setChecked(Settings::values.use_speed_limit.GetValue()); | 47 | ui->toggle_speed_limit->setChecked(Settings::values.use_speed_limit.GetValue()); |
| @@ -88,7 +87,6 @@ void ConfigureGeneral::ApplyConfiguration() { | |||
| 88 | UISettings::values.confirm_before_closing = ui->toggle_check_exit->isChecked(); | 87 | UISettings::values.confirm_before_closing = ui->toggle_check_exit->isChecked(); |
| 89 | UISettings::values.select_user_on_boot = ui->toggle_user_on_boot->isChecked(); | 88 | UISettings::values.select_user_on_boot = ui->toggle_user_on_boot->isChecked(); |
| 90 | UISettings::values.pause_when_in_background = ui->toggle_background_pause->isChecked(); | 89 | UISettings::values.pause_when_in_background = ui->toggle_background_pause->isChecked(); |
| 91 | UISettings::values.mute_when_in_background = ui->toggle_background_mute->isChecked(); | ||
| 92 | UISettings::values.hide_mouse = ui->toggle_hide_mouse->isChecked(); | 90 | UISettings::values.hide_mouse = ui->toggle_hide_mouse->isChecked(); |
| 93 | 91 | ||
| 94 | // Guard if during game and set to game-specific value | 92 | // Guard if during game and set to game-specific value |
diff --git a/src/yuzu/configuration/configure_general.ui b/src/yuzu/configuration/configure_general.ui index 5b90b1109..6cd79673c 100644 --- a/src/yuzu/configuration/configure_general.ui +++ b/src/yuzu/configuration/configure_general.ui | |||
| @@ -90,13 +90,6 @@ | |||
| 90 | </widget> | 90 | </widget> |
| 91 | </item> | 91 | </item> |
| 92 | <item> | 92 | <item> |
| 93 | <widget class="QCheckBox" name="toggle_background_mute"> | ||
| 94 | <property name="text"> | ||
| 95 | <string>Mute audio when in background</string> | ||
| 96 | </property> | ||
| 97 | </widget> | ||
| 98 | </item> | ||
| 99 | <item> | ||
| 100 | <widget class="QCheckBox" name="toggle_hide_mouse"> | 93 | <widget class="QCheckBox" name="toggle_hide_mouse"> |
| 101 | <property name="text"> | 94 | <property name="text"> |
| 102 | <string>Hide mouse on inactivity</string> | 95 | <string>Hide mouse on inactivity</string> |
diff --git a/src/yuzu/configuration/configure_system.cpp b/src/yuzu/configuration/configure_system.cpp index b01ffdbac..6af34f793 100644 --- a/src/yuzu/configuration/configure_system.cpp +++ b/src/yuzu/configuration/configure_system.cpp | |||
| @@ -116,14 +116,12 @@ void ConfigureSystem::SetConfiguration() { | |||
| 116 | ui->combo_language->setCurrentIndex(Settings::values.language_index.GetValue()); | 116 | ui->combo_language->setCurrentIndex(Settings::values.language_index.GetValue()); |
| 117 | ui->combo_region->setCurrentIndex(Settings::values.region_index.GetValue()); | 117 | ui->combo_region->setCurrentIndex(Settings::values.region_index.GetValue()); |
| 118 | ui->combo_time_zone->setCurrentIndex(Settings::values.time_zone_index.GetValue()); | 118 | ui->combo_time_zone->setCurrentIndex(Settings::values.time_zone_index.GetValue()); |
| 119 | ui->combo_sound->setCurrentIndex(Settings::values.sound_index.GetValue()); | ||
| 120 | } else { | 119 | } else { |
| 121 | ConfigurationShared::SetPerGameSetting(ui->combo_language, | 120 | ConfigurationShared::SetPerGameSetting(ui->combo_language, |
| 122 | &Settings::values.language_index); | 121 | &Settings::values.language_index); |
| 123 | ConfigurationShared::SetPerGameSetting(ui->combo_region, &Settings::values.region_index); | 122 | ConfigurationShared::SetPerGameSetting(ui->combo_region, &Settings::values.region_index); |
| 124 | ConfigurationShared::SetPerGameSetting(ui->combo_time_zone, | 123 | ConfigurationShared::SetPerGameSetting(ui->combo_time_zone, |
| 125 | &Settings::values.time_zone_index); | 124 | &Settings::values.time_zone_index); |
| 126 | ConfigurationShared::SetPerGameSetting(ui->combo_sound, &Settings::values.sound_index); | ||
| 127 | 125 | ||
| 128 | ConfigurationShared::SetHighlight(ui->label_language, | 126 | ConfigurationShared::SetHighlight(ui->label_language, |
| 129 | !Settings::values.language_index.UsingGlobal()); | 127 | !Settings::values.language_index.UsingGlobal()); |
| @@ -131,8 +129,6 @@ void ConfigureSystem::SetConfiguration() { | |||
| 131 | !Settings::values.region_index.UsingGlobal()); | 129 | !Settings::values.region_index.UsingGlobal()); |
| 132 | ConfigurationShared::SetHighlight(ui->label_timezone, | 130 | ConfigurationShared::SetHighlight(ui->label_timezone, |
| 133 | !Settings::values.time_zone_index.UsingGlobal()); | 131 | !Settings::values.time_zone_index.UsingGlobal()); |
| 134 | ConfigurationShared::SetHighlight(ui->label_sound, | ||
| 135 | !Settings::values.sound_index.UsingGlobal()); | ||
| 136 | } | 132 | } |
| 137 | } | 133 | } |
| 138 | 134 | ||
| @@ -164,7 +160,6 @@ void ConfigureSystem::ApplyConfiguration() { | |||
| 164 | ConfigurationShared::ApplyPerGameSetting(&Settings::values.region_index, ui->combo_region); | 160 | ConfigurationShared::ApplyPerGameSetting(&Settings::values.region_index, ui->combo_region); |
| 165 | ConfigurationShared::ApplyPerGameSetting(&Settings::values.time_zone_index, | 161 | ConfigurationShared::ApplyPerGameSetting(&Settings::values.time_zone_index, |
| 166 | ui->combo_time_zone); | 162 | ui->combo_time_zone); |
| 167 | ConfigurationShared::ApplyPerGameSetting(&Settings::values.sound_index, ui->combo_sound); | ||
| 168 | 163 | ||
| 169 | if (Settings::IsConfiguringGlobal()) { | 164 | if (Settings::IsConfiguringGlobal()) { |
| 170 | // Guard if during game and set to game-specific value | 165 | // Guard if during game and set to game-specific value |
| @@ -202,7 +197,6 @@ void ConfigureSystem::SetupPerGameUI() { | |||
| 202 | ui->combo_language->setEnabled(Settings::values.language_index.UsingGlobal()); | 197 | ui->combo_language->setEnabled(Settings::values.language_index.UsingGlobal()); |
| 203 | ui->combo_region->setEnabled(Settings::values.region_index.UsingGlobal()); | 198 | ui->combo_region->setEnabled(Settings::values.region_index.UsingGlobal()); |
| 204 | ui->combo_time_zone->setEnabled(Settings::values.time_zone_index.UsingGlobal()); | 199 | ui->combo_time_zone->setEnabled(Settings::values.time_zone_index.UsingGlobal()); |
| 205 | ui->combo_sound->setEnabled(Settings::values.sound_index.UsingGlobal()); | ||
| 206 | ui->rng_seed_checkbox->setEnabled(Settings::values.rng_seed.UsingGlobal()); | 200 | ui->rng_seed_checkbox->setEnabled(Settings::values.rng_seed.UsingGlobal()); |
| 207 | ui->rng_seed_edit->setEnabled(Settings::values.rng_seed.UsingGlobal()); | 201 | ui->rng_seed_edit->setEnabled(Settings::values.rng_seed.UsingGlobal()); |
| 208 | 202 | ||
| @@ -215,8 +209,6 @@ void ConfigureSystem::SetupPerGameUI() { | |||
| 215 | Settings::values.region_index.GetValue(true)); | 209 | Settings::values.region_index.GetValue(true)); |
| 216 | ConfigurationShared::SetColoredComboBox(ui->combo_time_zone, ui->label_timezone, | 210 | ConfigurationShared::SetColoredComboBox(ui->combo_time_zone, ui->label_timezone, |
| 217 | Settings::values.time_zone_index.GetValue(true)); | 211 | Settings::values.time_zone_index.GetValue(true)); |
| 218 | ConfigurationShared::SetColoredComboBox(ui->combo_sound, ui->label_sound, | ||
| 219 | Settings::values.sound_index.GetValue(true)); | ||
| 220 | 212 | ||
| 221 | ConfigurationShared::SetColoredTristate( | 213 | ConfigurationShared::SetColoredTristate( |
| 222 | ui->rng_seed_checkbox, Settings::values.rng_seed.UsingGlobal(), | 214 | ui->rng_seed_checkbox, Settings::values.rng_seed.UsingGlobal(), |
diff --git a/src/yuzu/configuration/configure_system.ui b/src/yuzu/configuration/configure_system.ui index 254a44147..9e7bc3b93 100644 --- a/src/yuzu/configuration/configure_system.ui +++ b/src/yuzu/configuration/configure_system.ui | |||
| @@ -439,32 +439,6 @@ | |||
| 439 | </property> | 439 | </property> |
| 440 | </widget> | 440 | </widget> |
| 441 | </item> | 441 | </item> |
| 442 | <item row="3" column="1"> | ||
| 443 | <widget class="QComboBox" name="combo_sound"> | ||
| 444 | <item> | ||
| 445 | <property name="text"> | ||
| 446 | <string>Mono</string> | ||
| 447 | </property> | ||
| 448 | </item> | ||
| 449 | <item> | ||
| 450 | <property name="text"> | ||
| 451 | <string>Stereo</string> | ||
| 452 | </property> | ||
| 453 | </item> | ||
| 454 | <item> | ||
| 455 | <property name="text"> | ||
| 456 | <string>Surround</string> | ||
| 457 | </property> | ||
| 458 | </item> | ||
| 459 | </widget> | ||
| 460 | </item> | ||
| 461 | <item row="3" column="0"> | ||
| 462 | <widget class="QLabel" name="label_sound"> | ||
| 463 | <property name="text"> | ||
| 464 | <string>Sound output mode</string> | ||
| 465 | </property> | ||
| 466 | </widget> | ||
| 467 | </item> | ||
| 468 | <item row="4" column="1"> | 442 | <item row="4" column="1"> |
| 469 | <widget class="QDateTimeEdit" name="custom_rtc_edit"> | 443 | <widget class="QDateTimeEdit" name="custom_rtc_edit"> |
| 470 | <property name="minimumDate"> | 444 | <property name="minimumDate"> |