[MPlayer-cvslog] r20931 - in trunk: DOCS/tech/slave.txt input/input.c input/input.h mplayer.c

reimar subversion at mplayerhq.hu
Tue Nov 14 20:52:22 CET 2006


Author: reimar
Date: Tue Nov 14 20:52:21 2006
New Revision: 20931

Modified:
   trunk/DOCS/tech/slave.txt
   trunk/input/input.c
   trunk/input/input.h
   trunk/mplayer.c

Log:
Introduce step_property command.
Patch by Carl Eugen Hoyos [cehoyos <at> ag or at] with modifications by me.


Modified: trunk/DOCS/tech/slave.txt
==============================================================================
--- trunk/DOCS/tech/slave.txt	(original)
+++ trunk/DOCS/tech/slave.txt	Tue Nov 14 20:52:21 2006
@@ -249,6 +249,9 @@
 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.
+
 sub_alignment [value]
     Toggle/set subtitle alignment.
         0 top alignment

Modified: trunk/input/input.c
==============================================================================
--- trunk/input/input.c	(original)
+++ trunk/input/input.c	Tue Nov 14 20:52:21 2006
@@ -164,6 +164,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_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}} } },

Modified: trunk/input/input.h
==============================================================================
--- trunk/input/input.h	(original)
+++ trunk/input/input.h	Tue Nov 14 20:52:21 2006
@@ -90,6 +90,7 @@
 #define MP_CMD_RADIO_SET_CHANNEL 88
 #define MP_CMD_RADIO_SET_FREQ 89
 #define MP_CMD_SET_MOUSE_POS 90
+#define MP_CMD_STEP_PROPERTY 91
 
 #define MP_CMD_GUI_EVENTS       5000
 #define MP_CMD_GUI_LOADFILE     5001

Modified: trunk/mplayer.c
==============================================================================
--- trunk/mplayer.c	(original)
+++ trunk/mplayer.c	Tue Nov 14 20:52:21 2006
@@ -4637,6 +4637,13 @@
                    cmd->args[0].v.s,cmd->args[1].v.s);
         
     } break;
+    case MP_CMD_STEP_PROPERTY: {
+        m_option_t* prop = mp_property_find(cmd->args[0].v.s);
+        float arg = cmd->args[1].v.f;
+        if(!prop) mp_msg(MSGT_CPLAYER,MSGL_WARN, "Unknown property: '%s'\n",cmd->args[0].v.s);
+        else if(m_property_do(prop,M_PROPERTY_STEP_UP, arg ? &arg : NULL) <= 0)
+            mp_msg(MSGT_CPLAYER,MSGL_WARN, "Failed to increment property '%s' by %f.\n",cmd->args[0].v.s, arg);
+    } break;
     case MP_CMD_GET_PROPERTY: {
         m_option_t* prop;
         void* val;



More information about the MPlayer-cvslog mailing list