changeset 23412:f6c225ffe60d

Allow setting the direction in the step_property command.
author albeu
date Thu, 31 May 2007 09:42:14 +0000
parents 07741c30e64c
children 62018ec2eb35
files DOCS/tech/slave.txt command.c input/input.c
diffstat 3 files changed, 7 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/DOCS/tech/slave.txt	Thu May 31 09:13:21 2007 +0000
+++ b/DOCS/tech/slave.txt	Thu May 31 09:42:14 2007 +0000
@@ -249,8 +249,10 @@
 speed_set <value>
     Set the speed to <value>.
 
-step_property <property> [<value>]
-    Change property by value, or increase by a default if value is not given.
+step_property <property> [value] [direction]
+    Change a property by value, or increase by a default if value is
+    not given or zero. The direction is reversed if direction is less
+    than zero.
 
 sub_alignment [value]
     Toggle/set subtitle alignment.
--- a/command.c	Thu May 31 09:13:21 2007 +0000
+++ b/command.c	Thu May 31 09:42:14 2007 +0000
@@ -1735,7 +1735,8 @@
 		               cmd->args[0].v.s);
 		}
 		r = mp_property_do(cmd->args[0].v.s,
-		                   M_PROPERTY_STEP_UP,
+		                   cmd->args[2].v.i < 0 ?
+		                   M_PROPERTY_STEP_DOWN : M_PROPERTY_STEP_UP,
 		                   arg, mpctx);
 	    step_prop_err:
 		if (r == M_PROPERTY_UNKNOWN)
--- a/input/input.c	Thu May 31 09:13:21 2007 +0000
+++ b/input/input.c	Thu May 31 09:42:14 2007 +0000
@@ -165,7 +165,7 @@
   { MP_CMD_KEYDOWN_EVENTS, "key_down_event", 1, { {MP_CMD_ARG_INT,{0}}, {-1,{0}} } },
   { MP_CMD_SET_PROPERTY, "set_property", 2, { {MP_CMD_ARG_STRING, {0}},  {MP_CMD_ARG_STRING, {0}}, {-1,{0}} } },
   { MP_CMD_GET_PROPERTY, "get_property", 1, { {MP_CMD_ARG_STRING, {0}},  {-1,{0}} } },
-  { MP_CMD_STEP_PROPERTY, "step_property", 1, { {MP_CMD_ARG_STRING, {0}}, {MP_CMD_ARG_FLOAT,{0}}, {-1,{0}} } },
+  { MP_CMD_STEP_PROPERTY, "step_property", 1, { {MP_CMD_ARG_STRING, {0}}, {MP_CMD_ARG_FLOAT,{0}}, {MP_CMD_ARG_INT,{0}}, {-1,{0}} } },
   
   { MP_CMD_SEEK_CHAPTER, "seek_chapter", 1, { {MP_CMD_ARG_INT,{0}}, {MP_CMD_ARG_INT,{0}}, {-1,{0}} } },
   { MP_CMD_SET_MOUSE_POS, "set_mouse_pos", 2, { {MP_CMD_ARG_INT,{0}}, {MP_CMD_ARG_INT,{0}}, {-1,{0}} } },