SimpleBasePlayer.PositionSupplier
public interface SimpleBasePlayer.PositionSupplier
SimpleBasePlayer.LivePositionSupplier |
A |
A supplier for a position.
Convenience methods and classes for creating position suppliers:
- Use
getConstantfor constant or non-moving positions. - Use
getExtrapolatingfor positions advancing with the system clock from a provided start time. - Use
LivePositionSupplierfor positions that can be directly obtained from a live system. Note that these suppliers should bedisconnectedfrom the live source as soon as the position is no longer valid, for example after a position discontinuity.
Summary
Constants |
|
|---|---|
default static final SimpleBasePlayer.PositionSupplier |
An instance returning a constant position of zero. |
Public methods |
|
|---|---|
abstract long |
get()Returns the position. |
default static SimpleBasePlayer.PositionSupplier |
getConstant(long positionMs)Returns an instance that returns a constant value. |
default static SimpleBasePlayer.PositionSupplier |
getExtrapolating(long currentPositionMs, float playbackSpeed)Returns an instance that extrapolates the provided position into the future. |
Constants
ZERO
default static final SimpleBasePlayer.PositionSupplier ZERO
An instance returning a constant position of zero.
Public methods
getConstant
default static SimpleBasePlayer.PositionSupplier getConstant(long positionMs)
Returns an instance that returns a constant value.
| Parameters | |
|---|---|
long positionMs |
The constant position to return, in milliseconds. |
getExtrapolating
default static SimpleBasePlayer.PositionSupplier getExtrapolating(long currentPositionMs, float playbackSpeed)
Returns an instance that extrapolates the provided position into the future.
| Parameters | |
|---|---|
long currentPositionMs |
The current position in milliseconds. |
float playbackSpeed |
The playback speed with which the position is assumed to increase. |