Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 17 additions & 10 deletions src/ui/MainMenu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2900,12 +2900,6 @@ namespace MainMenu {
}
current_recording_audio_device = recording_audio_device;
current_audio_device = audio_device;
if (fmod_speakermode != speaker_mode) {
fmod_speakermode = (FMOD_SPEAKERMODE)speaker_mode;
if (initialized) {
restartPromptRequired = true;
}
}
MainMenu::master_volume = std::min(std::max(0.f, master_volume / 100.f), 1.f);
sfxvolume = std::min(std::max(0.f, gameplay_volume / 100.f), 1.f);
sfxAmbientVolume = std::min(std::max(0.f, ambient_volume / 100.f), 1.f);
Expand All @@ -2927,6 +2921,13 @@ namespace MainMenu {
VoiceChat.activeSettings.enable_voice_receive = enable_voice_receive;
VoiceChat.activeSettings.use_custom_rolloff = use_voice_custom_rolloff;
VoiceChat.mainmenuSettings = VoiceChat.activeSettings;
if (fmod_speakermode != speaker_mode) {
fmod_speakermode = (FMOD_SPEAKERMODE)speaker_mode;
if (initialized) {
restartPromptRequired = true;
}
}
}
#endif
bindings.save();
for (int c = 0; c < MAX_SPLITSCREEN; ++c) {
Expand Down Expand Up @@ -3029,8 +3030,8 @@ namespace MainMenu {
settings.enable_voice_receive = VoiceChat.activeSettings.enable_voice_receive;
settings.use_voice_custom_rolloff = VoiceChat.activeSettings.use_custom_rolloff;
VoiceChat.mainmenuSettings = VoiceChat.activeSettings;
settings.speaker_mode = (int)fmod_speakermode;
#endif
settings.speaker_mode = (int)fmod_speakermode;
settings.master_volume = MainMenu::master_volume * 100.f;
settings.gameplay_volume = (float)sfxvolume * 100.f;
settings.ambient_volume = (float)sfxAmbientVolume * 100.f;
Expand Down Expand Up @@ -3911,8 +3912,10 @@ namespace MainMenu {
// set volume and sound driver
if (initialized) {
setAudioDevice(current_audio_device);
setRecordDevice(current_recording_audio_device);
setGlobalVolume(master_volume, musvolume, sfxvolume, sfxAmbientVolume, sfxEnvironmentVolume, sfxNotificationVolume);
#if defined USE_FMOD
setRecordDevice(current_recording_audio_device);
#endif
setGlobalVolume(master_volume, musvolume, sfxvolume, sfxAmbientVolume, sfxEnvironmentVolume, sfxNotificationVolume);
}
}

Expand Down Expand Up @@ -6767,7 +6770,7 @@ namespace MainMenu {
allSettings.preload_music_files_enabled, [](Button& button) {soundToggleSetting(button); allSettings.preload_music_files_enabled = button.isPressed(); });
#endif

#ifndef NINTENDO
#if !defined(NINTENDO) && defined(USE_FMOD)
if ( num_drivers > 0 && num_record_drivers > 0 )
{
hookSettings(*settings_subwindow,
Expand Down Expand Up @@ -25003,7 +25006,9 @@ namespace MainMenu {
{
soundCancel();
setAudioDevice(current_audio_device);
#ifdef USE_FMOD
setRecordDevice(current_recording_audio_device);
#endif
setGlobalVolume(master_volume, musvolume, sfxvolume, sfxAmbientVolume, sfxEnvironmentVolume, sfxNotificationVolume);
if (main_menu_frame) {
auto buttons = main_menu_frame->findFrame("buttons"); assert(buttons);
Expand All @@ -25028,7 +25033,9 @@ namespace MainMenu {
soundActivate();

setAudioDevice(current_audio_device);
#ifdef USE_FMOD
setRecordDevice(current_recording_audio_device);
#endif
setGlobalVolume(master_volume, musvolume, sfxvolume, sfxAmbientVolume, sfxEnvironmentVolume, sfxNotificationVolume);
if ( main_menu_frame ) {
auto buttons = main_menu_frame->findFrame("buttons"); assert(buttons);
Expand Down