summaryrefslogtreecommitdiffstats
path: root/DOCS
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2020-02-24 00:31:46 +0100
committerwm4 <wm4@nowhere>2020-02-24 00:31:46 +0100
commitc418aa38077e28a4e2303b9fbbe693d4830c8542 (patch)
tree35944ddd94489c41f85d1f3f4b2206b91dbd0bcc /DOCS
parent67311af05f61e78576e1ae67892b7d590aa1e996 (diff)
downloadmpv-c418aa38077e28a4e2303b9fbbe693d4830c8542.tar.bz2
mpv-c418aa38077e28a4e2303b9fbbe693d4830c8542.tar.xz
ipc: allow sending commands with named arguments
This has been part of the libmpv for a while, so the implementation in the IPC code is quite simple: just pass the mpv_node representing the value of the "command" field without further checks to mpv_command_node(). The only problem are the IPC-specific commands, which essentially have their own dispatch mechanism. They expect an array. I'm not going to rewrite the dispatch mechanism, so these still work only with an array. I decided make the other case explicit with cmd==NULL. (I could also have set cmd=="", which would have avoided changing each if condition since "" matches no existing command, but that felt dirty.)
Diffstat (limited to 'DOCS')
-rw-r--r--DOCS/man/ipc.rst11
1 files changed, 11 insertions, 0 deletions
diff --git a/DOCS/man/ipc.rst b/DOCS/man/ipc.rst
index 40e0730089..fdf5daf9b6 100644
--- a/DOCS/man/ipc.rst
+++ b/DOCS/man/ipc.rst
@@ -202,6 +202,17 @@ commands that finished execution immediately.
Cancellation of asynchronous commands is available in the libmpv API, but has
not yet been implemented in the IPC protocol.
+Commands with named arguments
+-----------------------------
+
+If the ``command`` field is a JSON object, named arguments are expected. This
+is described in the C API ``mpv_command_node()`` documentation (the
+``MPV_FORMAT_NODE_MAP`` case). In some cases, this may make commands more
+readable, while some obscure commands basically require using named arguments.
+
+Currently, only "proper" commands (as listed by `List of Input Commands`_)
+support named arguments.
+
Commands
--------