sk.baka.ambient
Interface IPlaylistPlayerListener

All Known Implementing Classes:
ContextController, MagnatuneController, PlayerController, PlaylistController, PowerHandler

public interface IPlaylistPlayerListener

Listens for higher-level player and playlist events. All methods are invoked in the message loop handler.

Author:
Martin Vysny

Method Summary
 void playbackStateChanged(PlayerStateEnum state)
          The playback state was changed.
 void playlistChanged(Interval target)
          Fired when the playlist changes - by removing a track, reshuffling etc.
 void randomChanged(Random random)
          The play mode was changed.
 void repeatChanged(Repeat repeat)
          The play mode was changed.
 void trackChanged(PlaylistItem track, boolean play, int positionMillis)
          A new track was selected in the playlist.
 void trackPositionChanged(int position, boolean playing)
           A position in the track was changed.
 

Method Detail

playbackStateChanged

void playbackStateChanged(PlayerStateEnum state)
The playback state was changed.

Parameters:
state - new playback state.

trackChanged

void trackChanged(PlaylistItem track,
                  boolean play,
                  int positionMillis)
A new track was selected in the playlist.

Parameters:
track - the new track, may be null - in this case the playback is stopped.
play - if true then the track is already being played (or is about to be played).
positionMillis - the starting playback position in milliseconds.

trackPositionChanged

void trackPositionChanged(int position,
                          boolean playing)

A position in the track was changed. This is only due to PlaylistPlayer.seek(int) - it is never invoked periodically as the playback progresses. This event is not invoked when a playback is started with non-zero start seek time.

Note that the playback may be paused.

Parameters:
position - the new position in milliseconds.
playing - if true then playback is activated, if false then the playback is paused. This event is not invoked when the playback is stopped.

repeatChanged

void repeatChanged(Repeat repeat)
The play mode was changed.

Parameters:
repeat - new repeat value, never null.

randomChanged

void randomChanged(Random random)
The play mode was changed.

Parameters:
random - new random value, never null.

playlistChanged

void playlistChanged(Interval target)
Fired when the playlist changes - by removing a track, reshuffling etc.

Parameters:
target - the "target" (or the product) of the operation - for example for copy/move operations this interval contains added items, for delete operation the interval is empty. May be null if the target is not known. Semantically, the target should contain tracks that were 'produced' by the operation and they should be the target of the next operation. This implies that the playlist view should make these tracks appear selected.


Copyright © 2007-2008. All Rights Reserved.