]> git.sesse.net Git - vlc/blobdiff - modules/visualization/visual/visual.c
Use gettext_noop() consistently
[vlc] / modules / visualization / visual / visual.c
index 2e8898259d27c2df5754336510e5ece01e39e9a1..2e78280f12aee06ae5d8584ea9e12b803c2221d2 100644 (file)
@@ -1,10 +1,10 @@
 /*****************************************************************************
  * visual.c : Visualisation system
  *****************************************************************************
- * Copyright (C) 2002 the VideoLAN team
+ * Copyright (C) 2002-2006 the VideoLAN team
  * $Id$
  *
- * Authors: Clément Stenac <zorglub@via.ecp.fr>
+ * Authors: Clément Stenac <zorglub@via.ecp.fr>
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
  *****************************************************************************/
 
 /*****************************************************************************
  * Preamble
  *****************************************************************************/
-#include <stdlib.h>                                      /* malloc(), free() */
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
 #include <vlc/vlc.h>
-#include <vlc/vout.h>
-#include "audio_output.h"
-#include "aout_internal.h"
+#include <vlc_plugin.h>
+#include <vlc_vout.h>
+#include <vlc_aout.h>
 
 #include "visual.h"
 
@@ -38,7 +41,7 @@
 #define ELIST_TEXT N_( "Effects list" )
 #define ELIST_LONGTEXT N_( \
       "A list of visual effect, separated by commas.\n"  \
-      "Current effects include: dummy, scope, spectrum" )
+      "Current effects include: dummy, scope, spectrum." )
 
 #define WIDTH_TEXT N_( "Video width" )
 #define WIDTH_LONGTEXT N_( \
@@ -52,7 +55,7 @@
 #define NBBANDS_LONGTEXT N_( \
       "Number of bands used by spectrum analyzer, should be 20 or 80." )
 #define SPNBBANDS_LONGTEXT N_( \
-      "Number of bands used by the spectrOmeter, from 20 to 80." )
+      "Number of bands used by the spectrometer, from 20 to 80." )
 
 #define SEPAR_TEXT N_( "Band separator" )
 #define SEPAR_LONGTEXT N_( \
 
 #define PEAKS_TEXT N_( "Enable peaks" )
 #define PEAKS_LONGTEXT N_( \
-        "Defines whether to draw peaks." )
+        "Draw \"peaks\" in the spectrum analyzer." )
 
 #define ORIG_TEXT N_( "Enable original graphic spectrum" )
 #define ORIG_LONGTEXT N_( \
-        "Defines whether to draw the original spectrum graphic routine." )
+        "Enable the \"flat\" spectrum analyzer in the spectrometer." )
 
 #define BANDS_TEXT N_( "Enable bands" )
 #define BANDS_LONGTEXT N_( \
-        "Defines whether to draw the bands." )
+        "Draw bands in the spectrometer." )
 
 #define BASE_TEXT N_( "Enable base" )
 #define BASE_LONGTEXT N_( \
 #define RADIUS_LONGTEXT N_( \
         "Defines radius size in pixels, of base of bands(beginning)." )
 
-#define SECT_TEXT N_( "Spectral sections" )
-#define SECT_LONGTEXT N_( \
+#define SSECT_TEXT N_( "Spectral sections" )
+#define SSECT_LONGTEXT N_( \
         "Determines how many sections of spectrum will exist." )
 
 #define PEAK_HEIGHT_TEXT N_( "Peak height" )
 #define PEAK_HEIGHT_LONGTEXT N_( \
-        "This is the total pixel height of the peak items." )
+        "Total pixel height of the peak items." )
 
 #define PEAK_WIDTH_TEXT N_( "Peak extra width" )
 #define PEAK_WIDTH_LONGTEXT N_( \
 
 #define STARS_TEXT N_( "Number of stars" )
 #define STARS_LONGTEXT N_( \
-        "Defines the number of stars to draw with random effect." )
+        "Number of stars to draw with random effect." )
 
 static int  Open         ( vlc_object_t * );
 static void Close        ( vlc_object_t * );
 
 vlc_module_begin();
-    set_shortname( _("Visualizer"));
+    set_shortname( N_("Visualizer"));
     set_category( CAT_AUDIO );
     set_subcategory( SUBCAT_AUDIO_VISUAL );
-    set_description( _("Visualizer filter") );
+    set_description( N_("Visualizer filter") );
     set_section( N_( "General") , NULL );
     add_string("effect-list", "spectrum", NULL,
-            ELIST_TEXT, ELIST_LONGTEXT, VLC_TRUE );
+            ELIST_TEXT, ELIST_LONGTEXT, true );
     add_integer("effect-width",VOUT_WIDTH,NULL,
-             WIDTH_TEXT, WIDTH_LONGTEXT, VLC_FALSE );
+             WIDTH_TEXT, WIDTH_LONGTEXT, false );
     add_integer("effect-height" , VOUT_HEIGHT , NULL,
-             HEIGHT_TEXT, HEIGHT_LONGTEXT, VLC_FALSE );
+             HEIGHT_TEXT, HEIGHT_LONGTEXT, false );
     set_section( N_("Spectrum analyser") , NULL );
     add_integer("visual-nbbands", 80, NULL,
-             NBBANDS_TEXT, NBBANDS_LONGTEXT, VLC_TRUE );
+             NBBANDS_TEXT, NBBANDS_LONGTEXT, true );
     add_integer("visual-separ", 1, NULL,
-             SEPAR_TEXT, SEPAR_LONGTEXT, VLC_TRUE );
+             SEPAR_TEXT, SEPAR_LONGTEXT, true );
     add_integer("visual-amp", 3, NULL,
-             AMP_TEXT, AMP_LONGTEXT, VLC_TRUE );
-    add_bool("visual-peaks", VLC_TRUE, NULL,
-             PEAKS_TEXT, PEAKS_LONGTEXT, VLC_TRUE );
+             AMP_TEXT, AMP_LONGTEXT, true );
+    add_bool("visual-peaks", true, NULL,
+             PEAKS_TEXT, PEAKS_LONGTEXT, true );
     set_section( N_("Spectrometer") , NULL );
-    add_bool("spect-show-original", VLC_FALSE, NULL,
-             ORIG_TEXT, ORIG_LONGTEXT, VLC_TRUE );
-    add_bool("spect-show-base", VLC_TRUE, NULL,
-             BASE_TEXT, BASE_LONGTEXT, VLC_TRUE );
+    add_bool("spect-show-original", false, NULL,
+             ORIG_TEXT, ORIG_LONGTEXT, true );
+    add_bool("spect-show-base", true, NULL,
+             BASE_TEXT, BASE_LONGTEXT, true );
     add_integer("spect-radius", 42, NULL,
-             RADIUS_TEXT, RADIUS_LONGTEXT, VLC_TRUE );
+             RADIUS_TEXT, RADIUS_LONGTEXT, true );
     add_integer("spect-sections", 3, NULL,
-             SECT_TEXT, SECT_LONGTEXT, VLC_TRUE );
+             SSECT_TEXT, SSECT_LONGTEXT, true );
     add_integer("spect-color", 80, NULL,
-             COLOR1_TEXT, COLOR1_LONGTEXT, VLC_TRUE );
-    add_bool("spect-show-bands", VLC_TRUE, NULL,
-             BANDS_TEXT, BANDS_LONGTEXT, VLC_TRUE );
+             COLOR1_TEXT, COLOR1_LONGTEXT, true );
+    add_bool("spect-show-bands", true, NULL,
+             BANDS_TEXT, BANDS_LONGTEXT, true );
     add_integer("spect-nbbands", 32, NULL,
-             NBBANDS_TEXT, SPNBBANDS_LONGTEXT, VLC_TRUE );
+             NBBANDS_TEXT, SPNBBANDS_LONGTEXT, true );
     add_integer("spect-separ", 1, NULL,
-             SEPAR_TEXT, SEPAR_LONGTEXT, VLC_TRUE );
+             SEPAR_TEXT, SEPAR_LONGTEXT, true );
     add_integer("spect-amp", 8, NULL,
-             AMP_TEXT, AMP_LONGTEXT, VLC_TRUE );
-    add_bool("spect-show-peaks", VLC_TRUE, NULL,
-             PEAKS_TEXT, PEAKS_LONGTEXT, VLC_TRUE );
+             AMP_TEXT, AMP_LONGTEXT, true );
+    add_bool("spect-show-peaks", true, NULL,
+             PEAKS_TEXT, PEAKS_LONGTEXT, true );
     add_integer("spect-peak-width", 61, NULL,
-             PEAK_WIDTH_TEXT, PEAK_WIDTH_LONGTEXT, VLC_TRUE );
+             PEAK_WIDTH_TEXT, PEAK_WIDTH_LONGTEXT, true );
     add_integer("spect-peak-height", 1, NULL,
-             PEAK_HEIGHT_TEXT, PEAK_HEIGHT_LONGTEXT, VLC_TRUE );
+             PEAK_HEIGHT_TEXT, PEAK_HEIGHT_LONGTEXT, true );
     set_capability( "visualization", 0 );
     set_callbacks( Open, Close );
     add_shortcut( "visualizer");
@@ -166,7 +169,7 @@ static int FilterCallback( vlc_object_t *, char const *,
                            vlc_value_t, vlc_value_t, void * );
 static struct
 {
-    char *psz_name;
+    const char *psz_name;
     int  (*pf_run)( visual_effect_t *, aout_instance_t *,
                     aout_buffer_t *, picture_t *);
 } pf_effect_run[]=
@@ -188,7 +191,8 @@ static int Open( vlc_object_t *p_this )
     vlc_value_t        val;
 
     char *psz_effects, *psz_parser;
-    video_format_t fmt = {0};
+    video_format_t fmt;
+
 
     if( ( p_filter->input.i_format != VLC_FOURCC('f','l','3','2') &&
           p_filter->input.i_format != VLC_FOURCC('f','i','3','2') ) )
@@ -228,6 +232,8 @@ static int Open( vlc_object_t *p_this )
         int  i;
 
         p_effect = malloc( sizeof( visual_effect_t ) );
+        if( !p_effect )
+            break;
         p_effect->i_width = p_sys->i_width;
         p_effect->i_height= p_sys->i_height;
         p_effect->i_nb_chans = aout_FormatNbChannels( &p_filter->input);
@@ -261,7 +267,7 @@ static int Open( vlc_object_t *p_this )
 
                 if( ( psz_eoa = strchr( psz_parser, '}') ) == NULL )
                 {
-                   msg_Err( p_filter, "Unable to parse effect list. Aborting");
+                   msg_Err( p_filter, "unable to parse effect list. Aborting");
                    break;
                 }
                 p_effect->psz_args =
@@ -302,6 +308,8 @@ static int Open( vlc_object_t *p_this )
     }
 
     /* Open the video output */
+    memset( &fmt, 0, sizeof(video_format_t) );
+
     fmt.i_width = fmt.i_visible_width = p_sys->i_width;
     fmt.i_height = fmt.i_visible_height = p_sys->i_height;
     fmt.i_chroma = VLC_FOURCC('I','4','2','0');
@@ -319,7 +327,6 @@ static int Open( vlc_object_t *p_this )
     p_filter->pf_do_work = DoWork;
     p_filter->b_in_place= 1;
 
-    msg_Dbg( p_filter,"Visualizer initialized");
     return VLC_SUCCESS;
 }
 
@@ -420,9 +427,11 @@ static int FilterCallback( vlc_object_t *p_this, char const *psz_cmd,
                            vlc_value_t oldval, vlc_value_t newval,
                            void *p_data )
 {
+    VLC_UNUSED(psz_cmd); VLC_UNUSED(oldval);
+    VLC_UNUSED(p_data); VLC_UNUSED(newval);
     aout_filter_t     *p_filter = (aout_filter_t *)p_this;
     /* restart this baby */
-    msg_Dbg( p_filter, "We should restart the visual filter" );
+    msg_Dbg( p_filter, "we should restart the visual filter" );
     return VLC_SUCCESS;
 }