public final class RandomTrackSelection extends BaseTrackSelection
TrackSelection whose selected track is updated randomly.| Modifier and Type | Class and Description |
|---|---|
static class |
RandomTrackSelection.Factory
Factory for
RandomTrackSelection instances. |
group, length, tracks| Constructor and Description |
|---|
RandomTrackSelection(TrackGroup group,
int... tracks) |
RandomTrackSelection(TrackGroup group,
int[] tracks,
long seed) |
RandomTrackSelection(TrackGroup group,
int[] tracks,
java.util.Random random) |
| Modifier and Type | Method and Description |
|---|---|
int |
getSelectedIndex()
Returns the index of the selected track.
|
java.lang.Object |
getSelectionData()
Returns optional data associated with the current track selection.
|
int |
getSelectionReason()
Returns the reason for the current track selection.
|
void |
updateSelectedTrack(long bufferedDurationUs)
Updates the selected track.
|
blacklist, equals, evaluateQueueSize, getFormat, getIndexInTrackGroup, getSelectedFormat, getSelectedIndexInTrackGroup, getTrackGroup, hashCode, indexOf, indexOf, isBlacklisted, lengthpublic RandomTrackSelection(TrackGroup group, int... tracks)
group - The TrackGroup. Must not be null.tracks - The indices of the selected tracks within the TrackGroup. Must not be
null or empty. May be in any order.public RandomTrackSelection(TrackGroup group, int[] tracks, long seed)
group - The TrackGroup. Must not be null.tracks - The indices of the selected tracks within the TrackGroup. Must not be
null or empty. May be in any order.seed - A seed for the Random instance used to update the selected track.public RandomTrackSelection(TrackGroup group, int[] tracks, java.util.Random random)
group - The TrackGroup. Must not be null.tracks - The indices of the selected tracks within the TrackGroup. Must not be
null or empty. May be in any order.random - A source of random numbers.public void updateSelectedTrack(long bufferedDurationUs)
TrackSelectionbufferedDurationUs - The duration of media currently buffered in microseconds.public int getSelectedIndex()
TrackSelectionpublic int getSelectionReason()
TrackSelectionpublic java.lang.Object getSelectionData()
TrackSelection