Commit Graph

161 Commits

Author SHA1 Message Date
wm4 38a36fd7ea client API: add comment about character encoding issues
Also mention that NULL isn't valid. Although I'm not sure whether the
implementation strictly follows this (it should, but there are some
wacky corner cases).
2014-02-24 22:50:24 +01:00
wm4 43ad09393c client API: add more data formats, add a structured data type
This adds declarations for new formats. The implementation will be added
in the following commits. (It still compiles and runs with this commit,
because it adds constants only.)

The obvious new types are MPV_FORMAT_FLAG, MPV_FORMAT_INT64,
MPV_FORMAT_DOUBLE. MPV_FORMAT_FLAG is a boolean, but to avoid nasty ABI
issues or with languages that don't have a bool data type (C89), it uses
int. Thus the format is not named MPV_FORMAT_BOOL, to avoid confusion.

The MPV_FORMAT_NONE type (mpv_node) is a generic structured type, like a
variant or, say, JSON. It can store strings/bools/numbers, as well as
arrays and key/value pairs (with string keys only).

The MPV_FORMAT_NODE_ARRAY and MPV_FORMAT_NODE_MAP types are used
internally by mpv_node only and can't be used with most of the other API
(like mpv_set_property()) directly.
2014-02-24 20:50:47 +01:00
wm4 1e27d130a2 client API: change semantics for MPV_FORMAT_STRING
With mpv_set_property(h, "property", MPV_FORMAT_STRING, ptr), ptr now
has to be of type char** instead of char*. This makes it more consistent
with mpv_get_property() and also non-pointer formats, which will be
introduced in the following commits. mpv_set_property() of course does
not change its interface (only its implementation is adjusted to keep
its interface).

This also affects mpv_set_option(), but again not
mpv_set_option_string().
2014-02-24 20:50:47 +01:00
wm4 1e30048184 client API: fix a typo 2014-02-24 20:48:59 +01:00
wm4 47aeb22b75 client API: remove trailing "," from enums
This is allowed in C99 and C++11, but apparently not in C89 and C++98.

Make it conform to the older standards, since we want the client API
header to be highly portable.
2014-02-24 20:48:59 +01:00
wm4 4123c2a708 client API: spelling 2014-02-24 20:48:55 +01:00
wm4 0ad2211508 client API: add event for metadata changes 2014-02-19 16:00:37 +01:00
wm4 5fcf4b46f7 client API: add events for video and audio reconfig 2014-02-17 02:52:59 +01:00
wm4 75d3267b43 client API: add a client message event
This comes with a "script_message" input command, which sends these
messages. Used by the following commits.
2014-02-17 02:52:58 +01:00
wm4 5af8070a97 client API: fix description of mpv_event.error field
The description was a left over from an earlier iteration of the API.
2014-02-12 22:00:13 +01:00
wm4 88ae914b1e Add a client API
Add a client API, which is intended to be a stable API to get some rough
control over the player. Basically, it reflects what can be done with
input.conf commands or the old slavemode. It will replace the old
slavemode (and enable the implementation of a new slave protocol).
2014-02-10 21:01:35 +01:00