Module Jack

type client
type port
type buffer = (float, Stdlib.Bigarray.float32_elt, Stdlib.Bigarray.c_layout) Stdlib.Bigarray.Array1.t
type client_open_option = [
  1. | `NoStartServer
  2. | `ServerName of string
]
val client_open : string -> client_open_option list -> client
val client_close : client -> unit
val get_sample_rate : client -> int
val get_buffer_size : client -> int
type port_flag = [
  1. | `IsInput
  2. | `IsOutput
  3. | `IsPhysical
  4. | `CanMonitor
  5. | `IsTerminal
]
val get_ports : pattern:string -> ?port_type:string -> flags:port_flag list -> client -> string list
val default_audio_type : string
val default_midi_type : string
val port_register : ?port_type:string -> ?buffer_size:int -> client -> string -> port_flag list -> port
module Ringbuffer : sig ... end
val activate : client -> unit
val port_get_buffer : port -> int -> buffer
val port_unregister : client -> port -> unit
val port_connect : client -> string -> string -> unit
val port_name : port -> string
module Wait : sig ... end

Lightweight one-shot thread synchronization. Backed by a POSIX semaphore on Unix/macOS (via GCD dispatch semaphores on macOS) and a mutex+condition variable on Windows. One thread calls wait to block; another calls signal to unblock it.