Timeline.Period, Timeline.Window| Constructor and Description |
|---|
ForwardingTimeline(Timeline timeline) |
| Modifier and Type | Method and Description |
|---|---|
int |
getFirstWindowIndex(boolean shuffleModeEnabled)
Returns the index of the first window in the playback order depending on whether shuffling is
enabled.
|
int |
getIndexOfPeriod(java.lang.Object uid)
Returns the index of the period identified by its unique
id, 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. |
int |
getPeriodCount()
Returns the number of periods in the timeline.
|
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. |
Timeline.Window |
getWindow(int windowIndex,
Timeline.Window window,
boolean setTag,
long defaultPositionProjectionUs)
Populates a
Timeline.Window with data for the window at the specified index. |
int |
getWindowCount()
Returns the number of windows in the timeline.
|
getNextPeriodIndex, getPeriod, getPeriodPosition, getPeriodPosition, getWindow, getWindow, isEmpty, isLastPeriodprotected final Timeline timeline
public ForwardingTimeline(Timeline timeline)
public int getWindowCount()
TimelinegetWindowCount in class Timelinepublic int getNextWindowIndex(int windowIndex,
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,
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 Timeline.Window getWindow(int windowIndex, Timeline.Window window, boolean setTag, 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.setTag - Whether Timeline.Window.tag should be populated. If false, the field will be set
to null. The caller should pass false for efficiency reasons unless the field is required.defaultPositionProjectionUs - A duration into the future that the populated window's
default start position should be projected.Timeline.Window, for convenience.public int getPeriodCount()
TimelinegetPeriodCount in class Timelinepublic 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 int getIndexOfPeriod(java.lang.Object uid)
Timelineid, 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.