Commit 13bedc70 authored by David Fuhrmann's avatar David Fuhrmann

macosx: deactivate compressor controls if compressor is disabled

parent 9d676f05
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -51,6 +51,7 @@ ...@@ -51,6 +51,7 @@
IBOutlet id o_eq_preamp_sld; IBOutlet id o_eq_preamp_sld;
/* Compressor */ /* Compressor */
IBOutlet id o_comp_view;
IBOutlet id o_comp_enable_ckb; IBOutlet id o_comp_enable_ckb;
IBOutlet id o_comp_reset_btn; IBOutlet id o_comp_reset_btn;
IBOutlet id o_comp_band1_sld; IBOutlet id o_comp_band1_sld;
......
...@@ -802,14 +802,17 @@ static bool GetEqualizerStatus(intf_thread_t *p_custom_intf, ...@@ -802,14 +802,17 @@ static bool GetEqualizerStatus(intf_thread_t *p_custom_intf,
#pragma mark Compressor #pragma mark Compressor
- (void)resetCompressor - (void)resetCompressor
{ {
BOOL b_enable_comp = NO;
char *psz_afilters; char *psz_afilters;
psz_afilters = config_GetPsz(p_intf, "audio-filter"); psz_afilters = config_GetPsz(p_intf, "audio-filter");
if (psz_afilters) { if (psz_afilters) {
b_enable_comp = strstr(psz_afilters, "compressor") != NULL;
[o_comp_enable_ckb setState: (NSInteger)strstr(psz_afilters, "compressor") ]; [o_comp_enable_ckb setState: (NSInteger)strstr(psz_afilters, "compressor") ];
free(psz_afilters); free(psz_afilters);
} }
else
[o_comp_enable_ckb setState: NSOffState]; [o_comp_view enableSubviews:b_enable_comp];
[o_comp_enable_ckb setState:(b_enable_comp ? NSOnState : NSOffState)];
[o_comp_band1_sld setFloatValue: config_GetFloat(p_intf, "compressor-rms-peak")]; [o_comp_band1_sld setFloatValue: config_GetFloat(p_intf, "compressor-rms-peak")];
[o_comp_band1_fld setStringValue:[NSString localizedStringWithFormat:@"%1.1f", [o_comp_band1_sld floatValue]]]; [o_comp_band1_fld setStringValue:[NSString localizedStringWithFormat:@"%1.1f", [o_comp_band1_sld floatValue]]];
...@@ -853,6 +856,7 @@ static bool GetEqualizerStatus(intf_thread_t *p_custom_intf, ...@@ -853,6 +856,7 @@ static bool GetEqualizerStatus(intf_thread_t *p_custom_intf,
- (IBAction)comp_enable:(id)sender - (IBAction)comp_enable:(id)sender
{ {
[o_comp_view enableSubviews:[sender state]];
[self setAudioFilter:"compressor" on:[sender state]]; [self setAudioFilter:"compressor" on:[sender state]];
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment