Commit 6e3ce832 authored by Clément Stenac's avatar Clément Stenac

Save equalizer values so that they don't get overriden on filter enable

Set default preamp to 12.0 dB
parent 29217b27
...@@ -71,7 +71,7 @@ vlc_module_begin(); ...@@ -71,7 +71,7 @@ vlc_module_begin();
BANDS_LONGTEXT, VLC_TRUE ); BANDS_LONGTEXT, VLC_TRUE );
add_bool( "equalizer-2pass", 0, NULL, TWOPASS_TEXT, add_bool( "equalizer-2pass", 0, NULL, TWOPASS_TEXT,
TWOPASS_LONGTEXT, VLC_TRUE ); TWOPASS_LONGTEXT, VLC_TRUE );
add_float( "equalizer-preamp", 0.0, NULL, PREAMP_TEXT, add_float( "equalizer-preamp", 12.0, NULL, PREAMP_TEXT,
PREAMP_LONGTEXT, VLC_TRUE ); PREAMP_LONGTEXT, VLC_TRUE );
set_callbacks( Open, Close ); set_callbacks( Open, Close );
add_shortcut( "equalizer" ); add_shortcut( "equalizer" );
......
...@@ -492,7 +492,7 @@ wxPanel *ExtraPanel::EqzPanel( wxWindow *parent ) ...@@ -492,7 +492,7 @@ wxPanel *ExtraPanel::EqzPanel( wxWindow *parent )
eq_gridsizer->AddGrowableRow( 0 ); eq_gridsizer->AddGrowableRow( 0 );
eq_gridsizer->AddGrowableCol( 1 ); eq_gridsizer->AddGrowableCol( 1 );
preamp_slider = new wxSlider( panel, Preamp_Event, 200, 0, 400, preamp_slider = new wxSlider( panel, Preamp_Event, 80, 0, 400,
wxDefaultPosition, wxSize( -1 , 90 ) , wxSL_VERTICAL ); wxDefaultPosition, wxSize( -1 , 90 ) , wxSL_VERTICAL );
eq_gridsizer->Add( preamp_slider, 1, wxEXPAND|wxALL, 2 ); eq_gridsizer->Add( preamp_slider, 1, wxEXPAND|wxALL, 2 );
...@@ -507,7 +507,7 @@ wxPanel *ExtraPanel::EqzPanel( wxWindow *parent ) ...@@ -507,7 +507,7 @@ wxPanel *ExtraPanel::EqzPanel( wxWindow *parent )
eq_gridsizer->Add( band_sliders[i], 1, wxEXPAND|wxALL, 2 ); eq_gridsizer->Add( band_sliders[i], 1, wxEXPAND|wxALL, 2 );
} }
preamp_text = new wxStaticText( panel, -1, wxT( "Preamp\n0.0dB" ) ); preamp_text = new wxStaticText( panel, -1, wxT( "Preamp\n12.0dB" ) );
wxFont font= preamp_text->GetFont(); wxFont font= preamp_text->GetFont();
font.SetPointSize(7); font.SetPointSize(7);
preamp_text->SetFont( font ); preamp_text->SetFont( font );
...@@ -595,6 +595,7 @@ void ExtraPanel::OnEnableEqualizer( wxCommandEvent &event ) ...@@ -595,6 +595,7 @@ void ExtraPanel::OnEnableEqualizer( wxCommandEvent &event )
VLC_OBJECT_AOUT, FIND_ANYWHERE); VLC_OBJECT_AOUT, FIND_ANYWHERE);
ChangeFiltersString( p_intf,p_aout, "equalizer", ChangeFiltersString( p_intf,p_aout, "equalizer",
event.IsChecked() ? VLC_TRUE : VLC_FALSE ); event.IsChecked() ? VLC_TRUE : VLC_FALSE );
if( p_aout != NULL ) if( p_aout != NULL )
vlc_object_release( p_aout ); vlc_object_release( p_aout );
} }
...@@ -619,10 +620,14 @@ void ExtraPanel::OnEqRestore( wxCommandEvent &event ) ...@@ -619,10 +620,14 @@ void ExtraPanel::OnEqRestore( wxCommandEvent &event )
} }
else else
{ {
var_SetFloat( p_aout, "equalizer-preamp", 0.0 ); var_SetFloat( p_aout, "equalizer-preamp", 12.0 );
config_PutFloat( p_intf, "equalizer-preamp", 12.0 );
var_SetString( p_aout, "equalizer-bands", var_SetString( p_aout, "equalizer-bands",
"0 0 0 0 0 0 0 0 0 0"); "0 0 0 0 0 0 0 0 0 0");
config_PutPsz( p_intf, "equalizer-bands",
"0 0 0 0 0 0 0 0 0 0");
var_SetString( p_aout , "equalizer-preset" , "flat" ); var_SetString( p_aout , "equalizer-preset" , "flat" );
config_PutPsz( p_intf, "equalizer-preset","flat" );
vlc_object_release( p_aout ); vlc_object_release( p_aout );
} }
} }
...@@ -641,6 +646,7 @@ void ExtraPanel::OnEq2Pass( wxCommandEvent &event ) ...@@ -641,6 +646,7 @@ void ExtraPanel::OnEq2Pass( wxCommandEvent &event )
else else
{ {
var_SetBool( p_aout, "equalizer-2pass", b_2p ); var_SetBool( p_aout, "equalizer-2pass", b_2p );
config_PutInt( p_intf, "equalizer-2pass", b_2p );
if( eq_chkbox->IsChecked() ) if( eq_chkbox->IsChecked() )
{ {
for( int i = 0; i < p_aout->i_nb_inputs; i++ ) for( int i = 0; i < p_aout->i_nb_inputs; i++ )
...@@ -677,6 +683,7 @@ void ExtraPanel::OnPreamp( wxScrollEvent &event ) ...@@ -677,6 +683,7 @@ void ExtraPanel::OnPreamp( wxScrollEvent &event )
else else
{ {
var_SetFloat( p_aout, "equalizer-preamp", f ); var_SetFloat( p_aout, "equalizer-preamp", f );
config_PutFloat( p_intf, "equalizer-preamp", f );
b_my_update = VLC_TRUE; b_my_update = VLC_TRUE;
vlc_object_release( p_aout ); vlc_object_release( p_aout );
} }
...@@ -689,6 +696,7 @@ void ExtraPanel::OnChangeEqualizer( wxScrollEvent &event ) ...@@ -689,6 +696,7 @@ void ExtraPanel::OnChangeEqualizer( wxScrollEvent &event )
char psz_values[102]; char psz_values[102];
memset( psz_values, 0, 102 ); memset( psz_values, 0, 102 );
/* Smoothing */ /* Smoothing */
int i_diff = event.GetPosition() - i_values[ event.GetId() - Band0_Event ]; int i_diff = event.GetPosition() - i_values[ event.GetId() - Band0_Event ];
i_values[ event.GetId() - Band0_Event] = event.GetPosition(); i_values[ event.GetId() - Band0_Event] = event.GetPosition();
...@@ -727,6 +735,7 @@ void ExtraPanel::OnChangeEqualizer( wxScrollEvent &event ) ...@@ -727,6 +735,7 @@ void ExtraPanel::OnChangeEqualizer( wxScrollEvent &event )
else else
{ {
var_SetString( p_aout, "equalizer-bands", psz_values ); var_SetString( p_aout, "equalizer-bands", psz_values );
config_PutPsz( p_intf, "equalizer-bands", psz_values );
b_my_update = VLC_TRUE; b_my_update = VLC_TRUE;
vlc_object_release( p_aout ); vlc_object_release( p_aout );
} }
......
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