From 6b5dc1e6123046245b1f76962170c94df4ea9dbe Mon Sep 17 00:00:00 2001 From: arpi Date: Wed, 5 Feb 2003 23:02:35 +0000 Subject: - It adds an option enqueue/noenqueue, so users can choose if they want to have playlist overwritten by files on commandline or just enqueue them at the end ... - Playtree is finally cleared, as such gui has total control! - Autoplay if files are available on commandline and -enqueue is not set! - Fallback on Playlists finally does work with Gui and even with streaming Playlists! [ Before gui was broken as mplayer.c:playtree tried to have control] patch by Fabian Franz git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@9292 b3059339-0415-0410-9bf9-f77b7e298cf2 --- mplayer.c | 39 +++++++++++++++++++++++++++++++++++++-- 1 file changed, 37 insertions(+), 2 deletions(-) (limited to 'mplayer.c') diff --git a/mplayer.c b/mplayer.c index 3fbc60e3a4..c20cc0bfce 100644 --- a/mplayer.c +++ b/mplayer.c @@ -181,6 +181,11 @@ static int output_quality=0; float playback_speed=1.0; int use_gui=0; + +#ifdef HAVE_NEW_GUI +int enqueue=0; +#endif + #define MAX_OSD_LEVEL 3 int osd_level=1; @@ -577,6 +582,15 @@ static int libmpdemux_was_interrupted(int eof) { int playtree_add_playlist(play_tree_t* entry) { +#ifdef HAVE_NEW_GUI + if (use_gui) { + if (entry) { + import_playtree_playlist_into_gui(entry, mconfig); + play_tree_free_list(entry,1); + } + } else +#endif + { if(!entry) { entry = playtree_iter->tree; if(play_tree_iter_step(playtree_iter,1,0) != PLAY_TREE_ITER_ENTRY) { @@ -597,6 +611,7 @@ int playtree_add_playlist(play_tree_t* entry) return PT_NEXT_ENTRY; } play_tree_remove(entry,1,1); + } return PT_NEXT_SRC; } @@ -743,6 +758,13 @@ int gui_no_filename=0; mp_msg(MSGT_CPLAYER,MSGL_WARN,MSGTR_GuiNeedsX); use_gui=0; } + if (use_gui && playtree_iter){ + // Remove Playtree and Playtree-Iter from memory as its not used by gui + play_tree_iter_free(playtree_iter); + playtree_iter=NULL; + // Import initital playtree into gui + import_initial_playtree_into_gui(playtree, mconfig, enqueue); + } #endif if(vo_plugin_args && vo_plugin_args[0] && strcmp(vo_plugin_args[0],"help")==0){ @@ -2303,7 +2325,19 @@ if (stream->type==STREAMTYPE_DVDNAV && dvd_nav_still) int n = cmd->args[0].v.i == 0 ? 1 : cmd->args[0].v.i; int force = cmd->args[1].v.i; - if(!force) { +#ifdef HAVE_NEW_GUI + if (use_gui) { + int i=0; + if (n>0) + for (i=0;itype==STREAMTYPE_DVDNAV && dvd_nav_still) eof = (n > 0) ? PT_NEXT_ENTRY : PT_PREV_ENTRY; if(eof) play_tree_step = n; + } } break; case MP_CMD_PLAY_TREE_UP_STEP : { int n = cmd->args[0].v.i > 0 ? 1 : -1; int force = cmd->args[1].v.i; - if(!force) { + if(!force && playtree_iter) { play_tree_iter_t* i = play_tree_iter_new_copy(playtree_iter); if(play_tree_iter_up_step(i,n,0) == PLAY_TREE_ITER_ENTRY) eof = (n > 0) ? PT_UP_NEXT : PT_UP_PREV; -- cgit v1.2.3