Merge pull request #3 from skidau/GBA-Sound-Filter

Fixed the GBA sound filter options which were not getting applied.
This commit is contained in:
skidau 2015-06-23 22:11:12 +10:00
commit 31daa5d38e
3 changed files with 8 additions and 2 deletions

View File

@ -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();
}

View File

@ -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),

View File

@ -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)