View Source Subtitle.Cue.Builder (kim_subtitle v0.1.1)

Builder allows to format and align cues. Pass in unformatted, long sentenced cues and get back a stream of cues formatted with the provided defaults.

Supports Cue payloads with WebVTT tags.

Summary

Functions

Flushes the pending cue.

Adds a new cue and maybe returns built cues.

Types

@type new_option() ::
  {:min_length, non_neg_integer()}
  | {:max_length, pos_integer()}
  | {:max_lines, pos_integer()}
  | {:min_duration, pos_integer()}
  | {:max_duration, pos_integer()}
@type t() :: %Subtitle.Cue.Builder{
  last: term(),
  max_duration: pos_integer(),
  max_length: pos_integer(),
  max_lines: pos_integer(),
  min_duration: pos_integer(),
  min_length: non_neg_integer(),
  pending: Subtitle.Cue.t() | nil
}

Functions

@spec flush(t()) :: {t(), Subtitle.Cue.t() | nil}

Flushes the pending cue.

@spec new([new_option()]) :: t()
Link to this function

put_and_get(builder, cue_or_cues, opts \\ [])

View Source
@spec put_and_get(t(), Subtitle.Cue.t() | [Subtitle.Cue.t()], Keyword.t()) ::
  {t(), [Subtitle.Cue.t()]}

Adds a new cue and maybe returns built cues.