A Track maintains information on a Player over time. It does this in two ways. First, it simply provides a repository for Player data, such as start time and stop stop time. Additionally, it does a 'look-ahead', moving the Player to prefetched state, obtaining information that is only valid at that point like duration and start latency. By treating a Player as a Track, you don't have to worry Player is in proper state to get that information.
The Player is moved into prefetched with a call to setPlayer
. This method is called at construction when the version of the constructor that takes a Player argument is called. Since Track does not implement ControllerListener, if you want a track to be more active and listen to its Player, you will need to subclass Track. A Track may have a view associated with it. This is typically a slider and can be set with setTrackSlider method. Each Track has a track number assigned upon creation.