Package io.opentimeline.opentimelineio
Class Item
java.lang.Object
- 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.
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classItem.ItemBuilderNested classes/interfaces inherited from class io.opentimeline.opentimelineio.Composable
Composable.ComposableBuilderNested classes/interfaces inherited from class io.opentimeline.opentimelineio.SerializableObjectWithMetadata
SerializableObjectWithMetadata.SerializableObjectWithMetadataBuilder -
Field Summary
-
Constructor Summary
Constructors Modifier Constructor Description protectedItem()Item(Item.ItemBuilder builder)Item(java.lang.String name, TimeRange sourceRange, AnyDictionary metadata, java.util.List<Effect> effects, java.util.List<Marker> markers) -
Method Summary
Modifier and Type Method Description TimeRangegetAvailableRange(ErrorStatus errorStatus)Implemented by child classes, available range of media.RationalTimegetDuration(ErrorStatus errorStatus)Convience wrapper for the trimmed_range.duration of the item.java.util.List<Effect>getEffects()java.util.List<Marker>getMarkers()TimeRangegetRangeInParent(ErrorStatus errorStatus)Find and return the untrimmed range of this item in the parent.TimeRangegetSourceRange()RationalTimegetTransformedTime(RationalTime time, Item toItem, ErrorStatus errorStatus)Converts time t in the coordinate system of self to coordinate system of toItem.TimeRangegetTransformedTimeRange(TimeRange timeRange, Item toItem, ErrorStatus errorStatus)Transforms timeRange to the range of child or this toItem.TimeRangegetTrimmedRange(ErrorStatus errorStatus)The range after applying the source range.TimeRangegetTrimmedRangeInParent(ErrorStatus errorStatus)Find and return the trimmed range of this item in the parent.TimeRangegetVisibleRange(ErrorStatus errorStatus)The range of this item's media visible to its parent.booleanisOverlapping()booleanisVisible()voidsetSourceRange(TimeRange sourceRange)java.lang.StringtoString()Methods inherited from class io.opentimeline.opentimelineio.SerializableObjectWithMetadata
getMetadata, getName, setMetadata, setNameMethods inherited from class io.opentimeline.opentimelineio.SerializableObject
clone, currentRefCount, dynamicFields, equals, fromJSONFile, fromJSONString, isEquivalentTo, isUnknownSchema, schemaName, schemaVersion, toJSONFile, toJSONFile, toJSONString, toJSONString
-
Constructor Details
-
Method Details
-
isVisible
public boolean isVisible()- Overrides:
isVisiblein classComposable- Returns:
- visibility of the Item. By default true.
-
isOverlapping
public boolean isOverlapping()- Overrides:
isOverlappingin classComposable- Returns:
- Return whether an Item is overlapping. By default false.
-
getSourceRange
-
setSourceRange
-
getEffects
-
getMarkers
-
getDuration
Convience wrapper for the trimmed_range.duration of the item.- Overrides:
getDurationin classComposable- Parameters:
errorStatus- errorStatus to report in case this is not implemented in a sub-class.- Returns:
- getTrimmedRange().duration
-
getAvailableRange
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
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
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
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
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
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 transformedtoItem- the Item in whose coordinate the time is to be transformederrorStatus- 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 transformedtoItem- the Item in whose coordinate the time is to be transformederrorStatus- errorStatus to report error during transformation- Returns:
- timeRange in coordinate of toItem.
-
toString
public java.lang.String toString()- Overrides:
toStringin classComposable
-