Class Item

All Implemented Interfaces:
java.lang.AutoCloseable
Direct Known Subclasses:
Clip, Composition, Gap

public class Item
extends Composable
An Item is a Composable that can be part of a Composition or Timeline. More specifically, it is a Composable that has meaningful duration. Can also hold effects and markers.
  • Constructor Details

  • Method Details

    • isVisible

      public boolean isVisible()
      Overrides:
      isVisible in class Composable
      Returns:
      visibility of the Item. By default true.
    • isOverlapping

      public boolean isOverlapping()
      Overrides:
      isOverlapping in class Composable
      Returns:
      Return whether an Item is overlapping. By default false.
    • getSourceRange

      public TimeRange getSourceRange()
    • setSourceRange

      public void setSourceRange​(TimeRange sourceRange)
    • getEffects

      public java.util.List<Effect> getEffects()
    • getMarkers

      public java.util.List<Marker> getMarkers()
    • getDuration

      public RationalTime getDuration​(ErrorStatus errorStatus)
      Convience wrapper for the trimmed_range.duration of the item.
      Overrides:
      getDuration in class Composable
      Parameters:
      errorStatus - errorStatus to report in case this is not implemented in a sub-class.
      Returns:
      getTrimmedRange().duration
    • getAvailableRange

      public TimeRange getAvailableRange​(ErrorStatus errorStatus)
      Implemented by child classes, available range of media.
      Parameters:
      errorStatus - errorStatus to report in case this is not implemented in a sub-class.
      Returns:
      available range of media
    • getTrimmedRange

      public TimeRange getTrimmedRange​(ErrorStatus errorStatus)
      The range after applying the source range.
      Parameters:
      errorStatus - errorStatus to report in case this is not implemented in a sub-class.
      Returns:
      range after applying the source range.
    • getVisibleRange

      public TimeRange getVisibleRange​(ErrorStatus errorStatus)
      The range of this item's media visible to its parent. Includes handles revealed by adjacent transitions (if any). This will always be larger or equal to trimmedRange.
      Parameters:
      errorStatus - errorStatus to report error in fetching visible range
      Returns:
      range of this item's media visible to its parent.
    • getTrimmedRangeInParent

      public TimeRange getTrimmedRangeInParent​(ErrorStatus errorStatus)
      Find and return the trimmed range of this item in the parent.
      Parameters:
      errorStatus - errorStatus to report in case trimmedRange is not implemented in a sub-class.
      Returns:
      trimmed range in parent.
    • getRangeInParent

      public TimeRange getRangeInParent​(ErrorStatus errorStatus)
      Find and return the untrimmed range of this item in the parent.
      Parameters:
      errorStatus - errorStatus to report in fetching range
      Returns:
      untrimmed range of this item in the parent
    • getTransformedTime

      public RationalTime getTransformedTime​(RationalTime time, Item toItem, ErrorStatus errorStatus)
      Converts time t in the coordinate system of self to coordinate system of toItem. Note that this and toItem must be part of the same timeline (they must have a common ancestor). Example: 0 20 [------t----D----------] [--A-][t----B---][--C--] 100 101 110 101 in B = 6 in D t = t argument
      Parameters:
      time - RationalTime to be transformed
      toItem - the Item in whose coordinate the time is to be transformed
      errorStatus - errorStatus to report error during transformation
      Returns:
      time in the coordinate system of self to coordinate system of toItem
    • getTransformedTimeRange

      public TimeRange getTransformedTimeRange​(TimeRange timeRange, Item toItem, ErrorStatus errorStatus)
      Transforms timeRange to the range of child or this toItem.
      Parameters:
      timeRange - timeRange to be transformed
      toItem - the Item in whose coordinate the time is to be transformed
      errorStatus - errorStatus to report error during transformation
      Returns:
      timeRange in coordinate of toItem.
    • toString

      public java.lang.String toString()
      Overrides:
      toString in class Composable