diff options
author | wm4 <wm4@nowhere> | 2020-03-21 17:45:30 +0100 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2020-03-21 19:33:03 +0100 |
commit | 7e885a3bc3af4df93681b6e760a34e59e2f47ef7 (patch) | |
tree | c2687c6b364a2e5aeef0c466fb04988bafc35ab3 /libmpv/client.h | |
parent | 956a5d9ac61ffe4034abcc81405e8ecdacac8b36 (diff) | |
download | mpv-7e885a3bc3af4df93681b6e760a34e59e2f47ef7.tar.bz2 mpv-7e885a3bc3af4df93681b6e760a34e59e2f47ef7.tar.xz |
client API: add a playlist entry unique ID
This should make dealing with some async. things easier.
It's intentionally not a globally unique ID.
Diffstat (limited to 'libmpv/client.h')
-rw-r--r-- | libmpv/client.h | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/libmpv/client.h b/libmpv/client.h index 8d3af89249..ef9ba0d423 100644 --- a/libmpv/client.h +++ b/libmpv/client.h @@ -1297,6 +1297,7 @@ typedef enum mpv_event_id { MPV_EVENT_COMMAND_REPLY = 5, /** * Notification before playback start of a file (before the file is loaded). + * See also mpv_event and mpv_event_start_file. */ MPV_EVENT_START_FILE = 6, /** @@ -1595,6 +1596,14 @@ typedef enum mpv_end_file_reason { MPV_END_FILE_REASON_REDIRECT = 5, } mpv_end_file_reason; +/// Since API version 1.108. +typedef struct mpv_event_start_file { + /** + * Playlist entry ID of the file being loaded now. + */ + int64_t playlist_entry_id; +} mpv_event_start_file; + typedef struct mpv_event_end_file { /** * Corresponds to the values in enum mpv_end_file_reason (the "int" type @@ -1610,6 +1619,13 @@ typedef struct mpv_event_end_file { * Since API version 1.9. */ int error; + /** + * Playlist entry ID of the file that was being played or attempted to be + * played. This has the same value as the playlist_entry_id field in the + * corresponding mpv_event_start_file event. + * Since API version 1.108. + */ + int64_t playlist_entry_id; } mpv_event_end_file; #if MPV_ENABLE_DEPRECATED @@ -1689,6 +1705,7 @@ typedef struct mpv_event { * MPV_EVENT_PROPERTY_CHANGE: mpv_event_property* * MPV_EVENT_LOG_MESSAGE: mpv_event_log_message* * MPV_EVENT_CLIENT_MESSAGE: mpv_event_client_message* + * MPV_EVENT_START_FILE: mpv_event_start_file* (since v1.108) * MPV_EVENT_END_FILE: mpv_event_end_file* * MPV_EVENT_HOOK: mpv_event_hook* * MPV_EVENT_COMMAND_REPLY* mpv_event_command* |