net.sourceforge.atunes.kernel.handlers
Class PlayListHandler

java.lang.Object
  extended by net.sourceforge.atunes.kernel.handlers.PlayListHandler
All Implemented Interfaces:
PlayListEventListener

public class PlayListHandler
extends java.lang.Object
implements PlayListEventListener

The Class PlayListHandler.


Method Summary
 void addAlbumsMostPlayed(int n)
          Gets n albums most played and adds to play list.
 void addArtistsMostPlayed(int n)
          Gets n artists most played and adds to play list.
 void addRandomSongs(int n)
          Gets a number of random songs and adds to play list.
 void addSongsMostPlayed(int n)
          Gets n songs most played and adds to play list.
 void addToPlayList(java.util.List<? extends AudioObject> audioObjects)
          Adds audio objects to play list.
 void addUnplayedSongs(int n)
          Adds n unplayed songs to playlist.
 void clear()
          Method of PlayListEventListener.
 void clearList()
          Removes all songs from play list.
 void editTags()
          Edit tags of selected songs on play list.
 void finish()
          Called by kernel when application is finishing.
static PlayListHandler getInstance()
          Method to access singleton instance.
 java.lang.Runnable getReadPlayListsRunnable()
          Gets the read play lists runnable.
 java.lang.Runnable getStartToPlayRunnable()
          Starts playing current song.
 void loadPlaylist()
          Loads play list from a file.
 void moveDown(int[] rows)
          Move rows of play list down.
 void moveToBottom(int[] rows)
          Move rows to bottom of play list.
 void moveToTop(int[] rows)
          Move rows to top of play list.
 void moveUp(int[] rows)
          Move rows of play list up.
 void playNow(AudioObject song)
          Plays song passed to argument.
 void removeSongs(int[] rows)
          Removes songs from play list.
 void savePlaylist()
          Saves current play list to a file.
 void selectedAudioObjectChanged(AudioObject audioObject)
          Method of PlayListEventListener.
 void setFilter(java.lang.String filter)
          Applies filter to play list.
 void setPlayLists()
          Retrieves stored play list and loads it.
 void shuffle()
          Shuffle.
 void sortPlayList(java.util.Comparator<AudioObject> comp)
          Sorts play list with a given comparator.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static PlayListHandler getInstance()
Method to access singleton instance.

Returns:
PlayListHandler

addAlbumsMostPlayed

public void addAlbumsMostPlayed(int n)
Gets n albums most played and adds to play list.

Parameters:
n - the n

addArtistsMostPlayed

public void addArtistsMostPlayed(int n)
Gets n artists most played and adds to play list.

Parameters:
n - the n

addRandomSongs

public void addRandomSongs(int n)
Gets a number of random songs and adds to play list.

Parameters:
n - the n

addSongsMostPlayed

public void addSongsMostPlayed(int n)
Gets n songs most played and adds to play list.

Parameters:
n - the n

addUnplayedSongs

public void addUnplayedSongs(int n)
Adds n unplayed songs to playlist.

Parameters:
n - the n

addToPlayList

public void addToPlayList(java.util.List<? extends AudioObject> audioObjects)
Adds audio objects to play list.

Parameters:
audioObjects - the audio objects

clear

public void clear()
Method of PlayListEventListener. Called when play list is cleared

Specified by:
clear in interface PlayListEventListener

clearList

public void clearList()
Removes all songs from play list.


editTags

public void editTags()
Edit tags of selected songs on play list.


finish

public void finish()
Called by kernel when application is finishing.


getReadPlayListsRunnable

public java.lang.Runnable getReadPlayListsRunnable()
Gets the read play lists runnable.

Returns:
the read play lists runnable

setPlayLists

public void setPlayLists()
Retrieves stored play list and loads it. This method is used when opening application, to load play list of previous execution


loadPlaylist

public void loadPlaylist()
Loads play list from a file.


moveDown

public void moveDown(int[] rows)
Move rows of play list down.

Parameters:
rows - the rows

moveToBottom

public void moveToBottom(int[] rows)
Move rows to bottom of play list.

Parameters:
rows - the rows

moveToTop

public void moveToTop(int[] rows)
Move rows to top of play list.

Parameters:
rows - the rows

moveUp

public void moveUp(int[] rows)
Move rows of play list up.

Parameters:
rows - the rows

playNow

public void playNow(AudioObject song)
Plays song passed to argument. If if not added to play list, it adds

Parameters:
song - the song

removeSongs

public void removeSongs(int[] rows)
Removes songs from play list.

Parameters:
rows - the rows

savePlaylist

public void savePlaylist()
Saves current play list to a file.


selectedAudioObjectChanged

public void selectedAudioObjectChanged(AudioObject audioObject)
Method of PlayListEventListener. Called when current song changes

Specified by:
selectedAudioObjectChanged in interface PlayListEventListener
Parameters:
audioObject - the audio object

setFilter

public void setFilter(java.lang.String filter)
Applies filter to play list.

Parameters:
filter - the filter

shuffle

public void shuffle()
Shuffle.


sortPlayList

public void sortPlayList(java.util.Comparator<AudioObject> comp)
Sorts play list with a given comparator.

Parameters:
comp - the comp

getStartToPlayRunnable

public java.lang.Runnable getStartToPlayRunnable()
Starts playing current song.

Returns:
the start to play runnable


Copyright © 2006-2008 The aTunes Team. All Rights Reserved.