From: Antoine Cellerier Date: Tue, 14 Jun 2005 20:38:44 +0000 (+0000) Subject: * add --playlist-enqueue option ( win32 only ) X-Git-Tag: 0.8.4~1479 X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=e86e468b81eb99def6f79266ed5b10377478045d;p=vlc * add --playlist-enqueue option ( win32 only ) When running with --one-instance, enqueue item to playlist and keep playing the current item. (default behavior is to start playing new item) --- diff --git a/src/libvlc.h b/src/libvlc.h index dd6a484fa5..b1adf50567 100644 --- a/src/libvlc.h +++ b/src/libvlc.h @@ -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, diff --git a/src/misc/win32_specific.c b/src/misc/win32_specific.c index 4ce7914d00..8d07007c9b 100644 --- a/src/misc/win32_specific.c +++ b/src/misc/win32_specific.c @@ -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; }