<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Protocol (libmpdclient.Mpd.Protocol)</title><link rel="stylesheet" href="../../odoc.css"/><meta charset="utf-8"/><meta name="viewport" content="width=device-width,initial-scale=1.0"/><script src="../../../highlight.pack.js"></script><script>hljs.initHighlightingOnLoad();</script></head><body><div class="content"><header><nav><a href="../index.html">Up</a> â€“ <a href="../../index.html">libmpdclient</a> &#x00BB; <a href="../index.html">Mpd</a> &#x00BB; Protocol</nav><h1>Module <code>Mpd.Protocol</code></h1></header><aside><p>Define the Mpd response and error types</p></aside><dl><dt class="spec type" id="type-ack_error"><a href="#type-ack_error" class="anchor"></a><code><span class="keyword">type </span>ack_error</code><code><span class="keyword"> = </span></code><table class="variant"><tr id="type-ack_error.Not_list" class="anchored"><td class="def constructor"><a href="#type-ack_error.Not_list" class="anchor"></a><code><span class="keyword">| </span></code><code><span class="constructor">Not_list</span></code></td></tr><tr id="type-ack_error.Arg" class="anchored"><td class="def constructor"><a href="#type-ack_error.Arg" class="anchor"></a><code><span class="keyword">| </span></code><code><span class="constructor">Arg</span></code></td></tr><tr id="type-ack_error.Password" class="anchored"><td class="def constructor"><a href="#type-ack_error.Password" class="anchor"></a><code><span class="keyword">| </span></code><code><span class="constructor">Password</span></code></td></tr><tr id="type-ack_error.Permission" class="anchored"><td class="def constructor"><a href="#type-ack_error.Permission" class="anchor"></a><code><span class="keyword">| </span></code><code><span class="constructor">Permission</span></code></td></tr><tr id="type-ack_error.Unknown" class="anchored"><td class="def constructor"><a href="#type-ack_error.Unknown" class="anchor"></a><code><span class="keyword">| </span></code><code><span class="constructor">Unknown</span></code></td></tr><tr id="type-ack_error.No_exist" class="anchored"><td class="def constructor"><a href="#type-ack_error.No_exist" class="anchor"></a><code><span class="keyword">| </span></code><code><span class="constructor">No_exist</span></code></td></tr><tr id="type-ack_error.Playlist_max" class="anchored"><td class="def constructor"><a href="#type-ack_error.Playlist_max" class="anchor"></a><code><span class="keyword">| </span></code><code><span class="constructor">Playlist_max</span></code></td></tr><tr id="type-ack_error.System" class="anchored"><td class="def constructor"><a href="#type-ack_error.System" class="anchor"></a><code><span class="keyword">| </span></code><code><span class="constructor">System</span></code></td></tr><tr id="type-ack_error.Playlist_load" class="anchored"><td class="def constructor"><a href="#type-ack_error.Playlist_load" class="anchor"></a><code><span class="keyword">| </span></code><code><span class="constructor">Playlist_load</span></code></td></tr><tr id="type-ack_error.Update_already" class="anchored"><td class="def constructor"><a href="#type-ack_error.Update_already" class="anchor"></a><code><span class="keyword">| </span></code><code><span class="constructor">Update_already</span></code></td></tr><tr id="type-ack_error.Player_sync" class="anchored"><td class="def constructor"><a href="#type-ack_error.Player_sync" class="anchor"></a><code><span class="keyword">| </span></code><code><span class="constructor">Player_sync</span></code></td></tr><tr id="type-ack_error.Exist" class="anchored"><td class="def constructor"><a href="#type-ack_error.Exist" class="anchor"></a><code><span class="keyword">| </span></code><code><span class="constructor">Exist</span></code></td><td class="doc"><p>Type of error that could occur when a command is sent to the mpd server.</p></td></tr></table></dt><dt class="spec type" id="type-response"><a href="#type-response" class="anchor"></a><code><span class="keyword">type </span>response</code><code><span class="keyword"> = </span></code><table class="variant"><tr id="type-response.Ok" class="anchored"><td class="def constructor"><a href="#type-response.Ok" class="anchor"></a><code><span class="keyword">| </span></code><code><span class="constructor">Ok</span><span class="keyword"> of </span>string option</code></td></tr><tr id="type-response.Error" class="anchored"><td class="def constructor"><a href="#type-response.Error" class="anchor"></a><code><span class="keyword">| </span></code><code><span class="constructor">Error</span><span class="keyword"> of </span><a href="index.html#type-ack_error">ack_error</a><span class="keyword"> * </span>int<span class="keyword"> * </span>string<span class="keyword"> * </span>string</code></td><td class="doc"><p>Type of the response of the mpd server.</p></td></tr></table></dt></dl><dl><dt class="spec value" id="val-error_name"><a href="#val-error_name" class="anchor"></a><code><span class="keyword">val </span>error_name : <a href="index.html#type-ack_error">ack_error</a> <span>&#45;&gt;</span> string</code></dt><dd><p>Get the error name of the error type.</p></dd></dl><dl><dt class="spec value" id="val-str_error_to_val"><a href="#val-str_error_to_val" class="anchor"></a><code><span class="keyword">val </span>str_error_to_val : string <span>&#45;&gt;</span> <a href="index.html#type-ack_error">ack_error</a></code></dt><dd><p>Return the related type for the error returned by the server as a string.</p></dd></dl><dl><dt class="spec value" id="val-parse_error_response"><a href="#val-parse_error_response" class="anchor"></a><code><span class="keyword">val </span>parse_error_response : string <span>&#45;&gt;</span> <a href="index.html#type-ack_error">ack_error</a><span class="keyword"> * </span>int<span class="keyword"> * </span>string<span class="keyword"> * </span>string</code></dt><dd><p>Parse the error response of the mpd server into the error type.</p></dd></dl><dl><dt class="spec value" id="val-parse_response"><a href="#val-parse_response" class="anchor"></a><code><span class="keyword">val </span>parse_response : string <span>&#45;&gt;</span> <a href="index.html#type-response">response</a></code></dt><dd><p>Parse the mpd server response</p></dd></dl><dl><dt class="spec type" id="type-mpd_response"><a href="#type-mpd_response" class="anchor"></a><code><span class="keyword">type </span>mpd_response</code><code><span class="keyword"> = </span></code><table class="variant"><tr id="type-mpd_response.Incomplete" class="anchored"><td class="def constructor"><a href="#type-mpd_response.Incomplete" class="anchor"></a><code><span class="keyword">| </span></code><code><span class="constructor">Incomplete</span></code></td></tr><tr id="type-mpd_response.Complete" class="anchored"><td class="def constructor"><a href="#type-mpd_response.Complete" class="anchor"></a><code><span class="keyword">| </span></code><code><span class="constructor">Complete</span><span class="keyword"> of </span>string<span class="keyword"> * </span>int</code></td><td class="doc"><p>Type used to describe a data while reading through a socket.</p></td></tr></table></dt></dl><dl><dt class="spec value" id="val-full_mpd_banner"><a href="#val-full_mpd_banner" class="anchor"></a><code><span class="keyword">val </span>full_mpd_banner : string <span>&#45;&gt;</span> <a href="index.html#type-mpd_response">mpd_response</a></code></dt><dd><p>fetch mpd banner</p></dd></dl><dl><dt class="spec value" id="val-request_response"><a href="#val-request_response" class="anchor"></a><code><span class="keyword">val </span>request_response : string <span>&#45;&gt;</span> <a href="index.html#type-mpd_response">mpd_response</a></code></dt><dd><p>fetch request response.</p></dd></dl><dl><dt class="spec value" id="val-command_response"><a href="#val-command_response" class="anchor"></a><code><span class="keyword">val </span>command_response : string <span>&#45;&gt;</span> <a href="index.html#type-mpd_response">mpd_response</a></code></dt><dd><p>fetch command response.</p></dd></dl><dl><dt class="spec value" id="val-full_mpd_idle_event"><a href="#val-full_mpd_idle_event" class="anchor"></a><code><span class="keyword">val </span>full_mpd_idle_event : string <span>&#45;&gt;</span> <a href="index.html#type-mpd_response">mpd_response</a></code></dt><dd><p>Get the Mpd response for an idle command.</p></dd></dl></div></body></html>