Class TimecodeRange

java.lang.Object
com.peterphi.std.types.TimecodeRange

public class TimecodeRange extends Object
Represents a range between two non-null timecodes
  • Constructor Details

  • Method Details

    • getStart

      public Timecode getStart()
    • getEnd

      public Timecode getEnd()
    • getDuration

      public SampleCount getDuration()
    • toOffset

      public TimecodeRange toOffset(Timecode reference)
      Constructs a new TimecodeRange where the values are expressed as offsets from reference.
      Parameters:
      reference - the reference timecode. Must be less than or equal to the start timecode for this range
      Returns:
    • subtract

      public TimecodeRange subtract(SampleCount samples)
      Move the range left by the specified number of samples
      Parameters:
      samples -
      Returns:
    • add

      public TimecodeRange add(SampleCount samples)
      Move the range right by the specified number of samples
      Parameters:
      samples -
      Returns:
    • resample

      public TimecodeRange resample(Timebase timebase)
    • resample

      public TimecodeRange resample(Timebase timebase, boolean toDropFrame)
    • within

      public boolean within(Timecode test)
      Tests whether a timecode lies within (or on the boundaries of) this range
      Parameters:
      test -
      Returns:
    • within

      public boolean within(TimecodeRange test)
      Test whether a given timecode range lies wholly within (or on the boundaries of) this range
      Parameters:
      test -
      Returns:
    • overlaps

      public boolean overlaps(TimecodeRange that)
      Determines whether two timecode ranges overlap (or are equivalent)
      Parameters:
      that - some other timecode range. comparisons will be made based on the time represented
      Returns:
      true if the ranges overlap, otherwise false
    • merge

      public static TimecodeRange merge(TimecodeRange a, TimecodeRange b)
      Produce a new Timecode range which includes all timecodes from a and b. This may result in coverage of additional timecodes if the two ranges do not overlap.
      Parameters:
      a -
      b -
      Returns:
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object