When working with media times, it can often be useful to refer to ranges that are things like "all times after two seconds" or "all times until 90 minutes". With time ranges expressing this, you can do things like: two_seconds_to_infinity_range.contains(RationalTime(36, 24)).
This can be thought of in two ways:
- A
TimeRange that goes from a concrete time to infinity or from negative infinity to a concrete time
- A
TimeRange with open end bounds or open front bounds
Modeling this as the first described solution would mean:
- Define
RationalTime constants for -infinity and infinity
- Updating
TimeRange to be expressed in terms of start_time and end_time(exclusive?) - instead of start_time and duration
For the second described solution one implementation might be to add TimeRange subclasses that are TimeRangeOpenEnd and TimeRangeOpenFront.
The second described solution would imply some API footprint changes for TimeRange.
When working with media times, it can often be useful to refer to ranges that are things like "all times after two seconds" or "all times until 90 minutes". With time ranges expressing this, you can do things like:
two_seconds_to_infinity_range.contains(RationalTime(36, 24)).This can be thought of in two ways:
TimeRangethat goes from a concrete time to infinity or from negative infinity to a concrete timeTimeRangewith open end bounds or open front boundsModeling this as the first described solution would mean:
RationalTimeconstants for -infinity and infinityTimeRangeto be expressed in terms ofstart_timeandend_time(exclusive?) - instead ofstart_timeanddurationFor the second described solution one implementation might be to add
TimeRangesubclasses that areTimeRangeOpenEndandTimeRangeOpenFront.The second described solution would imply some API footprint changes for
TimeRange.