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.State
-
Field Summary
Fields inherited from class org.jjazz.musiccontrol.api.playbacksession.BaseSongSession
PLAYBACK_SETTINGS_LOOP_COUNT
Fields inherited from interface org.jjazz.musiccontrol.api.playbacksession.ControlTrackProvider
ENABLED_STATE
Fields 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 TypeMethodDescriptionvoid
close()
Put session in the CLOSED state and release used resources, so that session can be disposed.static StaticSongSession
getSession
(SongContext sgContext) Same as getSession(sgContext, true, true, true, true, PLAYBACK_SETTINGS_LOOP_COUNT, null);static StaticSongSession
getSession
(SongContext sgContext, boolean enablePlaybackTransposition, boolean includeClickTrack, boolean includePrecountTrack, boolean includeControlTrack, int loopCount, ActionListener endOfPlaybackAction) Create or reuse a session for the specified parameters.void
Methods inherited from class org.jjazz.musiccontrol.api.playbacksession.BaseSongSession
addPropertyChangeListener, generate, getBarRange, getClickTrackId, getControlTrack, getEndOfPlaybackAction, getFreshCopy, getLoopCount, getLoopEndTick, getLoopStartTick, getPrecountTrackId, getRvPhraseMap, getRvTrackIdMap, getSequence, getSongContext, getState, getTempo, getTick, getTracksMuteStatus, isClickTrackIncluded, isControlTrackIncluded, isDirty, isPlaybackTranspositionEnabled, isPrecountTrackIncluded, isUseActiveSongBackgroundMusicBuilder, removePropertyChangeListener, toString
-
Method Details
-
getSession
public static StaticSongSession getSession(SongContext sgContext, boolean enablePlaybackTransposition, boolean includeClickTrack, boolean includePrecountTrack, boolean includeControlTrack, int loopCount, ActionListener endOfPlaybackAction) 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
-enablePlaybackTransposition
- If true apply the playback transpositionincludeClickTrack
- If true add the click track, and its muted/unmuted state will depend on the PlaybackSettingsincludePrecountTrack
- If true add the precount track, and loopStartTick will depend on the PlaybackSettingsincludeControlTrack
- if true add a control track (beat positions + chord symbol markers)loopCount
- See Sequencer.setLoopCount(). Use PLAYBACK_SETTINGS_LOOP_COUNT to rely on the PlaybackSettings instance value.endOfPlaybackAction
- Action executed when playback is stopped. Can be null.- Returns:
- A session in the NEW or GENERATED state.
-
getSession
Same as getSession(sgContext, true, true, true, true, PLAYBACK_SETTINGS_LOOP_COUNT, null);- Parameters:
sgContext
-- Returns:
- A targetSession in the NEW or GENERATED state.
-
close
public void close()Description copied from interface:PlaybackSession
Put session in the CLOSED state and release used resources, so that session can be disposed.- Specified by:
close
in interfacePlaybackSession
- Overrides:
close
in classBaseSongSession
- See Also:
-
propertyChange
- Specified by:
propertyChange
in interfacePropertyChangeListener
- Overrides:
propertyChange
in classBaseSongSession
-