[Mplayer-cvslog] CVS: main cfg-mplayer.h,1.191,1.192 mplayer.c,1.669,1.670

Arpi of Ize arpi at mplayerhq.hu
Thu Feb 6 00:02:39 CET 2003


Update of /cvsroot/mplayer/main
In directory mail:/var/tmp.root/cvs-serv26201

Modified Files:
	cfg-mplayer.h mplayer.c 
Log Message:
- 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 <FabianFranz at gmx.de>


Index: cfg-mplayer.h
===================================================================
RCS file: /cvsroot/mplayer/main/cfg-mplayer.h,v
retrieving revision 1.191
retrieving revision 1.192
diff -u -r1.191 -r1.192
--- cfg-mplayer.h	10 Jan 2003 01:45:21 -0000	1.191
+++ cfg-mplayer.h	5 Feb 2003 23:02:35 -0000	1.192
@@ -106,6 +106,7 @@
 
 #ifdef HAVE_NEW_GUI
 extern char * skinName;
+extern int enqueue;
 #endif
 
 #ifdef HAVE_ODIVX_POSTPROCESS
@@ -395,6 +396,8 @@
       
 #ifdef HAVE_NEW_GUI
 	{"skin", &skinName, CONF_TYPE_STRING, CONF_GLOBAL, 0, 0, NULL},
+	{"enqueue", &enqueue, CONF_TYPE_FLAG, 0, 0, 1, NULL},
+	{"noenqueue", &enqueue, CONF_TYPE_FLAG, 0, 0, 0, NULL},
 #endif
 
 	{"noloop", &loop_times, CONF_TYPE_FLAG, 0, 0, -1, NULL},

Index: mplayer.c
===================================================================
RCS file: /cvsroot/mplayer/main/mplayer.c,v
retrieving revision 1.669
retrieving revision 1.670
diff -u -r1.669 -r1.670
--- mplayer.c	2 Feb 2003 02:42:55 -0000	1.669
+++ mplayer.c	5 Feb 2003 23:02:35 -0000	1.670
@@ -181,6 +181,11 @@
 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 @@
 
 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 @@
     return PT_NEXT_ENTRY;
   }      
   play_tree_remove(entry,1,1);
+  }
   return PT_NEXT_SRC;
 }
 
@@ -743,6 +758,13 @@
       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 @@
       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;i<n;i++)
+	    mplNext();
+        else
+	  for (i=0;i<-1*n;i++)
+	    mplPrev();
+     } else
+#endif
+     {
+      if(!force && playtree_iter) {
 	play_tree_iter_t* i = play_tree_iter_new_copy(playtree_iter);
 	
 	if(play_tree_iter_step(i,n,0) == PLAY_TREE_ITER_ENTRY)
@@ -2313,12 +2347,13 @@
 	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;



More information about the MPlayer-cvslog mailing list