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

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 )
......
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