sig
type operation = [ `Both | `Read | `Write ]
type transport = {
write : Stdlib.Bytes.t -> int -> int -> int;
read : Stdlib.Bytes.t -> int -> int -> int;
wait_for : Cry.operation -> float -> bool;
close : unit -> unit;
}
val register_ssl :
(?bind:string -> host:string -> Unix.sockaddr -> Cry.transport) -> unit
type error =
Create of exn
| Connect of exn
| Close of exn
| Write of exn
| Read of exn
| Busy
| Ssl_unavailable
| Not_connected
| Invalid_usage
| Unknown_host of string
| Bad_answer of string option
| Http_answer of int * string * string
exception Error of Cry.error
val string_of_error : exn -> string
type verb = Put | Post | Source
type protocol = Icy | Http of Cry.verb | Https of Cry.verb
val string_of_protocol : Cry.protocol -> string
type content_type
val ogg_application : Cry.content_type
val ogg_audio : Cry.content_type
val ogg_video : Cry.content_type
val mpeg : Cry.content_type
val content_type_of_string : string -> Cry.content_type
val string_of_content_type : Cry.content_type -> string
type mount = Icy_id of int | Icecast_mount of string
type connection = {
mount : Cry.mount;
user : string;
password : string;
host : string;
port : int;
chunked : bool;
content_type : Cry.content_type;
protocol : Cry.protocol;
headers : (string, string) Stdlib.Hashtbl.t;
}
val string_of_connection : Cry.connection -> string
type audio_info = (string, string) Stdlib.Hashtbl.t
type metadata = (string, string) Stdlib.Hashtbl.t
type connection_data = {
connection : Cry.connection;
transport : Cry.transport;
}
type status = Connected of Cry.connection_data | Disconnected
type t
val create :
?bind:string ->
?connection_timeout:float -> ?timeout:float -> unit -> Cry.t
val get_status : Cry.t -> Cry.status
val get_icy_cap : Cry.t -> bool
val get_connection_data : Cry.t -> Cry.connection_data
val audio_info :
?samplerate:int ->
?channels:int -> ?quality:float -> ?bitrate:int -> unit -> Cry.audio_info
val connection :
?user_agent:string ->
?name:string ->
?genre:string ->
?url:string ->
?public:bool ->
?audio_info:Cry.audio_info ->
?description:string ->
?host:string ->
?port:int ->
?chunked:bool ->
?password:string ->
?protocol:Cry.protocol ->
?user:string ->
mount:Cry.mount ->
content_type:Cry.content_type -> unit -> Cry.connection
val connect : Cry.t -> Cry.connection -> unit
val update_metadata : ?charset:string -> Cry.t -> Cry.metadata -> unit
val manual_update_metadata :
host:string ->
port:int ->
protocol:Cry.protocol ->
user:string ->
password:string ->
mount:Cry.mount ->
?connection_timeout:float ->
?timeout:float ->
?headers:(string, string) Stdlib.Hashtbl.t ->
?bind:string -> ?charset:string -> Cry.metadata -> unit
val send : Cry.t -> string -> unit
val close : Cry.t -> unit
end