1
mirror of https://github.com/mpv-player/mpv synced 2025-01-05 03:06:28 +01:00

Now enter key quit if no next file is avaible

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@5136 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
albeu 2002-03-16 16:36:32 +00:00
parent 24c5ce1c3b
commit 82d7a7a8f3
2 changed files with 25 additions and 11 deletions

View File

@ -37,8 +37,8 @@ static mp_cmd_t mp_cmds[] = {
{ MP_CMD_QUIT, "quit", 0, { {-1,{0}} } },
{ MP_CMD_PAUSE, "pause", 0, { {-1,{0}} } },
{ MP_CMD_GRAB_FRAMES, "grab_frames",0, { {-1,{0}} } },
{ MP_CMD_PLAY_TREE_STEP, "pt_step",1, { { MP_CMD_ARG_INT ,{0}}, {-1,{0}} } },
{ MP_CMD_PLAY_TREE_UP_STEP, "pt_up_step",1, { { MP_CMD_ARG_INT,{0} }, {-1,{0}} } },
{ MP_CMD_PLAY_TREE_STEP, "pt_step",1, { { MP_CMD_ARG_INT ,{0}}, { MP_CMD_ARG_INT ,{0}}, {-1,{0}} } },
{ MP_CMD_PLAY_TREE_UP_STEP, "pt_up_step",1, { { MP_CMD_ARG_INT,{0} }, { MP_CMD_ARG_INT ,{0}}, {-1,{0}} } },
{ MP_CMD_PLAY_ALT_SRC_STEP, "alt_src_step",1, { { MP_CMD_ARG_INT,{0} }, {-1,{0}} } },
{ MP_CMD_SUB_DELAY, "sub_delay",1, { {MP_CMD_ARG_FLOAT,{0}}, {MP_CMD_ARG_INT,{0}}, {-1,{0}} } },
{ MP_CMD_OSD, "osd",0, { {MP_CMD_ARG_INT,{-1}}, {-1,{0}} } },
@ -157,12 +157,16 @@ static mp_cmd_bind_t def_cmd_binds[] = {
{ { 'q', 0 }, "quit" },
{ { KEY_ESC, 0 }, "quit" },
{ { KEY_ENTER, 0 }, "quit" },
// { { 'p', 0 }, "pause" },
#ifndef HAVE_NEW_GUI
{ { 'p', 0 }, "pause" },
#endif
{ { ' ', 0 }, "pause" },
{ { KEY_HOME, 0 }, "pt_up_step 1" },
{ { KEY_END, 0 }, "pt_up_step -1" },
{ { '>', 0 }, "pt_step 1" },
// { { KEY_ENTER, 0 }, "pt_step 1" },
#ifndef HAVE_NEW_GUI
{ { KEY_ENTER, 0 }, "pt_step 1 1" },
#endif
{ { '<', 0 }, "pt_step -1" },
{ { KEY_INS, 0 }, "alt_src_step 1" },
{ { KEY_DEL, 0 }, "alt_src_step -1" },

View File

@ -2364,18 +2364,28 @@ if(step_sec>0) {
} break;
case MP_CMD_PLAY_TREE_STEP : {
int n = cmd->args[0].v.i > 0 ? 1 : -1;
play_tree_iter_t* i = play_tree_iter_new_copy(playtree_iter);
if(play_tree_iter_step(i,n,0) == PLAY_TREE_ITER_ENTRY)
int force = cmd->args[1].v.i;
if(!force) {
play_tree_iter_t* i = play_tree_iter_new_copy(playtree_iter);
if(play_tree_iter_step(i,n,0) == PLAY_TREE_ITER_ENTRY)
eof = (n > 0) ? PT_NEXT_ENTRY : PT_PREV_ENTRY;
play_tree_iter_free(i);
} else
eof = (n > 0) ? PT_NEXT_ENTRY : PT_PREV_ENTRY;
play_tree_iter_free(i);
} break;
case MP_CMD_PLAY_TREE_UP_STEP : {
int n = cmd->args[0].v.i > 0 ? 1 : -1;
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)
int force = cmd->args[1].v.i;
if(!force) {
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;
play_tree_iter_free(i);
} else
eof = (n > 0) ? PT_UP_NEXT : PT_UP_PREV;
play_tree_iter_free(i);
} break;
case MP_CMD_PLAY_ALT_SRC_STEP : {
if(playtree_iter->num_files > 1) {