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.
Returns the sum of two times, at the higher of the two rates.
OtioRationalTime otio_rational_time_add(OtioRationalTime left, OtioRationalTime right);| Parameter | Type | Role |
|---|---|---|
| left | OtioRationalTime | what the call is about |
| right | OtioRationalTime | input |
Returns whether two times are within `delta` of each other.
bool otio_rational_time_almost_equal(
OtioRationalTime left,
OtioRationalTime right,
double delta);| Parameter | Type | Role |
|---|---|---|
| left | OtioRationalTime | what the call is about |
| right | OtioRationalTime | input |
| delta | double | input |
Returns the time rounded towards positive infinity.
OtioRationalTime otio_rational_time_ceil(OtioRationalTime time);| Parameter | Type | Role |
|---|---|---|
| time | OtioRationalTime | what the call is about |
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);| Parameter | Type | Role |
|---|---|---|
| left | OtioRationalTime | what the call is about |
| right | OtioRationalTime | input |
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);| Parameter | Type | Role |
|---|---|---|
| start_time | OtioRationalTime | input |
| end_time_exclusive | OtioRationalTime | input |
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);| Parameter | Type | Role |
|---|---|---|
| start_time | OtioRationalTime | input |
| end_time_inclusive | OtioRationalTime | input |
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);| Parameter | Type | Role |
|---|---|---|
| left | OtioRationalTime | what the call is about |
| right | OtioRationalTime | input |
Returns the time rounded towards negative infinity.
OtioRationalTime otio_rational_time_floor(OtioRationalTime time);| Parameter | Type | Role |
|---|---|---|
| time | OtioRationalTime | what the call is about |
Builds a time from a frame number at a rate.
OtioRationalTime otio_rational_time_from_frames(double frame, double rate);| Parameter | Type | Role |
|---|---|---|
| frame | double | input |
| rate | double | input |
Builds a time from a number of seconds, at a rate of one.
OtioRationalTime otio_rational_time_from_seconds(double seconds);| Parameter | Type | Role |
|---|---|---|
| seconds | double | input |
Builds a time from a number of seconds at a rate.
OtioRationalTime otio_rational_time_from_seconds_at_rate(double seconds, double rate);| Parameter | Type | Role |
|---|---|---|
| seconds | double | input |
| rate | double | input |
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);| Parameter | Type | Role |
|---|---|---|
| time_string | text | input |
| rate | double | input |
| out_time | OtioRationalTime | written through, not read |
| out_error | text | why the call failed, or null to skip it |
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);| Parameter | Type | Role |
|---|---|---|
| timecode | text | input |
| rate | double | input |
| out_time | OtioRationalTime | written through, not read |
| out_error | text | why the call failed, or null to skip it |
Returns whether a time is usable: both parts finite and the rate positive.
bool otio_rational_time_is_valid(OtioRationalTime time);| Parameter | Type | Role |
|---|---|---|
| time | OtioRationalTime | what the call is about |
Returns the time with its sign flipped.
OtioRationalTime otio_rational_time_negate(OtioRationalTime time);| Parameter | Type | Role |
|---|---|---|
| time | OtioRationalTime | what the call is about |
Returns the same instant expressed at another rate.
OtioRationalTime otio_rational_time_rescaled_to(OtioRationalTime time, double rate);| Parameter | Type | Role |
|---|---|---|
| time | OtioRationalTime | what the call is about |
| rate | double | input |
Returns the same instant expressed at another time's rate.
OtioRationalTime otio_rational_time_rescaled_to_time(
OtioRationalTime time,
OtioRationalTime other);| Parameter | Type | Role |
|---|---|---|
| time | OtioRationalTime | what the call is about |
| other | OtioRationalTime | input |
Returns the time rounded to the nearest whole value, halves away from zero.
OtioRationalTime otio_rational_time_round(OtioRationalTime time);| Parameter | Type | Role |
|---|---|---|
| time | OtioRationalTime | what the call is about |
Returns whether two times have the same value and the same rate.
bool otio_rational_time_strictly_equal(OtioRationalTime left, OtioRationalTime right);| Parameter | Type | Role |
|---|---|---|
| left | OtioRationalTime | what the call is about |
| right | OtioRationalTime | input |
Returns the difference of two times, at the higher of the two rates.
OtioRationalTime otio_rational_time_subtract(
OtioRationalTime left,
OtioRationalTime right);| Parameter | Type | Role |
|---|---|---|
| left | OtioRationalTime | what the call is about |
| right | OtioRationalTime | input |
Returns the frame number this time falls on.
int32_t otio_rational_time_to_frames(OtioRationalTime time);| Parameter | Type | Role |
|---|---|---|
| time | OtioRationalTime | what the call is about |
Returns the frame number this time falls on at another rate.
int32_t otio_rational_time_to_frames_at_rate(OtioRationalTime time, double rate);| Parameter | Type | Role |
|---|---|---|
| time | OtioRationalTime | what the call is about |
| rate | double | input |
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);| Parameter | Type | Role |
|---|---|---|
| time | OtioRationalTime | what the call is about |
| rate | double | input |
| drop_frame | OtioDropFrame | input |
| out_timecode | text | written through, not read |
| out_error | text | why the call failed, or null to skip it |
Returns the time in seconds.
double otio_rational_time_to_seconds(OtioRationalTime time);| Parameter | Type | Role |
|---|---|---|
| time | OtioRationalTime | what the call is about |
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);| Parameter | Type | Role |
|---|---|---|
| time | OtioRationalTime | what the call is about |
| out_string | text | written through, not read |
| out_error | text | why the call failed, or null to skip it |
Writes a time as a timecode at its own rate.
OtioStatus otio_rational_time_to_timecode(
OtioRationalTime time,
OtioBuffer *out_timecode,
OtioBuffer *out_error);| Parameter | Type | Role |
|---|---|---|
| time | OtioRationalTime | what the call is about |
| out_timecode | text | written through, not read |
| out_error | text | why the call failed, or null to skip it |
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);| Parameter | Type | Role |
|---|---|---|
| time | OtioRationalTime | what the call is about |
| rate | double | input |
| drop_frame | OtioDropFrame | input |
| out_timecode | text | written through, not read |
| out_error | text | why the call failed, or null to skip it |
Returns what this time's value would be at another rate.
double otio_rational_time_value_rescaled_to(OtioRationalTime time, double rate);| Parameter | Type | Role |
|---|---|---|
| time | OtioRationalTime | what the call is about |
| rate | double | input |