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 Summary
Modifier and TypeMethodDescriptionvoid
addChangeListener
(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.boolean
Check if ActiveSongMusicBuilder is directly being generating music that will produce a new Result.boolean
Get state (true by default).void
removeChangeListener
(ChangeListener listener) void
setEnabled
(boolean b) Change the ActiveSongMusicBuilder state.
-
Method Details
-
getDefault
Get the default implementation.- Returns:
- Can't be null
-
addChangeListener
Register a listener to be notified each time a new result is available.- Parameters:
listener
-- See Also:
-
getLastResult
MusicGenerationQueue.Result getLastResult()Get the last music generation result available.- Returns:
- Can be null.
-
getSong
Song getSong()Get the active song for this ActiveSongMusicBuilder.- Returns:
- Can be null
-
isDirectlyGeneratingMusic
boolean 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.
-
isEnabled
boolean isEnabled()Get state (true by default).- Returns:
-
removeChangeListener
-
setEnabled
void setEnabled(boolean b) Change the ActiveSongMusicBuilder state.When disabled the ActiveSongMusicBuilder does nothing. Convenient for debugging in specific cases.
- Parameters:
b
-
-