Class virtual Source.source


class virtual source : ?name:string -> Frame.content_kind -> object .. end
The source use is to send music frames through the get method.

Naming

method id : string
Identifier of the source.
method set_id : ?definitive:bool -> string -> unit

Liveness type

stype is the liveness type, telling whether a scheduler is fallible or not, i.e. get will never fail. It is defined by each operator based on its sources' types.

method virtual stype : source_t

Init/shutdown

val mutable ns_kind : string
Registered server commands for the source
method register_command : descr:string -> ?usage:string -> string -> (string -> string) -> unit
method on_shutdown : (unit -> unit) -> unit
Register a callback, to be executed when source shuts down.
method clock : clock_variable
The clock under which the source will run, initially unknown.
method private set_clock : unit
Choose your clock, by adjusting to your children source, or anything custom.
method get_ready : ?dynamic:bool -> source list -> unit
The operator says to the source that he will ask it frames.
method private wake_up : source list -> unit
Called when the source must be ready and had no active operator, means that the source has to initialize.
method leave : ?dynamic:bool -> source -> unit
Opposite of get_ready : the operator no longer needs the source.
method private sleep : unit

Streaming

method kind : Frame.content_kind
What kind of content does this source produce.
method virtual remaining : int
Number of frames left in the current track. Defaults to -1=infinity.
method seek : int -> int
method virtual is_ready : bool
is_ready tells you if get can be called.
method get : Frame.t -> unit
get buf asks the source to fill the buffer buf if possible. The get call is partial when the buffer is not completely filled. get should never be called with a full buffer, and without checking that the source is ready.
method private virtual get_frame : Frame.t -> unit
method virtual abort_track : unit
Tells the source to finish the reading of current track.
method is_output : bool
method after_output : unit
Wait for output round to finish. Typically, output nodes compute an audio frame (a full buffer), then launch a few output threads, which take care of encoding and outputting (to a file, network, ...). In that case, after_output allows the node to wait for its output threads.
method advance : unit

Utilities

method private create_request : ?metadata:(string * string) list ->
?persistent:bool -> ?indicators:Request.indicator list -> string -> Request.t
Create a request with a "source" metadata.
method private log : Dtools.Log.t