changeset 5135:aeef7f3c2096

Now enter key quit if no next file is avaible
author albeu
date Sat, 16 Mar 2002 16:36:32 +0000
parents 83b3dc5132a5
children 79ea91540f29
files input/input.c mplayer.c
diffstat 2 files changed, 25 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/input/input.c	Sat Mar 16 15:49:26 2002 +0000
+++ b/input/input.c	Sat Mar 16 16:36:32 2002 +0000
@@ -37,8 +37,8 @@
   { 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 @@
   { { '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" },
--- a/mplayer.c	Sat Mar 16 15:49:26 2002 +0000
+++ b/mplayer.c	Sat Mar 16 16:36:32 2002 +0000
@@ -2364,18 +2364,28 @@
     } 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) {