]> git.sesse.net Git - vlc/commitdiff
* include/configuration.h: added the add_directory() config macro.
authorGildas Bazin <gbazin@videolan.org>
Sun, 30 Mar 2003 14:24:20 +0000 (14:24 +0000)
committerGildas Bazin <gbazin@videolan.org>
Sun, 30 Mar 2003 14:24:20 +0000 (14:24 +0000)
* modules/gui/wxwindows/preferences.cpp: support for add_string_from_list().
* ALL: changed some add_string() config options to add_file().

include/configuration.h
modules/audio_output/file.c
modules/demux/demuxdump.c
modules/demux/util/sub.c
modules/gui/wxwindows/preferences.cpp
modules/misc/logger/logger.c
modules/video_output/fb.c
src/libvlc.h

index 7ff00b7fd9598951466b55807b64302a00ca8817..b874af042a146cbf6e10a0d97fa20efa323e9d73 100644 (file)
@@ -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 ) \
index 9c38d3f81c7e09db7771acc48f5bdf4fc7683750..96e2abe7a78e0a6f9835602130da5ec3a684c9fa 100644 (file)
@@ -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 );
index 21ecfe87cfe74683abed916cc2c5d4c76fb9acf1..3903d8df4f1a073b790aad05658e76b37d6594b2 100644 (file)
@@ -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();
index d04b7215692c98c09c0d9498be86c6c8a74f5639..a1a104fcdab97d2ab9b778e5616b31be4bea008e 100644 (file)
@@ -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 );
index 9cda6df805a148aa5ee600cb7fd245720ec7972b..6759c07598027f09da48d7e69b25bb48349c11e4 100644 (file)
@@ -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(),
index 365e0f14ff258c2c737ecca407540c119a22d91c..5543f234c4be7a7e7ae8210ed9cdbc6ed7460600 100644 (file)
@@ -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 );
index 17144ba159c7df0cef6b0a7f3df0f76e6adb41ba..d4e5ac778d2685915020fd74f58d2322ce628850 100644 (file)
@@ -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 );
index 32abd3646de872402937a7dbe359f3acd4defceb..db825609392f32ac509ee10d9ff465efa2a3fc15 100644 (file)
@@ -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 );