[vlc-devel] commit: qt4 equalizer load core bands and preamp to extended panel ( Kaarlo Raiha )
git version control
git at videolan.org
Sun Nov 8 15:07:42 CET 2009
vlc | branch: master | Kaarlo Raiha <kaarlo.raiha at tut.fi> | Sat Nov 7 21:02:11 2009 +0200| [d6418e15514dae6c1889e3682fa32c1de3072511] | committer: Ilkka Ollakka
qt4 equalizer load core bands and preamp to extended panel
Signed-off-by: Ilkka Ollakka <ileoo at iki.fi>
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=d6418e15514dae6c1889e3682fa32c1de3072511
---
modules/gui/qt4/components/extended_panels.cpp | 21 ++++++++++++++++++++-
1 files changed, 20 insertions(+), 1 deletions(-)
diff --git a/modules/gui/qt4/components/extended_panels.cpp b/modules/gui/qt4/components/extended_panels.cpp
index 2408784..34a4c8b 100644
--- a/modules/gui/qt4/components/extended_panels.cpp
+++ b/modules/gui/qt4/components/extended_panels.cpp
@@ -885,7 +885,7 @@ void Equalizer::clean()
/* Write down initial values */
void Equalizer::updateUIFromCore()
{
- char *psz_af, *psz_pres;
+ char *psz_af, *psz_pres, *psz_bands;
float f_preamp;
int i_preset;
@@ -897,6 +897,7 @@ void Equalizer::updateUIFromCore()
if( var_GetBool( p_aout, "equalizer-2pass" ) )
ui.eq2PassCheck->setChecked( true );
f_preamp = var_GetFloat( p_aout, "equalizer-preamp" );
+ psz_bands = var_GetNonEmptyString( p_aout, "equalizer-bands" );
i_preset = presetsComboBox->findData( QVariant( psz_pres ) );
vlc_object_release( p_aout );
}
@@ -907,6 +908,7 @@ void Equalizer::updateUIFromCore()
if( config_GetInt( p_intf, "equalizer-2pass" ) )
ui.eq2PassCheck->setChecked( true );
f_preamp = config_GetFloat( p_intf, "equalizer-preamp" );
+ psz_bands = config_GetPsz( p_intf, "equalizer-bands" );
i_preset = presetsComboBox->findData( QVariant( psz_pres ) );
}
if( psz_af && strstr( psz_af, "equalizer" ) != NULL )
@@ -915,6 +917,23 @@ void Equalizer::updateUIFromCore()
presetsComboBox->setCurrentIndex( i_preset );
+ ui.preampSlider->setValue( (int)( ( f_preamp + 20 ) * 10 ) );
+
+ if( psz_bands && strlen( psz_bands ) > 1 )
+ {
+ char *psz_bands_orig = psz_bands;
+ for( int i = 0; i < BANDS; i++ )
+ {
+ const float f = us_strtod(psz_bands, &psz_bands );
+ bands[i]->setValue( (int)( ( f + 20 ) * 10 ) );
+ if( psz_bands == NULL || *psz_bands == '\0' ) break;
+ psz_bands++;
+ if( *psz_bands == '\0' ) break;
+ }
+ free( psz_bands_orig );
+ }
+ else free( psz_bands );
+
free( psz_af );
free( psz_pres );
}
More information about the vlc-devel
mailing list