1 /*****************************************************************************
2 * AudioEffects.m: MacOS X interface module
3 *****************************************************************************
4 * Copyright (C) 2004-2011 VLC authors and VideoLAN
7 * Authors: Felix Paul Kühne <fkuehne -at- videolan -dot- org>
8 * Jérôme Decoodt <djc@videolan.org>
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 2 of the License, or
13 * (at your option) any later version.
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, write to the Free Software
22 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
23 *****************************************************************************/
30 #import "AudioEffects.h"
31 #import "../../audio_filter/equalizer_presets.h"
32 #import "CompatibilityFixes.h"
34 #import <vlc_common.h>
35 #import <vlc_aout_intf.h>
40 #pragma mark Initialization & Generic code
42 @implementation VLCAudioEffects
43 static VLCAudioEffects *_o_sharedInstance = nil;
45 + (VLCAudioEffects *)sharedInstance
47 return _o_sharedInstance ? _o_sharedInstance : [[self alloc] init];
52 if (_o_sharedInstance) {
56 _o_sharedInstance = [super init];
59 return _o_sharedInstance;
64 /* setup the user's language */
66 [o_eq_enable_ckb setTitle:_NS("Enable")];
67 [o_eq_twopass_ckb setTitle:_NS("2 Pass")];
68 [o_eq_preamp_lbl setStringValue:_NS("Preamp")];
69 [o_eq_presets_popup removeAllItems];
70 for( int i = 0; i < NB_PRESETS ; i++ )
72 [o_eq_presets_popup addItemWithTitle: _NS(preset_list_text[i])];
73 [[o_eq_presets_popup lastItem] setTag: i];
77 [o_comp_enable_ckb setTitle:_NS("Enable dynamic range compressor")];
78 [o_comp_reset_btn setTitle:_NS("Reset")];
79 [o_comp_band1_lbl setStringValue:_NS("RMS/peak")];;
80 [o_comp_band2_lbl setStringValue:_NS("Attack")];
81 [o_comp_band3_lbl setStringValue:_NS("Release")];
82 [o_comp_band4_lbl setStringValue:_NS("Threshold")];
83 [o_comp_band5_lbl setStringValue:_NS("Ratio")];
84 [o_comp_band6_lbl setStringValue:_NS("Knee radius")];
85 [o_comp_band7_lbl setStringValue:_NS("Makeup gain")];
88 [o_spat_enable_ckb setTitle:_NS("Enable Spatializer")];
89 [o_spat_reset_btn setTitle:_NS("Reset")];
90 [o_spat_band1_lbl setStringValue:_NS("Size")];
91 [o_spat_band2_lbl setStringValue:_NS("Width")];
92 [o_spat_band3_lbl setStringValue:_NS("Wet")];
93 [o_spat_band4_lbl setStringValue:_NS("Dry")];
94 [o_spat_band5_lbl setStringValue:_NS("Damp")];
97 [o_filter_headPhone_ckb setTitle:_NS("Headphone virtualization")];
98 [o_filter_normLevel_ckb setTitle:_NS("Volume normalization")];
99 [o_filter_normLevel_lbl setStringValue:_NS("Maximum level")];
102 [[o_tableView tabViewItemAtIndex:[o_tableView indexOfTabViewItemWithIdentifier:@"equalizer"]] setLabel:_NS("Equalizer")];
103 [[o_tableView tabViewItemAtIndex:[o_tableView indexOfTabViewItemWithIdentifier:@"compressor"]] setLabel:_NS("Compressor")];
104 [[o_tableView tabViewItemAtIndex:[o_tableView indexOfTabViewItemWithIdentifier:@"spatializer"]] setLabel:_NS("Spatializer")];
105 [[o_tableView tabViewItemAtIndex:[o_tableView indexOfTabViewItemWithIdentifier:@"filter"]] setLabel:_NS("Filter")];
106 [o_window setTitle:_NS("Audio Effects")];
107 [o_window setExcludedFromWindowsMenu:YES];
109 [o_window setCollectionBehavior: NSWindowCollectionBehaviorFullScreenAuxiliary];
111 [self setupEqualizer];
112 [self resetCompressor];
113 [self resetSpatializer];
114 [self resetAudioFilters];
117 - (IBAction)toggleWindow:(id)sender
119 if( [o_window isVisible] )
120 [o_window orderOut:sender];
122 [o_window makeKeyAndOrderFront:sender];
125 - (void)setAudioFilter: (char *)psz_name on:(BOOL)b_on
128 audio_output_t * p_aout = getAout();
130 psz_tmp = var_GetNonEmptyString( p_aout, "audio-filter" );
132 psz_tmp = config_GetPsz( p_intf, "audio-filter" );
137 config_PutPsz( p_intf, "audio-filter", psz_name );
138 else if( (NSInteger)strstr( psz_tmp, psz_name ) == NO )
140 psz_tmp = (char *)[[NSString stringWithFormat: @"%s:%s", psz_tmp, psz_name] UTF8String];
141 config_PutPsz( p_intf, "audio-filter", psz_tmp );
146 psz_tmp = (char *)[[[NSString stringWithUTF8String: psz_tmp] stringByTrimmingCharactersInSet: [NSCharacterSet characterSetWithCharactersInString:[NSString stringWithFormat:@":%s",psz_name]]] UTF8String];
147 psz_tmp = (char *)[[[NSString stringWithUTF8String: psz_tmp] stringByTrimmingCharactersInSet: [NSCharacterSet characterSetWithCharactersInString:[NSString stringWithFormat:@"%s:",psz_name]]] UTF8String];
148 psz_tmp = (char *)[[[NSString stringWithUTF8String: psz_tmp] stringByTrimmingCharactersInSet: [NSCharacterSet characterSetWithCharactersInString:[NSString stringWithUTF8String:psz_name]]] UTF8String];
149 config_PutPsz( p_intf, "audio-filter", psz_tmp );
154 aout_EnableFilter( pl_Get( p_intf ), psz_name, b_on );
155 vlc_object_release( p_aout );
160 #pragma mark Equalizer
161 static bool GetEqualizerStatus( intf_thread_t *p_custom_intf,
164 char *psz_parser, *psz_string = NULL;
165 vlc_object_t *p_object = VLC_OBJECT(getAout());
166 if( p_object == NULL )
167 p_object = vlc_object_hold(pl_Get( p_custom_intf ));
169 psz_string = config_GetPsz( p_custom_intf, "audio-filter" );
172 psz_string = var_GetNonEmptyString( p_object, "audio-filter" );
174 vlc_object_release( p_object );
176 if( !psz_string ) return false;
178 psz_parser = strstr( psz_string, psz_name );
188 - (void)setupEqualizer
190 vlc_object_t *p_object = VLC_OBJECT(getAout());
191 if( p_object == NULL )
192 p_object = vlc_object_hold(pl_Get( p_intf ));
196 var_Create( p_object, "equalizer-preset", VLC_VAR_STRING | VLC_VAR_DOINHERIT );
197 psz_preset = var_GetNonEmptyString( p_object, "equalizer-preset" );
199 for( int i = 0 ; i < NB_PRESETS ; i++ )
201 if( strcmp( preset_list[i], psz_preset ) )
204 [o_eq_presets_popup selectItemWithTag:i];
206 [o_eq_preamp_sld setFloatValue: eqz_preset_10b[i].f_preamp];
207 [self setBandSlidersValues: (float *)eqz_preset_10b[i].f_amp];
209 if( strcmp( psz_preset, "flat" ) )
213 snprintf( psz_bands, sizeof( psz_bands ),
214 "%.1f %.1f %.1f %.1f %.1f %.1f %.1f "
216 eqz_preset_10b[i].f_amp[0],
217 eqz_preset_10b[i].f_amp[1],
218 eqz_preset_10b[i].f_amp[2],
219 eqz_preset_10b[i].f_amp[3],
220 eqz_preset_10b[i].f_amp[4],
221 eqz_preset_10b[i].f_amp[5],
222 eqz_preset_10b[i].f_amp[6],
223 eqz_preset_10b[i].f_amp[7],
224 eqz_preset_10b[i].f_amp[8],
225 eqz_preset_10b[i].f_amp[9] );
227 var_Create( p_object, "equalizer-preamp", VLC_VAR_FLOAT | VLC_VAR_DOINHERIT );
228 var_Create( p_object, "equalizer-bands", VLC_VAR_STRING | VLC_VAR_DOINHERIT );
229 var_SetFloat( p_object, "equalizer-preamp", eqz_preset_10b[i].f_preamp );
230 var_SetString( p_object, "equalizer-bands", psz_bands );
234 vlc_object_release( p_object );
236 [self equalizerUpdated];
239 - (void)equalizerUpdated
241 float f_preamp, f_band[10];
242 char *psz_bands, *psz_bands_init, *p_next;
244 bool b_enabled = GetEqualizerStatus( p_intf, (char *)"equalizer" );
245 vlc_object_t *p_object = VLC_OBJECT(getAout());
247 if( p_object == NULL )
248 p_object = vlc_object_hold(pl_Get( p_intf ));
250 var_Create( p_object, "equalizer-preamp", VLC_VAR_FLOAT |
252 var_Create( p_object, "equalizer-bands", VLC_VAR_STRING |
255 psz_bands = var_GetNonEmptyString( p_object, "equalizer-bands" );
257 if( psz_bands == NULL )
258 psz_bands = strdup( "0 0 0 0 0 0 0 0 0 0" );
260 b_2p = (BOOL)config_GetInt( p_object, "equalizer-2pass" );
261 f_preamp = config_GetFloat( p_object, "equalizer-preamp" );
263 vlc_object_release( p_object );
265 /* Set the preamp slider */
266 [o_eq_preamp_sld setFloatValue: f_preamp];
268 /* Set the bands slider */
269 psz_bands_init = psz_bands;
271 for( int i = 0; i < 10; i++ )
274 f_band[i] = strtof( psz_bands, &p_next );
275 if( !p_next || p_next == psz_bands ) break; /* strtof() failed */
277 if( !*psz_bands ) break; /* end of line */
278 psz_bands = p_next+1;
280 free( psz_bands_init );
281 [self setBandSlidersValues:f_band];
283 /* Set the the checkboxes */
284 [o_eq_enable_ckb setState: b_enabled];
285 [o_eq_twopass_ckb setState: b_2p];
288 - (id)sliderByIndex:(int)index
292 case 0 : return o_eq_band1_sld;
293 case 1 : return o_eq_band2_sld;
294 case 2 : return o_eq_band3_sld;
295 case 3 : return o_eq_band4_sld;
296 case 4 : return o_eq_band5_sld;
297 case 5 : return o_eq_band6_sld;
298 case 6 : return o_eq_band7_sld;
299 case 7 : return o_eq_band8_sld;
300 case 8 : return o_eq_band9_sld;
301 case 9 : return o_eq_band10_sld;
302 default : return nil;
306 - (void)setBandSlidersValues:(float *)values
308 for (int i = 0 ; i<= 9 ; i++)
309 [self setValue:values[i] forSlider:i];
312 - (void)initBandSliders
314 for (int i = 0 ; i< 9 ; i++)
315 [self setValue:0.0 forSlider:i];
318 - (void)setValue:(float)value forSlider:(int)index
320 id slider = [self sliderByIndex:index];
323 [slider setFloatValue:value];
326 - (IBAction)eq_enable:(id)sender
328 [self setAudioFilter: "equalizer" on:[sender state]];
331 - (IBAction)eq_bandSliderUpdated:(id)sender
333 vlc_object_t *p_object = VLC_OBJECT(getAout());
335 if( p_object == NULL )
336 p_object = vlc_object_hold(pl_Get( p_intf ));
338 const char *psz_values;
339 NSString *preset = [NSString stringWithFormat:@"%.1f ", [o_eq_band1_sld floatValue] ];
340 preset = [preset stringByAppendingFormat:@"%.1f ", [o_eq_band2_sld floatValue] ];
341 preset = [preset stringByAppendingFormat:@"%.1f ", [o_eq_band3_sld floatValue] ];
342 preset = [preset stringByAppendingFormat:@"%.1f ", [o_eq_band4_sld floatValue] ];
343 preset = [preset stringByAppendingFormat:@"%.1f ", [o_eq_band5_sld floatValue] ];
344 preset = [preset stringByAppendingFormat:@"%.1f ", [o_eq_band6_sld floatValue] ];
345 preset = [preset stringByAppendingFormat:@"%.1f ", [o_eq_band7_sld floatValue] ];
346 preset = [preset stringByAppendingFormat:@"%.1f ", [o_eq_band8_sld floatValue] ];
347 preset = [preset stringByAppendingFormat:@"%.1f ", [o_eq_band9_sld floatValue] ];
348 preset = [preset stringByAppendingFormat:@"%.1f", [o_eq_band10_sld floatValue] ];
350 psz_values = [preset UTF8String];
351 var_SetString( p_object, "equalizer-bands", psz_values );
353 /* save changed to config */
354 config_PutPsz( p_intf, "equalizer-bands", psz_values );
356 vlc_object_release( p_object );
358 - (IBAction)eq_changePreset:(id)sender
360 vlc_object_t *p_object= VLC_OBJECT(getAout());
361 if( p_object == NULL )
362 p_object = vlc_object_hold(pl_Get( p_intf ));
363 NSInteger numberOfChosenPreset = [[sender selectedItem] tag];
365 var_SetString( p_object , "equalizer-preset" , preset_list[numberOfChosenPreset] );
367 NSString *preset = @"";
368 const char *psz_values;
369 for( int i = 0; i < EQZ_BANDS_MAX; i++ )
371 preset = [preset stringByAppendingFormat:@"%.1f ", eqz_preset_10b[numberOfChosenPreset].f_amp[i] ];
373 psz_values = [preset UTF8String];
374 var_SetString( p_object, "equalizer-bands", psz_values );
375 var_SetFloat( p_object, "equalizer-preamp", eqz_preset_10b[[[sender selectedItem] tag]].f_preamp);
377 [o_eq_preamp_sld setFloatValue: eqz_preset_10b[numberOfChosenPreset].f_preamp];
379 [self setBandSlidersValues:(float *)eqz_preset_10b[numberOfChosenPreset].f_amp];
381 /* save changed to config */
382 config_PutPsz( p_intf, "equalizer-bands", psz_values );
383 config_PutFloat( p_intf, "equalizer-preamp", eqz_preset_10b[numberOfChosenPreset].f_preamp );
384 config_PutPsz( p_intf, "equalizer-preset", preset_list[numberOfChosenPreset] );
386 vlc_object_release( p_object );
388 - (IBAction)eq_preampSliderUpdated:(id)sender
390 float f_preamp = [sender floatValue] ;
392 vlc_object_t *p_object = VLC_OBJECT(getAout());
393 if( p_object == NULL )
394 p_object = vlc_object_hold(pl_Get( p_intf ));
396 var_SetFloat( p_object, "equalizer-preamp", f_preamp );
398 /* save changed to config */
399 config_PutFloat( p_intf, "equalizer-preamp", f_preamp );
401 vlc_object_release( p_object );
403 - (IBAction)eq_twopass:(id)sender
405 bool b_2p = [sender state] ? true : false;
406 audio_output_t *p_aout = getAout();
407 vlc_object_t *p_object= VLC_OBJECT(p_aout);
408 if( p_object == NULL )
409 p_object = vlc_object_hold(pl_Get( p_intf ));
411 var_SetBool( p_object, "equalizer-2pass", b_2p );
413 /* save changed to config */
414 config_PutInt( p_intf, "equalizer-2pass", (int)b_2p );
416 vlc_object_release( p_object );
420 #pragma mark Compressor
421 - (void)resetCompressor
424 psz_afilters = config_GetPsz( p_intf, "audio-filter" );
426 [o_comp_enable_ckb setState: (NSInteger)strstr( psz_afilters, "compressor" ) ];
427 free( psz_afilters );
430 [o_comp_enable_ckb setState: NSOffState];
432 [o_comp_band1_sld setFloatValue: config_GetFloat( p_intf, "compressor-rms-peak" )];
433 [o_comp_band1_fld setStringValue:[NSString localizedStringWithFormat:@"%1.1f", [o_comp_band1_sld floatValue]]];
434 [o_comp_band2_sld setFloatValue: config_GetFloat( p_intf, "compressor-attack" )];
435 [o_comp_band2_fld setStringValue:[NSString localizedStringWithFormat:@"%2.1f ms", [o_comp_band2_sld floatValue]]];
436 [o_comp_band3_sld setFloatValue: config_GetFloat( p_intf, "compressor-release" )];
437 [o_comp_band3_fld setStringValue:[NSString localizedStringWithFormat:@"%3.1f ms", [o_comp_band3_sld floatValue]]];
438 [o_comp_band4_sld setFloatValue: config_GetFloat( p_intf, "compressor-threshold" )];
439 [o_comp_band4_fld setStringValue:[NSString localizedStringWithFormat:@"%2.1f dB", [o_comp_band4_sld floatValue]]];
440 [o_comp_band5_sld setFloatValue: config_GetFloat( p_intf, "compressor-ratio" )];
441 [o_comp_band5_fld setStringValue:[NSString localizedStringWithFormat:@"%1.1f:1", [o_comp_band5_sld floatValue]]];
442 [o_comp_band6_sld setFloatValue: config_GetFloat( p_intf, "compressor-knee" )];
443 [o_comp_band6_fld setStringValue:[NSString localizedStringWithFormat:@"%1.1f dB", [o_comp_band6_sld floatValue]]];
444 [o_comp_band7_sld setFloatValue: config_GetFloat( p_intf, "compressor-makeup-gain" )];
445 [o_comp_band7_fld setStringValue:[NSString localizedStringWithFormat:@"%1.1f dB", [o_comp_band7_sld floatValue]]];
448 - (IBAction)resetCompressorValues:(id)sender
450 config_PutFloat( p_intf, "compressor-rms-peak", 0.000000 );
451 config_PutFloat( p_intf, "compressor-attack", 25.000000 );
452 config_PutFloat( p_intf, "compressor-release", 100.000000 );
453 config_PutFloat( p_intf, "compressor-threshold", -11.000000 );
454 config_PutFloat( p_intf, "compressor-ratio", 8.000000 );
455 config_PutFloat( p_intf, "compressor-knee", 2.500000 );
456 config_PutFloat( p_intf, "compressor-makeup-gain", 7.000000 );
458 audio_output_t * p_aout = getAout();
460 var_SetFloat( p_aout, "compressor-rms-peak", 0.000000 );
461 var_SetFloat( p_aout, "compressor-attack", 25.000000 );
462 var_SetFloat( p_aout, "compressor-release", 100.000000 );
463 var_SetFloat( p_aout, "compressor-threshold", -11.000000 );
464 var_SetFloat( p_aout, "compressor-ratio", 8.000000 );
465 var_SetFloat( p_aout, "compressor-knee", 2.500000 );
466 var_SetFloat( p_aout, "compressor-makeup-gain", 7.000000 );
467 vlc_object_release( p_aout );
469 [self resetCompressor];
472 - (IBAction)comp_enable:(id)sender
474 [self setAudioFilter:"compressor" on:[sender state]];
477 - (IBAction)comp_sliderUpdated:(id)sender
479 audio_output_t * p_aout = getAout();
481 if( sender == o_comp_band1_sld )
482 value = "compressor-rms-peak";
483 else if( sender == o_comp_band2_sld )
484 value = "compressor-attack";
485 else if( sender == o_comp_band3_sld )
486 value = "compressor-release";
487 else if( sender == o_comp_band4_sld )
488 value = "compressor-threshold";
489 else if( sender == o_comp_band5_sld )
490 value = "compressor-ratio";
491 else if( sender == o_comp_band6_sld )
492 value = "compressor-knee";
493 else if( sender == o_comp_band7_sld )
494 value = "compressor-makeup-gain";
497 var_SetFloat( p_aout, value, [sender floatValue] );
498 vlc_object_release( p_aout );
500 config_PutFloat( p_intf, value, [sender floatValue] );
502 if( sender == o_comp_band1_sld )
503 [o_comp_band1_fld setStringValue:[NSString localizedStringWithFormat:@"%1.1f", [sender floatValue]]];
504 else if( sender == o_comp_band2_sld )
505 [o_comp_band2_fld setStringValue:[NSString localizedStringWithFormat:@"%2.1f ms", [sender floatValue]]];
506 else if( sender == o_comp_band3_sld )
507 [o_comp_band3_fld setStringValue:[NSString localizedStringWithFormat:@"%3.1f ms", [sender floatValue]]];
508 else if( sender == o_comp_band4_sld )
509 [o_comp_band4_fld setStringValue:[NSString localizedStringWithFormat:@"%2.1f dB", [sender floatValue]]];
510 else if( sender == o_comp_band5_sld )
511 [o_comp_band5_fld setStringValue:[NSString localizedStringWithFormat:@"%1.1f:1", [sender floatValue]]];
512 else if( sender == o_comp_band6_sld )
513 [o_comp_band6_fld setStringValue:[NSString localizedStringWithFormat:@"%1.1f dB", [sender floatValue]]];
514 else if( sender == o_comp_band7_sld )
515 [o_comp_band7_fld setStringValue:[NSString localizedStringWithFormat:@"%1.1f dB", [sender floatValue]]];
519 #pragma mark Spatializer
520 - (void)resetSpatializer
523 psz_afilters = config_GetPsz( p_intf, "audio-filter" );
525 [o_spat_enable_ckb setState: (NSInteger)strstr( psz_afilters, "spatializer" ) ];
526 free( psz_afilters );
529 [o_spat_enable_ckb setState: NSOffState];
531 [o_spat_band1_sld setFloatValue: config_GetFloat( p_intf, "spatializer-roomsize" )];
532 [o_spat_band1_fld setStringValue:[NSString localizedStringWithFormat:@"%1.1f", [o_spat_band1_sld floatValue]]];
533 [o_spat_band2_sld setFloatValue: config_GetFloat( p_intf, "spatializer-width" )];
534 [o_spat_band2_fld setStringValue:[NSString localizedStringWithFormat:@"%1.1f", [o_spat_band2_sld floatValue]]];
535 [o_spat_band3_sld setFloatValue: config_GetFloat( p_intf, "spatializer-wet" )];
536 [o_spat_band3_fld setStringValue:[NSString localizedStringWithFormat:@"%1.1f", [o_spat_band3_sld floatValue]]];
537 [o_spat_band4_sld setFloatValue: config_GetFloat( p_intf, "spatializer-dry" )];
538 [o_spat_band4_fld setStringValue:[NSString localizedStringWithFormat:@"%1.1f", [o_spat_band4_sld floatValue]]];
539 [o_spat_band5_sld setFloatValue: config_GetFloat( p_intf, "spatializer-damp" )];
540 [o_spat_band5_fld setStringValue:[NSString localizedStringWithFormat:@"%1.1f", [o_spat_band5_sld floatValue]]];
543 - (IBAction)resetSpatializerValues:(id)sender
545 config_PutFloat( p_intf, "spatializer-roomsize", 1.050000 );
546 config_PutFloat( p_intf, "spatializer-width", 10.000000 );
547 config_PutFloat( p_intf, "spatializer-wet", 3.000000 );
548 config_PutFloat( p_intf, "spatializer-dry", 2.000000 );
549 config_PutFloat( p_intf, "spatializer-damp", 1.000000 );
551 audio_output_t * p_aout = getAout();
553 var_SetFloat( p_aout, "spatializer-roomsize", 1.050000 );
554 var_SetFloat( p_aout, "spatializer-width", 10.000000 );
555 var_SetFloat( p_aout, "spatializer-wet", 3.000000 );
556 var_SetFloat( p_aout, "spatializer-dry", 2.000000 );
557 var_SetFloat( p_aout, "spatializer-damp", 1.000000 );
558 vlc_object_release( p_aout );
560 [self resetSpatializer];
563 - (IBAction)spat_enable:(id)sender
565 [self setAudioFilter:"spatializer" on:[sender state]];
568 - (IBAction)spat_sliderUpdated:(id)sender
570 audio_output_t * p_aout = getAout();
572 if( sender == o_spat_band1_sld )
573 value = "spatializer-roomsize";
574 else if( sender == o_spat_band2_sld )
575 value = "spatializer-width";
576 else if( sender == o_spat_band3_sld )
577 value = "spatializer-wet";
578 else if( sender == o_spat_band4_sld )
579 value = "spatializer-dry";
580 else if( sender == o_spat_band5_sld )
581 value = "spatializer-damp";
584 var_SetFloat( p_aout, value, [sender floatValue] );
585 vlc_object_release( p_aout );
587 config_PutFloat( p_intf, value, [sender floatValue] );
589 if( sender == o_spat_band1_sld )
590 [o_spat_band1_fld setStringValue:[NSString localizedStringWithFormat:@"%1.1f", [sender floatValue]]];
591 else if( sender == o_spat_band2_sld )
592 [o_spat_band2_fld setStringValue:[NSString localizedStringWithFormat:@"%1.1f", [sender floatValue]]];
593 else if( sender == o_spat_band3_sld )
594 [o_spat_band3_fld setStringValue:[NSString localizedStringWithFormat:@"%1.1f", [sender floatValue]]];
595 else if( sender == o_spat_band4_sld )
596 [o_spat_band4_fld setStringValue:[NSString localizedStringWithFormat:@"%1.1f", [sender floatValue]]];
597 else if( sender == o_spat_band5_sld )
598 [o_spat_band5_fld setStringValue:[NSString localizedStringWithFormat:@"%1.1f", [sender floatValue]]];
603 - (void)resetAudioFilters
606 psz_afilters = config_GetPsz( p_intf, "audio-filter" );
609 [o_filter_headPhone_ckb setState: (NSInteger)strstr( psz_afilters, "headphone" ) ];
610 [o_filter_normLevel_ckb setState: (NSInteger)strstr( psz_afilters, "normvol" ) ];
611 free( psz_afilters );
613 [o_filter_headPhone_ckb setState: NSOffState];
614 [o_filter_normLevel_ckb setState: NSOffState];
616 [o_filter_normLevel_sld setFloatValue: config_GetFloat( p_intf, "norm-max-level" )];
619 - (IBAction)filter_enableHeadPhoneVirt:(id)sender
621 [self setAudioFilter: "headphone" on:[sender state]];
624 - (IBAction)filter_enableVolumeNorm:(id)sender
626 [self setAudioFilter: "normvol" on:[sender state]];
629 - (IBAction)filter_volNormSliderUpdated:(id)sender
631 audio_output_t * p_aout= getAout();
635 var_SetFloat( p_aout, "norm-max-level", [o_filter_normLevel_sld floatValue] );
636 vlc_object_release( p_aout );
639 config_PutFloat( p_intf, "norm-max-level", [o_filter_normLevel_sld floatValue] );