Commit f34b83de authored by Benjamin Pracht's avatar Benjamin Pracht

* Fixes initialization when a preset is saved in the prefs or provided from...

* Fixes initialization when a preset is saved in the prefs or provided from command line. Could be cleaner, but it seems at least to work.

parent a1aaf849
...@@ -380,10 +380,77 @@ static vlc_bool_t GetFiltersStatus( intf_thread_t *p_intf, ...@@ -380,10 +380,77 @@ static vlc_bool_t GetFiltersStatus( intf_thread_t *p_intf,
- (void)awakeFromNib - (void)awakeFromNib
{ {
int i;
vlc_object_t *p_object= vlc_object_find( VLCIntf,
VLC_OBJECT_AOUT, FIND_ANYWHERE );
if( p_object == NULL )
p_object = vlc_object_find( VLCIntf,
VLC_OBJECT_PLAYLIST, FIND_ANYWHERE );
[o_window setExcludedFromWindowsMenu: TRUE]; [o_window setExcludedFromWindowsMenu: TRUE];
[self initStrings]; [self initStrings];
if( p_object )
{
char *psz_preset;
var_Create( p_object, "equalizer-preset", VLC_VAR_STRING |
VLC_VAR_DOINHERIT );
psz_preset = var_GetString( p_object, "equalizer-preset" );
for( i = 0 ; i < 18 ; i++ )
{
if( !strcmp( preset_list[i], psz_preset ) )
{
[o_popup_presets selectItemAtIndex: i];
[o_slider_preamp setFloatValue: eqz_preset_10b[i]->f_preamp];
[o_slider_band1 setFloatValue: eqz_preset_10b[i]->f_amp[0]];
[o_slider_band2 setFloatValue: eqz_preset_10b[i]->f_amp[1]];
[o_slider_band3 setFloatValue: eqz_preset_10b[i]->f_amp[2]];
[o_slider_band4 setFloatValue: eqz_preset_10b[i]->f_amp[3]];
[o_slider_band5 setFloatValue: eqz_preset_10b[i]->f_amp[4]];
[o_slider_band6 setFloatValue: eqz_preset_10b[i]->f_amp[5]];
[o_slider_band7 setFloatValue: eqz_preset_10b[i]->f_amp[6]];
[o_slider_band8 setFloatValue: eqz_preset_10b[i]->f_amp[7]];
[o_slider_band9 setFloatValue: eqz_preset_10b[i]->f_amp[8]];
[o_slider_band10 setFloatValue: eqz_preset_10b[i]->f_amp[9]];
if( strcmp( psz_preset, "flat" ) )
{
char psz_bands[100];
memset( psz_bands, 0, 100 );
sprintf( psz_bands, "%.1f %.1f %.1f %.1f %.1f %.1f %.1f "
"%.1f %.1f %.1f",
eqz_preset_10b[i]->f_amp[0],
eqz_preset_10b[i]->f_amp[1],
eqz_preset_10b[i]->f_amp[2],
eqz_preset_10b[i]->f_amp[3],
eqz_preset_10b[i]->f_amp[4],
eqz_preset_10b[i]->f_amp[5],
eqz_preset_10b[i]->f_amp[6],
eqz_preset_10b[i]->f_amp[7],
eqz_preset_10b[i]->f_amp[8],
eqz_preset_10b[i]->f_amp[9] );
var_Create( p_object, "equalizer-preamp", VLC_VAR_FLOAT |
VLC_VAR_DOINHERIT );
var_Create( p_object, "equalizer-bands", VLC_VAR_STRING |
VLC_VAR_DOINHERIT );
var_SetFloat( p_object, "equalizer-preamp",
eqz_preset_10b[i]->f_preamp );
var_SetString( p_object, "equalizer-bands", psz_bands );
}
}
}
free( psz_preset );
vlc_object_release( p_object );
}
[self equalizerUpdated]; [self equalizerUpdated];
} }
@end @end
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