org.musicontroller
Interface DJ

All Known Implementing Classes:
DJImpl

public interface DJ


Method Summary
 Song choose()
          Lets the DJ choose a new Song to play, using the SongSelector to select a song from the candidates generated by the CandidateSelector
 void confirmPlay()
          Call this when the currently playing Song has been played completely.
 void confirmSkip()
          Call this when the currently playing Song has indeed be skipped.
 CandidateSelector getCandidateSelector()
           
 Song getCurrentSong()
           
 MusiController getMusiController()
           
 int getPlayingTime()
           
 java.util.List<java.lang.Long> getRequests()
           
 SongSelector getSongSelector()
           
 IUser getUser()
           
 boolean mustSkip()
           
 java.util.List<java.lang.Long> peek(int count)
          Takes a look into the future, and tells which Songs will be played next.
 void playSong(long songid)
          Tells the DJ to skip the currently playing Song, and start playing a new one.
 void requestSong(long songid)
          Requests a song.
 void setCandidateSelector(CandidateSelector selector)
           
 void setMusiController(MusiController musicontroller)
           
 void setPlaying(boolean playing)
          Sets the state of the DJ.
 void setPlayingTime(int millis)
          To be used by the StreamService, to provide feedback to the DJ about the amount of milliseconds that have been played of the current ssong.
 void setSongSelector(SongSelector selector)
           
 void setUser(IUser user)
           
 void skipSong()
          Tells the DJ to skip the currently playing Song.
 void unrequestSong(long songid)
          Unrequests a previously requested Song.
 

Method Detail

setMusiController

void setMusiController(MusiController musicontroller)

getMusiController

MusiController getMusiController()

setSongSelector

void setSongSelector(SongSelector selector)

getSongSelector

SongSelector getSongSelector()

getCandidateSelector

CandidateSelector getCandidateSelector()

setCandidateSelector

void setCandidateSelector(CandidateSelector selector)

setUser

void setUser(IUser user)

getUser

IUser getUser()

requestSong

void requestSong(long songid)
Requests a song.

Parameters:
songid - The Id of the Song.

unrequestSong

void unrequestSong(long songid)
Unrequests a previously requested Song. The Song will be marked 'skipped'.

Parameters:
songid - The Id of the Song.

skipSong

void skipSong()
Tells the DJ to skip the currently playing Song.


playSong

void playSong(long songid)
Tells the DJ to skip the currently playing Song, and start playing a new one.

Parameters:
songid - The Id of the new Song to be played.

mustSkip

boolean mustSkip()
Returns:
True, if skipSong was called, False otherwise.

confirmSkip

void confirmSkip()
Call this when the currently playing Song has indeed be skipped. A skipped-event will be added to the Song.


confirmPlay

void confirmPlay()
Call this when the currently playing Song has been played completely. A played-event will be added to the Song.


setPlaying

void setPlaying(boolean playing)
Sets the state of the DJ.

Parameters:
playing - Use True, if the DJ is playing or False otherwise.

getRequests

java.util.List<java.lang.Long> getRequests()

choose

Song choose()
Lets the DJ choose a new Song to play, using the SongSelector to select a song from the candidates generated by the CandidateSelector

Returns:
A new Song

peek

java.util.List<java.lang.Long> peek(int count)
Takes a look into the future, and tells which Songs will be played next. This information is valid until new requests/unrequests are made. Requests will always be in the resultset, followed by 'count' predicted songs.

Parameters:
count - The amount of Songs to predict (maxed at 15).
Returns:
A List of Song-ids that will be played next.

getCurrentSong

Song getCurrentSong()
Returns:
The Song that is currently playing, or null is the DJ is not playing any Song.

setPlayingTime

void setPlayingTime(int millis)
To be used by the StreamService, to provide feedback to the DJ about the amount of milliseconds that have been played of the current ssong.

Parameters:
millis - The amount of milliseconds the current song has been played.

getPlayingTime

int getPlayingTime()
Returns:
The amount of milliseconds the current song has been played.


Copyright © 2010 A.J.V.. All Rights Reserved.