summaryrefslogtreecommitdiffstats
path: root/player/core.h
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 /player/core.h
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 'player/core.h')
-rw-r--r--player/core.h9
1 files changed, 7 insertions, 2 deletions
diff --git a/player/core.h b/player/core.h
index 9048685827..58c1e3793c 100644
--- a/player/core.h
+++ b/player/core.h
@@ -97,6 +97,11 @@ enum seek_type {
MPSEEK_FACTOR,
};
+// A bit-mask would be best, but I preferred not to use that with the client API.
+#define PAUSE_BY_COMMAND ((mpv_event_pause_reason){.by_command=1})
+#define PAUSE_BY_CACHE ((mpv_event_pause_reason){.by_cache=1})
+#define PAUSE_BY_KEEP_OPEN ((mpv_event_pause_reason){.by_keep_open=1})
+
struct track {
enum stream_type type;
@@ -420,8 +425,8 @@ void set_osd_function(struct MPContext *mpctx, int osd_function);
void set_osd_subtitle(struct MPContext *mpctx, const char *text);
// playloop.c
-void pause_player(struct MPContext *mpctx);
-void unpause_player(struct MPContext *mpctx);
+void pause_player(struct MPContext *mpctx, mpv_event_pause_reason reason);
+void unpause_player(struct MPContext *mpctx, mpv_event_pause_reason reason);
void add_step_frame(struct MPContext *mpctx, int dir);
void queue_seek(struct MPContext *mpctx, enum seek_type type, double amount,
int exact, bool immediate);