comparison mplayer.c @ 9291:64b8c5a07c2c

- 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@gmx.de>
author arpi
date Wed, 05 Feb 2003 23:02:35 +0000
parents 420e2b2f8e5a
children 7841308ad250
comparison
equal deleted inserted replaced
9290:0e043196d176 9291:64b8c5a07c2c
179 static int output_quality=0; 179 static int output_quality=0;
180 180
181 float playback_speed=1.0; 181 float playback_speed=1.0;
182 182
183 int use_gui=0; 183 int use_gui=0;
184
185 #ifdef HAVE_NEW_GUI
186 int enqueue=0;
187 #endif
188
184 #define MAX_OSD_LEVEL 3 189 #define MAX_OSD_LEVEL 3
185 190
186 int osd_level=1; 191 int osd_level=1;
187 int osd_level_saved=-1; 192 int osd_level_saved=-1;
188 int osd_visible=100; 193 int osd_visible=100;
575 580
576 #define mp_basename(s) (strrchr(s,'/')==NULL?(char*)s:(strrchr(s,'/')+1)) 581 #define mp_basename(s) (strrchr(s,'/')==NULL?(char*)s:(strrchr(s,'/')+1))
577 582
578 int playtree_add_playlist(play_tree_t* entry) 583 int playtree_add_playlist(play_tree_t* entry)
579 { 584 {
585 #ifdef HAVE_NEW_GUI
586 if (use_gui) {
587 if (entry) {
588 import_playtree_playlist_into_gui(entry, mconfig);
589 play_tree_free_list(entry,1);
590 }
591 } else
592 #endif
593 {
580 if(!entry) { 594 if(!entry) {
581 entry = playtree_iter->tree; 595 entry = playtree_iter->tree;
582 if(play_tree_iter_step(playtree_iter,1,0) != PLAY_TREE_ITER_ENTRY) { 596 if(play_tree_iter_step(playtree_iter,1,0) != PLAY_TREE_ITER_ENTRY) {
583 return PT_NEXT_ENTRY; 597 return PT_NEXT_ENTRY;
584 } 598 }
595 entry = playtree_iter->tree; 609 entry = playtree_iter->tree;
596 if(play_tree_iter_step(playtree_iter,1,0) != PLAY_TREE_ITER_ENTRY) { 610 if(play_tree_iter_step(playtree_iter,1,0) != PLAY_TREE_ITER_ENTRY) {
597 return PT_NEXT_ENTRY; 611 return PT_NEXT_ENTRY;
598 } 612 }
599 play_tree_remove(entry,1,1); 613 play_tree_remove(entry,1,1);
614 }
600 return PT_NEXT_SRC; 615 return PT_NEXT_SRC;
601 } 616 }
602 617
603 static int play_tree_step = 1; 618 static int play_tree_step = 1;
604 619
740 } 755 }
741 #else 756 #else
742 if(use_gui && !vo_init()){ 757 if(use_gui && !vo_init()){
743 mp_msg(MSGT_CPLAYER,MSGL_WARN,MSGTR_GuiNeedsX); 758 mp_msg(MSGT_CPLAYER,MSGL_WARN,MSGTR_GuiNeedsX);
744 use_gui=0; 759 use_gui=0;
760 }
761 if (use_gui && playtree_iter){
762 // Remove Playtree and Playtree-Iter from memory as its not used by gui
763 play_tree_iter_free(playtree_iter);
764 playtree_iter=NULL;
765 // Import initital playtree into gui
766 import_initial_playtree_into_gui(playtree, mconfig, enqueue);
745 } 767 }
746 #endif 768 #endif
747 769
748 if(vo_plugin_args && vo_plugin_args[0] && strcmp(vo_plugin_args[0],"help")==0){ 770 if(vo_plugin_args && vo_plugin_args[0] && strcmp(vo_plugin_args[0],"help")==0){
749 mp_msg(MSGT_CPLAYER, MSGL_INFO, MSGTR_AvailableVideoOutputPlugins); 771 mp_msg(MSGT_CPLAYER, MSGL_INFO, MSGTR_AvailableVideoOutputPlugins);
2301 } break; 2323 } break;
2302 case MP_CMD_PLAY_TREE_STEP : { 2324 case MP_CMD_PLAY_TREE_STEP : {
2303 int n = cmd->args[0].v.i == 0 ? 1 : cmd->args[0].v.i; 2325 int n = cmd->args[0].v.i == 0 ? 1 : cmd->args[0].v.i;
2304 int force = cmd->args[1].v.i; 2326 int force = cmd->args[1].v.i;
2305 2327
2306 if(!force) { 2328 #ifdef HAVE_NEW_GUI
2329 if (use_gui) {
2330 int i=0;
2331 if (n>0)
2332 for (i=0;i<n;i++)
2333 mplNext();
2334 else
2335 for (i=0;i<-1*n;i++)
2336 mplPrev();
2337 } else
2338 #endif
2339 {
2340 if(!force && playtree_iter) {
2307 play_tree_iter_t* i = play_tree_iter_new_copy(playtree_iter); 2341 play_tree_iter_t* i = play_tree_iter_new_copy(playtree_iter);
2308 2342
2309 if(play_tree_iter_step(i,n,0) == PLAY_TREE_ITER_ENTRY) 2343 if(play_tree_iter_step(i,n,0) == PLAY_TREE_ITER_ENTRY)
2310 eof = (n > 0) ? PT_NEXT_ENTRY : PT_PREV_ENTRY; 2344 eof = (n > 0) ? PT_NEXT_ENTRY : PT_PREV_ENTRY;
2311 play_tree_iter_free(i); 2345 play_tree_iter_free(i);
2312 } else 2346 } else
2313 eof = (n > 0) ? PT_NEXT_ENTRY : PT_PREV_ENTRY; 2347 eof = (n > 0) ? PT_NEXT_ENTRY : PT_PREV_ENTRY;
2314 if(eof) 2348 if(eof)
2315 play_tree_step = n; 2349 play_tree_step = n;
2350 }
2316 } break; 2351 } break;
2317 case MP_CMD_PLAY_TREE_UP_STEP : { 2352 case MP_CMD_PLAY_TREE_UP_STEP : {
2318 int n = cmd->args[0].v.i > 0 ? 1 : -1; 2353 int n = cmd->args[0].v.i > 0 ? 1 : -1;
2319 int force = cmd->args[1].v.i; 2354 int force = cmd->args[1].v.i;
2320 2355
2321 if(!force) { 2356 if(!force && playtree_iter) {
2322 play_tree_iter_t* i = play_tree_iter_new_copy(playtree_iter); 2357 play_tree_iter_t* i = play_tree_iter_new_copy(playtree_iter);
2323 if(play_tree_iter_up_step(i,n,0) == PLAY_TREE_ITER_ENTRY) 2358 if(play_tree_iter_up_step(i,n,0) == PLAY_TREE_ITER_ENTRY)
2324 eof = (n > 0) ? PT_UP_NEXT : PT_UP_PREV; 2359 eof = (n > 0) ? PT_UP_NEXT : PT_UP_PREV;
2325 play_tree_iter_free(i); 2360 play_tree_iter_free(i);
2326 } else 2361 } else