Commit 9ecc1e48 authored by Christophe Massiot's avatar Christophe Massiot

* src/libvlc.*: New --open option to allow to permanently start an MRL on

   startup. Fixed two typos in two strings.
parent d58778ce
...@@ -252,6 +252,7 @@ int VLC_Init( int i_object, int i_argc, char *ppsz_argv[] ) ...@@ -252,6 +252,7 @@ int VLC_Init( int i_object, int i_argc, char *ppsz_argv[] )
vlc_t * p_vlc = vlc_current_object( i_object ); vlc_t * p_vlc = vlc_current_object( i_object );
module_t *p_help_module; module_t *p_help_module;
playlist_t *p_playlist; playlist_t *p_playlist;
vlc_value_t val;
if( !p_vlc ) if( !p_vlc )
{ {
...@@ -555,7 +556,6 @@ int VLC_Init( int i_object, int i_argc, char *ppsz_argv[] ) ...@@ -555,7 +556,6 @@ int VLC_Init( int i_object, int i_argc, char *ppsz_argv[] )
var_Create( p_vlc, "verbose", VLC_VAR_INTEGER | VLC_VAR_DOINHERIT ); var_Create( p_vlc, "verbose", VLC_VAR_INTEGER | VLC_VAR_DOINHERIT );
if( config_GetInt( p_vlc, "quiet" ) ) if( config_GetInt( p_vlc, "quiet" ) )
{ {
vlc_value_t val;
val.i_int = -1; val.i_int = -1;
var_Set( p_vlc, "verbose", val ); var_Set( p_vlc, "verbose", val );
} }
...@@ -727,6 +727,18 @@ int VLC_Init( int i_object, int i_argc, char *ppsz_argv[] ) ...@@ -727,6 +727,18 @@ int VLC_Init( int i_object, int i_argc, char *ppsz_argv[] )
*/ */
GetFilenames( p_vlc, i_argc, ppsz_argv ); GetFilenames( p_vlc, i_argc, ppsz_argv );
/*
* Get --open argument
*/
var_Create( p_vlc, "open", VLC_VAR_STRING | VLC_VAR_DOINHERIT );
var_Get( p_vlc, "open", &val );
if ( val.psz_string != NULL && *val.psz_string )
{
VLC_AddTarget( p_vlc->i_object_id, val.psz_string, NULL, 0,
PLAYLIST_INSERT, 0 );
}
if ( val.psz_string != NULL ) free( val.psz_string );
if( i_object ) vlc_object_release( p_vlc ); if( i_object ) vlc_object_release( p_vlc );
return VLC_SUCCESS; return VLC_SUCCESS;
} }
......
...@@ -66,12 +66,16 @@ static char *ppsz_snap_formats[] = ...@@ -66,12 +66,16 @@ static char *ppsz_snap_formats[] =
#define VERBOSE_TEXT N_("Verbosity (0,1,2)") #define VERBOSE_TEXT N_("Verbosity (0,1,2)")
#define VERBOSE_LONGTEXT N_( \ #define VERBOSE_LONGTEXT N_( \
"This options sets the verbosity level (0=only errors and " \ "This option sets the verbosity level (0=only errors and " \
"standard messages, 1=warnings, 2=debug).") "standard messages, 1=warnings, 2=debug).")
#define QUIET_TEXT N_("Be quiet") #define QUIET_TEXT N_("Be quiet")
#define QUIET_LONGTEXT N_( \ #define QUIET_LONGTEXT N_( \
"This options turns off all warning and information messages.") "This option turns off all warning and information messages.")
#define OPEN_TEXT N_("Open MRL")
#define OPEN_LONGTEXT N_( \
"This option allows you to open a default MRL on start-up.")
#define LANGUAGE_TEXT N_("Language") #define LANGUAGE_TEXT N_("Language")
#define LANGUAGE_LONGTEXT N_( "This option allows you to set the language " \ #define LANGUAGE_LONGTEXT N_( "This option allows you to set the language " \
...@@ -1290,6 +1294,7 @@ vlc_module_begin(); ...@@ -1290,6 +1294,7 @@ vlc_module_begin();
add_bool( "color", 0, NULL, COLOR_TEXT, COLOR_LONGTEXT, VLC_TRUE ); add_bool( "color", 0, NULL, COLOR_TEXT, COLOR_LONGTEXT, VLC_TRUE );
add_bool( "advanced", 0, NULL, ADVANCED_TEXT, ADVANCED_LONGTEXT, add_bool( "advanced", 0, NULL, ADVANCED_TEXT, ADVANCED_LONGTEXT,
VLC_FALSE ); VLC_FALSE );
add_string( "open", "", NULL, OPEN_TEXT, OPEN_LONGTEXT, VLC_FALSE );
set_subcategory( SUBCAT_INTERFACE_CONTROL ); set_subcategory( SUBCAT_INTERFACE_CONTROL );
add_module_list_cat( "control", SUBCAT_INTERFACE_CONTROL, NULL, NULL, add_module_list_cat( "control", SUBCAT_INTERFACE_CONTROL, NULL, NULL,
......
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