Class StaticSongSession
java.lang.Object
org.jjazz.musiccontrol.api.playbacksession.BaseSongSession
org.jjazz.musiccontrol.api.playbacksession.StaticSongSession
- All Implemented Interfaces:
PropertyChangeListener,EventListener,ControlTrackProvider,EndOfPlaybackActionProvider,PlaybackSession,SongContextProvider
A BaseSongSession which becomes dirty as soon as the SongContext has changed musically.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.jjazz.musiccontrol.api.playbacksession.PlaybackSession
PlaybackSession.Context, PlaybackSession.State -
Field Summary
Fields inherited from class org.jjazz.musiccontrol.api.playbacksession.BaseSongSession
PLAYBACK_SETTINGS_LOOP_COUNTFields inherited from interface org.jjazz.musiccontrol.api.playbacksession.ControlTrackProvider
ENABLED_STATEFields inherited from interface org.jjazz.musiccontrol.api.playbacksession.PlaybackSession
PROP_DIRTY, PROP_LOOP_COUNT, PROP_MUTED_TRACKS, PROP_STATE, PROP_TEMPO -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Put session in the CLOSED state and release used resources, so that session can be disposed.voidgenerate(boolean silent) Overridden to add our songMusicGenerationListener.static StaticSongSessiongetSession(SongContext sgContext, PlaybackSession.Context context) Get a session with a default SessionConfig.static StaticSongSessiongetSession(SongContext sgContext, SessionConfig sConfig, PlaybackSession.Context context) Create or reuse a session for the specified parameters.voidMethods inherited from class org.jjazz.musiccontrol.api.playbacksession.BaseSongSession
addPropertyChangeListener, getBarRange, getClickTrackId, getContext, getControlTrack, getEndOfPlaybackAction, getFreshCopy, getLoopCount, getLoopEndTick, getLoopStartTick, getPrecountTrackId, getRvPhraseMap, getRvTrackIdMap, getSequence, getSessionConfig, getSongContext, getState, getTempo, getTick, getTracksMuteStatus, isDirty, isUseActiveSongBackgroundMusicBuilder, removePropertyChangeListener, toString
-
Method Details
-
getSession
public static StaticSongSession getSession(SongContext sgContext, SessionConfig sConfig, PlaybackSession.Context context) Create or reuse a session for the specified parameters.Sessions are cached: if a non-dirty session in the NEW or GENERATED state already exists for the same parameters then return it, otherwise a new session is created.
- Parameters:
sgContext-sConfig-context-- Returns:
- A session in the NEW or GENERATED state.
-
getSession
Get a session with a default SessionConfig.- Parameters:
sgContext-context-- Returns:
- A targetSession in the NEW or GENERATED state.
-
generate
Overridden to add our songMusicGenerationListener.- Specified by:
generatein interfacePlaybackSession- Overrides:
generatein classBaseSongSession- Parameters:
silent-- Throws:
MusicGenerationException
-
close
public void close()Description copied from interface:PlaybackSessionPut session in the CLOSED state and release used resources, so that session can be disposed.- Specified by:
closein interfacePlaybackSession- Overrides:
closein classBaseSongSession- See Also:
-
propertyChange
- Specified by:
propertyChangein interfacePropertyChangeListener- Overrides:
propertyChangein classBaseSongSession
-