]> git.sesse.net Git - vlc/blobdiff - modules/audio_filter/spatializer/spatializer.cpp
Merge branch '1.0-bugfix'
[vlc] / modules / audio_filter / spatializer / spatializer.cpp
index d9043495076d6818ab541d42cfd404fbb6ea32c6..b8b2ecf8f7a13e02163432ab0f163e6c70fba19c 100644 (file)
 /*****************************************************************************
  * Preamble
  *****************************************************************************/
-#include <stdlib.h>                                      /* malloc(), free() */
-#include <math.h>
-
 #ifdef HAVE_CONFIG_H
 # include "config.h"
 #endif
 
+#include <stdlib.h>                                      /* malloc(), free() */
+#include <math.h>
+
 #include <vlc_common.h>
 #include <vlc_plugin.h>
 #include "vlc_aout.h"
@@ -52,14 +52,14 @@ static void Close( vlc_object_t * );
 #define WIDTH_TEXT N_("Room width")
 #define WIDTH_LONGTEXT N_("Width of the virtual room")
 
-#define WET_TEXT ""
-#define WET_LONGTEXT ""
+#define WET_TEXT N_("Wet")
+#define WET_LONGTEXT NULL
 
-#define DRY_TEXT ""
-#define DRY_LONGTEXT ""
+#define DRY_TEXT N_("Dry")
+#define DRY_LONGTEXT NULL
 
-#define DAMP_TEXT ""
-#define DAMP_LONGTEXT ""
+#define DAMP_TEXT N_("Damp")
+#define DAMP_LONGTEXT NULL
 
 vlc_module_begin ()
     set_description( N_("Audio Spatializer") )
@@ -70,11 +70,12 @@ vlc_module_begin ()
 
     set_callbacks( Open, Close )
     add_shortcut( "spatializer" )
-    add_float( "roomsize", 1.05, NULL, ROOMSIZE_TEXT,ROOMSIZE_LONGTEXT, true)
-    add_float( "width", 10.0, NULL, WIDTH_TEXT,WIDTH_LONGTEXT, true)
-    add_float( "wet", 3.0, NULL, WET_TEXT,WET_LONGTEXT, true)
-    add_float( "dry", 2.0, NULL, DRY_TEXT,DRY_LONGTEXT, true)
-    add_float( "damp", 1.0, NULL, DAMP_TEXT,DAMP_LONGTEXT, true)
+    add_float( "spatializer-roomsize", 1.05, NULL, ROOMSIZE_TEXT,
+               ROOMSIZE_LONGTEXT, true )
+    add_float( "spatializer-width", 10., NULL, WIDTH_TEXT,WIDTH_LONGTEXT, true )
+    add_float( "spatializer-wet", 3., NULL, WET_TEXT,WET_LONGTEXT, true )
+    add_float( "spatializer-dry", 2., NULL, DRY_TEXT,DRY_LONGTEXT, true )
+    add_float( "spatializer-damp", 1., NULL, DAMP_TEXT,DAMP_LONGTEXT, true )
 vlc_module_end ()
 
 /*****************************************************************************
@@ -102,7 +103,8 @@ private:
 
 static const char *psz_control_names[] =
 {
-    "Roomsize", "Width" , "Wet", "Dry", "Damp"
+    "spatializer-roomsize", "spatializer-width" ,
+    "spatializer-wet", "spatializer-dry", "spatializer-damp"
 };
 static void DoWork( aout_instance_t *, aout_filter_t *,
                     aout_buffer_t *, aout_buffer_t * );
@@ -130,14 +132,14 @@ static int Open( vlc_object_t *p_this )
     aout_filter_t     *p_filter = (aout_filter_t *)p_this;
     aout_filter_sys_t *p_sys;
     bool         b_fit = true;
-    msg_Dbg(p_this, "Opening filter spatializer %s %s %d\n", __FILE__,__func__,__LINE__);
+    msg_Dbg(p_this, "Opening filter spatializer %s %s %d", __FILE__,__func__,__LINE__);
 
-    if( p_filter->input.i_format != VLC_FOURCC('f','l','3','2' ) ||
-        p_filter->output.i_format != VLC_FOURCC('f','l','3','2') )
+    if( p_filter->input.i_format != VLC_CODEC_FL32 ||
+        p_filter->output.i_format != VLC_CODEC_FL32 )
     {
         b_fit = false;
-        p_filter->input.i_format = VLC_FOURCC('f','l','3','2');
-        p_filter->output.i_format = VLC_FOURCC('f','l','3','2');
+        p_filter->input.i_format = VLC_CODEC_FL32;
+        p_filter->output.i_format = VLC_CODEC_FL32;
         msg_Warn( p_filter, "bad input or output format" );
     }
     if ( !AOUT_FMTS_SIMILAR( &p_filter->input, &p_filter->output ) )
@@ -184,7 +186,7 @@ static void Close( vlc_object_t *p_this )
     delete p_sys->p_reverbm;
     vlc_mutex_destroy( &p_sys->lock );
     free( p_sys );
-    msg_Dbg(p_this, "Closing filter spatializer %s %s %d\n", __FILE__,__func__,__LINE__);
+    msg_Dbg(p_this, "Closing filter spatializer %s %s %d", __FILE__,__func__,__LINE__);
 }
 
 /*****************************************************************************
@@ -279,7 +281,7 @@ static int RoomCallback( vlc_object_t *p_this, char const *psz_cmd,
     CLocker locker( &p_sys->lock );
 
     p_sys->p_reverbm->setroomsize(newval.f_float);
-    msg_Dbg (p_this,"room callback %3.1f %s %s %d\n", newval.f_float, __FILE__,__func__,__LINE__);
+    msg_Dbg (p_this,"room callback %3.1f %s %s %d", newval.f_float, __FILE__,__func__,__LINE__);
     return VLC_SUCCESS;
 }
 
@@ -290,7 +292,7 @@ static int WidthCallback( vlc_object_t *p_this, char const *psz_cmd,
     CLocker locker( &p_sys->lock );
 
     p_sys->p_reverbm->setwidth(newval.f_float);
-    msg_Dbg (p_this,"width callback %3.1f %s %s %d\n", newval.f_float,  __FILE__,__func__,__LINE__);
+    msg_Dbg (p_this,"width callback %3.1f %s %s %d", newval.f_float,  __FILE__,__func__,__LINE__);
     return VLC_SUCCESS;
 }
 static int WetCallback( vlc_object_t *p_this, char const *psz_cmd,
@@ -300,7 +302,7 @@ static int WetCallback( vlc_object_t *p_this, char const *psz_cmd,
     CLocker locker( &p_sys->lock );
 
     p_sys->p_reverbm->setwet(newval.f_float);
-    msg_Dbg (p_this,"wet callback %3.1f %s %s %d\n", newval.f_float,  __FILE__,__func__,__LINE__);
+    msg_Dbg (p_this,"wet callback %3.1f %s %s %d", newval.f_float,  __FILE__,__func__,__LINE__);
     return VLC_SUCCESS;
 }
 static int DryCallback( vlc_object_t *p_this, char const *psz_cmd,
@@ -310,7 +312,7 @@ static int DryCallback( vlc_object_t *p_this, char const *psz_cmd,
     CLocker locker( &p_sys->lock );
 
     p_sys->p_reverbm->setdry(newval.f_float);
-    msg_Dbg (p_this,"dry callback %3.1f %s %s %d\n", newval.f_float, __FILE__,__func__,__LINE__);
+    msg_Dbg (p_this,"dry callback %3.1f %s %s %d", newval.f_float, __FILE__,__func__,__LINE__);
     return VLC_SUCCESS;
 }
 static int DampCallback( vlc_object_t *p_this, char const *psz_cmd,
@@ -320,7 +322,7 @@ static int DampCallback( vlc_object_t *p_this, char const *psz_cmd,
     CLocker locker( &p_sys->lock );
 
     p_sys->p_reverbm->setdamp(newval.f_float);
-    msg_Dbg (p_this, "damp callback %3.1f %s %s %d\n", newval.f_float, __FILE__,__func__,__LINE__);
+    msg_Dbg (p_this, "damp callback %3.1f %s %s %d", newval.f_float, __FILE__,__func__,__LINE__);
     return VLC_SUCCESS;
 }