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

public class StaticSongSession extends BaseSongSession
A BaseSongSession which becomes dirty as soon as the SongContext has changed musically.

  • 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 transposition
      includeClickTrack - If true add the click track, and its muted/unmuted state will depend on the PlaybackSettings
      includePrecountTrack - If true add the precount track, and loopStartTick will depend on the PlaybackSettings
      includeControlTrack - 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

      public static StaticSongSession getSession(SongContext sgContext)
      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 interface PlaybackSession
      Overrides:
      close in class BaseSongSession
      See Also:
    • propertyChange

      public void propertyChange(PropertyChangeEvent e)
      Specified by:
      propertyChange in interface PropertyChangeListener
      Overrides:
      propertyChange in class BaseSongSession