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 class
Item.ItemBuilder
Nested classes/interfaces inherited from class io.opentimeline.opentimelineio.Composable
Composable.ComposableBuilder
Nested classes/interfaces inherited from class io.opentimeline.opentimelineio.SerializableObjectWithMetadata
SerializableObjectWithMetadata.SerializableObjectWithMetadataBuilder
-
Field Summary
-
Constructor Summary
Constructors Modifier Constructor Description protected
Item()
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 TimeRange
getAvailableRange(ErrorStatus errorStatus)
Implemented by child classes, available range of media.RationalTime
getDuration(ErrorStatus errorStatus)
Convience wrapper for the trimmed_range.duration of the item.java.util.List<Effect>
getEffects()
java.util.List<Marker>
getMarkers()
TimeRange
getRangeInParent(ErrorStatus errorStatus)
Find and return the untrimmed range of this item in the parent.TimeRange
getSourceRange()
RationalTime
getTransformedTime(RationalTime time, Item toItem, ErrorStatus errorStatus)
Converts time t in the coordinate system of self to coordinate system of toItem.TimeRange
getTransformedTimeRange(TimeRange timeRange, Item toItem, ErrorStatus errorStatus)
Transforms timeRange to the range of child or this toItem.TimeRange
getTrimmedRange(ErrorStatus errorStatus)
The range after applying the source range.TimeRange
getTrimmedRangeInParent(ErrorStatus errorStatus)
Find and return the trimmed range of this item in the parent.TimeRange
getVisibleRange(ErrorStatus errorStatus)
The range of this item's media visible to its parent.boolean
isOverlapping()
boolean
isVisible()
void
setSourceRange(TimeRange sourceRange)
java.lang.String
toString()
Methods inherited from class io.opentimeline.opentimelineio.SerializableObjectWithMetadata
getMetadata, getName, setMetadata, setName
Methods 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:
isVisible
in classComposable
- Returns:
- visibility of the Item. By default true.
-
isOverlapping
public boolean isOverlapping()- Overrides:
isOverlapping
in 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:
getDuration
in 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:
toString
in classComposable
-