Module Mpd.Protocol

type ack_error =
| Not_list
| Arg
| Password
| Permission
| Unknown
| No_exist
| Playlist_max
| System
| Playlist_load
| Update_already
| Player_sync
| Exist

Type of error that could occur when a command is sent to the mpd server.

type response =
| Ok of string option
| Error of ack_error * int * string * string

Type of the response of the mpd server.

val error_name : ack_error -> string

Get the error name of the error type.

val str_error_to_val : string -> ack_error

Return the related type for the error returned by the server as a string.

val parse_error_response : string -> ack_error * int * string * string

Parse the error response of the mpd server into the error type.

val parse_response : string -> response

Parse the mpd server response

type mpd_response =
| Incomplete
| Complete of string * int

Type used to describe a data while reading through a socket.

val full_mpd_banner : string -> mpd_response

fetch mpd banner

val request_response : string -> mpd_response

fetch request response.

val command_response : string -> mpd_response

fetch command response.

val full_mpd_idle_event : string -> mpd_response

Get the Mpd response for an idle command.