# HG changeset patch # User reimar # Date 1124094643 0 # Node ID 4b2b8c90d370967a9decfa90d63a3252423affe8 # Parent 94bb243636e1c51a4d1203e375a2c5ee2621a6eb loadfile/loadlist can now also add files to the playlist diff -r 94bb243636e1 -r 4b2b8c90d370 DOCS/tech/slave.txt --- a/DOCS/tech/slave.txt Sun Aug 14 23:16:17 2005 +0000 +++ b/DOCS/tech/slave.txt Mon Aug 15 08:30:43 2005 +0000 @@ -173,11 +173,15 @@ If is != 0, then the pan-and scan range is interpreted as an absolute range. -loadfile +loadfile Load the given file/URL. + If is 0 or not given playback of the current file will be stopped + and the playlist replaced. Otherwise it will only be added to the playlist. -loadlist +loadlist Load the given playlist file. + If is 0 or not given playback of the current file will be stopped + and the playlist replaced. Otherwise it will only be added to the playlist. change_rectangle Change the position of the rectangle filter rectangle. diff -r 94bb243636e1 -r 4b2b8c90d370 input/input.c --- a/input/input.c Sun Aug 14 23:16:17 2005 +0000 +++ b/input/input.c Mon Aug 15 08:30:43 2005 +0000 @@ -110,8 +110,8 @@ { MP_CMD_SCREENSHOT, "screenshot", 0, { {-1,{0}} } }, { MP_CMD_PANSCAN, "panscan",1, { {MP_CMD_ARG_FLOAT,{0}}, {MP_CMD_ARG_INT,{0}}, {-1,{0}} } }, { MP_CMD_SWITCH_VSYNC, "switch_vsync", 0, { {MP_CMD_ARG_INT,{0}}, {-1,{0}} } }, - { MP_CMD_LOADFILE, "loadfile", 1, { {MP_CMD_ARG_STRING, {0}}, {-1,{0}} } }, - { MP_CMD_LOADLIST, "loadlist", 1, { {MP_CMD_ARG_STRING, {0}}, {-1,{0}} } }, + { MP_CMD_LOADFILE, "loadfile", 1, { {MP_CMD_ARG_STRING, {0}}, {MP_CMD_ARG_INT,{0}}, {-1,{0}} } }, + { MP_CMD_LOADLIST, "loadlist", 1, { {MP_CMD_ARG_STRING, {0}}, {MP_CMD_ARG_INT,{0}}, {-1,{0}} } }, { MP_CMD_RUN, "run", 1, { {MP_CMD_ARG_STRING,{0}}, {-1,{0}} } }, { MP_CMD_VF_CHANGE_RECTANGLE, "change_rectangle", 2, { {MP_CMD_ARG_INT,{0}}, {MP_CMD_ARG_INT,{0}}, {-1,{0}}}}, diff -r 94bb243636e1 -r 4b2b8c90d370 mplayer.c --- a/mplayer.c Sun Aug 14 23:16:17 2005 +0000 +++ b/mplayer.c Mon Aug 15 08:30:43 2005 +0000 @@ -2998,6 +2998,9 @@ play_tree_t* e = play_tree_new(); play_tree_add_file(e,cmd->args[0].v.s); + if (cmd->args[1].v.i) // append + play_tree_append_entry(playtree, e); + else { // Go back to the start point while(play_tree_iter_up_step(playtree_iter,0,1) != PLAY_TREE_ITER_END) /* NOP */; @@ -3005,6 +3008,7 @@ play_tree_set_child(playtree,e); play_tree_iter_step(playtree_iter,0,0); eof = PT_NEXT_SRC; + } brk_cmd = 1; } break; case MP_CMD_LOADLIST : { @@ -3012,6 +3016,9 @@ if(!e) mp_msg(MSGT_CPLAYER,MSGL_ERR,MSGTR_PlaylistLoadUnable,cmd->args[0].v.s); else { + if (cmd->args[1].v.i) // append + play_tree_append_entry(playtree, e); + else { // Go back to the start point while(play_tree_iter_up_step(playtree_iter,0,1) != PLAY_TREE_ITER_END) /* NOP */; @@ -3019,6 +3026,7 @@ play_tree_set_child(playtree,e); play_tree_iter_step(playtree_iter,0,0); eof = PT_NEXT_SRC; + } } brk_cmd = 1; } break;