#
View Source Vtc.Source.Seconds protocol (vtc v0.13.15)

Protocol which types can implement to be passed as the main value of `Framestamp.with_seconds/3`.

##

implementations

Implementations

Out of the box, this protocol is implemented for the following types:

- `Integer`
- `Float`
- `Ratio`
- `String`
  - runtime ("01:00:00.0")
  - decimal ("3600.0")
- `Vtc.Source.Seconds.RuntimeStr`
- `Vtc.Source.Seconds.PremiereTicks`

# Link to this section Summary

## Types

result()

Result type of `seconds/2`.

t()

## Functions

seconds(value, rate)

Returns the value as a rational, real-world seconds value.

# Link to this section Types

Link to this type

# result()

View Source

    @type result() :: {:ok, Ratio.t()} | {:error, Vtc.Framestamp.ParseError.t()}

Result type of `seconds/2`.

Link to this type

# t()

View Source

    @type t() :: term()

# Link to this section Functions

Link to this function

# seconds(value, rate)

View Source

    @spec seconds(t(), Vtc.Framerate.t()) :: result()

Returns the value as a rational, real-world seconds value.

##

arguments

Arguments

- value: The source value.

- rate: The framerate of the framestamp being parsed.

##

returns

Returns

A result tuple with a rational representation of the seconds value using `Ratio` on success.