Commit 17a31fd8 authored by gbazin's avatar gbazin

* include/configuration.h: added the add_directory() config macro.
* modules/gui/wxwindows/preferences.cpp: support for add_string_from_list().
* ALL: changed some add_string() config options to add_file().
parent f1a8337b
......@@ -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.25 2003/03/30 11:43:38 gbazin Exp $
* $Id: configuration.h,v 1.26 2003/03/30 14:24:20 gbazin Exp $
*
* Authors: Gildas Bazin <gbazin@netcourrier.com>
*
......@@ -136,6 +136,8 @@ VLC_EXPORT( void, config_UnsetCallbacks, ( module_config_t * ) );
{ static module_config_t tmp = { CONFIG_ITEM_STRING, NULL, name, '\0', text, longtext, psz_value, 0, 0, 0, 0, 0, 0, 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++
#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++
#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++
#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++
#define add_integer( name, i_value, p_callback, text, longtext, advc ) \
......
......@@ -2,7 +2,7 @@
* file.c : audio output which writes the samples to a file
*****************************************************************************
* Copyright (C) 2002 VideoLAN
* $Id: file.c,v 1.18 2003/03/30 14:09:59 sigmunau Exp $
* $Id: file.c,v 1.19 2003/03/30 14:24:20 gbazin Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
* Gildas Bazin <gbazin@netcourrier.com>
......@@ -101,15 +101,15 @@ static int format_int[] = { VLC_FOURCC('u','8',' ',' '),
VLC_FOURCC('f','l','3','2'),
VLC_FOURCC('s','p','i','f') };
#define PATH_TEXT N_("path of the output file")
#define PATH_LONGTEXT N_("By default samples.raw")
#define FILE_TEXT N_("output file")
#define FILE_LONGTEXT N_("file to which the audio samples will be written to")
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_file( "audiofile-path", "audiofile.wav", NULL, PATH_TEXT,
PATH_LONGTEXT, VLC_FALSE );
add_file( "audiofile", "audiofile.wav", NULL, FILE_TEXT,
FILE_LONGTEXT, VLC_FALSE );
add_bool( "audiofile-wav", 1, NULL, WAV_TEXT, WAV_LONGTEXT, VLC_TRUE );
set_description( N_("file audio output module") );
set_capability( "audio output", 0 );
......
......@@ -2,7 +2,7 @@
* demuxdump.c : Pseudo demux module for vlc (dump raw stream)
*****************************************************************************
* Copyright (C) 2001 VideoLAN
* $Id: demuxdump.c,v 1.6 2003/03/29 12:22:15 gbazin Exp $
* $Id: demuxdump.c,v 1.7 2003/03/30 14:24:20 gbazin Exp $
*
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
*
......@@ -53,8 +53,8 @@ vlc_module_begin();
set_description( _("Dump Demux input") );
set_capability( "demux", 0 );
add_category_hint( "File", NULL, VLC_FALSE );
add_string( "demuxdump-file", "stream-demux.dump", NULL, FILE_TEXT,
FILE_LONGTEXT, VLC_FALSE );
add_file( "demuxdump-file", "stream-demux.dump", NULL, FILE_TEXT,
FILE_LONGTEXT, VLC_FALSE );
set_callbacks( Activate, Desactivate );
add_shortcut( "dump" );
vlc_module_end();
......
......@@ -2,7 +2,7 @@
* sub.c
*****************************************************************************
* Copyright (C) 1999-2001 VideoLAN
* $Id: sub.c,v 1.10 2003/03/16 23:35:39 fenrir Exp $
* $Id: sub.c,v 1.11 2003/03/30 14:24:20 gbazin Exp $
*
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
*
......@@ -67,8 +67,8 @@ vlc_module_begin();
set_description( _("text subtitle demux") );
set_capability( "subtitle demux", 12 );
add_category_hint( "subtitle", NULL, VLC_TRUE );
add_string( "sub-file", NULL, NULL,
"subtitle file name", "subtitle file name", VLC_TRUE );
add_file( "sub-file", NULL, NULL,
"subtitle file name", "subtitle file name", VLC_TRUE );
add_float( "sub-fps", 0.0, NULL,
"override frames per second",
SUB_FPS_LONGTEXT, VLC_TRUE );
......
......@@ -2,7 +2,7 @@
* preferences.cpp : wxWindows plugin for vlc
*****************************************************************************
* Copyright (C) 2000-2001 VideoLAN
* $Id: preferences.cpp,v 1.5 2003/03/30 13:23:27 gbazin Exp $
* $Id: preferences.cpp,v 1.6 2003/03/30 14:24:20 gbazin Exp $
*
* Authors: Gildas Bazin <gbazin@netcourrier.com>
*
......@@ -92,11 +92,12 @@ struct ConfigData
{
ConfigData( wxPanel *_panel, int _i_conf_type,
vlc_bool_t _b_advanced, char *psz_name )
{ panel = _panel; b_advanced = _b_advanced;
{ panel = _panel; b_advanced = _b_advanced; b_config_list = VLC_FALSE;
i_config_type = _i_conf_type; option_name = psz_name; }
vlc_bool_t b_advanced;
int i_config_type;
vlc_bool_t b_config_list;
union control
{
......@@ -609,13 +610,35 @@ PrefsPanel::PrefsPanel( wxWindow* parent, intf_thread_t *_p_intf,
case CONFIG_ITEM_FILE:
case CONFIG_ITEM_DIRECTORY:
label = new wxStaticText(panel, -1, p_item->psz_text);
textctrl = new wxTextCtrl( panel, -1, p_item->psz_value,
wxDefaultPosition, wxDefaultSize,
wxTE_PROCESS_ENTER);
textctrl->SetToolTip( p_item->psz_longtext );
config_data->control.textctrl = textctrl;
panel_sizer->Add( label, 0, wxALL, 5 );
panel_sizer->Add( textctrl, 1, wxALL, 5 );
panel_sizer->Add( label, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5 );
if( !p_item->ppsz_list )
{
textctrl = new wxTextCtrl( panel, -1, p_item->psz_value,
wxDefaultPosition, wxDefaultSize,
wxTE_PROCESS_ENTER);
textctrl->SetToolTip( p_item->psz_longtext );
config_data->control.textctrl = textctrl;
panel_sizer->Add( textctrl, 1, wxALL, 5 );
}
else
{
combo = new wxComboBox( panel, -1, p_item->psz_value,
wxDefaultPosition, wxDefaultSize,
0, NULL, wxCB_READONLY | wxCB_SORT );
/* build a list of available options */
for( int i_index = 0; p_item->ppsz_list[i_index]; i_index++ )
{
combo->Append( p_item->ppsz_list[i_index] );
}
combo->SetToolTip( p_item->psz_longtext );
config_data->control.combobox = combo;
config_data->b_config_list = VLC_TRUE;
panel_sizer->Add( combo, 1, wxALL, 5 );
}
if( p_item->i_type == CONFIG_ITEM_FILE )
{
button = new wxButton( panel, -1, _("Browse...") );
......@@ -729,8 +752,12 @@ void PrefsPanel::ApplyChanges()
case CONFIG_ITEM_STRING:
case CONFIG_ITEM_FILE:
case CONFIG_ITEM_DIRECTORY:
config_PutPsz( p_intf, config_data->option_name.c_str(),
config_data->control.textctrl->GetValue() );
if( !config_data->b_config_list )
config_PutPsz( p_intf, config_data->option_name.c_str(),
config_data->control.textctrl->GetValue() );
else
config_PutPsz( p_intf, config_data->option_name.c_str(),
config_data->control.combobox->GetValue() );
break;
case CONFIG_ITEM_BOOL:
config_PutInt( p_intf, config_data->option_name.c_str(),
......
......@@ -2,7 +2,7 @@
* logger.c : file logging plugin for vlc
*****************************************************************************
* Copyright (C) 2002 VideoLAN
* $Id: logger.c,v 1.5 2003/03/30 11:54:29 sigmunau Exp $
* $Id: logger.c,v 1.6 2003/03/30 14:24:20 gbazin Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
......@@ -86,7 +86,7 @@ static char *mode_list[] = { "text", "html", NULL };
#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_string( "logfile", NULL, NULL, N_("log filename"), N_("Specify the log filename."), 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 );
set_description( _("file logging interface module") );
set_capability( "interface", 0 );
......
......@@ -2,7 +2,7 @@
* fb.c : framebuffer plugin for vlc
*****************************************************************************
* Copyright (C) 2000, 2001 VideoLAN
* $Id: fb.c,v 1.3 2003/02/20 01:52:46 sigmunau Exp $
* $Id: fb.c,v 1.4 2003/03/30 14:24:20 gbazin Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
......@@ -66,7 +66,7 @@ static void GfxMode ( int i_tty );
vlc_module_begin();
add_category_hint( N_("Frame Buffer"), NULL, VLC_FALSE );
add_string( FB_DEV_VAR, "/dev/fb0", NULL, N_("framebuffer device"), NULL, VLC_FALSE );
add_file( FB_DEV_VAR, "/dev/fb0", NULL, N_("framebuffer device"), NULL, VLC_FALSE );
set_description( _("Linux console framebuffer module") );
set_capability( "video output", 30 );
set_callbacks( Create, Destroy );
......
......@@ -2,7 +2,7 @@
* libvlc.h: main libvlc header
*****************************************************************************
* Copyright (C) 1998-2002 VideoLAN
* $Id: libvlc.h,v 1.51 2003/03/29 12:22:15 gbazin Exp $
* $Id: libvlc.h,v 1.52 2003/03/30 14:24:20 gbazin Exp $
*
* Authors: Vincent Seguin <seguin@via.ecp.fr>
* Samuel Hocevar <sam@zoy.org>
......@@ -519,8 +519,8 @@ vlc_module_begin();
add_integer( "spu-channel", -1, NULL,
INPUT_SUBT_TEXT, INPUT_SUBT_LONGTEXT, VLC_TRUE );
add_string( "dvd", DVD_DEVICE, NULL, DVD_DEV_TEXT, DVD_DEV_LONGTEXT, VLC_FALSE );
add_string( "vcd", VCD_DEVICE, NULL, VCD_DEV_TEXT, VCD_DEV_LONGTEXT, VLC_FALSE );
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 );
......
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