Package org.jjazz.activesong.spi
Interface ActiveSongBackgroundMusicBuilder
public interface ActiveSongBackgroundMusicBuilder
A service provider which provides the musical phrases of the active song, which are built in a background task.
 
- 
Method SummaryModifier and TypeMethodDescriptionvoidaddChangeListener(ChangeListener listener) Register a listener to be notified each time a new result is available.Get the default implementation.Get the last music generation result available.getSong()Get the active song for this ActiveSongMusicBuilder.booleanCheck if ActiveSongMusicBuilder is directly being generating music that will produce a new Result.booleanGet state (true by default).voidremoveChangeListener(ChangeListener listener) voidsetEnabled(boolean b) Change the ActiveSongMusicBuilder state.
- 
Method Details- 
getDefaultGet the default implementation.- Returns:
- Can't be null
 
- 
addChangeListenerRegister a listener to be notified each time a new result is available.- Parameters:
- listener-
- See Also:
 
- 
getLastResultMusicGenerationQueue.Result getLastResult()Get the last music generation result available.- Returns:
- Can be null.
 
- 
getSongSong getSong()Get the active song for this ActiveSongMusicBuilder.- Returns:
- Can be null
 
- 
isDirectlyGeneratingMusicboolean isDirectlyGeneratingMusic()Check if ActiveSongMusicBuilder is directly being generating music that will produce a new Result.- Returns:
- True if song is not playing and music is being generated because there was a song change.
 
- 
isEnabledboolean isEnabled()Get state (true by default).- Returns:
 
- 
removeChangeListener
- 
setEnabledvoid setEnabled(boolean b) Change the ActiveSongMusicBuilder state.When disabled the ActiveSongMusicBuilder does nothing. Convenient for debugging in specific cases. - Parameters:
- b-
 
 
-