diff command.c @ 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 22bdd7ba8892
children 1eee249e519d
line wrap: on
line diff
--- 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,