Vtc.Timecode.with_seconds

You're seeing just the function with_seconds, go back to Vtc.Timecode module for more information.
Link to this function

with_seconds(seconds, rate, opts \\ [])

View Source

Specs

with_seconds(
  Vtc.Source.Seconds.t(),
  Vtc.Framerate.t(),
  opts :: [{:round, maybe_round()}]
) ::
  parse_result()

Returns a new Timecode with a Timecode.seconds field value equal to the seconds arg.

Arguments

  • seconds: A value which can be represented as a number of real-world seconds. Must implement the Seconds protocol.

  • rate: Frame-per-second playback value of the timecode.

Options

  • round: How to round the result with regards to whole-frames.

Examples

Accetps runtime strings...

iex> Timecode.with_seconds("01:00:00.5", Rates.f23_98) |> inspect()
"{:ok, <00:59:56:22 @ <23.98 NTSC NDF>>}"

... floats...

iex> Timecode.with_seconds(3600.5, Rates.f23_98) |> inspect()
"{:ok, <00:59:56:22 @ <23.98 NTSC NDF>>}"

... integers...

iex> Timecode.with_seconds(3600, Rates.f23_98) |> inspect()
"{:ok, <00:59:56:10 @ <23.98 NTSC NDF>>}"

... integer Strings...

iex> Timecode.with_seconds("3600", Rates.f23_98) |> inspect()
"{:ok, <00:59:56:10 @ <23.98 NTSC NDF>>}"

... and float strings.

iex> Timecode.with_seconds("3600.5", Rates.f23_98) |> inspect()
"{:ok, <00:59:56:22 @ <23.98 NTSC NDF>>}"