at.tuwien.ifs.somtoolbox.apps.viewer.controls.player
Class PlayList

java.lang.Object
  extended by at.tuwien.ifs.somtoolbox.apps.viewer.controls.player.PlayList
All Implemented Interfaces:
PlayerListener

public class PlayList
extends Object
implements PlayerListener


Nested Class Summary
private  class PlayList.NotificationPostponer
           
private  class PlayList.PlayListCellRenderer
           
private  class PlayList.PlayListModel
           
 
Field Summary
private  int currentSong
           
private  boolean isPlaying
           
private  Vector<PlayerListener> listeners
           
private  PlayList.PlayListModel lm
           
private  AudioPlayer player
           
private  List<AudioVectorMetaData> plContent
           
private  Vector<PlayListListener> plListeners
           
private  PlayList.NotificationPostponer pllNP
           
private static long serialVersionUID
           
private  boolean showFilenames
           
 
Fields inherited from interface at.tuwien.ifs.somtoolbox.apps.viewer.controls.player.PlayerListener
START_MODE_NEW, START_MODE_RESUME, STOP_REASON_ENDED, STOP_REASON_PAUSED, STOP_REASON_STOPPED
 
Constructor Summary
PlayList()
           
PlayList(AudioPlayer player)
           
 
Method Summary
 boolean addAllSongs(List<String> songs)
           
 boolean addAllSongs(List<String> songs, List<File> songfiles)
           
 void addPlayerListener(PlayerListener l)
           
 void addPlayListListener(PlayListListener pll)
           
 boolean addSong(String song)
           
 boolean addSong(String song, File songfile)
           
 void addSong(String song, File songfile, int position)
           
 void addSong(String song, int position)
           
 void clearPlaylist()
           
 JList createMatchingJList(boolean addDefaultListeners)
           
 int getCurrentSongIndex()
           
 List<String> getDataItems()
           
 int getIndexOf(String id)
           
 AudioVectorMetaData getPlayListItem(int index)
           
 List<AudioVectorMetaData> getPlayListItems()
           
 List<File> getSongs()
           
private  void informPlayListListeners()
           
 boolean isPlaying()
           
private  boolean moreToPlay()
           
 void next()
           
 void play()
           
 void play(int selectedIndex)
           
 void playStarted(int mode, AudioVectorMetaData song)
           
 void playStopped(int reason, AudioVectorMetaData song)
           
 void prev()
           
 List<AudioVectorMetaData> remove(int from, int to)
           
 void removePlayerListener(PlayerListener l)
           
 void removePlayListListener(PlayListListener pll)
           
 AudioVectorMetaData removeSong(int index)
           
 void setCurrentSong(int index)
           
 boolean skip(int count)
           
 void stop()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

serialVersionUID

private static final long serialVersionUID
See Also:
Constant Field Values

plContent

private List<AudioVectorMetaData> plContent

lm

private PlayList.PlayListModel lm

currentSong

private int currentSong

isPlaying

private boolean isPlaying

player

private AudioPlayer player

listeners

private Vector<PlayerListener> listeners

plListeners

private Vector<PlayListListener> plListeners

pllNP

private PlayList.NotificationPostponer pllNP

showFilenames

private boolean showFilenames
Constructor Detail

PlayList

public PlayList(AudioPlayer player)

PlayList

public PlayList()
Method Detail

addAllSongs

public boolean addAllSongs(List<String> songs)

addAllSongs

public boolean addAllSongs(List<String> songs,
                           List<File> songfiles)

addSong

public boolean addSong(String song,
                       File songfile)

addSong

public boolean addSong(String song)

addSong

public void addSong(String song,
                    File songfile,
                    int position)

addSong

public void addSong(String song,
                    int position)

getPlayListItems

public List<AudioVectorMetaData> getPlayListItems()

getSongs

public List<File> getSongs()

getPlayListItem

public AudioVectorMetaData getPlayListItem(int index)

getDataItems

public List<String> getDataItems()

getIndexOf

public int getIndexOf(String id)

removeSong

public AudioVectorMetaData removeSong(int index)

remove

public List<AudioVectorMetaData> remove(int from,
                                        int to)

clearPlaylist

public void clearPlaylist()

next

public void next()

prev

public void prev()

moreToPlay

private boolean moreToPlay()

skip

public boolean skip(int count)
Parameters:
count - How many songs to skip
Returns:
true if there was a song to skip to, false otherwise.

playStarted

public void playStarted(int mode,
                        AudioVectorMetaData song)
Specified by:
playStarted in interface PlayerListener

playStopped

public void playStopped(int reason,
                        AudioVectorMetaData song)
Specified by:
playStopped in interface PlayerListener

play

public void play(int selectedIndex)

play

public void play()

stop

public void stop()

addPlayerListener

public void addPlayerListener(PlayerListener l)

removePlayerListener

public void removePlayerListener(PlayerListener l)

addPlayListListener

public void addPlayListListener(PlayListListener pll)

removePlayListListener

public void removePlayListListener(PlayListListener pll)

informPlayListListeners

private void informPlayListListeners()

getCurrentSongIndex

public int getCurrentSongIndex()

createMatchingJList

public JList createMatchingJList(boolean addDefaultListeners)

isPlaying

public boolean isPlaying()

setCurrentSong

public void setCurrentSong(int index)