From efea2e33d84de46b8d7b81687804c2bec2291140 Mon Sep 17 00:00:00 2001 From: Christopher Snowhill Date: Mon, 14 Feb 2022 20:19:03 -0800 Subject: [PATCH] Equalizer: Correctly handle flatten vs. custom Flatten EQ button should remember that the preset is set to "Flat", and drawing on the equalizer or changing sliders should remember that the preset is on "Custom". Signed-off-by: Christopher Snowhill --- Equalizer/EqualizerWindowController.m | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Equalizer/EqualizerWindowController.m b/Equalizer/EqualizerWindowController.m index 282cb7916..9d3cdfb73 100644 --- a/Equalizer/EqualizerWindowController.m +++ b/Equalizer/EqualizerWindowController.m @@ -364,7 +364,11 @@ void equalizerApplyPreset(AudioUnit au, const NSDictionary *preset) { } - (IBAction)flattenEQ:(id)sender { - [presetSelector selectItemWithTitle:@"Flat"]; + NSDictionary *preset = [equalizer_presets_by_name objectForKey:equalizerDefaultGenre]; + NSInteger index = [equalizer_presets_processed indexOfObject:preset]; + + [presetSelector selectItemAtIndex:index]; + [[NSUserDefaults standardUserDefaults] setInteger:index forKey:@"GraphicEQpreset"]; [self changePreset:presetSelector]; } @@ -464,6 +468,7 @@ void equalizerApplyPreset(AudioUnit au, const NSDictionary *preset) { NSInteger count = [equalizer_presets_processed count]; if([[NSUserDefaults standardUserDefaults] integerForKey:@"GraphicEQpreset"] != count) { [[NSUserDefaults standardUserDefaults] setInteger:count forKey:@"GraphicEQpreset"]; + [presetSelector selectItemAtIndex:count]; } if(tag == 0) {