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
......@@ -4,7 +4,7 @@
* It includes functions allowing to declare, get or set configuration options.
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
* $Id: configuration.h,v 1.31 2003/08/14 19:25:55 sigmunau Exp $
* $Id: configuration.h,v 1.32 2003/11/05 00:39:16 gbazin Exp $
*
* Authors: Gildas Bazin <gbazin@netcourrier.com>
*
......@@ -69,6 +69,10 @@ struct module_config_t
void *p_callback_data;
char **ppsz_list; /* List of possible values for the option */
int *pi_list; /* Idem for integers */
char **ppsz_list_text; /* Friendly names for list values */
int i_list; /* Options list size */
vlc_callback_t pf_list_update; /* Callback that updates the list */
vlc_mutex_t *p_lock; /* Lock to use when modifying the config */
vlc_bool_t b_dirty; /* Dirty flag to indicate a config change */
......@@ -98,7 +102,8 @@ VLC_EXPORT( int, __config_LoadConfigFile, ( vlc_object_t *, const char * ) );
VLC_EXPORT( int, __config_SaveConfigFile, ( vlc_object_t *, const char * ) );
VLC_EXPORT( void, __config_ResetAll, ( vlc_object_t * ) );
VLC_EXPORT( module_config_t *, config_FindConfig,( vlc_object_t *, const char *psz_name ) );
VLC_EXPORT( module_config_t *, config_FindConfig,( vlc_object_t *, const char * ) );
VLC_EXPORT( module_t *, config_FindModule,( vlc_object_t *, const char * ) );
VLC_EXPORT( void, config_Duplicate, ( module_t *, module_config_t * ) );
void config_Free ( module_t * );
......@@ -133,50 +138,61 @@ VLC_EXPORT( void, config_UnsetCallbacks, ( module_config_t * ) );
*****************************************************************************/
#define add_category_hint( text, longtext, advc ) \
{ static module_config_t tmp = { CONFIG_HINT_CATEGORY, NULL, NULL, '\0', text, longtext }; p_config[ i_config ] = tmp; p_config[i_config].b_advanced = advc; } i_config++
i_config++; \
{ static module_config_t tmp = { CONFIG_HINT_CATEGORY, NULL, NULL, '\0', text, longtext }; p_config[ i_config ] = tmp; p_config[i_config].b_advanced = advc; }
#define add_subcategory_hint( text, longtext ) \
{ static module_config_t tmp = { CONFIG_HINT_SUBCATEGORY, NULL, NULL, '\0', text, longtext }; p_config[ i_config ] = tmp; } i_config++
i_config++; \
{ static module_config_t tmp = { CONFIG_HINT_SUBCATEGORY, NULL, NULL, '\0', text, longtext }; p_config[ i_config ] = tmp; }
#define end_subcategory_hint \
{ static module_config_t tmp = { CONFIG_HINT_SUBCATEGORY_END, NULL, NULL, '\0' }; p_config[ i_config ] = tmp; } i_config++
i_config++; \
{ static module_config_t tmp = { CONFIG_HINT_SUBCATEGORY_END, NULL, NULL, '\0' }; p_config[ i_config ] = tmp; }
#define add_usage_hint( text ) \
{ static module_config_t tmp = { CONFIG_HINT_USAGE, NULL, NULL, '\0', text }; p_config[ i_config ] = tmp; } i_config++
i_config++; \
{ static module_config_t tmp = { CONFIG_HINT_USAGE, NULL, NULL, '\0', text }; p_config[ i_config ] = tmp; }
#define add_string( name, psz_value, p_callback, text, longtext, advc ) \
{ static module_config_t tmp = { CONFIG_ITEM_STRING, NULL, name, '\0', text, longtext, psz_value }; tmp.b_advanced = advc; p_config[ i_config ] = tmp; p_config[ i_config ].pf_callback = p_callback; } i_config++
#define add_string_from_list( name, psz_value, ppsz_list, p_callback, text, \
longtext, advc ) \
{ static module_config_t tmp = { CONFIG_ITEM_STRING, NULL, name, '\0', text, longtext, psz_value, 0, 0, 0, 0, 0, 0, NULL, NULL, ppsz_list }; p_config[ i_config ] = tmp; p_config[ i_config ].pf_callback = p_callback; p_config[i_config].b_advanced = advc; } i_config++
i_config++; \
{ static module_config_t tmp = { CONFIG_ITEM_STRING, NULL, name, '\0', text, longtext, psz_value }; tmp.b_advanced = advc; p_config[ i_config ] = tmp; p_config[ i_config ].pf_callback = p_callback; }
#define add_file( name, psz_value, p_callback, text, longtext, advc ) \
{ static module_config_t tmp = { CONFIG_ITEM_FILE, NULL, name, '\0', text, longtext, psz_value, 0, 0 }; p_config[ i_config ] = tmp; p_config[ i_config ].pf_callback = p_callback; p_config[i_config].b_advanced = advc; } i_config++
i_config++; \
{ static module_config_t tmp = { CONFIG_ITEM_FILE, NULL, name, '\0', text, longtext, psz_value, 0, 0 }; p_config[ i_config ] = tmp; p_config[ i_config ].pf_callback = p_callback; p_config[i_config].b_advanced = advc; }
#define add_directory( name, psz_value, p_callback, text, longtext, advc ) \
{ static module_config_t tmp = { CONFIG_ITEM_DIRECTORY, NULL, name, '\0', text, longtext, psz_value, 0, 0 }; p_config[ i_config ] = tmp; p_config[ i_config ].pf_callback = p_callback; p_config[i_config].b_advanced = advc; } i_config++
i_config++; \
{ static module_config_t tmp = { CONFIG_ITEM_DIRECTORY, NULL, name, '\0', text, longtext, psz_value, 0, 0 }; p_config[ i_config ] = tmp; p_config[ i_config ].pf_callback = p_callback; p_config[i_config].b_advanced = advc; }
#define add_module( name, psz_caps, psz_value, p_callback, text, longtext, advc ) \
{ static module_config_t tmp = { CONFIG_ITEM_MODULE, psz_caps, name, '\0', text, longtext, psz_value }; p_config[ i_config ] = tmp; p_config[ i_config ].pf_callback = p_callback; p_config[i_config].b_advanced = advc; } i_config++
i_config++; \
{ static module_config_t tmp = { CONFIG_ITEM_MODULE, psz_caps, name, '\0', text, longtext, psz_value }; p_config[ i_config ] = tmp; p_config[ i_config ].pf_callback = p_callback; p_config[i_config].b_advanced = advc; }
#define add_integer( name, i_value, p_callback, text, longtext, advc ) \
{ static module_config_t tmp = { CONFIG_ITEM_INTEGER, NULL, name, '\0', text, longtext, NULL, i_value }; p_config[ i_config ] = tmp; p_config[ i_config ].pf_callback = p_callback; p_config[i_config].b_advanced = advc; } i_config++
i_config++; \
{ static module_config_t tmp = { CONFIG_ITEM_INTEGER, NULL, name, '\0', text, longtext, NULL, i_value }; p_config[ i_config ] = tmp; p_config[ i_config ].pf_callback = p_callback; p_config[i_config].b_advanced = advc; }
#define add_key( name, i_value, p_callback, text, longtext, advc ) \
{ static module_config_t tmp = { CONFIG_ITEM_KEY, NULL, name, '\0', text, longtext, NULL, i_value }; p_config[ i_config ] = tmp; p_config[ i_config ].pf_callback = p_callback; p_config[i_config].b_advanced = advc; } i_config++
i_config++; \
{ static module_config_t tmp = { CONFIG_ITEM_KEY, NULL, name, '\0', text, longtext, NULL, i_value }; p_config[ i_config ] = tmp; p_config[ i_config ].pf_callback = p_callback; p_config[i_config].b_advanced = advc; }
#define add_integer_with_range( name, i_value, i_min, i_max, p_callback, text, longtext, advc ) \
{ static module_config_t tmp = { CONFIG_ITEM_INTEGER, NULL, name, '\0', text, longtext, NULL, i_value, 0, i_min, i_max }; p_config[ i_config ] = tmp; p_config[ i_config ].pf_callback = p_callback; p_config[i_config].b_advanced = advc; } i_config++
i_config++; \
{ static module_config_t tmp = { CONFIG_ITEM_INTEGER, NULL, name, '\0', text, longtext, NULL, i_value, 0, i_min, i_max }; p_config[ i_config ] = tmp; p_config[ i_config ].pf_callback = p_callback; p_config[i_config].b_advanced = advc; }
#define add_float( name, f_value, p_callback, text, longtext, advc ) \
{ static module_config_t tmp = { CONFIG_ITEM_FLOAT, NULL, name, '\0', text, longtext, NULL, 0, f_value }; p_config[ i_config ] = tmp; p_config[ i_config ].pf_callback = p_callback; p_config[i_config].b_advanced = advc; } i_config++
i_config++; \
{ static module_config_t tmp = { CONFIG_ITEM_FLOAT, NULL, name, '\0', text, longtext, NULL, 0, f_value }; p_config[ i_config ] = tmp; p_config[ i_config ].pf_callback = p_callback; p_config[i_config].b_advanced = advc; }
#define add_float_with_range( name, f_value, f_min, f_max, p_callback, text, longtext, advc ) \
{ static module_config_t tmp = { CONFIG_ITEM_FLOAT, NULL, name, '\0', text, longtext, NULL, 0, f_value, 0, 0, f_min, f_max }; p_config[ i_config ] = tmp; p_config[ i_config ].pf_callback = p_callback; p_config[i_config].b_advanced = advc; } i_config++
i_config++; \
{ static module_config_t tmp = { CONFIG_ITEM_FLOAT, NULL, name, '\0', text, longtext, NULL, 0, f_value, 0, 0, f_min, f_max }; p_config[ i_config ] = tmp; p_config[ i_config ].pf_callback = p_callback; p_config[i_config].b_advanced = advc; }
#define add_bool( name, b_value, p_callback, text, longtext, advc ) \
{ static module_config_t tmp = { CONFIG_ITEM_BOOL, NULL, name, '\0', text, longtext, NULL, b_value }; p_config[ i_config ] = tmp; p_config[ i_config ].pf_callback = p_callback; p_config[i_config].b_advanced = advc; } i_config++
/* These should be seldom used. They were added just to provide easy shortcuts
* for the command line interface */
#define add_string_with_short( name, ch, psz_value, p_callback, text, ltext, advc ) \
{ static module_config_t tmp = { CONFIG_ITEM_STRING, NULL, name, ch, text, ltext, psz_value }; p_config[ i_config ] = tmp; p_config[ i_config ].pf_callback = p_callback; p_config[i_config].b_advanced = advc; } i_config++
#define add_file_with_short( name, ch, psz_value, p_callback, text, ltext, advc ) \
{ static module_config_t tmp = { CONFIG_ITEM_FILE, NULL, name, ch, text, ltext, psz_value }; p_config[ i_config ] = tmp; p_config[ i_config ].pf_callback = p_callback; p_config[i_config].b_advanced = advc; } i_config++
#define add_module_with_short( name, ch, psz_caps, psz_value, p_callback, \
text, ltext, advc) \
{ static module_config_t tmp = { CONFIG_ITEM_MODULE, psz_caps, name, ch, text, ltext, psz_value }; p_config[ i_config ] = tmp; p_config[ i_config ].pf_callback = p_callback; p_config[i_config].b_advanced = advc; } i_config++
#define add_integer_with_short( name, ch, i_value, p_callback, text, ltext, advc ) \
{ static module_config_t tmp = { CONFIG_ITEM_INTEGER, NULL, name, ch, text, ltext, NULL, i_value }; p_config[ i_config ] = tmp; p_config[ i_config ].pf_callback = p_callback; p_config[i_config].b_advanced = advc; } i_config++
#define add_float_with_short( name, ch, f_value, p_callback, text, ltext, advc ) \
{ static module_config_t tmp = { CONFIG_ITEM_FLOAT, NULL, name, ch, text, ltext, NULL, 0, f_value }; p_config[ i_config ] = tmp; p_config[ i_config ].pf_callback = p_callback; p_config[i_config].b_advanced = advc;} i_config++
#define add_bool_with_short( name, ch, b_value, p_callback, text, ltext, advc ) \
{ static module_config_t tmp = { CONFIG_ITEM_BOOL, NULL, name, ch, text, ltext, NULL, b_value }; p_config[ i_config ] = tmp; p_config[ i_config ].pf_callback = p_callback; p_config[i_config].b_advanced = advc;} i_config++
i_config++; \
{ static module_config_t tmp = { CONFIG_ITEM_BOOL, NULL, name, '\0', text, longtext, NULL, b_value }; p_config[ i_config ] = tmp; p_config[ i_config ].pf_callback = p_callback; p_config[i_config].b_advanced = advc; }
/* Modifier macros for the config options (used for fine tuning) */
#define change_short( ch ) \
p_config[i_config].i_short = ch;
#define change_string_list( list, list_text, list_update_func ) \
p_config[i_config].i_list = sizeof(list)/sizeof(char *); \
p_config[i_config].ppsz_list = list; \
p_config[i_config].ppsz_list_text = list_text; \
p_config[i_config].pf_list_update = list_update_func;
#define change_integer_list( list, list_text, list_update_func ) \
p_config[i_config].i_list = sizeof(list)/sizeof(int); \
p_config[i_config].pi_list = list; \
p_config[i_config].ppsz_list_text = list_text; \
p_config[i_config].pf_list_update = list_update_func;
......@@ -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_FALS