O
Sections
Every group

RationalTime

A point in time, or a length of it, as a value over a rate.

Symbols in this group are spelled otio_rational_time_…. An SDK drops that prefix, which is why the name beside each call is the short one.

add

method

Returns the sum of two times, at the higher of the two rates.

OtioRationalTime otio_rational_time_add(OtioRationalTime left, OtioRationalTime right);
ParameterTypeRole
leftOtioRationalTimewhat the call is about
rightOtioRationalTimeinput

almost_equals

method

Returns whether two times are within `delta` of each other.

bool otio_rational_time_almost_equal(
    OtioRationalTime left,
    OtioRationalTime right,
    double delta);
ParameterTypeRole
leftOtioRationalTimewhat the call is about
rightOtioRationalTimeinput
deltadoubleinput

ceil

getter

Returns the time rounded towards positive infinity.

OtioRationalTime otio_rational_time_ceil(OtioRationalTime time);
ParameterTypeRole
timeOtioRationalTimewhat the call is about

compare

method

Orders two times: -1 if `left` is earlier, 1 if later, 0 if the same.

A comparison involving a NaN has no answer, and reports 0.

int32_t otio_rational_time_compare(OtioRationalTime left, OtioRationalTime right);
ParameterTypeRole
leftOtioRationalTimewhat the call is about
rightOtioRationalTimeinput

duration_from_start_end_time

free

Returns how long it is from one instant to another, the end excluded.

OtioRationalTime otio_rational_time_duration_from_start_end_time(
    OtioRationalTime start_time,
    OtioRationalTime end_time_exclusive);
ParameterTypeRole
start_timeOtioRationalTimeinput
end_time_exclusiveOtioRationalTimeinput

duration_from_start_end_time_inclusive

free

Returns how long it is from one instant to another, the end included.

OtioRationalTime otio_rational_time_duration_from_start_end_time_inclusive(
    OtioRationalTime start_time,
    OtioRationalTime end_time_inclusive);
ParameterTypeRole
start_timeOtioRationalTimeinput
end_time_inclusiveOtioRationalTimeinput

equals

method

Returns whether two times are the same instant.

Times at different rates that name the same instant compare equal; this is upstream's `==`, not a field-by-field comparison. For that, use [`otio_rational_time_strictly_equal`].

bool otio_rational_time_equal(OtioRationalTime left, OtioRationalTime right);
ParameterTypeRole
leftOtioRationalTimewhat the call is about
rightOtioRationalTimeinput

floor

getter

Returns the time rounded towards negative infinity.

OtioRationalTime otio_rational_time_floor(OtioRationalTime time);
ParameterTypeRole
timeOtioRationalTimewhat the call is about

from_frames

constructor

Builds a time from a frame number at a rate.

OtioRationalTime otio_rational_time_from_frames(double frame, double rate);
ParameterTypeRole
framedoubleinput
ratedoubleinput

from_seconds

constructor

Builds a time from a number of seconds, at a rate of one.

OtioRationalTime otio_rational_time_from_seconds(double seconds);
ParameterTypeRole
secondsdoubleinput

from_seconds_at_rate

constructor

Builds a time from a number of seconds at a rate.

OtioRationalTime otio_rational_time_from_seconds_at_rate(double seconds, double rate);
ParameterTypeRole
secondsdoubleinput
ratedoubleinput

from_time_string

constructor

Reads a time from a `[-]HH:MM:SS.sss` time string at a rate.

OtioStatus otio_rational_time_from_time_string(
    const char *time_string,
    double rate,
    OtioRationalTime *out_time,
    OtioBuffer *out_error);
ParameterTypeRole
time_stringtextinput
ratedoubleinput
out_timeOtioRationalTimewritten through, not read
out_errortextwhy the call failed, or null to skip it

from_timecode

constructor

Reads a time from a `HH:MM:SS:FF` timecode at a rate.

OtioStatus otio_rational_time_from_timecode(
    const char *timecode,
    double rate,
    OtioRationalTime *out_time,
    OtioBuffer *out_error);
ParameterTypeRole
timecodetextinput
ratedoubleinput
out_timeOtioRationalTimewritten through, not read
out_errortextwhy the call failed, or null to skip it

is_valid

getter

Returns whether a time is usable: both parts finite and the rate positive.

bool otio_rational_time_is_valid(OtioRationalTime time);
ParameterTypeRole
timeOtioRationalTimewhat the call is about

negate

getter

Returns the time with its sign flipped.

OtioRationalTime otio_rational_time_negate(OtioRationalTime time);
ParameterTypeRole
timeOtioRationalTimewhat the call is about

rescaled_to

method

Returns the same instant expressed at another rate.

OtioRationalTime otio_rational_time_rescaled_to(OtioRationalTime time, double rate);
ParameterTypeRole
timeOtioRationalTimewhat the call is about
ratedoubleinput

rescaled_to_time

method

Returns the same instant expressed at another time's rate.

OtioRationalTime otio_rational_time_rescaled_to_time(
    OtioRationalTime time,
    OtioRationalTime other);
ParameterTypeRole
timeOtioRationalTimewhat the call is about
otherOtioRationalTimeinput

round

getter

Returns the time rounded to the nearest whole value, halves away from zero.

OtioRationalTime otio_rational_time_round(OtioRationalTime time);
ParameterTypeRole
timeOtioRationalTimewhat the call is about

strictly_equals

method

Returns whether two times have the same value and the same rate.

bool otio_rational_time_strictly_equal(OtioRationalTime left, OtioRationalTime right);
ParameterTypeRole
leftOtioRationalTimewhat the call is about
rightOtioRationalTimeinput

subtract

method

Returns the difference of two times, at the higher of the two rates.

OtioRationalTime otio_rational_time_subtract(
    OtioRationalTime left,
    OtioRationalTime right);
ParameterTypeRole
leftOtioRationalTimewhat the call is about
rightOtioRationalTimeinput

to_frames

getter

Returns the frame number this time falls on.

int32_t otio_rational_time_to_frames(OtioRationalTime time);
ParameterTypeRole
timeOtioRationalTimewhat the call is about

to_frames_at_rate

method

Returns the frame number this time falls on at another rate.

int32_t otio_rational_time_to_frames_at_rate(OtioRationalTime time, double rate);
ParameterTypeRole
timeOtioRationalTimewhat the call is about
ratedoubleinput

to_nearest_timecode_at

method

Writes a time as a timecode, rounding to the nearest frame first.

OtioStatus otio_rational_time_to_nearest_timecode_at(
    OtioRationalTime time,
    double rate,
    OtioDropFrame drop_frame,
    OtioBuffer *out_timecode,
    OtioBuffer *out_error);
ParameterTypeRole
timeOtioRationalTimewhat the call is about
ratedoubleinput
drop_frameOtioDropFrameinput
out_timecodetextwritten through, not read
out_errortextwhy the call failed, or null to skip it

to_seconds

getter

Returns the time in seconds.

double otio_rational_time_to_seconds(OtioRationalTime time);
ParameterTypeRole
timeOtioRationalTimewhat the call is about

to_time_string

getter

Writes a time as a `HH:MM:SS.sss` time string.

OtioStatus otio_rational_time_to_time_string(
    OtioRationalTime time,
    OtioBuffer *out_string,
    OtioBuffer *out_error);
ParameterTypeRole
timeOtioRationalTimewhat the call is about
out_stringtextwritten through, not read
out_errortextwhy the call failed, or null to skip it

to_timecode

getter

Writes a time as a timecode at its own rate.

OtioStatus otio_rational_time_to_timecode(
    OtioRationalTime time,
    OtioBuffer *out_timecode,
    OtioBuffer *out_error);
ParameterTypeRole
timeOtioRationalTimewhat the call is about
out_timecodetextwritten through, not read
out_errortextwhy the call failed, or null to skip it

to_timecode_at

method

Writes a time as a timecode at a given rate and drop-frame setting.

OtioStatus otio_rational_time_to_timecode_at(
    OtioRationalTime time,
    double rate,
    OtioDropFrame drop_frame,
    OtioBuffer *out_timecode,
    OtioBuffer *out_error);
ParameterTypeRole
timeOtioRationalTimewhat the call is about
ratedoubleinput
drop_frameOtioDropFrameinput
out_timecodetextwritten through, not read
out_errortextwhy the call failed, or null to skip it

value_rescaled_to

method

Returns what this time's value would be at another rate.

double otio_rational_time_value_rescaled_to(OtioRationalTime time, double rate);
ParameterTypeRole
timeOtioRationalTimewhat the call is about
ratedoubleinput