From 96166f9e8d99289e1f92ab6b45d73d9722b7c0c9 Mon Sep 17 00:00:00 2001 From: Christopher Snowhill Date: Mon, 17 Jan 2022 23:19:18 -0800 Subject: [PATCH] Equalizer: Hide stock control's 'Flatten EQ' button --- Window/AUPlayerView.m | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/Window/AUPlayerView.m b/Window/AUPlayerView.m index 3139a2f84..0de81d7d1 100644 --- a/Window/AUPlayerView.m +++ b/Window/AUPlayerView.m @@ -14,6 +14,8 @@ #import "json.h" +#import "Logging.h" + static NSString * equalizerGenre = @""; static const NSString * equalizerDefaultGenre = @"Flat"; static NSArray * equalizer_presets_processed = nil; @@ -572,7 +574,27 @@ void equalizerApplyPreset(AudioUnit au, NSDictionary * preset) { AUListenerAddParameter(listenerRef, (__bridge void *)self, ¶m); [[NSUserDefaultsController sharedUserDefaultsController] addObserver:self forKeyPath:@"values.GraphicEQpreset" options:0 context:nil]; - + + // Time to hack the auView + NSButton * flattenButton = nil; + NSPopUpButton * bandsButton = nil; + NSArray * views = [auView subviews]; + + for (NSView * view in views) { + if ([view isKindOfClass:[NSPopUpButton class]]) { + NSPopUpButton * popupButton = (NSPopUpButton *) view; + bandsButton = popupButton; + } + else if ([view isKindOfClass:[NSButton class]]) { + NSButton * button = (NSButton *) view; + flattenButton = button; + } + } + + [flattenButton setHidden:YES]; + + // Hacking done, showing window + if (front) { [self orderFront:self];