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
-
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_CustomPhrase
getCustomPhraseRp
(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.boolean
isCompatibleWith
(RhythmParameter<?> rp) Compatible with another RP_SYS_CustomPhrase for the same rhythm time signature.boolean
Indicate if this RhythmParameter is a primary parameter for its rhythm.boolean
Try 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:RhythmParameter
Indicate 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:
isPrimary
in interfaceRhythmParameter<RP_SYS_CustomPhraseValue>
- Returns:
-
getRhythm
The rhythm associated to this RhythmParameter.- Returns:
-
getId
- Specified by:
getId
in interfaceRhythmParameter<RP_SYS_CustomPhraseValue>
- Returns:
- A unique identifier. Usually the english name.
-
getDisplayName
- Specified by:
getDisplayName
in interfaceRhythmParameter<RP_SYS_CustomPhraseValue>
- Returns:
- The localized display name of the rhythm parameter.
-
getDescription
Description copied from interface:RhythmParameter
The description of this rhythm parameter.- Specified by:
getDescription
in interfaceRhythmParameter<RP_SYS_CustomPhraseValue>
- Returns:
-
getValueDescription
Description copied from interface:RhythmParameter
Provide an optional description or help text associated to the specified value.- Specified by:
getValueDescription
in interfaceRhythmParameter<RP_SYS_CustomPhraseValue>
- Returns:
- Can be null.
-
getDefaultValue
- Specified by:
getDefaultValue
in interfaceRhythmParameter<RP_SYS_CustomPhraseValue>
- Returns:
- Object The default value.
-
saveAsString
Description copied from interface:RhythmParameter
Try to convert the specified RhythmParameter value to a string.- Specified by:
saveAsString
in 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:RhythmParameter
Try to convert the specified string to a RhythmParameter value.- Specified by:
loadFromString
in interfaceRhythmParameter<RP_SYS_CustomPhraseValue>
- Parameters:
s
- A string produced by valueToString().- Returns:
- Can be null if conversion failed.
- See Also:
-
isValidValue
- Specified by:
isValidValue
in interfaceRhythmParameter<RP_SYS_CustomPhraseValue>
- Returns:
- True is value is valid.
-
cloneValue
Description copied from interface:RhythmParameter
Clone 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:
cloneValue
in 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:
isCompatibleWith
in interfaceRhythmParameter<RP_SYS_CustomPhraseValue>
- Parameters:
rp
-- Returns:
-
convertValue
Reuse a custom phrase when there is a matching RhythmVoice (same type).- Specified by:
convertValue
in interfaceRhythmParameter<RP_SYS_CustomPhraseValue>
- Type Parameters:
T
-- Parameters:
rp
-value
-- Returns:
-
getDisplayValue
Description copied from interface:RhythmParameter
Get a short String representation of the value.- Specified by:
getDisplayValue
in 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
-