Commit e53ac062 authored by Gildas Bazin's avatar Gildas Bazin

* include/configuration.h: some small re-work of the config declaration macros.

   String choices lists can now also have a list of text descriptions associated with them.
   Added integer choices lists.
* modules/gui/wxwindows/: modified config widgets to use the new config options.
* ALL: updated for the new config options.
parent 354c7ab9
This diff is collapsed.
......@@ -2,7 +2,7 @@
* modules_inner.h : Macros used from within a module.
*****************************************************************************
* Copyright (C) 2001 VideoLAN
* $Id: modules_inner.h,v 1.39 2003/10/30 21:44:48 gbazin Exp $
* $Id: modules_inner.h,v 1.40 2003/11/05 00:39:16 gbazin Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
......@@ -91,7 +91,7 @@
EXTERN_SYMBOL DLL_SYMBOL int CDECL_SYMBOL \
__VLC_SYMBOL(vlc_entry) ( module_t *p_module ) \
{ \
int i_shortcut = 1, i_config = 0; \
int i_shortcut = 1, i_config = -1; \
module_config_t p_config[ 130 ]; \
STORE_SYMBOLS; \
p_module->b_submodule = VLC_FALSE; \
......@@ -114,7 +114,7 @@
} \
{ \
static module_config_t tmp = { CONFIG_HINT_END }; \
p_config[ i_config ] = tmp; \
p_config[ ++i_config ] = tmp; \
} \
config_Duplicate( p_module, p_config ); \
if( p_module->p_config == NULL ) \
......
......@@ -2,7 +2,7 @@
* dvd.c : DVD input module for vlc
*****************************************************************************
* Copyright (C) 2000-2001 VideoLAN
* $Id: dvd.c,v 1.8 2003/06/17 16:09:16 gbazin Exp $
* $Id: dvd.c,v 1.9 2003/11/05 00:39:16 gbazin Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
......@@ -79,14 +79,18 @@ static void UnprobeLibDVDCSS( void );
"libcss.\n" \
"The default method is: key.")
static char *cssmethod_list[] = { "title", "disc", "key", NULL };
static char *psz_css_list[] = { "title", "disc", "key" };
static char *psz_css_list_text[] = { N_("title"), N_("Disc"), N_("Key") };
vlc_module_begin();
int i;
add_usage_hint( N_("[dvd:][device][@raw_device][@[title][,[chapter][,angle]]]") );
add_category_hint( N_("dvd"), NULL, VLC_TRUE );
add_string_from_list( "dvdcss-method", NULL, cssmethod_list, NULL,
CSSMETHOD_TEXT, CSSMETHOD_LONGTEXT, VLC_TRUE );
add_string( "dvdcss-method", NULL, NULL, CSSMETHOD_TEXT,
CSSMETHOD_LONGTEXT, VLC_TRUE );
change_string_list( psz_css_list, psz_css_list_text, 0 );
#ifdef GOD_DAMN_DMCA
set_description( _("DVD input (uses libdvdcss if installed)") );
i = 90;
......
......@@ -2,7 +2,7 @@
* file.c : audio output which writes the samples to a file
*****************************************************************************
* Copyright (C) 2002 VideoLAN
* $Id: file.c,v 1.23 2003/10/25 00:49:13 sam Exp $
* $Id: file.c,v 1.24 2003/11/05 00:39:16 gbazin Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
* Gildas Bazin <gbazin@netcourrier.com>
......@@ -89,7 +89,7 @@ static void Play ( aout_instance_t * );
static char *format_list[] = { "u8", "s8", "u16", "s16", "u16_le", "s16_le",
"u16_be", "s16_be", "fixed32", "float32",
"spdif", NULL };
"spdif" };
static int format_int[] = { VLC_FOURCC('u','8',' ',' '),
VLC_FOURCC('s','8',' ',' '),
AOUT_FMT_U16_NE, AOUT_FMT_S16_NE,
......@@ -106,8 +106,9 @@ static int format_int[] = { VLC_FOURCC('u','8',' ',' '),
vlc_module_begin();
add_category_hint( N_("Audio"), NULL, VLC_FALSE );
add_string_from_list( "audiofile-format", "s16", format_list, NULL,
FORMAT_TEXT, FORMAT_LONGTEXT, VLC_TRUE );
add_string( "audiofile-format", "s16", NULL,
FORMAT_TEXT, FORMAT_LONGTEXT, VLC_TRUE );
change_string_list( format_list, 0, 0 );
add_file( "audiofile", "audiofile.wav", NULL, FILE_TEXT,
FILE_LONGTEXT, VLC_FALSE );
add_bool( "audiofile-wav", 1, NULL, WAV_TEXT, WAV_LONGTEXT, VLC_TRUE );
......
......@@ -2,7 +2,7 @@
* subsdec.c : text subtitles decoder
*****************************************************************************
* Copyright (C) 2000-2001 VideoLAN
* $Id: subsdec.c,v 1.4 2003/11/05 00:17:50 hartman Exp $
* $Id: subsdec.c,v 1.5 2003/11/05 00:39:16 gbazin Exp $
*
* Authors: Gildas Bazin <gbazin@netcourrier.com>
* Samuel Hocevar <sam@zoy.org>
......@@ -89,13 +89,16 @@ static char *ppsz_encodings[] = { DEFAULT_NAME, "ASCII", "UTF-8", "",
"C99", "JAVA", "UCS-2", "UCS-2BE", "UCS-2LE", "UCS-4", "UCS-4BE", "UCS-4LE", "",
"HZ", "GBK", "GB18030", "JOHAB", "ARMSCII-8",
"Georgian-Academy", "Georgian-PS", "TIS-620", "MuleLao-1", "VISCII", "TCVN",
"HPROMAN8", "NEXTSTEP", NULL };
"HPROMAN8", "NEXTSTEP" };
#endif
static int pi_justification[] = { 0, 1, 2 };
static char *ppsz_justification_text[] = {N_("Center"),N_("Left"),N_("Right")};
#define ENCODING_TEXT N_("Subtitles text encoding")
#define ENCODING_LONGTEXT N_("Change the encoding used in text subtitles")
#define ALIGN_TEXT N_("Subtitles justification")
#define ALIGN_LONGTEXT N_("Change the justification of substitles (0=center, 1=left, 2=right)")
#define ALIGN_LONGTEXT N_("Change the justification of substitles")
vlc_module_begin();
set_description( _("text subtitles decoder") );
......@@ -103,9 +106,13 @@ vlc_module_begin();
set_callbacks( OpenDecoder, NULL );
add_category_hint( N_("Subtitles"), NULL, VLC_FALSE );
add_integer( "subsdec-align", 0, NULL, ALIGN_TEXT, ALIGN_LONGTEXT, VLC_TRUE );
add_integer( "subsdec-align", 0, NULL, ALIGN_TEXT, ALIGN_LONGTEXT,
VLC_TRUE );
change_integer_list( pi_justification, ppsz_justification_text, 0 );
#if defined(HAVE_ICONV)
add_string_from_list( "subsdec-encoding", DEFAULT_NAME, ppsz_encodings, NULL, ENCODING_TEXT, ENCODING_LONGTEXT, VLC_FALSE );
add_string( "subsdec-encoding", DEFAULT_NAME, NULL,
ENCODING_TEXT, ENCODING_LONGTEXT, VLC_FALSE );
change_string_list( ppsz_encodings, 0, 0 );
#endif
vlc_module_end();
......
......@@ -2,7 +2,7 @@
* geatures.c: control vlc with mouse gestures
*****************************************************************************
* Copyright (C) 2002 VideoLAN
* $Id: gestures.c,v 1.5 2003/06/22 13:27:41 sigmunau Exp $
* $Id: gestures.c,v 1.6 2003/11/05 00:39:16 gbazin Exp $
*
* Authors: Sigmund Augdal <sigmunau@idi.ntnu.no>
*
......@@ -83,13 +83,15 @@ static void RunIntf ( intf_thread_t *p_intf );
#define BUTTON_LONGTEXT N_( \
"the mouse button to be held down during mouse gestures" )
static char *button_list[] = { "left", "middle", "right", NULL };
static char *button_list[] = { "left", "middle", "right" };
static char *button_list_text[] = { N_("Left"), N_("Middle"), N_("Right") };
vlc_module_begin();
add_category_hint( N_( "Gestures" ), NULL, VLC_FALSE );
add_integer( "gestures-threshold", 30, NULL, THRESHOLD_TEXT, THRESHOLD_LONGTEXT, VLC_TRUE );
add_string_from_list( "gestures-button", "right", button_list, NULL,
BUTTON_TEXT, BUTTON_LONGTEXT, VLC_FALSE );
add_string( "gestures-button", "right", NULL,
BUTTON_TEXT, BUTTON_LONGTEXT, VLC_FALSE );
change_string_list( button_list, button_list_text, 0 );
set_description( _("mouse gestures control interface") );
set_capability( "interface", 0 );
......
......@@ -2,7 +2,7 @@
* mkv.cpp : matroska demuxer
*****************************************************************************
* Copyright (C) 2001 VideoLAN
* $Id: mkv.cpp,v 1.36 2003/11/05 00:17:50 hartman Exp $
* $Id: mkv.cpp,v 1.37 2003/11/05 00:39:16 gbazin Exp $
*
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
*
......@@ -1249,7 +1249,7 @@ static int Open( vlc_object_t * p_this )
!strcmp( tk.psz_codec, "S_ASS" ))
{
tk.i_codec = VLC_FOURCC( 's', 's', 'a', ' ' );
tk.p_es->p_demux_data = malloc( sizeof( subtitle_data_t ) );
tk.p_es->p_demux_data = (es_sys_t *)malloc( sizeof( subtitle_data_t ) );
tk.p_es->p_demux_data->psz_header = strdup( (char *)tk.p_extra_data );
}
else if( !strcmp( tk.psz_codec, "S_VOBSUB" ) )
......
......@@ -2,7 +2,7 @@
* sub.c
*****************************************************************************
* Copyright (C) 1999-2003 VideoLAN
* $Id: sub.c,v 1.34 2003/11/05 00:17:50 hartman Exp $
* $Id: sub.c,v 1.35 2003/11/05 00:39:16 gbazin Exp $
*
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
*
......@@ -53,9 +53,8 @@ static void sub_close( subtitle_demux_t *p_sub );
static void sub_fix( subtitle_demux_t *p_sub );
static char *ppsz_sub_type[] = { "auto", "microdvd", "subrip", "ssa1", "ssa2-4",
"vplayer", "sami", "vobsub", NULL };
static char *ppsz_sub_type[] = { "auto", "microdvd", "subrip", "ssa1",
"ssa2-4", "vplayer", "sami", "vobsub" };
/*****************************************************************************
* Module descriptor
......@@ -79,9 +78,9 @@ vlc_module_begin();
add_integer( "sub-delay", 0, NULL,
"Delay subtitles (in 1/10s)",
SUB_DELAY_LONGTEXT, VLC_TRUE );
add_string_from_list( "sub-type", "auto", ppsz_sub_type, NULL,
"subtitles type",
SUB_TYPE_LONGTEXT, VLC_TRUE );
add_string( "sub-type", "auto", NULL, "subtitles type",
SUB_TYPE_LONGTEXT, VLC_TRUE );
change_string_list( ppsz_sub_type, 0, 0 );
set_callbacks( Open, NULL );
vlc_module_end();
......
......@@ -2,11 +2,11 @@
* beos.cpp : BeOS plugin for vlc
*****************************************************************************
* Copyright (C) 2000, 2001 VideoLAN
* $Id: BeOS.cpp,v 1.12 2003/06/17 16:09:16 gbazin Exp $
* $Id: BeOS.cpp,v 1.13 2003/11/05 00:39:16 gbazin Exp $
*
* Authors: Jean-Marc Dressler <polux@via.ecp.fr>
* Samuel Hocevar <sam@zoy.org>
* Stephan Aßmus <stippi@yellowbites.com>
* Stephan Aßmus <stippi@yellowbites.com>
*
* 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
......@@ -46,12 +46,14 @@ void E_(CloseVideo) ( vlc_object_t * );
/*****************************************************************************
* Module descriptor
*****************************************************************************/
static char * ppsz_screenshotformat[] = { "TGA", "PPM", "PNG", "JPEG", "BMP", NULL };
static char * ppsz_screenshotformat[] = { "TGA", "PPM", "PNG", "JPEG", "BMP" };
vlc_module_begin();
add_bool( "beos-dvdmenus", 0, NULL, "Use DVD Menus", "", VLC_TRUE );
add_string( "beos-screenshotpath", "/boot/home/", NULL, "Screenshot Path", "", VLC_TRUE );
add_string_from_list( "beos-screenshotformat", "PNG", ppsz_screenshotformat, NULL, "Screenshot Format", "", VLC_TRUE );
add_string( "beos-screenshotformat", "PNG", NULL, "Screenshot Format",
"", VLC_TRUE );
change_string_list( ppsz_screenshotformat, 0, 0 );
set_description( _("BeOS standard API interface") );
set_capability( "interface", 100 );
set_callbacks( E_(OpenIntf), E_(CloseIntf) );
......
......@@ -2,7 +2,7 @@
* preferences_widgets.cpp : wxWindows plugin for vlc
*****************************************************************************
* Copyright (C) 2000-2001 VideoLAN
* $Id: preferences_widgets.cpp,v 1.9 2003/11/02 22:16:32 gbazin Exp $
* $Id: preferences_widgets.cpp,v 1.10 2003/11/05 00:39:16 gbazin Exp $
*
* Authors: Gildas Bazin <gbazin@netcourrier.com>
* Sigmund Augdal <sigmunau@idi.ntnu.no>
......@@ -53,7 +53,7 @@ ConfigControl *CreateConfigControl( vlc_object_t *p_this,
break;
case CONFIG_ITEM_STRING:
if( !p_item->ppsz_list )
if( !p_item->i_list )
{
p_control = new StringConfigControl( p_item, parent );
}
......@@ -69,7 +69,11 @@ ConfigControl *CreateConfigControl( vlc_object_t *p_this,
break;
case CONFIG_ITEM_INTEGER:
if( p_item->i_min != 0 || p_item->i_max != 0 )
if( p_item->i_list )
{
p_control = new IntegerListConfigControl( p_item, parent );
}
else if( p_item->i_min != 0 || p_item->i_max != 0 )
{
p_control = new RangedIntConfigControl( p_item, parent );
}
......@@ -359,22 +363,29 @@ StringListConfigControl::StringListConfigControl( module_config_t *p_item,
{
label = new wxStaticText(this, -1, wxU(p_item->psz_text));
sizer->Add( label, 1, wxALIGN_CENTER_VERTICAL | wxALL, 5 );
combo = new wxComboBox( this, -1, wxU(p_item->psz_value),
combo = new wxComboBox( this, -1, wxT(""),
wxDefaultPosition, wxDefaultSize,
0, NULL, wxCB_READONLY );
/* build a list of available options */
for( int i_index = 0; p_item->ppsz_list[i_index];
i_index++ )
for( int i_index = 0; i_index < p_item->i_list; i_index++ )
{
combo->Append( wxU(p_item->ppsz_list[i_index]) );
combo->Append( ( p_item->ppsz_list_text &&
p_item->ppsz_list_text[i_index] ) ?
wxU(p_item->ppsz_list_text[i_index]) :
wxU(p_item->ppsz_list[i_index]) );
combo->SetClientData( i_index, (void *)p_item->ppsz_list[i_index] );
if( p_item->psz_value && !strcmp( p_item->psz_value,
p_item->ppsz_list[i_index] ) )
{
combo->SetSelection( i_index );
combo->SetValue( ( p_item->ppsz_list_text &&
p_item->ppsz_list_text[i_index] ) ?
wxU(p_item->ppsz_list_text[i_index]) :
wxU(p_item->ppsz_list[i_index]) );
}
}
if( p_item->psz_value )
combo->SetValue( wxU(p_item->psz_value) );
combo->SetToolTip( wxU(p_item->psz_longtext) );
sizer->Add( combo, 1, wxALIGN_CENTER_VERTICAL | wxALL, 5 );
sizer->Layout();
......@@ -388,7 +399,12 @@ StringListConfigControl::~StringListConfigControl()
wxString StringListConfigControl::GetPszValue()
{
return combo->GetStringSelection();
int selected = combo->GetSelection();
if( selected != -1 )
{
return (char *)combo->GetClientData( selected );
}
return wxString();
}
/*****************************************************************************
......@@ -484,6 +500,60 @@ int IntegerConfigControl::GetIntValue()
return spin->GetValue();
}
/*****************************************************************************
* IntegerListConfigControl implementation
*****************************************************************************/
IntegerListConfigControl::IntegerListConfigControl( module_config_t *p_item,
wxWindow *parent )
: ConfigControl( p_item, parent )
{
label = new wxStaticText(this, -1, wxU(p_item->psz_text));
sizer->Add( label, 1, wxALIGN_CENTER_VERTICAL | wxALL, 5 );
combo = new wxComboBox( this, -1, wxT(""),
wxDefaultPosition, wxDefaultSize,
0, NULL, wxCB_READONLY );
/* build a list of available options */
for( int i_index = 0; i_index < p_item->i_list; i_index++ )
{
combo->Append( ( p_item->ppsz_list_text &&
p_item->ppsz_list_text[i_index] ) ?
wxU(p_item->ppsz_list_text[i_index]) :
wxString::Format(wxT("%i"),
p_item->pi_list[i_index]) );
combo->SetClientData( i_index, (void *)p_item->pi_list[i_index] );
if( p_item->i_value == p_item->pi_list[i_index] )
{
combo->SetSelection( i_index );
combo->SetValue( ( p_item->ppsz_list_text &&
p_item->ppsz_list_text[i_index] ) ?
wxU(p_item->ppsz_list_text[i_index]) :
wxString::Format(wxT("%i"),
p_item->pi_list[i_index]) );
}
}
combo->SetToolTip( wxU(p_item->psz_longtext) );
sizer->Add( combo, 1, wxALIGN_CENTER_VERTICAL | wxALL, 5 );
sizer->Layout();
this->SetSizerAndFit( sizer );
}
IntegerListConfigControl::~IntegerListConfigControl()
{
;
}
int IntegerListConfigControl::GetIntValue()
{
int selected = combo->GetSelection();
if( selected != -1 )
{
return (int)combo->GetClientData( selected );
}
return -1;
}
/*****************************************************************************
* RangedIntConfigControl implementation
*****************************************************************************/
......
......@@ -2,7 +2,7 @@
* preferences_widgets.h : wxWindows plugin for vlc
*****************************************************************************
* Copyright (C) 2000-2003 VideoLAN
* $Id: preferences_widgets.h,v 1.3 2003/10/20 12:25:22 gbazin Exp $
* $Id: preferences_widgets.h,v 1.4 2003/11/05 00:39:16 gbazin Exp $
*
* Authors: Sigmund Augdal <sigmunau@idi.ntnu.no>
*
......@@ -117,6 +117,16 @@ private:
wxSpinCtrl *spin;
};
class IntegerListConfigControl: public ConfigControl
{
public:
IntegerListConfigControl( module_config_t *p_item, wxWindow *parent );
~IntegerListConfigControl();
virtual int GetIntValue();
private:
wxComboBox *combo;
};
class RangedIntConfigControl: public ConfigControl
{
public:
......
......@@ -2,7 +2,7 @@
* freetype.c : Put text on the video, using freetype2
*****************************************************************************
* Copyright (C) 2002, 2003 VideoLAN
* $Id: freetype.c,v 1.30 2003/10/29 12:23:50 gbazin Exp $
* $Id: freetype.c,v 1.31 2003/11/05 00:39:16 gbazin Exp $
*
* Authors: Sigmund Augdal <sigmunau@idi.ntnu.no>
*
......@@ -89,13 +89,17 @@ static line_desc_t *NewLine( byte_t * );
#define FONTSIZE_TEXT N_("Font size")
#define FONTSIZE_LONGTEXT N_("The size of the fonts used by the osd module" )
static char *ppsz_sizes[] = { "smaller", "small", "normal", "large", "larger", NULL};
static char *ppsz_sizes[] = { "smaller", "small", "normal", "large", "larger"};
static char *ppsz_sizes_text[] = { N_("Smaller"), N_("Small"), N_("Normal"),
N_("Large"), N_("Larger") };
vlc_module_begin();
add_category_hint( N_("Fonts"), NULL, VLC_FALSE );
add_file( "freetype-font", DEFAULT_FONT, NULL, FONT_TEXT, FONT_LONGTEXT, VLC_FALSE );
add_integer( "freetype-fontsize", 16, NULL, FONTSIZE_TEXT, FONTSIZE_LONGTEXT, VLC_TRUE );
add_string_from_list( "freetype-rel-fontsize", "normal", ppsz_sizes, NULL, FONTSIZE_TEXT, FONTSIZE_LONGTEXT, VLC_FALSE );
add_string( "freetype-rel-fontsize", "normal", NULL, FONTSIZE_TEXT,
FONTSIZE_LONGTEXT, VLC_FALSE );
change_string_list( ppsz_sizes, ppsz_sizes_text, 0 );
set_description( _("freetype2 font renderer") );
set_capability( "text renderer", 100 );
add_shortcut( "text" );
......
......@@ -2,7 +2,7 @@
* logger.c : file logging plugin for vlc
*****************************************************************************
* Copyright (C) 2002 VideoLAN
* $Id: logger.c,v 1.8 2003/05/15 22:27:37 massiot Exp $
* $Id: logger.c,v 1.9 2003/11/05 00:39:16 gbazin Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
......@@ -81,14 +81,18 @@ static void HtmlPrint ( const msg_item_t *, FILE * );
/*****************************************************************************
* Module descriptor
*****************************************************************************/
static char *mode_list[] = { "text", "html", NULL };
static char *mode_list[] = { "text", "html" };
static char *mode_list_text[] = { N_("Text"), N_("Html") };
#define LOGMODE_TEXT N_("Log format")
#define LOGMODE_LONGTEXT N_("Specify the log format. Available choices are \"text\" (default) and \"html\"")
vlc_module_begin();
add_category_hint( N_("Miscellaneous"), NULL, VLC_FALSE );
add_file( "logfile", NULL, NULL, N_("log filename"), N_("Specify the log filename."), VLC_FALSE );
add_string_from_list( "logmode", "text", mode_list, NULL, LOGMODE_TEXT, LOGMODE_LONGTEXT, VLC_FALSE );
add_string( "logmode", "text", NULL, LOGMODE_TEXT, LOGMODE_LONGTEXT,
VLC_FALSE );
change_string_list( mode_list, mode_list_text, 0 );
set_description( _("file logging interface") );
set_capability( "interface", 0 );
set_callbacks( Open, Close );
......
......@@ -2,7 +2,7 @@
* deinterlace.c : deinterlacer plugin for vlc
*****************************************************************************
* Copyright (C) 2000, 2001, 2002, 2003 VideoLAN
* $Id: deinterlace.c,v 1.15 2003/10/15 22:49:48 gbazin Exp $
* $Id: deinterlace.c,v 1.16 2003/11/05 00:39:17 gbazin Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
......@@ -75,12 +75,15 @@ static int FilterCallback ( vlc_object_t *, char const *,
#define MODE_TEXT N_("Deinterlace mode")
#define MODE_LONGTEXT N_("You can choose the default deinterlace mode")
static char *mode_list[] = { "discard", "blend", "mean", "bob", "linear", NULL };
static char *mode_list[] = { "discard", "blend", "mean", "bob", "linear" };
static char *mode_list_text[] = { N_("discard"), N_("Blend"), N_("Mean"),
N_("Bob"), N_("Linear") };
vlc_module_begin();
add_category_hint( N_("Deinterlace"), NULL, VLC_FALSE );
add_string_from_list( "deinterlace-mode", "discard", mode_list, NULL,
MODE_TEXT, MODE_LONGTEXT, VLC_FALSE );
add_string( "deinterlace-mode", "discard", NULL, MODE_TEXT,
MODE_LONGTEXT, VLC_FALSE );
change_string_list( mode_list, mode_list_text, 0 );
set_description( _("video deinterlacing filter") );
set_capability( "video filter", 0 );
add_shortcut( "deinterlace" );
......
......@@ -2,7 +2,7 @@
* distort.c : Misc video effects plugin for vlc
*****************************************************************************
* Copyright (C) 2000, 2001, 2002, 2003 VideoLAN
* $Id: distort.c,v 1.11 2003/10/15 22:49:48 gbazin Exp $
* $Id: distort.c,v 1.12 2003/11/05 00:39:17 gbazin Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
......@@ -59,12 +59,14 @@ static int SendEvents ( vlc_object_t *, char const *,
#define MODE_TEXT N_("Distort mode")
#define MODE_LONGTEXT N_("Distort mode, one of \"wave\" and \"ripple\"")
static char *mode_list[] = { "wave", "ripple", NULL };
static char *mode_list[] = { "wave", "ripple" };
static char *mode_list_text[] = { N_("Wave"), N_("Ripple") };
vlc_module_begin();
add_category_hint( N_("Distort"), NULL, VLC_FALSE );
add_string_from_list( "distort-mode", "wave", mode_list, NULL,
MODE_TEXT, MODE_LONGTEXT, VLC_FALSE );
add_string( "distort-mode", "wave", NULL, MODE_TEXT, MODE_LONGTEXT,
VLC_FALSE );
change_string_list( mode_list, mode_list_text, 0 );
set_description( _("miscellaneous distort video effects filter") );
set_capability( "video filter", 0 );
add_shortcut( "distort" );
......
......@@ -2,7 +2,7 @@
* transform.c : transform image plugin for vlc
*****************************************************************************
* Copyright (C) 2000, 2001, 2002, 2003 VideoLAN
* $Id: transform.c,v 1.14 2003/10/15 22:49:48 gbazin Exp $
* $Id: transform.c,v 1.15 2003/11/05 00:39:17 gbazin Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
......@@ -57,12 +57,15 @@ static int SendEvents( vlc_object_t *, char const *,
#define TYPE_TEXT N_("Transform type")
#define TYPE_LONGTEXT N_("One of '90', '180', '270', 'hflip' and 'vflip'")
static char *type_list[] = { "90", "180", "270", "hflip", "vflip", NULL };
static char *type_list[] = { "90", "180", "270", "hflip", "vflip" };
static char *type_list_text[] = { N_("Rotate by 90"), N_("Rotate by 1800"),
N_("Rotate by 270"), N_("Flip horizontally"), N_("Flip vertically") };
vlc_module_begin();
add_category_hint( N_("Miscellaneous"), NULL, VLC_FALSE );
add_string_from_list( "transform-type", "90", type_list, NULL,
add_string( "transform-type", "90", NULL,
TYPE_TEXT, TYPE_LONGTEXT, VLC_FALSE);
change_string_list( type_list, type_list_text, 0);
set_description( _("video transformation filter") );
set_capability( "video filter", 0 );
add_shortcut( "transform" );
......
......@@ -2,7 +2,7 @@
* libvlc.h: main libvlc header
*****************************************************************************
* Copyright (C) 1998-2002 VideoLAN
* $Id: libvlc.h,v 1.100 2003/10/30 22:34:48 hartman Exp $
* $Id: libvlc.h,v 1.101 2003/11/05 00:39:17 gbazin Exp $
*
* Authors: Vincent Seguin <seguin@via.ecp.fr>
* Samuel Hocevar <sam@zoy.org>
......@@ -26,8 +26,13 @@
#define Nothing here, this is just to prevent update-po from being stupid
#include "vlc_keys.h"
static char *ppsz_language[] = { "auto", "en", "en_GB", "es", "de", "fr", "it", "ja",
"nl", "no", "pl", "pt_BR", "ru", "sv", NULL };
static char *ppsz_language[] =
{ "auto", "en", "en_GB", "es", "de", "fr", "it", "ja",
"nl", "no", "pl", "pt_BR", "ru", "sv" };
static char *ppsz_language_text[] =
{ N_("Auto"), N_("English US"), N_("English GB"), N_("Spanish"), N_("German"),
N_("French"), N_("Italian"), N_("Japanese"), N_("Dutch"), N_("Norwegian"),
N_("Polish"), N_("Portugese BR"), N_("Russian"), N_("Swedish") };
/*****************************************************************************
* Configuration options for the main program. Each module will also separatly
......@@ -584,16 +589,19 @@ static char *ppsz_language[] = { "auto", "en", "en_GB", "es", "de", "fr", "it",
vlc_module_begin();
/* Interface options */
add_category_hint( N_("Interface"), INTF_CAT_LONGTEXT , VLC_FALSE );
add_module_with_short( "intf", 'I', "interface", NULL, NULL,
INTF_TEXT, INTF_LONGTEXT, VLC_TRUE );
add_module( "intf", "interface", NULL, NULL, INTF_TEXT,
INTF_LONGTEXT, VLC_TRUE );
change_short('I');
add_string( "extraintf", NULL, NULL, EXTRAINTF_TEXT,
EXTRAINTF_LONGTEXT, VLC_FALSE );
add_integer_with_short( "verbose", 'v', 0, NULL,
VERBOSE_TEXT, VERBOSE_LONGTEXT, VLC_FALSE );
add_bool_with_short( "quiet", 'q', 0, NULL, QUIET_TEXT,
QUIET_LONGTEXT, VLC_TRUE );
add_string_from_list( "language", "auto", ppsz_language, NULL,
LANGUAGE_TEXT, LANGUAGE_LONGTEXT, VLC_FALSE );
add_integer( "verbose", 0, NULL, VERBOSE_TEXT, VERBOSE_LONGTEXT,
VLC_FALSE );
change_short('v');
add_bool( "quiet", 0, NULL, QUIET_TEXT, QUIET_LONGTEXT, VLC_TRUE );
change_short('q');
add_string( "language", "auto", NULL, LANGUAGE_TEXT, LANGUAGE_LONGTEXT,
VLC_FALSE );
change_string_list( ppsz_language, ppsz_language_text, 0 );
add_bool( "color", 0, NULL, COLOR_TEXT, COLOR_LONGTEXT, VLC_TRUE );
add_bool( "advanced", 0, NULL, ADVANCED_TEXT,
ADVANCED_LONGTEXT, VLC_FALSE );
......@@ -604,8 +612,9 @@ vlc_module_begin();
/* Audio options */
add_category_hint( N_("Audio"), AOUT_CAT_LONGTEXT , VLC_FALSE );
add_module_with_short( "aout", 'A', "audio output", NULL, NULL,
AOUT_TEXT, AOUT_LONGTEXT, VLC_TRUE);
add_module( "aout", "audio output", NULL, NULL, AOUT_TEXT, AOUT_LONGTEXT,
VLC_TRUE );
change_short('A');
add_bool( "audio", 1, NULL, AUDIO_TEXT, AUDIO_LONGTEXT, VLC_FALSE );
add_integer_with_range( "volume", AOUT_VOLUME_DEFAULT, AOUT_VOLUME_MIN,
AOUT_VOLUME_MAX, NULL, VOLUME_TEXT,
......@@ -628,8 +637,9 @@ vlc_module_begin();
/* Video options */
add_category_hint( N_("Video"), VOUT_CAT_LONGTEXT , VLC_FALSE );
add_module_with_short( "vout", 'V', "video output", NULL, NULL,
VOUT_TEXT, VOUT_LONGTEXT, VLC_TRUE );
add_module( "vout", "video output", NULL, NULL, VOUT_TEXT, VOUT_LONGTEXT,
VLC_TRUE );
change_short('V');
add_bool( "video", 1, NULL, VIDEO_TEXT, VIDEO_LONGTEXT, VLC_TRUE );
add_integer( "width", -1, NULL, WIDTH_TEXT, WIDTH_LONGTEXT, VLC_TRUE );
add_integer( "height", -1, NULL, HEIGHT_TEXT, HEIGHT_LONGTEXT, VLC_TRUE );
......@@ -678,8 +688,10 @@ vlc_module_begin();
add_file( "dvd", DVD_DEVICE, NULL, DVD_DEV_TEXT, DVD_DEV_LONGTEXT, VLC_FALSE );
add_file( "vcd", VCD_DEVICE, NULL, VCD_DEV_TEXT, VCD_DEV_LONGTEXT, VLC_FALSE );
add_bool_with_short( "ipv6", '6', 0, NULL, IPV6_TEXT, IPV6_LONGTEXT, VLC_FALSE );
add_bool_with_short( "ipv4", '4', 0, NULL, IPV4_TEXT, IPV4_LONGTEXT, VLC_FALSE );
add_bool( "ipv6", 0, NULL, IPV6_TEXT, IPV6_LONGTEXT, VLC_FALSE );
change_short('6');
add_bool( "ipv4", 0, NULL, IPV4_TEXT, IPV4_LONGTEXT, VLC_FALSE );
change_short('4');
/* Decoder options */
add_category_hint( N_("Decoders"), CODEC_CAT_LONGTEXT , VLC_TRUE );
......@@ -722,9 +734,12 @@ vlc_module_begin();
/* Playlist options */
add_category_hint( N_("Playlist"), PLAYLIST_CAT_LONGTEXT , VLC_FALSE );
add_bool_with_short( "random", 'Z', 0, NULL, RANDOM_TEXT, RANDOM_LONGTEXT, VLC_FALSE );
add_bool_with_short( "loop", 'L', 0, NULL, LOOP_TEXT, LOOP_LONGTEXT, VLC_FALSE );
add_bool_with_short( "repeat", 'R', 0, NULL, REPEAT_TEXT, REPEAT_LONGTEXT, VLC_TRUE );
add_bool( "random", 0, NULL, RANDOM_TEXT, RANDOM_LONGTEXT, VLC_FALSE );
change_short('Z');
add_bool( "loop", 0, NULL, LOOP_TEXT, LOOP_LONGTEXT, VLC_FALSE );
change_short('L');
add_bool( "repeat", 0, NULL, REPEAT_TEXT, REPEAT_LONGTEXT, VLC_TRUE );
change_short('R');
/* Misc options */
add_category_hint( N_("Miscellaneous"), MISC_CAT_LONGTEXT, VLC_TRUE );
......
......@@ -2,7 +2,7 @@
* configuration.c management of the modules configuration
*****************************************************************************
* Copyright (C) 2001 VideoLAN
* $Id: configuration.c,v 1.66 2003/10/29 01:33:27 gbazin Exp $
* $Id: configuration.c,v 1.67 2003/11/05 00:39:17 gbazin Exp $
*
* Authors: Gildas Bazin <gbazin@netcourrier.com>
*
......@@ -423,6 +423,34 @@ module_config_t *config_FindConfig( vlc_object_t *p_this, const char *psz_name )
return NULL;
}
/*****************************************************************************
* config_FindModule: find a specific module structure.
*****************************************************************************/
module_t *config_FindModule( vlc_object_t *p_this, const char *psz_name )
{
vlc_list_t *p_list;
module_t *p_module, *p_result = NULL;
int i_index;
if( !psz_name ) return NULL;
p_list = vlc_list_find( p_this, VLC_OBJECT_MODULE, FIND_ANYWHERE );
for( i_index = 0; i_index < p_list->i_count; i_index++ )
{
p_module = (module_t *)p_list->p_values[i_index].p_object;
if( !strcmp( p_module->psz_object_name, psz_name ) )
{
p_result = p_module;
break;
}
}
vlc_list_release( p_list );
return p_result;
}
/*****************************************************************************
* config_Duplicate: creates a duplicate of a module's configuration data.
*****************************************************************************
......@@ -466,18 +494,7 @@ void config_Duplicate( module_t *p_module, module_config_t *p_orig )
/* Do the duplication job */
for( i = 0; i < i_lines ; i++ )
{
p_module->p_config[i].i_type = p_orig[i].i_type;
p_module->p_config[i].i_short = p_orig[i].i_short;
p_module->p_config[i].i_value = p_orig[i].i_value;
p_module->p_config[i].i_value_orig = p_orig[i].i_value;
p_module->p_config[i].i_min = p_orig[i].i_min;
p_module->p_config[i].i_max = p_orig[i].i_max;
p_module->p_config[i].f_value = p_orig[i].f_value;
p_module->p_config[i].f_value_orig = p_orig[i].f_value;
p_module->p_config[i].f_min = p_orig[i].f_min;
p_module->p_config[i].f_max = p_orig[i].f_max;
p_module->p_config[i].b_dirty = p_orig[i].b_dirty;
p_module->p_config[i].b_advanced = p_orig[i].b_advanced;
p_module->p_config[i] = p_orig[i];
p_module->p_config[i].psz_type = p_orig[i].psz_type ?
strdup( p_orig[i].psz_type ) : NULL;
......@@ -495,18 +512,43 @@ void config_Duplicate( module_t *p_module, module_config_t *p_orig )
p_module->p_config[i].p_lock = &p_module->object_lock;
/* duplicate the string list */
p_module->p_config[i].ppsz_list = NULL;
if( p_orig[i].ppsz_list )
if( p_orig[i].i_list )
{
for( j = 0; p_orig[i].ppsz_list[j]; j++ );
p_module->p_config[i].ppsz_list = malloc( (j+1) *sizeof(char *) );
if( p_module->p_config[i].ppsz_list )
if( p_orig[i].ppsz_list )
{
p_module->p_config[i].ppsz_list =
malloc( (p_orig[i].i_list + 1) * sizeof(char *) );
if( p_module->p_config[i].ppsz_list )
{
for( j = 0; j < p_orig[i].i_list; j++ )
p_module->p_config[i].ppsz_list[j] =
strdup( p_orig[i].ppsz_list[j] );
p_module->p_config[i].ppsz_list[j] = NULL;
}
}
if( p_orig[i].ppsz_list_text )
{
for( j = 0; p_orig[i].ppsz_list[j]; j++ )
p_module->p_config[i].ppsz_list[j] =
strdup( p_orig[i].ppsz_list[j] );
p_module->p_config[i].ppsz_list_text =
malloc( (p_orig[i].i_list + 1) * sizeof(char *) );
if( p_module->p_config[i].ppsz_list_text )
{
for( j = 0; j < p_orig[i].i_list; j++ )
p_module->p_config[i].ppsz_list_text[j] =
strdup( _(p_orig[i].ppsz_list_text[j]) );
p_module->p_config[i].ppsz_list_text[j] = NULL;
}
}
if( p_orig[i].pi_list )
{
p_module->p_config[i].pi_list =
malloc( (p_orig[i].i_list + 1) * sizeof(int) );
if( p_module->p_config[i].pi_list )
{
for( j = 0; j < p_orig[i].i_list; j++ )
p_module->p_config[i].pi_list[j] =
p_orig[i].pi_list[j];
}
}
p_module->p_config[i].ppsz_list[j] = NULL;
}
p_module->p_config[i].pf_callback = p_orig[i].pf_callback;
......@@ -548,11 +590,18 @@ void config_Free( module_t *p_module )
if( p_item->psz_value_orig )
free( p_item->psz_value_orig );
if( p_item->ppsz_list )
if( p_item->i_list )
{
for( i = 0; p_item->ppsz_list[i]; i++ )
free(p_item->ppsz_list[i]);
free( p_item->ppsz_list );
for( i = 0; i < p_item->i_list; i++ )
{
if( p_item->ppsz_list && p_item->ppsz_list[i] )
free( p_item->ppsz_list[i] );
if( p_item->ppsz_list_text && p_item->ppsz_list_text[i] )
free( p_item->ppsz_list_text[i] );
}
if( p_item->ppsz_list ) free( p_item->ppsz_list );
if( p_item->ppsz_list_text ) free( p_item->ppsz_list_text );
if( p_item->pi_list ) free( p_item->pi_list );
}
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment