/*****************************************************************************
* equalizer.c:
*****************************************************************************
- * Copyright (C) 2004 the VideoLAN team
+ * Copyright (C) 2004, 2006 the VideoLAN team
* $Id$
*
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
/*****************************************************************************
* Preamble
*****************************************************************************/
-#include <stdlib.h> /* malloc(), free() */
#include <math.h>
#include <vlc/vlc.h>
-#include <vlc/aout.h>
-#include "aout_internal.h"
+#include "vlc_aout.h"
#include "equalizer_presets.h"
/* TODO:
static void Close( vlc_object_t * );
#define PRESET_TEXT N_( "Equalizer preset" )
-#define PRESET_LONGTEXT PRESET_TEXT
+#define PRESET_LONGTEXT N_("Preset to use for the equalizer." )
#define BANDS_TEXT N_( "Bands gain")
-#define BANDS_LONGTEXT N_( "Override preset bands gain in dB (-20 ... 20)" )
+#define BANDS_LONGTEXT N_( \
+ "Don't use presets, but manually specified bands. You need to " \
+ "provide 10 values between -20dB and 20dB, separated by spaces, " \
+ "e.g. \"0 2 4 2 0 -2 -4 -2 0\"." )
#define TWOPASS_TEXT N_( "Two pass" )
-#define TWOPASS_LONGTEXT N_( "Filter twice the audio" )
+#define TWOPASS_LONGTEXT N_( "Filter the audio twice. This provides a more " \
+ "intense effect.")
#define PREAMP_TEXT N_("Global gain" )
-#define PREAMP_LONGTEXT N_("Set the global gain in dB (-20 ... 20)" )
+#define PREAMP_LONGTEXT N_("Set the global gain in dB (-20 ... 20)." )
vlc_module_begin();
- set_description( _("Equalizer 10 bands") );
- set_shortname( N_("Equalizer" ) );
+ set_description( _("Equalizer with 10 bands") );
+ set_shortname( _("Equalizer" ) );
set_capability( "audio filter", 0 );
set_category( CAT_AUDIO );
set_subcategory( SUBCAT_AUDIO_AFILTER );
add_string( "equalizer-preset", "flat", NULL, PRESET_TEXT,
PRESET_LONGTEXT, VLC_FALSE );
change_string_list( preset_list, preset_list_text, 0 );
+ change_safe();
add_string( "equalizer-bands", NULL, NULL, BANDS_TEXT,
BANDS_LONGTEXT, VLC_TRUE );
+ change_safe();
add_bool( "equalizer-2pass", 0, NULL, TWOPASS_TEXT,
TWOPASS_LONGTEXT, VLC_TRUE );
+ change_safe();
add_float( "equalizer-preamp", 12.0, NULL, PREAMP_TEXT,
PREAMP_LONGTEXT, VLC_TRUE );
+ change_safe();
set_callbacks( Open, Close );
add_shortcut( "equalizer" );
vlc_module_end();
b_fit = VLC_FALSE;
p_filter->input.i_format = VLC_FOURCC('f','l','3','2');
p_filter->output.i_format = VLC_FOURCC('f','l','3','2');
- msg_Warn( p_filter, "Bad input or output format" );
+ msg_Warn( p_filter, "bad input or output format" );
}
if ( !AOUT_FMTS_SIMILAR( &p_filter->input, &p_filter->output ) )
{
else
{
/* TODO compute the coeffs on the fly */
- msg_Err( p_filter, "unsupported rate" );
+ msg_Err( p_filter, "rate not supported" );
return VLC_EGENERIC;
}
div = lldiv( eqz_preset_10b[i]->f_amp[j] * 10000000,
10000000 );
sprintf( psz_newbands, "%s "I64Fd".%07u", psz_newbands,
- div.quot, (unsigned int) div.rem );
+ (int64_t)div.quot, (unsigned int) div.rem );
}
if( p_sys->b_first == VLC_FALSE )
{