Timeline.Period, Timeline.Window
Constructor | Description |
---|---|
AbstractConcatenatedTimeline(boolean isAtomic,
ShuffleOrder shuffleOrder) |
Sets up a concatenated timeline with a shuffle order of child timelines.
|
Modifier and Type | Method | Description |
---|---|---|
protected abstract int |
getChildIndexByChildUid(Object childUid) |
Returns the index of the child timeline with the given UID or
C.INDEX_UNSET if not
found. |
protected abstract int |
getChildIndexByPeriodIndex(int periodIndex) |
Returns the index of the child timeline containing the given period index.
|
protected abstract int |
getChildIndexByWindowIndex(int windowIndex) |
Returns the index of the child timeline containing the given window index.
|
static Object |
getChildPeriodUidFromConcatenatedUid(Object concatenatedUid) |
Returns UID of the period in the child timeline from a concatenated period UID.
|
static Object |
getChildTimelineUidFromConcatenatedUid(Object concatenatedUid) |
Returns UID of child timeline from a concatenated period UID.
|
protected abstract Object |
getChildUidByChildIndex(int childIndex) |
Returns the UID of the child timeline with the given index.
|
static Object |
getConcatenatedUid(Object childTimelineUid,
Object childPeriodOrWindowUid) |
Returns a concatenated UID for a period or window in a child timeline.
|
protected abstract int |
getFirstPeriodIndexByChildIndex(int childIndex) |
Returns the first period index belonging to the child timeline with the given index.
|
int |
getFirstWindowIndex(boolean shuffleModeEnabled) |
Returns the index of the first window in the playback order depending on whether shuffling is
enabled.
|
protected abstract int |
getFirstWindowIndexByChildIndex(int childIndex) |
Returns the first window index belonging to the child timeline with the given index.
|
int |
getIndexOfPeriod(Object uid) |
Returns the index of the period identified by its unique
Timeline.Period.uid , or C.INDEX_UNSET if the period is not in the timeline. |
int |
getLastWindowIndex(boolean shuffleModeEnabled) |
Returns the index of the last window in the playback order depending on whether shuffling is
enabled.
|
int |
getNextWindowIndex(int windowIndex,
int repeatMode,
boolean shuffleModeEnabled) |
Returns the index of the window after the window at index
windowIndex depending on the
repeatMode and whether shuffling is enabled. |
Timeline.Period |
getPeriod(int periodIndex,
Timeline.Period period,
boolean setIds) |
Populates a
Timeline.Period with data for the period at the specified index. |
Timeline.Period |
getPeriodByUid(Object uid,
Timeline.Period period) |
Populates a
Timeline.Period with data for the period with the specified unique identifier. |
int |
getPreviousWindowIndex(int windowIndex,
int repeatMode,
boolean shuffleModeEnabled) |
Returns the index of the window before the window at index
windowIndex depending on the
repeatMode and whether shuffling is enabled. |
protected abstract Timeline |
getTimelineByChildIndex(int childIndex) |
Returns the child timeline for the child with the given index.
|
Object |
getUidOfPeriod(int periodIndex) |
Returns the unique id of the period identified by its index in the timeline.
|
Timeline.Window |
getWindow(int windowIndex,
Timeline.Window window,
long defaultPositionProjectionUs) |
Populates a
Timeline.Window with data for the window at the specified index. |
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
equals, getNextPeriodIndex, getPeriod, getPeriodCount, getPeriodPosition, getPeriodPosition, getWindow, getWindow, getWindowCount, hashCode, isEmpty, isLastPeriod
public AbstractConcatenatedTimeline(boolean isAtomic, ShuffleOrder shuffleOrder)
isAtomic
- Whether the child timelines shall be treated as atomic, i.e., treated as a
single item for repeating and shuffling.shuffleOrder
- A shuffle order of child timelines. The number of child timelines must
match the number of elements in the shuffle order.public static Object getChildTimelineUidFromConcatenatedUid(Object concatenatedUid)
concatenatedUid
- UID of a period in a concatenated timeline.public static Object getChildPeriodUidFromConcatenatedUid(Object concatenatedUid)
concatenatedUid
- UID of a period in a concatenated timeline.public static Object getConcatenatedUid(Object childTimelineUid, Object childPeriodOrWindowUid)
childTimelineUid
- UID of the child timeline this period or window belongs to.childPeriodOrWindowUid
- UID of the period or window in the child timeline.public int getNextWindowIndex(int windowIndex, @RepeatMode int repeatMode, boolean shuffleModeEnabled)
Timeline
windowIndex
depending on the
repeatMode
and whether shuffling is enabled.getNextWindowIndex
in class Timeline
windowIndex
- Index of a window in the timeline.repeatMode
- A repeat mode.shuffleModeEnabled
- Whether shuffling is enabled.C.INDEX_UNSET
if this is the last window.public int getPreviousWindowIndex(int windowIndex, @RepeatMode int repeatMode, boolean shuffleModeEnabled)
Timeline
windowIndex
depending on the
repeatMode
and whether shuffling is enabled.getPreviousWindowIndex
in class Timeline
windowIndex
- Index of a window in the timeline.repeatMode
- A repeat mode.shuffleModeEnabled
- Whether shuffling is enabled.C.INDEX_UNSET
if this is the first window.public int getLastWindowIndex(boolean shuffleModeEnabled)
Timeline
getLastWindowIndex
in class Timeline
shuffleModeEnabled
- Whether shuffling is enabled.C.INDEX_UNSET
if the
timeline is empty.public int getFirstWindowIndex(boolean shuffleModeEnabled)
Timeline
getFirstWindowIndex
in class Timeline
shuffleModeEnabled
- Whether shuffling is enabled.C.INDEX_UNSET
if the
timeline is empty.public final Timeline.Window getWindow(int windowIndex, Timeline.Window window, long defaultPositionProjectionUs)
Timeline
Timeline.Window
with data for the window at the specified index.getWindow
in class Timeline
windowIndex
- The index of the window.window
- The Timeline.Window
to populate. Must not be null.defaultPositionProjectionUs
- A duration into the future that the populated window's
default start position should be projected.Timeline.Window
, for convenience.public final Timeline.Period getPeriodByUid(Object uid, Timeline.Period period)
Timeline
Timeline.Period
with data for the period with the specified unique identifier.getPeriodByUid
in class Timeline
uid
- The unique identifier of the period.period
- The Timeline.Period
to populate. Must not be null.Timeline.Period
, for convenience.public final Timeline.Period getPeriod(int periodIndex, Timeline.Period period, boolean setIds)
Timeline
Timeline.Period
with data for the period at the specified index.getPeriod
in class Timeline
periodIndex
- The index of the period.period
- The Timeline.Period
to populate. Must not be null.setIds
- Whether Timeline.Period.id
and Timeline.Period.uid
should be populated. If false,
the fields will be set to null. The caller should pass false for efficiency reasons unless
the fields are required.Timeline.Period
, for convenience.public final int getIndexOfPeriod(Object uid)
Timeline
Timeline.Period.uid
, or C.INDEX_UNSET
if the period is not in the timeline.getIndexOfPeriod
in class Timeline
uid
- A unique identifier for a period.C.INDEX_UNSET
if the period was not found.public final Object getUidOfPeriod(int periodIndex)
Timeline
getUidOfPeriod
in class Timeline
periodIndex
- The index of the period.protected abstract int getChildIndexByPeriodIndex(int periodIndex)
periodIndex
- A valid period index within the bounds of the timeline.protected abstract int getChildIndexByWindowIndex(int windowIndex)
windowIndex
- A valid window index within the bounds of the timeline.protected abstract int getChildIndexByChildUid(Object childUid)
C.INDEX_UNSET
if not
found.childUid
- A child UID.C.INDEX_UNSET
if UID was not found.protected abstract Timeline getTimelineByChildIndex(int childIndex)
childIndex
- A valid child index within the bounds of the timeline.protected abstract int getFirstPeriodIndexByChildIndex(int childIndex)
childIndex
- A valid child index within the bounds of the timeline.protected abstract int getFirstWindowIndexByChildIndex(int childIndex)
childIndex
- A valid child index within the bounds of the timeline.protected abstract Object getChildUidByChildIndex(int childIndex)
childIndex
- A valid child index within the bounds of the timeline.