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 <kode54@gmail.com>
CQTexperiment
Christopher Snowhill 2022-02-14 20:19:03 -08:00
parent b8a98e301e
commit efea2e33d8
1 changed files with 6 additions and 1 deletions

View File

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