diff options
author | wm4 <wm4@nowhere> | 2014-04-05 23:54:21 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2014-04-06 03:22:49 +0200 |
commit | 49d1b42f7088c0d41df346437b64fe20bbaac22f (patch) | |
tree | 9756ee23e00870608705b17371bc25c38eee38cd /player/client.h | |
parent | 14eb233da98bbac1c606e392e658f400deb5024b (diff) | |
download | mpv-49d1b42f7088c0d41df346437b64fe20bbaac22f.tar.bz2 mpv-49d1b42f7088c0d41df346437b64fe20bbaac22f.tar.xz |
client API: add a way to notify clients of property changes
This turned out ridiculously complex. I think it will have to be
simplified some day. Main reason for the complexity are:
- filtering properties by forcing clients to observe individual
properties explicitly
(to avoid spamming clients with changes they don't want)
- optional retrieval of property value with the notification
(the basic idea was that this is more user friendly)
- allowing to the client to specify a format in which the value
should be retrieved
(because if a property changes its type, the client API couldn't
convert it properly, and compatibility would break)
I don't know yet which of these are important, and everything could
change. In particular, the interface and semantics should be adjusted
to reduce the implementation complexity.
While I consider the API complete, there could (and probably will) be
bugs left. Also while the implementation is complete, it's inefficient.
The complexity of the property matching is O(a*b*c) with a clients,
b observed properties, and c properties changing at once. I threw away
an earlier implementation using bitmasks, because it was too unwieldy.
Diffstat (limited to 'player/client.h')
-rw-r--r-- | player/client.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/player/client.h b/player/client.h index 4c0c23c614..6e078e9d7b 100644 --- a/player/client.h +++ b/player/client.h @@ -17,6 +17,7 @@ int mp_clients_num(struct MPContext *mpctx); void mp_client_broadcast_event(struct MPContext *mpctx, int event, void *data); int mp_client_send_event(struct MPContext *mpctx, const char *client_name, int event, void *data); +void mp_client_property_change(struct MPContext *mpctx, const char **list); struct mpv_handle *mp_new_client(struct mp_client_api *clients, const char *name); struct mp_log *mp_client_get_log(struct mpv_handle *ctx); |