/usr/lib/ocaml/shout/shout.mli is in libshout-ocaml-dev 0.2.7-1build8.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 | (*
Copyright 2003-2006 Savonet team
This file is part of Ocaml-shout.
Ocaml-shout is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
Ocaml-shout is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Ocaml-shout; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*)
(**
Libshout 2 bindings for OCaml.
@author Samuel Mimram
*)
(* $Id: shout.mli 3589 2007-05-10 21:17:44Z smimram $ *)
(** {1 Types and exceptions.} *)
(** A shout connection. *)
type shout
(* Exceptions *)
(** Bad parameters, either nonsense or not applicable due to the current state of the connection. *)
exception Insane
(** A connection with the server could not be established. *)
exception No_connect
(** The server refused to accept a login attemp (bad user name or password?). *)
exception No_login
(** An error occured while sending or receiving data. *)
exception Socket
(** A problem occured while trying to allocate memory (no more memory left?). This exception could be raised by most of the functions. *)
exception Malloc
(** An error occured while updating the metadatas on the server. *)
exception Metadata
(** We are connected to a server. *)
exception Connected
(** We are not connected to a server. *)
exception Unconnected
(** The operation is not supported. *)
exception Unsupported
(** An error occured while sending data. *)
exception Send_error
(** Format of audio data. *)
type data_format =
| Format_vorbis (** ogg / vorbis *)
| Format_mp3 (** mp3 *)
(** Kind of protocol to use. *)
type protocol =
| Protocol_http (** http *)
| Protocol_xaudiocast (** audiocast *)
| Protocol_icy (** shoutcast *)
(** {1 Initialization and creation functions.} *)
(** Initialize the shout library. Must be called before anything else. *)
val init : unit -> unit
(** Shut down the shout library, deallocating any global storage. Don't call anything afterwards. This function should be called after having finished to use the shout library. *)
val shutdown : unit -> unit
(** Get a version string as well as the value of the library major, minor, and patch levels, respectively. *)
val version : unit -> string * int * int * int
(** Get a string describing the last shout error to occur. Only valid until the next call to a [Shout] function. *)
val get_error : shout -> string
(** Get the number of the last error. *)
val get_errno : shout -> int
(** Create a new [shout] value. *)
val new_shout : unit -> shout
(** Am I connected to a shoutcast server? *)
val is_connected : shout -> bool
(** {1 Setting and retrieving preliminary parameters.} *)
(** The following parameters may be set only {i before} calling [open_shout]. They might raise the [Malloc] exception or the [Connected] exception when attempting to change a connection attribute while the connection is open. *)
(** {2 Connection parameters} *)
(** Set the server's hostname or ip address (default: localhost). *)
val set_host : shout -> string -> unit
(** Retrieve the server's hostname or ip address. *)
val get_host : shout -> string
(** Set the server's port (default: 8000). *)
val set_port : shout -> int -> unit
(** Retrieve the server's port. *)
val get_port : shout -> int
(** Set the user to authenticate as (default: source). *)
val set_user : shout -> string -> unit
(** Retrieve the user to authenticate as. *)
val get_user : shout -> string
(** Set the password to authenticate the server with. *)
val set_password : shout -> string -> unit
(** Retrieve the server's password. *)
val get_password : shout -> string
(** Set the protocol to connect to the server with (default: Protocol_http). *)
val set_protocol : shout -> protocol -> unit
(** Retrieve the protocol used to connect to the server. *)
val get_protocol : shout -> protocol
(** Set the stream's audio format (default: Format_vorbis). *)
val set_format : shout -> data_format -> unit
(** Retrieve the stream's audio format. *)
val get_format : shout -> data_format
(** Set the the mountpoint (not supported by the [Protocol_icy] protocol). *)
val set_mount : shout -> string -> unit
(** Retrieve the mountpoint. *)
val get_mount : shout -> string
(** Request that your stream be archived on the server under the specified name. *)
val set_dumpfile : shout -> string -> unit
(** Retrieve the dumpfile name. *)
val get_dumpfile : shout -> string
(** Set the user agent header (default: libshout/VERSION). *)
val set_agent : shout -> string -> unit
(** Retrieve the user agent header. *)
val get_agent : shout -> string
(** {2 Directory parameters (optionnal)} *)
(** Should we ask the server to list the stream in any directories it knows about (default: [false])? *)
val set_public : shout -> bool -> unit
(** Should we ask the server to list the stream in any directories it knows about? *)
val get_public : shout -> bool
(** Set the name of the stream. *)
val set_name : shout -> string -> unit
(** Retrieve the name of the stream. *)
val get_name : shout -> string
(** Set the url of a site about this stream. *)
val set_url : shout -> string -> unit
(** Retrieve the url of a site about this stream. *)
val get_url : shout -> string
(** Set the stream genre. *)
val set_genre : shout -> string -> unit
(** Retrieve the stream genre. *)
val get_genre : shout -> string
(** Set the stream description. *)
val set_description : shout -> string -> unit
(** Retrieve the stream description. *)
val get_description : shout -> string
(** [set_audio_info shout name value] sets the stream audio parameter [name] to the value [value]. *)
val set_audio_info : shout -> string -> string -> unit
(** Retrieve a stream audio parameter. *)
val get_audio_info : shout -> string -> string
(** {2 Multicasting} *)
(** Set the ip for multicasting the stream. *)
val set_multicast_ip : shout -> string -> unit
(** Retrieve the ip for multicasting the stream. *)
val get_multicast_ip : shout -> string
(** {1 Managing the connection and sending data.} *)
(** Open a connection to the server. All parameters must already be set.
@raise Insane if host, port or password is unset.
@raise Connected if the connection has already been opened.
@raise Unsupported if the protocol / format combination is unsupported (e.g. ogg / vobis may only be sent via the http protocol).
@raise No_connect if a connection to the server could not be established.
@raise Socket if an error occured while talking to the server.
@raise No_login if the server refused login (authentication failed). *)
val open_shout : shout -> unit
(** Close a connection to the server.
@raise Unconnected if the [shout] value is not currently connected. *)
val close : shout -> unit
(** Send data to the server, parsing it for format specific timing info.
@raise Unconnected if the [shout] value is not currently connected.
@raise Socket if an error occured while talking to the server. *)
val send : shout -> string -> unit
(** @deprecated Send unparsed data to the server. Do not use this unless you know what you are doing.
@raise Unconnected if the [shout] value is not currently connected.
@raise Socket if an error occured while talking to the server.
@return the number of bytes written. *)
val send_raw : shout -> string -> int
(** Put caller to sleep until it is time to send more data to the server. Should be called before every call to [send] (the function [delay] could also be used to determine the amout of time the caller should wait before sendig data). *)
val sync : shout -> unit
(** Amount of time in miliseconds caller should wait before sending again. *)
val delay : shout -> int
(** Set metadata for mp3 streams.
@raise No_connect if the server refused the connection attempt.
@raise No_login if the server did not accept your authorization credentials.
@raise Socket if an error occured talking to the server.
@raise Unsupported if the format is not mp3.
@raise Metadata if an other error happened (e.g. bad mount point). *)
val set_metadata : shout -> (string * string) array -> unit
|