summaryrefslogtreecommitdiffstats
path: root/libmpv
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2014-02-24 22:49:07 +0100
committerwm4 <wm4@nowhere>2014-02-24 22:50:25 +0100
commit0adb8a9aaf1e1c76300d717a0a3dd04849e70d1d (patch)
tree3dd2387c4eacd986a25a6025fac2e99aad621396 /libmpv
parent5d7007c6448660b2bdbc7758db7f486157ff1fa2 (diff)
downloadmpv-0adb8a9aaf1e1c76300d717a0a3dd04849e70d1d.tar.bz2
mpv-0adb8a9aaf1e1c76300d717a0a3dd04849e70d1d.tar.xz
client API: report pause/unpause reason
Not sure about this... might redo. At least this provides a case of a broadcasted event, which requires per-event data allocation. See github issue #576.
Diffstat (limited to 'libmpv')
-rw-r--r--libmpv/client.h28
1 files changed, 28 insertions, 0 deletions
diff --git a/libmpv/client.h b/libmpv/client.h
index a37afdbcb5..04fc94663d 100644
--- a/libmpv/client.h
+++ b/libmpv/client.h
@@ -889,6 +889,32 @@ typedef struct mpv_event_log_message {
const char *text;
} mpv_event_log_message;
+typedef struct mpv_event_pause_reason {
+ /**
+ * Actual pause state (0 or 1)
+ */
+ int real_paused;
+ /**
+ * User requested pause state (0 or 1)
+ */
+ int user_paused;
+ /**
+ * 1 if the action was triggered by an input command (or via an user key
+ * binding), 0 otherwise.
+ */
+ int by_command;
+ /**
+ * 1 if the action was triggered by a low (or recovering) cache state,
+ * 0 otherwise.
+ */
+ int by_cache;
+ /**
+ * 1 if the pausing was triggered because the end of playback was reached,
+ * and the "keep-open" option is enabled, 0 otherwise.
+ */
+ int by_keep_open;
+} mpv_event_pause_reason;
+
typedef struct mpv_event_script_input_dispatch {
/**
* Arbitrary integer value that was provided as argument to the
@@ -938,6 +964,8 @@ typedef struct mpv_event {
* The meaning and contents of data member depend on the event_id:
* MPV_EVENT_GET_PROPERTY_REPLY: mpv_event_property*
* MPV_EVENT_LOG_MESSAGE: mpv_event_log_message*
+ * MPV_EVENT_PAUSE: mpv_event_pause_reason*
+ * MPV_EVENT_UNPAUSE: mpv_event_pause_reason*
* MPV_EVENT_SCRIPT_INPUT_DISPATCH: mpv_event_script_input_dispatch*
* MPV_EVENT_CLIENT_MESSAGE: mpv_event_client_message*
* other: NULL