Commit 963630ba authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

split add_file into add_loadfile and add_savefile

The preference panel needs to know which of open or save file dialog
it should use. Here we have 27 load and 4 save cases, plus 2 fonts
that were not correctly marked as such in projectM.
parent 9ef38092
......@@ -296,7 +296,8 @@ void ParseOption( module_config_t *p_item, mumap &mods, mcmap &mods2 )
}
break;
case CONFIG_ITEM_FILE:
case CONFIG_ITEM_LOADFILE:
case CONFIG_ITEM_SAVEFILE:
psz_arguments = strdup( "_files" );
break;
case CONFIG_ITEM_DIRECTORY:
......
......@@ -56,7 +56,7 @@ extern "C" {
/* Configuration item types */
#define CONFIG_ITEM_STRING 0x0010 /* String option */
#define CONFIG_ITEM_FILE 0x0020 /* File option */
/* unused 0x0020 */
#define CONFIG_ITEM_MODULE 0x0030 /* Module option */
#define CONFIG_ITEM_INTEGER 0x0040 /* Integer option */
#define CONFIG_ITEM_BOOL 0x0050 /* Bool option */
......@@ -68,6 +68,8 @@ extern "C" {
#define CONFIG_ITEM_MODULE_LIST_CAT 0x00B0 /* Module option */
#define CONFIG_ITEM_FONT 0x00C0 /* Font option */
#define CONFIG_ITEM_PASSWORD 0x00D0 /* Password option (*) */
#define CONFIG_ITEM_LOADFILE 0x00E0 /* Read file option */
#define CONFIG_ITEM_SAVEFILE 0x00F0 /* Written file option */
#define CONFIG_ITEM 0x00F0
......
......@@ -120,8 +120,8 @@ enum vlc_module_properties
/**
* Current plugin ABI version
*/
# define MODULE_SYMBOL 1_2_0d
# define MODULE_SUFFIX "__1_2_0d"
# define MODULE_SYMBOL 1_2_0e
# define MODULE_SUFFIX "__1_2_0e"
/*****************************************************************************
* Add a few defines. You do not want to read this section. Really.
......@@ -307,8 +307,12 @@ enum vlc_module_properties
add_string_inner( CONFIG_ITEM_PASSWORD, name, text, longtext, advc, \
p_callback, value )
#define add_file( name, value, p_callback, text, longtext, advc ) \
add_string_inner( CONFIG_ITEM_FILE, name, text, longtext, advc, \
#define add_loadfile( name, value, p_callback, text, longtext, advc ) \
add_string_inner( CONFIG_ITEM_LOADFILE, name, text, longtext, advc, \
p_callback, value )
#define add_savefile( name, value, p_callback, text, longtext, advc ) \
add_string_inner( CONFIG_ITEM_SAVEFILE, name, text, longtext, advc, \
p_callback, value )
#define add_directory( name, value, p_callback, text, longtext, advc ) \
......
......@@ -111,8 +111,8 @@ vlc_module_begin ()
#endif
#ifdef SCREEN_MOUSE
add_file( "screen-mouse-image", "", NULL, MOUSE_TEXT, MOUSE_LONGTEXT,
true )
add_loadfile( "screen-mouse-image", "", NULL, MOUSE_TEXT, MOUSE_LONGTEXT,
true )
#endif
#ifdef WIN32
......
......@@ -118,8 +118,8 @@ vlc_module_begin ()
change_string_list( format_list, 0, 0 )
add_integer( "audiofile-channels", 0, NULL,
CHANNELS_TEXT, CHANNELS_LONGTEXT, true )
add_file( "audiofile-file", "audiofile.wav", NULL, FILE_TEXT,
FILE_LONGTEXT, false )
add_savefile( "audiofile-file", "audiofile.wav", NULL, FILE_TEXT,
FILE_LONGTEXT, false )
add_bool( "audiofile-wav", true, NULL, WAV_TEXT, WAV_LONGTEXT, true )
set_capability( "audio output", 0 )
......
......@@ -106,8 +106,8 @@ vlc_module_begin ()
set_category( CAT_AUDIO )
set_subcategory( SUBCAT_AUDIO_AOUT )
add_file( "oss-audio-device", "/dev/dsp", aout_FindAndRestart,
N_("OSS DSP device"), NULL, false )
add_loadfile( "oss-audio-device", "/dev/dsp", aout_FindAndRestart,
N_("OSS DSP device"), NULL, false )
add_deprecated_alias( "dspdev" ) /* deprecated since 0.9.3 */
add_bool( "oss-buggy", false, NULL, BUGGY_TEXT, BUGGY_LONGTEXT, true )
......
......@@ -60,8 +60,8 @@ vlc_module_begin ()
set_category (CAT_INPUT)
set_subcategory (SUBCAT_INPUT_ACODEC)
set_callbacks (Open, Close)
add_file ("soundfont", "", NULL,
SOUNDFONT_TEXT, SOUNDFONT_LONGTEXT, false);
add_loadfile ("soundfont", "", NULL,
SOUNDFONT_TEXT, SOUNDFONT_LONGTEXT, false);
vlc_module_end ()
......
......@@ -53,8 +53,8 @@ vlc_module_begin ()
set_subcategory( SUBCAT_INPUT_DEMUX )
set_description( N_("File dumper") )
set_capability( "demux", 0 )
add_file( "demuxdump-file", "stream-demux.dump", NULL, FILE_TEXT,
FILE_LONGTEXT, false )
add_savefile( "demuxdump-file", "stream-demux.dump", NULL, FILE_TEXT,
FILE_LONGTEXT, false )
add_bool( "demuxdump-append", false, NULL, APPEND_TEXT, APPEND_LONGTEXT,
false )
set_callbacks( Open, Close )
......
......@@ -176,7 +176,7 @@ vlc_module_begin ()
add_integer( "ts-csa-pkt", 188, NULL, CPKT_TEXT, CPKT_LONGTEXT, true )
add_bool( "ts-silent", false, NULL, SILENT_TEXT, SILENT_LONGTEXT, true )
add_file( "ts-dump-file", NULL, NULL, TSDUMP_TEXT, TSDUMP_LONGTEXT, false )
add_savefile( "ts-dump-file", NULL, NULL, TSDUMP_TEXT, TSDUMP_LONGTEXT, false )
add_bool( "ts-dump-append", false, NULL, APPEND_TEXT, APPEND_LONGTEXT, false )
add_integer( "ts-dump-size", 16384, NULL, DUMPSIZE_TEXT,
DUMPSIZE_LONGTEXT, true )
......
......@@ -180,8 +180,8 @@ vlc_module_begin ()
set_category( CAT_INTERFACE )
set_subcategory( SUBCAT_INTERFACE_MAIN )
add_file( "fbosd-dev", "/dev/fb0", NULL, DEVICE_TEXT, DEVICE_LONGTEXT,
false )
add_loadfile( "fbosd-dev", "/dev/fb0", NULL, DEVICE_TEXT, DEVICE_LONGTEXT,
false )
add_string( "fbosd-aspect-ratio", "", NULL, ASPECT_RATIO_TEXT,
ASPECT_RATIO_LONGTEXT, true )
......
......@@ -452,7 +452,8 @@ o_textfield = [[[NSSecureTextField alloc] initWithFrame: s_rc] retain]; \
case CONFIG_ITEM_STRING_LIST:
i_margin = 7;
break;
case CONFIG_ITEM_FILE:
case CONFIG_ITEM_LOADFILE:
case CONFIG_ITEM_SAVEFILE:
i_margin = 8;
break;
case CONFIG_ITEM_MODULE:
......@@ -488,7 +489,8 @@ o_textfield = [[[NSSecureTextField alloc] initWithFrame: s_rc] retain]; \
case CONFIG_ITEM_STRING_LIST:
i_margin = 7;
break;
case CONFIG_ITEM_FILE:
case CONFIG_ITEM_LOADFILE:
case CONFIG_ITEM_SAVEFILE:
i_margin = 6;
break;
case CONFIG_ITEM_MODULE:
......@@ -514,7 +516,8 @@ o_textfield = [[[NSSecureTextField alloc] initWithFrame: s_rc] retain]; \
break;
}
break;
case CONFIG_ITEM_FILE:
case CONFIG_ITEM_LOADFILE:
case CONFIG_ITEM_SAVEFILE:
switch( i_lastItem )
{
case CONFIG_ITEM_STRING:
......@@ -524,7 +527,8 @@ o_textfield = [[[NSSecureTextField alloc] initWithFrame: s_rc] retain]; \
case CONFIG_ITEM_STRING_LIST:
i_margin = 10;
break;
case CONFIG_ITEM_FILE:
case CONFIG_ITEM_LOADFILE:
case CONFIG_ITEM_SAVEFILE:
i_margin = 9;
break;
case CONFIG_ITEM_MODULE:
......@@ -560,7 +564,8 @@ o_textfield = [[[NSSecureTextField alloc] initWithFrame: s_rc] retain]; \
case CONFIG_ITEM_STRING_LIST:
i_margin = 7;
break;
case CONFIG_ITEM_FILE:
case CONFIG_ITEM_LOADFILE:
case CONFIG_ITEM_SAVEFILE:
i_margin = 6;
break;
case CONFIG_ITEM_MODULE:
......@@ -596,7 +601,8 @@ o_textfield = [[[NSSecureTextField alloc] initWithFrame: s_rc] retain]; \
case CONFIG_ITEM_STRING_LIST:
i_margin = 7;
break;
case CONFIG_ITEM_FILE:
case CONFIG_ITEM_LOADFILE:
case CONFIG_ITEM_SAVEFILE:
i_margin = 6;
break;
case CONFIG_ITEM_MODULE:
......@@ -632,7 +638,8 @@ o_textfield = [[[NSSecureTextField alloc] initWithFrame: s_rc] retain]; \
case CONFIG_ITEM_STRING_LIST:
i_margin = 7;
break;
case CONFIG_ITEM_FILE:
case CONFIG_ITEM_LOADFILE:
case CONFIG_ITEM_SAVEFILE:
i_margin = 8;
break;
case CONFIG_ITEM_MODULE:
......@@ -668,7 +675,8 @@ o_textfield = [[[NSSecureTextField alloc] initWithFrame: s_rc] retain]; \
case CONFIG_ITEM_STRING_LIST:
i_margin = 9;
break;
case CONFIG_ITEM_FILE:
case CONFIG_ITEM_LOADFILE:
case CONFIG_ITEM_SAVEFILE:
i_margin = 8;
break;
case CONFIG_ITEM_MODULE:
......@@ -704,7 +712,8 @@ o_textfield = [[[NSSecureTextField alloc] initWithFrame: s_rc] retain]; \
case CONFIG_ITEM_STRING_LIST:
i_margin = 7;
break;
case CONFIG_ITEM_FILE:
case CONFIG_ITEM_LOADFILE:
case CONFIG_ITEM_SAVEFILE:
i_margin = 6;
break;
case CONFIG_ITEM_MODULE:
......@@ -740,7 +749,8 @@ o_textfield = [[[NSSecureTextField alloc] initWithFrame: s_rc] retain]; \
case CONFIG_ITEM_STRING_LIST:
i_margin = 7;
break;
case CONFIG_ITEM_FILE:
case CONFIG_ITEM_LOADFILE:
case CONFIG_ITEM_SAVEFILE:
i_margin = 6;
break;
case CONFIG_ITEM_MODULE:
......@@ -795,7 +805,8 @@ o_textfield = [[[NSSecureTextField alloc] initWithFrame: s_rc] retain]; \
withView: o_parent_view];
}
break;
case CONFIG_ITEM_FILE:
case CONFIG_ITEM_LOADFILE:
case CONFIG_ITEM_SAVEFILE:
case CONFIG_ITEM_DIRECTORY:
p_control = [[FileConfigControl alloc]
initWithItem: _p_item
......@@ -905,7 +916,8 @@ o_textfield = [[[NSSecureTextField alloc] initWithFrame: s_rc] retain]; \
{
case CONFIG_ITEM_STRING:
case CONFIG_ITEM_PASSWORD:
case CONFIG_ITEM_FILE:
case CONFIG_ITEM_LOADFILE:
case CONFIG_ITEM_SAVEFILE:
case CONFIG_ITEM_DIRECTORY:
case CONFIG_ITEM_MODULE:
case CONFIG_ITEM_MODULE_LIST:
......@@ -1165,7 +1177,7 @@ o_textfield = [[[NSSecureTextField alloc] initWithFrame: s_rc] retain]; \
if( [super initWithFrame: mainFrame item: _p_item] != nil )
{
i_view_type = CONFIG_ITEM_FILE;
i_view_type = CONFIG_ITEM_LOADFILE;
o_itemTooltip = [[VLCMain sharedInstance]
wrapString: [[VLCMain sharedInstance]
......
......@@ -1402,7 +1402,8 @@ void CaptureOpenPanel::advancedDialog()
switch( control->getType() )
{
case CONFIG_ITEM_STRING:
case CONFIG_ITEM_FILE:
case CONFIG_ITEM_LOADFILE:
case CONFIG_ITEM_SAVEFILE:
case CONFIG_ITEM_DIRECTORY:
case CONFIG_ITEM_MODULE:
tempMRL += colon_escape( QString("=%1").arg( qobject_cast<VStringConfigControl *>(control)->getValue() ) );
......
......@@ -129,7 +129,8 @@ ConfigControl *ConfigControl::createControl( vlc_object_t *p_this,
p_control = new IntegerConfigControl( p_this, p_item, parent,
l, line );
break;
case CONFIG_ITEM_FILE:
case CONFIG_ITEM_LOADFILE:
case CONFIG_ITEM_SAVEFILE:
p_control = new FileConfigControl( p_this, p_item, parent, l, line);
break;
case CONFIG_ITEM_DIRECTORY:
......
......@@ -478,8 +478,8 @@ static int onTaskBarChange( vlc_object_t *pObj, const char *pVariable,
vlc_module_begin ()
set_category( CAT_INTERFACE )
set_subcategory( SUBCAT_INTERFACE_MAIN )
add_file( "skins2-last", "", NULL, SKINS2_LAST, SKINS2_LAST_LONG,
true )
add_loadfile( "skins2-last", "", NULL, SKINS2_LAST, SKINS2_LAST_LONG,
true )
change_autosave ()
add_string( "skins2-config", "", NULL, SKINS2_CONFIG, SKINS2_CONFIG_LONG,
true )
......
......@@ -65,7 +65,7 @@ static int FindMeta( vlc_object_t * );
vlc_module_begin ()
set_shortname( N_( "Folder" ) )
set_description( N_("Folder meta data") )
add_file( "album-art-filename", NULL, NULL,
add_loadfile( "album-art-filename", NULL, NULL,
N_("Album art filename"), N_("Filename to look for album art in current directory"), false );
set_capability( "art finder", 90 )
set_callbacks( FindMeta, NULL )
......
......@@ -165,7 +165,7 @@ vlc_module_begin ()
set_category( CAT_ADVANCED )
set_subcategory( SUBCAT_ADVANCED_MISC )
add_file( "logfile", NULL, NULL,
add_savefile( "logfile", NULL, NULL,
N_("Log filename"), N_("Specify the log filename."), false )
add_string( "logmode", "text", NULL, LOGMODE_TEXT, LOGMODE_LONGTEXT,
false )
......
......@@ -168,7 +168,7 @@ vlc_module_begin();
HOST_TEXT, HOST_LONGTEXT, false )
add_password( SOUT_CFG_PREFIX "password", NULL, NULL,
PASSWORD_TEXT, PASSWORD_LONGTEXT, false )
add_file( SOUT_CFG_PREFIX "password-file", NULL, NULL,
add_loadfile( SOUT_CFG_PREFIX "password-file", NULL, NULL,
PASSWORD_FILE_TEXT, PASSWORD_FILE_LONGTEXT, false )
add_integer_with_range( SOUT_CFG_PREFIX "volume", 100, 0, 255, NULL,
VOLUME_TEXT, VOLUME_LONGTEXT, false )
......
......@@ -381,8 +381,8 @@ add_string(CFG_PREFIX "serialdev", "COM1", NULL,
on win32 the executeable external driver application
for automatic start if needed
*/
add_file(CFG_PREFIX "atmowinexe", NULL, NULL,
ATMOWINEXE_TEXT, ATMOWINEXE_LONGTEXT, false )
add_loadfile(CFG_PREFIX "atmowinexe", NULL, NULL,
ATMOWINEXE_TEXT, ATMOWINEXE_LONGTEXT, false )
#else
add_string(CFG_PREFIX "serialdev", "/dev/ttyUSB0", NULL,
SERIALDEV_TEXT, SERIALDEV_LONGTEXT, false )
......@@ -583,16 +583,16 @@ effects with this...) the images MUST not compressed, should have 24-bit per
pixel, or a simple 256 color grayscale palette
*/
set_section( N_("Change gradients" ), 0 )
add_file(CFG_PREFIX "gradient_zone_0", NULL, NULL,
ZONE_0_GRADIENT_TEXT, ZONE_X_GRADIENT_LONG_TEXT, true )
add_file(CFG_PREFIX "gradient_zone_1", NULL, NULL,
ZONE_1_GRADIENT_TEXT, ZONE_X_GRADIENT_LONG_TEXT, true )
add_file(CFG_PREFIX "gradient_zone_2", NULL, NULL,
ZONE_2_GRADIENT_TEXT, ZONE_X_GRADIENT_LONG_TEXT, true )
add_file(CFG_PREFIX "gradient_zone_3", NULL, NULL,
ZONE_3_GRADIENT_TEXT, ZONE_X_GRADIENT_LONG_TEXT, true )
add_file(CFG_PREFIX "gradient_zone_4", NULL, NULL,
ZONE_4_GRADIENT_TEXT, ZONE_X_GRADIENT_LONG_TEXT, true )
add_loadfile(CFG_PREFIX "gradient_zone_0", NULL, NULL,
ZONE_0_GRADIENT_TEXT, ZONE_X_GRADIENT_LONG_TEXT, true )
add_loadfile(CFG_PREFIX "gradient_zone_1", NULL, NULL,
ZONE_1_GRADIENT_TEXT, ZONE_X_GRADIENT_LONG_TEXT, true )
add_loadfile(CFG_PREFIX "gradient_zone_2", NULL, NULL,
ZONE_2_GRADIENT_TEXT, ZONE_X_GRADIENT_LONG_TEXT, true )
add_loadfile(CFG_PREFIX "gradient_zone_3", NULL, NULL,
ZONE_3_GRADIENT_TEXT, ZONE_X_GRADIENT_LONG_TEXT, true )
add_loadfile(CFG_PREFIX "gradient_zone_4", NULL, NULL,
ZONE_4_GRADIENT_TEXT, ZONE_X_GRADIENT_LONG_TEXT, true )
add_directory(CFG_PREFIX "gradient_path", NULL, NULL,
GRADIENT_PATH_TEXT, GRADIENT_PATH_LONGTEXT, false )
......
......@@ -84,14 +84,14 @@ vlc_module_begin ()
ALPHA_LONGTEXT, false )
set_section( N_("Base image"), NULL )
add_file( CFG_PREFIX "base-image", NULL, NULL, BASE_IMAGE_TEXT,
BASE_IMAGE_LONGTEXT, false )
add_loadfile( CFG_PREFIX "base-image", NULL, NULL, BASE_IMAGE_TEXT,
BASE_IMAGE_LONGTEXT, false )
add_string( CFG_PREFIX "base-chroma", "I420", NULL, BASE_CHROMA_TEXT,
BASE_CHROMA_LONGTEXT, false )
set_section( N_("Blend image"), NULL )
add_file( CFG_PREFIX "blend-image", NULL, NULL, BLEND_IMAGE_TEXT,
BLEND_IMAGE_LONGTEXT, false )
add_loadfile( CFG_PREFIX "blend-image", NULL, NULL, BLEND_IMAGE_TEXT,
BLEND_IMAGE_LONGTEXT, false )
add_string( CFG_PREFIX "blend-chroma", "YUVA", NULL, BLEND_CHROMA_TEXT,
BLEND_CHROMA_LONGTEXT, false )
......
......@@ -70,10 +70,11 @@ vlc_module_begin ()
set_subcategory( SUBCAT_VIDEO_VFILTER )
set_capability( "sub filter", 0 )
add_file( "overlay-input", NULL, NULL, INPUT_TEXT, INPUT_LONGTEXT,
false )
add_file( "overlay-output", NULL, NULL, OUTPUT_TEXT, OUTPUT_LONGTEXT,
false )
add_loadfile( "overlay-input", NULL, NULL, INPUT_TEXT, INPUT_LONGTEXT,
false )
/* Note: add_loadfile as O_WRONLY w/o O_CREAT, i.e. FIFO must exist */
add_loadfile( "overlay-output", NULL, NULL, OUTPUT_TEXT, OUTPUT_LONGTEXT,
false )
add_shortcut( "overlay" )
set_callbacks( Create, Destroy )
......
......@@ -72,8 +72,8 @@ vlc_module_begin ()
set_category( CAT_VIDEO )
set_subcategory( SUBCAT_VIDEO_VFILTER )
add_file( CFG_PREFIX "mask", NULL, NULL,
MASK_TEXT, MASK_LONGTEXT, false )
add_loadfile( CFG_PREFIX "mask", NULL, NULL,
MASK_TEXT, MASK_LONGTEXT, false )
add_integer( CFG_PREFIX "x", 0, NULL, POSX_TEXT, POSX_LONGTEXT, false )
add_integer( CFG_PREFIX "y", 0, NULL, POSY_TEXT, POSY_LONGTEXT, false )
......
......@@ -93,7 +93,7 @@ vlc_module_begin ()
set_shortname( N_("Logo overlay") )
add_shortcut( "logo" )
add_file( CFG_PREFIX "file", NULL, NULL, FILE_TEXT, FILE_LONGTEXT, false )
add_loadfile( CFG_PREFIX "file", NULL, NULL, FILE_TEXT, FILE_LONGTEXT, false )
add_integer( CFG_PREFIX "x", -1, NULL, POSX_TEXT, POSX_LONGTEXT, true )
add_integer( CFG_PREFIX "y", -1, NULL, POSY_TEXT, POSY_LONGTEXT, true )
/* default to 1000 ms per image, continuously cycle through them */
......
......@@ -83,8 +83,8 @@ vlc_module_begin ()
set_shortname("Framebuffer")
set_category(CAT_VIDEO)
set_subcategory(SUBCAT_VIDEO_VOUT)
add_file(FB_DEV_VAR, "/dev/fb0", NULL, DEVICE_TEXT, DEVICE_LONGTEXT,
false)
add_loadfile(FB_DEV_VAR, "/dev/fb0", NULL, DEVICE_TEXT, DEVICE_LONGTEXT,
false)
add_bool("fb-tty", true, NULL, TTY_TEXT, TTY_LONGTEXT, true)
add_string( "fb-chroma", NULL, NULL, CHROMA_TEXT, CHROMA_LONGTEXT, true )
add_obsolete_string("fb-aspect-ratio")
......
......@@ -70,14 +70,14 @@ vlc_module_begin ()
set_category( CAT_AUDIO )
set_subcategory( SUBCAT_AUDIO_VISUAL )
#ifndef HAVE_PROJECTM2
add_file( "projectm-config", "/usr/share/projectM/config.inp", NULL,
CONFIG_TEXT, CONFIG_LONGTEXT, true )
add_loadfile( "projectm-config", "/usr/share/projectM/config.inp", NULL,
CONFIG_TEXT, CONFIG_LONGTEXT, true )
#else
add_file( "projectm-preset-path", "/usr/share/projectM/presets", NULL,
PRESET_PATH_TXT, PRESET_PATH_LONGTXT, true )
add_file( "projectm-title-font", "/usr/share/fonts/truetype/ttf-dejavu/DejaVuSans.ttf", NULL,
TITLE_FONT_TXT, TITLE_FONT_LONGTXT, true )
add_file( "projectm-menu-font", "/usr/share/fonts/truetype/ttf-dejavu/DejaVuSansMono.ttf", NULL,
add_loadfile( "projectm-preset-path", "/usr/share/projectM/presets", NULL,
PRESET_PATH_TXT, PRESET_PATH_LONGTXT, true )
add_font( "projectm-title-font", "/usr/share/fonts/truetype/ttf-dejavu/DejaVuSans.ttf", NULL,
TITLE_FONT_TXT, TITLE_FONT_LONGTXT, true )
add_font( "projectm-menu-font", "/usr/share/fonts/truetype/ttf-dejavu/DejaVuSansMono.ttf", NULL,
MENU_FONT_TXT, MENU_FONT_LONGTXT, true )
#endif
add_integer( "projectm-width", 800, NULL, WIDTH_TEXT, WIDTH_LONGTEXT,
......
......@@ -246,7 +246,8 @@ int config_LoadCmdLine( vlc_object_t *p_this, int i_argc,
{
case CONFIG_ITEM_STRING:
case CONFIG_ITEM_PASSWORD:
case CONFIG_ITEM_FILE:
case CONFIG_ITEM_LOADFILE:
case CONFIG_ITEM_SAVEFILE:
case CONFIG_ITEM_DIRECTORY:
case CONFIG_ITEM_MODULE:
case CONFIG_ITEM_MODULE_LIST:
......@@ -286,7 +287,8 @@ int config_LoadCmdLine( vlc_object_t *p_this, int i_argc,
{
case CONFIG_ITEM_STRING:
case CONFIG_ITEM_PASSWORD:
case CONFIG_ITEM_FILE:
case CONFIG_ITEM_LOADFILE:
case CONFIG_ITEM_SAVEFILE:
case CONFIG_ITEM_DIRECTORY:
case CONFIG_ITEM_MODULE:
case CONFIG_ITEM_MODULE_CAT:
......
......@@ -48,9 +48,10 @@ int IsConfigStringType (int type)
{
static const unsigned char config_types[] =
{
CONFIG_ITEM_STRING, CONFIG_ITEM_FILE, CONFIG_ITEM_MODULE,
CONFIG_ITEM_STRING, CONFIG_ITEM_MODULE,
CONFIG_ITEM_DIRECTORY, CONFIG_ITEM_MODULE_CAT, CONFIG_ITEM_PASSWORD,
CONFIG_ITEM_MODULE_LIST, CONFIG_ITEM_MODULE_LIST_CAT, CONFIG_ITEM_FONT
CONFIG_ITEM_MODULE_LIST, CONFIG_ITEM_MODULE_LIST_CAT,
CONFIG_ITEM_FONT, CONFIG_ITEM_LOADFILE, CONFIG_ITEM_SAVEFILE,
};
/* NOTE: this needs to be changed if we ever get more than 255 types */
......@@ -119,7 +120,8 @@ int config_GetType( vlc_object_t *p_this, const char *psz_name )
i_type = VLC_VAR_STRING;
break;
case CONFIG_ITEM_FILE:
case CONFIG_ITEM_LOADFILE:
case CONFIG_ITEM_SAVEFILE:
i_type = VLC_VAR_FILE;
break;
......@@ -209,7 +211,7 @@ float config_GetFloat( vlc_object_t *p_this, const char *psz_name )
* config_GetPsz: get the string value of a string variable
*****************************************************************************
* This function is used to get the value of variables which are internally
* represented by a string (CONFIG_ITEM_STRING, CONFIG_ITEM_FILE,
* represented by a string (CONFIG_ITEM_STRING, CONFIG_ITEM_*FILE,
* CONFIG_ITEM_DIRECTORY, CONFIG_ITEM_PASSWORD, and CONFIG_ITEM_MODULE).
*
* Important note: remember to free() the returned char* because it's a
......@@ -248,7 +250,7 @@ char * config_GetPsz( vlc_object_t *p_this, const char *psz_name )
* config_PutPsz: set the string value of a string variable
*****************************************************************************
* This function is used to set the value of variables which are internally
* represented by a string (CONFIG_ITEM_STRING, CONFIG_ITEM_FILE,
* represented by a string (CONFIG_ITEM_STRING, CONFIG_ITEM_*FILE,
* CONFIG_ITEM_DIRECTORY, CONFIG_ITEM_PASSWORD, and CONFIG_ITEM_MODULE).
*****************************************************************************/
void config_PutPsz( vlc_object_t *p_this,
......
......@@ -1579,7 +1579,8 @@ const char vlc_usage[] = N_(
* add_usage_hint( N_(text), b_advanced_option )
* add_string( option_name, value, p_callback, N_(text), N_(longtext),
b_advanced_option )
* add_file( option_name, psz_value, p_callback, N_(text), N_(longtext) )
* add_loadfile( option_name, psz_value, p_callback, N_(text), N_(longtext) )
* add_savefile( option_name, psz_value, p_callback, N_(text), N_(longtext) )
* add_module( option_name, psz_value, i_capability, p_callback,
* N_(text), N_(longtext) )
* add_integer( option_name, i_value, p_callback, N_(text), N_(longtext),
......@@ -1795,8 +1796,8 @@ vlc_module_begin ()
TEXTRENDERER_LONGTEXT, true )
set_section( N_("Subtitles") , NULL )
add_file( "sub-file", NULL, NULL, SUB_FILE_TEXT,
SUB_FILE_LONGTEXT, false )
add_loadfile( "sub-file", NULL, NULL, SUB_FILE_TEXT,
SUB_FILE_LONGTEXT, false )
change_safe()
add_bool( "sub-autodetect-file", true, NULL,
SUB_AUTO_TEXT, SUB_AUTO_LONGTEXT, false )
......@@ -1877,12 +1878,12 @@ vlc_module_begin ()
set_section( N_( "Default devices") , NULL )
add_file( "dvd", DVD_DEVICE, NULL, DVD_DEV_TEXT, DVD_DEV_LONGTEXT,
false )
add_file( "vcd", VCD_DEVICE, NULL, VCD_DEV_TEXT, VCD_DEV_LONGTEXT,
false )
add_file( "cd-audio", CDAUDIO_DEVICE, NULL, CDAUDIO_DEV_TEXT,
CDAUDIO_DEV_LONGTEXT, false )
add_loadfile( "dvd", DVD_DEVICE, NULL, DVD_DEV_TEXT, DVD_DEV_LONGTEXT,
false )
add_loadfile( "vcd", VCD_DEVICE, NULL, VCD_DEV_TEXT, VCD_DEV_LONGTEXT,
false )
add_loadfile( "cd-audio", CDAUDIO_DEVICE, NULL, CDAUDIO_DEV_TEXT,
CDAUDIO_DEV_LONGTEXT, false )
set_section( N_( "Network settings" ), NULL )
......
......@@ -1504,7 +1504,8 @@ static void Usage( libvlc_int_t *p_this, char const *psz_search )
break;
case CONFIG_ITEM_STRING:
case CONFIG_ITEM_FILE:
case CONFIG_ITEM_LOADFILE:
case CONFIG_ITEM_SAVEFILE:
case CONFIG_ITEM_DIRECTORY:
case CONFIG_ITEM_MODULE: /* We could also have "=<" here */
case CONFIG_ITEM_MODULE_CAT:
......
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