Interface PhraseTransform
- All Superinterfaces:
Comparable<PhraseTransform>
- All Known Implementing Classes:
DrumsMixTransform
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic class
Descriptive info of a PhraseTransform. -
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptiondefault int
Compare using alphabetical order first on category, then on name.static boolean
equals
(PhraseTransform pt1, Object o2) Helper method to implement PhraseTransform subclass equals(Object) method.getCopy()
Get a copy of this PhraseTransform instance.int
getFitScore
(SizedPhrase inPhrase, SongPartContext context) Return a [0-100] value which indicates how much this transform is adapted for the specified parameters.getInfo()
Get the information for this transform.Get the PhraseTransform properties.static int
Helper method to implement PhraseTransform subclass hashCode() method.default boolean
Return true if PhraseTransform has settings which can be modified by end-user.static PhraseTransform
Try to get a PhraseTransform instance from the specified save string.static String
A string like "uniqueId#prop1=value1,prop=value2".default void
showUserSettingsDialog
(Component anchor) Show a modal dialog to modify the user settings of this PhraseTransform.transform
(SizedPhrase inPhrase, SongPartContext context) Transform inPhrase into another phrase.
-
Field Details
-
ICON_SIZE
-
SAVE_STRING_DELIMITER
- See Also:
-
HIDDEN_ID_TOKEN
- See Also:
-
-
Method Details
-
getInfo
PhraseTransform.Info getInfo()Get the information for this transform.- Returns:
-
transform
Transform inPhrase into another phrase.The optional context must match inPhrase beat range. Context can be used to retrieve additional information, e.g.:
- the chord symbols used in the phrase
- the target RhythmVoice (or RhythmVoiceDelegate) for the phrase, obtained via context.getMidiMix().getRhythmVoice(inPhrase.getChannel()).
- the InstrumentMix used for the phrase, obtained via context.getMidiMix().getInstrumentMixFromChannel(inPhrase.getChannel()).- Parameters:
inPhrase
-context
- Can be null. An optional context to provide additional information about inPhrase.- Returns:
- The new transformed phrase.
- Throws:
IllegalArgumentException
- If context is non-null and its beat range differs from the beat range of inPhrase.
-
getFitScore
Return a [0-100] value which indicates how much this transform is adapted for the specified parameters.A PhraseTransform which can not work without a context should return 0 if context is null.
- Parameters:
inPhrase
-context
- Can be null. An optional context to provide additional information about inPhrase.- Returns:
- 0 means this transform is not adapted at all, 100 means this transform is perfectly fit for this context.
- See Also:
-
getCopy
PhraseTransform getCopy()Get a copy of this PhraseTransform instance.- Returns:
-
compareTo
Compare using alphabetical order first on category, then on name.- Specified by:
compareTo
in interfaceComparable<PhraseTransform>
- Parameters:
pt
-- Returns:
-
getProperties
PtProperties getProperties()Get the PhraseTransform properties.- Returns:
- Can't be null (but can be empty)
-
showUserSettingsDialog
Show a modal dialog to modify the user settings of this PhraseTransform.The PhraseTransform is responsible for the persistence of its settings. The method does nothing if hasUserSettings() returns false.
- Parameters:
anchor
- The anchor component to adjust dialog location.- See Also:
-
hasUserSettings
default boolean hasUserSettings()Return true if PhraseTransform has settings which can be modified by end-user.- Returns:
- See Also:
-
showUserSettingsDialog()
-
equals
Helper method to implement PhraseTransform subclass equals(Object) method.2 PhraseTransforms are equal when they have same uniqueId and same property/value pairs.
- Parameters:
pt1
-o2
-- Returns:
-
hashCode
Helper method to implement PhraseTransform subclass hashCode() method.Rely on uniqueId and properties.
- Parameters:
pt
-- Returns:
-
saveAsString
A string like "uniqueId#prop1=value1,prop=value2".If no property set, return "uniqueId#".
- Parameters:
pt
-- Returns:
- See Also:
-
loadFromString
Try to get a PhraseTransform instance from the specified save string.- Parameters:
s
-- Returns:
- Null if not found.
- Throws:
ParseException
- See Also:
-