Class RP_SYS_CustomPhraseValue

java.lang.Object
org.jjazz.rhythmparametersimpl.api.RP_SYS_CustomPhraseValue

public class RP_SYS_CustomPhraseValue extends Object
The value of RP_SYS_CustomPhrase.

All custom phrases start at beat 0.

  • Constructor Details

    • RP_SYS_CustomPhraseValue

      public RP_SYS_CustomPhraseValue(Rhythm r)
      Create an empty value.
      Parameters:
      r -
    • RP_SYS_CustomPhraseValue

      public RP_SYS_CustomPhraseValue(Rhythm r, Map<RhythmVoice, Phrase> mapRvPhrase)
      Create a value with custom phrases.
      Parameters:
      r -
      mapRvPhrase - The custom phrases. Can be empty. The instance will keep deep copies of the phrases.
    • RP_SYS_CustomPhraseValue

      public RP_SYS_CustomPhraseValue(RP_SYS_CustomPhraseValue value)
      Create a deep copy.
      Parameters:
      value -
  • Method Details

    • setCustomizedPhrase

      public RP_SYS_CustomPhraseValue setCustomizedPhrase(RhythmVoice rv, Phrase p)
      Get a new instance with the specified customized phrase set.
      Parameters:
      rv - Must belong to the rhythm
      p - Phrase must be beat-0 based.
      Returns:
    • removeCustomizedPhrase

      public RP_SYS_CustomPhraseValue removeCustomizedPhrase(RhythmVoice rv)
      Get a new instance with a customized phrase removed.
      Parameters:
      rv - The RhythmVoice to be removed
      Returns:
    • getRhythmParameter

      public RP_SYS_CustomPhrase getRhythmParameter()
    • getRhythm

      public Rhythm getRhythm()
      Get the Rhythm which uses this RhythmParameter instance.
      Returns:
    • getCustomizedPhrase

      public Phrase getCustomizedPhrase(RhythmVoice rv)
      Get a deep copy of the custom phrase for the specified RhythmVoice.
      Parameters:
      rv -
      Returns:
      Null if no customized phrase for rv. Phrase starts at beat 0.
    • getCustomizedRhythmVoices

      public Set<RhythmVoice> getCustomizedRhythmVoices()
      Get the RhythmVoices for which there is a custom phrase.
      Returns:
      Empty set if no custom phrase.
    • toDescriptionString

      public String toDescriptionString()
      The list of RhythmVoice names sorted by preferred channel.
      Returns:
    • saveAsString

      public static String saveAsString(RP_SYS_CustomPhraseValue v)
      Save the specified object state as a string.

      Example "Bass%[PhraseString]&Piano%[PhraseString]" means 2 RhythmVoices/Phrases. "" means no custom phrase.

      Parameters:
      v -
      Returns:
      See Also:
    • loadFromString

      public static RP_SYS_CustomPhraseValue loadFromString(Rhythm r, String s) throws ParseException
      Create an object from a string.
      Parameters:
      r -
      s -
      Returns:
      Throws:
      ParseException - If s is invalid
      See Also:
    • equals

      public boolean equals(Object obj)
      RhythmParameter value classes must have equals()/hashCode() defined.
      Overrides:
      equals in class Object
      Parameters:
      obj -
      Returns:
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object