]> git.sesse.net Git - vlc/commitdiff
* add --playlist-enqueue option ( win32 only )
authorAntoine Cellerier <dionoea@videolan.org>
Tue, 14 Jun 2005 20:38:44 +0000 (20:38 +0000)
committerAntoine Cellerier <dionoea@videolan.org>
Tue, 14 Jun 2005 20:38:44 +0000 (20:38 +0000)
When running with --one-instance, enqueue item to playlist and keep playing
the current item. (default behavior is to start playing new item)

src/libvlc.h
src/misc/win32_specific.c

index dd6a484fa5ee6ea839c452329508dc26d23c9d5b..b1adf5056707346809ee5feb425b5ab845b9d21d 100644 (file)
@@ -722,6 +722,12 @@ static char *ppsz_clock_descriptions[] =
     "double-click on a file in the explorer. This option will allow you " \
     "to play the file with the already running instance or enqueue it.")
 
+#define PLAYLISTENQUEUE_TEXT N_( \
+    "Enqueue items to playlist when in one instance mode")
+#define PLAYLISTENQUEUE_LONGTEXT N_( \
+    "When using the one instance only option, enqueue items to playlist " \
+    "and keep playing current item.")
+
 #define HPRIORITY_TEXT N_("Increase the priority of the process")
 #define HPRIORITY_LONGTEXT N_( \
     "Increasing the priority of the process will very likely improve your " \
@@ -1225,6 +1231,8 @@ vlc_module_begin();
 #if defined(WIN32)
     add_bool( "one-instance", 0, NULL, ONEINSTANCE_TEXT,
               ONEINSTANCE_LONGTEXT, VLC_TRUE );
+    add_bool( "playlist-enqueue", 0, NULL, ONEINSTANCE_TEXT,
+              ONEINSTANCE_LONGTEXT, VLC_TRUE );
     add_bool( "high-priority", 0, NULL, HPRIORITY_TEXT,
               HPRIORITY_LONGTEXT, VLC_FALSE );
     add_bool( "fast-mutex", 0, NULL, FAST_MUTEX_TEXT,
index 4ce7914d00fcba48e968ccc9f4ba59c485a4ee98..8d07007c9b8668efe2bc5c6a78b85827e4807e7f 100644 (file)
@@ -326,12 +326,20 @@ LRESULT CALLBACK WMCOPYWNDPROC( HWND hwnd, UINT uMsg, WPARAM wParam,
                 {
                     i_options++;
                 }
-
-                playlist_AddExt( p_playlist, ppsz_argv[i_opt],ppsz_argv[i_opt],
-                    PLAYLIST_APPEND | (i_opt? 0 : PLAYLIST_GO),
+                if( i_opt || config_GetInt( p_this, "playlist-enqueue" ) )
+                {
+                  playlist_AddExt( p_playlist, ppsz_argv[i_opt],
+                    ppsz_argv[i_opt], PLAYLIST_APPEND ,
+                    PLAYLIST_END, -1,
+                    (char const **)( i_options ? &ppsz_argv[i_opt+1] : NULL ),
+                    i_options );
+                } else {
+                  playlist_AddExt( p_playlist, ppsz_argv[i_opt],
+                    ppsz_argv[i_opt], PLAYLIST_APPEND | PLAYLIST_GO,
                     PLAYLIST_END, -1,
                     (char const **)( i_options ? &ppsz_argv[i_opt+1] : NULL ),
                     i_options );
+                }
 
                 i_opt += i_options;
             }