Interface ActiveSongBackgroundMusicBuilder
public interface ActiveSongBackgroundMusicBuilder
A service provider which provides the musical phrases of the active song, which are built in some background task.
-
Method Summary
Modifier and TypeMethodDescriptionvoidaddChangeListener(ChangeListener listener) Register a listener to be notified each time a new result is available.Get the default implementation.Get the latest music generation result available.getSong()Get the active song for this ActiveSongMusicBuilder.booleanGet state (true by default).booleanCheck if the Result returned by getLastResult() is up to date.voidremoveChangeListener(ChangeListener listener) voidsetEnabled(boolean b) Change the ActiveSongMusicBuilder state.
-
Method Details
-
getDefault
Get the default implementation.- Returns:
- Can 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 latest music generation result available.Note that the returned value might not be up to date, see
isLastResultUpToDate().- Returns:
- Can be null.
-
isLastResultUpToDate
boolean isLastResultUpToDate()Check if the Result returned by getLastResult() is up to date.Returns false if :
- last result is null
- A new music generation is currently being generated
- Active song is playing and there was a song structure change- Returns:
-
getSong
-
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-
-