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, waitequals, getNextPeriodIndex, getPeriod, getPeriodCount, getPeriodPosition, getPeriodPosition, getWindow, getWindow, getWindowCount, hashCode, isEmpty, isLastPeriodpublic 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)
TimelinewindowIndex depending on the
repeatMode and whether shuffling is enabled.getNextWindowIndex in class TimelinewindowIndex - 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)
TimelinewindowIndex depending on the
repeatMode and whether shuffling is enabled.getPreviousWindowIndex in class TimelinewindowIndex - 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)
TimelinegetLastWindowIndex in class TimelineshuffleModeEnabled - Whether shuffling is enabled.C.INDEX_UNSET if the
timeline is empty.public int getFirstWindowIndex(boolean shuffleModeEnabled)
TimelinegetFirstWindowIndex in class TimelineshuffleModeEnabled - Whether shuffling is enabled.C.INDEX_UNSET if the
timeline is empty.public final Timeline.Window getWindow(int windowIndex, Timeline.Window window, long defaultPositionProjectionUs)
TimelineTimeline.Window with data for the window at the specified index.getWindow in class TimelinewindowIndex - 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)
TimelineTimeline.Period with data for the period with the specified unique identifier.getPeriodByUid in class Timelineuid - 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)
TimelineTimeline.Period with data for the period at the specified index.getPeriod in class TimelineperiodIndex - 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)
TimelineTimeline.Period.uid, or C.INDEX_UNSET if the period is not in the timeline.getIndexOfPeriod in class Timelineuid - A unique identifier for a period.C.INDEX_UNSET if the period was not found.public final Object getUidOfPeriod(int periodIndex)
TimelinegetUidOfPeriod in class TimelineperiodIndex - 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.