[vlc-commits] audio_filter: add stereowiden config prefix

Francois Cartegnie git at videolan.org
Tue Jan 24 12:01:38 CET 2017


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Tue Jan 24 11:31:54 2017 +0100| [8ca24508d9227b7aa2dcda66888d8818c7f39c27] | committer: Francois Cartegnie

audio_filter: add stereowiden config prefix

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=8ca24508d9227b7aa2dcda66888d8818c7f39c27
---

 modules/audio_filter/stereo_widen.c | 34 ++++++++++++++++++----------------
 1 file changed, 18 insertions(+), 16 deletions(-)

diff --git a/modules/audio_filter/stereo_widen.c b/modules/audio_filter/stereo_widen.c
index 9cc652a..1eac465 100644
--- a/modules/audio_filter/stereo_widen.c
+++ b/modules/audio_filter/stereo_widen.c
@@ -68,6 +68,8 @@ struct filter_sys_t
 #define DRYMIX_TEXT N_("Dry mix")
 #define DRYMIX_LONGTEXT N_("Level of input signal of original channel.")
 
+#define CONFIG_PREFIX "stereowiden-"
+
 /*****************************************************************************
  * Module descriptor
  *****************************************************************************/
@@ -80,13 +82,13 @@ vlc_module_begin ()
     set_capability( "audio filter", 0 )
     set_callbacks( Open, Close )
 
-    add_float_with_range( "delay", 20, 1, 100,
+    add_float_with_range( CONFIG_PREFIX "delay", 20, 1, 100,
         DELAY_TEXT, DELAY_LONGTEXT, true )
-    add_float_with_range( "feedback", 0.3, 0.0, 0.9,
+    add_float_with_range( CONFIG_PREFIX "feedback", 0.3, 0.0, 0.9,
         FEEDBACK_TEXT, FEEDBACK_LONGTEXT, true )
-    add_float_with_range( "crossfeed", 0.3, 0.0, 0.8,
+    add_float_with_range( CONFIG_PREFIX "crossfeed", 0.3, 0.0, 0.8,
         CROSSFEED_TEXT, CROSSFEED_LONGTEXT, true )
-    add_float_with_range( "dry-mix", 0.8, 0.0, 1.0,
+    add_float_with_range( CONFIG_PREFIX "dry-mix", 0.8, 0.0, 1.0,
         DRYMIX_TEXT, DRYMIX_LONGTEXT, true )
 vlc_module_end ()
 
@@ -135,10 +137,10 @@ static int Open( vlc_object_t *obj )
     p_sys->stor = var_CreateGetFloat( obj, var ); \
     var_AddCallback( p_filter, var, paramCallback, p_sys );
 
-    CREATE_VAR( f_delay, "delay" )
-    CREATE_VAR( f_feedback, "feedback" )
-    CREATE_VAR( f_crossfeed, "crossfeed" )
-    CREATE_VAR( f_dry_mix, "dry-mix" )
+    CREATE_VAR( f_delay,     CONFIG_PREFIX "delay" )
+    CREATE_VAR( f_feedback,  CONFIG_PREFIX "feedback" )
+    CREATE_VAR( f_crossfeed, CONFIG_PREFIX "crossfeed" )
+    CREATE_VAR( f_dry_mix,   CONFIG_PREFIX "dry-mix" )
 
     /* Compute buffer length and allocate space */
     p_sys->pf_ringbuf = NULL;
@@ -200,10 +202,10 @@ static void Close( vlc_object_t *obj )
     var_DelCallback( p_filter, var, paramCallback, p_sys ); \
     var_Destroy( p_filter, var );
 
-    DEL_VAR( "feedback" );
-    DEL_VAR( "crossfeed" );
-    DEL_VAR( "dry-mix" );
-    var_Destroy( p_filter, "delay" );
+    DEL_VAR( CONFIG_PREFIX "feedback" );
+    DEL_VAR( CONFIG_PREFIX "crossfeed" );
+    DEL_VAR( CONFIG_PREFIX "dry-mix" );
+    var_Destroy( p_filter, CONFIG_PREFIX "delay" );
 
     free( p_sys->pf_ringbuf );
     free( p_sys );
@@ -223,7 +225,7 @@ static int paramCallback( vlc_object_t *p_this, char const *psz_var,
     VLC_UNUSED(oldval);
     VLC_UNUSED(p_this);
 
-    if( !strcmp( psz_var, "delay" ) )
+    if( !strcmp( psz_var, CONFIG_PREFIX "delay" ) )
     {
         if( MakeRingBuffer( &p_sys->pf_ringbuf, &p_sys->i_len, &p_sys->pf_write,
                             newval.f_float, p_filter->fmt_in.audio.i_rate ) != VLC_SUCCESS )
@@ -235,11 +237,11 @@ static int paramCallback( vlc_object_t *p_this, char const *psz_var,
             p_sys->f_delay = newval.f_float;
         }
     }
-    else if( !strcmp( psz_var, "feedback" ) )
+    else if( !strcmp( psz_var, CONFIG_PREFIX "feedback" ) )
         p_sys->f_feedback = newval.f_float;
-    else if( !strcmp( psz_var, "crossfeed" ) )
+    else if( !strcmp( psz_var, CONFIG_PREFIX "crossfeed" ) )
         p_sys->f_feedback = newval.f_float;
-    else if( !strcmp( psz_var, "dry-mix" ) )
+    else if( !strcmp( psz_var, CONFIG_PREFIX "dry-mix" ) )
         p_sys->f_dry_mix = newval.f_float;
 
     return VLC_SUCCESS;



More information about the vlc-commits mailing list