Class GhostPhrasesModel

java.lang.Object
org.jjazz.pianoroll.api.GhostPhrasesModel
All Implemented Interfaces:
PropertyChangeListener, EventListener, ChangeListener

public class GhostPhrasesModel extends Object implements PropertyChangeListener, ChangeListener
The ghost phrases (one per channel, excepted for the edited channel) and their visible state.
  • Field Details

    • PROP_PHRASE_LIST

      public static final String PROP_PHRASE_LIST
      A phrase was added or removed or renamed or channel changed in the midimix.

      The visible channels might also have been changed as a result.

      See Also:
    • PROP_VISIBLE_PHRASE_CONTENT

      public static final String PROP_VISIBLE_PHRASE_CONTENT
      One or more phrases content were musically changed for the visible phrases.
      See Also:
    • PROP_VISIBLE_PHRASE_SELECTION

      public static final String PROP_VISIBLE_PHRASE_SELECTION
      A phrase was made visible or hidden.

      OldValue=old visible channels set, newValue=new visible channels set.

      See Also:
  • Constructor Details

    • GhostPhrasesModel

      public GhostPhrasesModel(MidiMix midiMix, int editedChannel)
      Create the model.

      By default no ghost phrase is visible.

      Parameters:
      midiMix -
      editedChannel - The channel currently edited, which does not require a GhostPhrase.
  • Method Details

    • getEditedChannel

      public int getEditedChannel()
    • setEditedChannel

      public void setEditedChannel(int editedChannel)
      Set the channel currently edited, which does not require a GhostPhrase.
      Parameters:
      editedChannel -
    • getMidiMix

      public MidiMix getMidiMix()
    • setVisibleChannels

      public void setVisibleChannels(Collection<Integer> newVisibleChannels)
      Set which ghost phrases are visible.
      Parameters:
      newVisibleChannels - Can be null or empty to not show any ghost phrase.
    • getAllChannels

      public List<Integer> getAllChannels()
      Get all the channels, visible or not, except the edited channel.
      Returns:
    • getVisibleChannels

      public Set<Integer> getVisibleChannels()
      Get the channels for which ghost phrases are visible.
      Returns:
    • getVisibleGhostPhrases

      public Map<Integer,Phrase> getVisibleGhostPhrases()
      Get the visible ghost phrases.
      Returns:
    • cleanup

      public void cleanup()
    • addPropertyChangeListener

      public void addPropertyChangeListener(PropertyChangeListener l)
    • removePropertyChangeListener

      public void removePropertyChangeListener(PropertyChangeListener l)
    • stateChanged

      public void stateChanged(ChangeEvent evt)
      Specified by:
      stateChanged in interface ChangeListener
    • propertyChange

      public void propertyChange(PropertyChangeEvent evt)
      Specified by:
      propertyChange in interface PropertyChangeListener