changeset 27648:427fec163870

Add a "pause" property to allow checking if MPlayer is paused. Behaviour without pausing_keep_force prefix is a bit weird.
author reimar
date Wed, 01 Oct 2008 17:05:30 +0000
parents 98478619a22c
children 1eee249e519d
files DOCS/tech/slave.txt command.c
diffstat 2 files changed, 9 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/DOCS/tech/slave.txt	Wed Oct 01 17:05:18 2008 +0000
+++ b/DOCS/tech/slave.txt	Wed Oct 01 17:05:30 2008 +0000
@@ -470,6 +470,7 @@
 osdlevel           int       0       3       X   X   X    as -osdlevel
 speed              float     0.01    100     X   X   X    as -speed
 loop               int       -1              X   X   X    as -loop
+pause              flag      0       1       X            1 if paused, use with pausing_keep_force
 filename           string                    X            file playing wo path
 path               string                    X            file playing
 demuxer            string                    X            demuxer used
--- a/command.c	Wed Oct 01 17:05:18 2008 +0000
+++ b/command.c	Wed Oct 01 17:05:30 2008 +0000
@@ -554,6 +554,12 @@
     return M_PROPERTY_NOT_IMPLEMENTED;
 }
 
+static int mp_property_pause(m_option_t * prop, int action, void *arg,
+                             MPContext * mpctx)
+{
+    return m_property_flag_ro(prop, action, arg, mpctx->osd_function == OSD_PAUSE);
+}
+
 
 ///@}
 
@@ -2000,6 +2006,8 @@
      CONF_RANGE, -2, 10, NULL },
     { "metadata", mp_property_metadata, CONF_TYPE_STRING_LIST,
      0, 0, 0, NULL },
+    { "pause", mp_property_pause, CONF_TYPE_FLAG,
+     M_OPT_RANGE, 0, 1, NULL },
 
     // Audio
     { "volume", mp_property_volume, CONF_TYPE_FLOAT,