]> git.sesse.net Git - vlc/commitdiff
* src/libvlc.*: New --open option to allow to permanently start an MRL on
authorChristophe Massiot <massiot@videolan.org>
Tue, 21 Jun 2005 12:29:55 +0000 (12:29 +0000)
committerChristophe Massiot <massiot@videolan.org>
Tue, 21 Jun 2005 12:29:55 +0000 (12:29 +0000)
   startup. Fixed two typos in two strings.

src/libvlc.c
src/libvlc.h

index 949c30a8a17b1da6b0df672aec987f10fbfacfcf..9f04c7adacc1429a90952f75a8a9d6649a5a2c94 100644 (file)
@@ -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 );
     module_t    *p_help_module;
     playlist_t  *p_playlist;
+    vlc_value_t  val;
 
     if( !p_vlc )
     {
@@ -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 );
     if( config_GetInt( p_vlc, "quiet" ) )
     {
-        vlc_value_t val;
         val.i_int = -1;
         var_Set( p_vlc, "verbose", val );
     }
@@ -727,6 +727,18 @@ int VLC_Init( int i_object, int i_argc, char *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 );
     return VLC_SUCCESS;
 }
index e8d9f25588569286d58b13629d7cf69a62dca92b..dd09e89e016014f18f1b87ba20b6f916bf790b19 100644 (file)
@@ -66,12 +66,16 @@ static char *ppsz_snap_formats[] =
 
 #define VERBOSE_TEXT N_("Verbosity (0,1,2)")
 #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).")
 
 #define QUIET_TEXT N_("Be quiet")
 #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_LONGTEXT N_( "This option allows you to set the language " \
@@ -1290,6 +1294,7 @@ vlc_module_begin();
     add_bool( "color", 0, NULL, COLOR_TEXT, COLOR_LONGTEXT, VLC_TRUE );
     add_bool( "advanced", 0, NULL, ADVANCED_TEXT, ADVANCED_LONGTEXT,
                     VLC_FALSE );
+    add_string( "open", "", NULL, OPEN_TEXT, OPEN_LONGTEXT, VLC_FALSE );
 
     set_subcategory( SUBCAT_INTERFACE_CONTROL );
     add_module_list_cat( "control", SUBCAT_INTERFACE_CONTROL, NULL, NULL,