Class RP_SYS_CustomPhrase
java.lang.Object
org.jjazz.rhythm.api.rhythmparameters.RP_SYS_CustomPhrase
- All Implemented Interfaces:
RhythmParameter<RP_SYS_CustomPhraseValue>
public class RP_SYS_CustomPhrase
extends Object
implements RhythmParameter<RP_SYS_CustomPhraseValue>
A RhythmParameter to replace one or more generated Phrases by custom Phrases.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionClone the specified value.convertValue(RhythmParameter<T> rp, T value) Reuse a custom phrase when there is a matching RhythmVoice (same type).static RP_SYS_CustomPhrasegetCustomPhraseRp(Rhythm rhythm) Find the first RP_SYS_CustomPhrase instance in the rhythm parameters of r.The description of this rhythm parameter.Get a short String representation of the value.getId()The rhythm associated to this RhythmParameter.Provide an optional description or help text associated to the specified value.booleanisCompatibleWith(RhythmParameter<?> rp) Compatible with another RP_SYS_CustomPhrase for the same rhythm time signature.booleanIndicate if this RhythmParameter is a primary parameter for its rhythm.booleanTry to convert the specified string to a RhythmParameter value.Try to convert the specified RhythmParameter value to a string.toString()
-
Constructor Details
-
RP_SYS_CustomPhrase
-
-
Method Details
-
isPrimary
public boolean isPrimary()Description copied from interface:RhythmParameterIndicate if this RhythmParameter is a primary parameter for its rhythm.This information is made available mainly for the user interface, e.g. to select which RhythmParameters to show first.
Default implementation returns true.
- Specified by:
isPrimaryin interfaceRhythmParameter<RP_SYS_CustomPhraseValue>- Returns:
-
getRhythm
The rhythm associated to this RhythmParameter.- Returns:
-
getId
- Specified by:
getIdin interfaceRhythmParameter<RP_SYS_CustomPhraseValue>- Returns:
- A unique identifier. Usually the english name.
-
getDisplayName
- Specified by:
getDisplayNamein interfaceRhythmParameter<RP_SYS_CustomPhraseValue>- Returns:
- The localized display name of the rhythm parameter.
-
getDescription
Description copied from interface:RhythmParameterThe description of this rhythm parameter.- Specified by:
getDescriptionin interfaceRhythmParameter<RP_SYS_CustomPhraseValue>- Returns:
-
getValueDescription
Description copied from interface:RhythmParameterProvide an optional description or help text associated to the specified value.- Specified by:
getValueDescriptionin interfaceRhythmParameter<RP_SYS_CustomPhraseValue>- Returns:
- Can be null.
-
getDefaultValue
- Specified by:
getDefaultValuein interfaceRhythmParameter<RP_SYS_CustomPhraseValue>- Returns:
- Object The default value.
-
saveAsString
Description copied from interface:RhythmParameterTry to convert the specified RhythmParameter value to a string.- Specified by:
saveAsStringin interfaceRhythmParameter<RP_SYS_CustomPhraseValue>- Returns:
- Can be null if value is invalid or RhytmParameter does not have this capability.
- See Also:
-
loadFromString
Description copied from interface:RhythmParameterTry to convert the specified string to a RhythmParameter value.- Specified by:
loadFromStringin interfaceRhythmParameter<RP_SYS_CustomPhraseValue>- Parameters:
s- A string produced by valueToString().- Returns:
- Can be null if conversion failed.
- See Also:
-
isValidValue
- Specified by:
isValidValuein interfaceRhythmParameter<RP_SYS_CustomPhraseValue>- Returns:
- True is value is valid.
-
cloneValue
Description copied from interface:RhythmParameterClone the specified value.The default implementation just return value, which is fine is E is an immutable class. If E is mutable, this method must be overridden.
- Specified by:
cloneValuein interfaceRhythmParameter<RP_SYS_CustomPhraseValue>- Returns:
- A copy of the specified value.
-
isCompatibleWith
Compatible with another RP_SYS_CustomPhrase for the same rhythm time signature.- Specified by:
isCompatibleWithin interfaceRhythmParameter<RP_SYS_CustomPhraseValue>- Parameters:
rp-- Returns:
-
convertValue
Reuse a custom phrase when there is a matching RhythmVoice (same type).- Specified by:
convertValuein interfaceRhythmParameter<RP_SYS_CustomPhraseValue>- Type Parameters:
T-- Parameters:
rp-value-- Returns:
-
getDisplayValue
Description copied from interface:RhythmParameterGet a short String representation of the value.- Specified by:
getDisplayValuein interfaceRhythmParameter<RP_SYS_CustomPhraseValue>- Returns:
- Can be an empty String.
-
toString
-
getCustomPhraseRp
Find the first RP_SYS_CustomPhrase instance in the rhythm parameters of r.- Parameters:
rhythm-- Returns:
- Can be null if not found
-