From 9f463f3850d2f4a73fd6cf909bc7d3add6ed46e7 Mon Sep 17 00:00:00 2001 From: skidau Date: Tue, 23 Jun 2015 22:10:07 +1000 Subject: [PATCH] Fixed the GBA sound filter options which were not getting applied. --- src/wx/cmdevents.cpp | 2 +- src/wx/opts.cpp | 2 +- src/wx/panel.cpp | 6 ++++++ 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/wx/cmdevents.cpp b/src/wx/cmdevents.cpp index 17d6ba39..bce9dc1f 100644 --- a/src/wx/cmdevents.cpp +++ b/src/wx/cmdevents.cpp @@ -2609,7 +2609,7 @@ EVT_HANDLER(PrintSnap, "Automatically save printouts as screen captures with -pr EVT_HANDLER(GBASoundInterpolation, "GBA sound interpolation") { - GetMenuOptionBool("GBASoundInterpolation", gopts.soundInterpolation); + GetMenuOptionBool("GBASoundInterpolation", soundInterpolation); update_opts(); } diff --git a/src/wx/opts.cpp b/src/wx/opts.cpp index 63ebe1f3..c683e74d 100644 --- a/src/wx/opts.cpp +++ b/src/wx/opts.cpp @@ -247,7 +247,7 @@ opt_desc opts[] = INTOPT("Sound/Buffers", "", wxTRANSLATE("Number of sound buffers"), gopts.audio_buffers, 2, 10), INTOPT("Sound/Enable", "", wxTRANSLATE("Bit mask of sound channels to enable"), gopts.sound_en, 0, 0x30f), INTOPT("Sound/GBAFiltering", "", wxTRANSLATE("GBA sound filtering (%)"), gopts.gba_sound_filter, 0, 100), - BOOLOPT("Sound/GBAInterpolation", "GBASoundInterpolation", wxTRANSLATE("GBA sound interpolation"), gopts.soundInterpolation), + BOOLOPT("Sound/GBAInterpolation", "GBASoundInterpolation", wxTRANSLATE("GBA sound interpolation"), soundInterpolation), BOOLOPT("Sound/GBDeclicking", "GBDeclicking", wxTRANSLATE("GB sound declicking"), gopts.gb_declick), INTOPT("Sound/GBEcho", "", wxTRANSLATE("GB echo effect (%)"), gopts.gb_echo, 0, 100), BOOLOPT("Sound/GBEnableEffects", "GBEnhanceSound", wxTRANSLATE("Enable GB sound effects"), gopts.gb_effects_config_enabled), diff --git a/src/wx/panel.cpp b/src/wx/panel.cpp index c3457d8a..4587874a 100644 --- a/src/wx/panel.cpp +++ b/src/wx/panel.cpp @@ -283,12 +283,18 @@ void GameArea::LoadGame(const wxString &name) doMirroring(mirroringEnable); // start sound; this must happen before CPU stuff + gb_effects_config.echo = (float)gopts.gb_echo / 100.0; + gb_effects_config.stereo = (float)gopts.gb_stereo / 100.0; + gbSoundSetDeclicking(gopts.gb_declick); soundInit(); soundSetThrottle(throttle); soundSetEnable(gopts.sound_en); + gbSoundSetSampleRate(!gopts.sound_qual ? 48000 : + 44100 / (1 << (gopts.sound_qual - 1))); soundSetSampleRate(!gopts.sound_qual ? 48000 : 44100 / (1 << (gopts.sound_qual - 1))); soundSetVolume((float)gopts.sound_vol / 100.0); + soundFiltering = (float)gopts.gba_sound_filter / 100.0f; CPUInit(gopts.gba_bios.mb_fn_str(), useBiosFileGBA); if (useBiosFileGBA && !useBios)