jon.recoil.org

Module Media.PropSource

Media objects properties, capabilities and constraints.

Ranges and constraints

Sourcemodule Bool : sig ... end

bool constraints.

Sourcemodule Int : sig ... end

int ranges and constraints.

Sourcemodule Float : sig ... end

float ranges and constraints.

Sourcemodule Jstr : sig ... end

Jstr constraints.

Properties

Sourcetype ('a, 'b, 'c) t

The type for properties of type 'a whose capabilities are described by 'b and which are constrained by 'c.

The type for boolean properties.

bool n is a bool property named n.

int n is an integer property named n.

The type for floating point properties.

float n is a float property named n.

jstr n is a string property named n.

The type for string enumeration properties.

jstr n is a string enumeration property named n.

Low-level interface

Sourcetype 'a conv = ('a -> Jv.t) * (Jv.t -> 'a)

'a conv specifies encoding and decoding functions for JavaScript.

v v_conv cap_conv constr_conv n is a new property named n whose values are converted with v_conv, capabilities with cap_conv and constraints with constr_conv.

name p is the name of the property.

Sourceval value_of_jv : ('a, 'b, 'c) Brr_io.Media.Prop.t -> Jv.t -> 'a

of_jv p jv is the property value of p from jv.

Sourceval value_to_jv : ('a, 'b, 'c) Brr_io.Media.Prop.t -> 'a -> Jv.t

to_jv p v is the JavaScript value of p for v.

Sourceval cap_of_jv : ('a, 'b, 'c) Brr_io.Media.Prop.t -> Jv.t -> 'b

cap_of_jv p jv is the property capability of p from jv.

Sourceval cap_to_jv : ('a, 'b, 'c) Brr_io.Media.Prop.t -> 'b -> Jv.t

cap_jv p v is the capability value of p for v.

Sourceval constr_of_jv : ('a, 'b, 'c) Brr_io.Media.Prop.t -> Jv.t -> 'c

cap_of_jv p jv is the property constraint of p from jv.

Sourceval constr_to_jv : ('a, 'b, 'c) Brr_io.Media.Prop.t -> 'c -> Jv.t

cap_jv p v is the cosntraint value of p for v.