Package org.jjazz.songstructure.api
Interface SongPart
- All Superinterfaces:
Transferable
A song part defines how a rhythm is played for a number of bars starting at startBarIndex.
Rhythm generation is controlled by the RhythmParameters values. Rhythm can not be changed but a SongPart can be cloned using a new rhythm.
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
clone
(Rhythm r, int startBarIndex, int nbBars, CLI_Section parentSection) Create a new SongPart with same name based on this object.default IntRange
Convenience method.getName()
By default set to the parentSection's nameint
The size of the song part in bars (same as the parentSection size).An optional CLI_Section associated to this SongPart.<T> T
getRPValue
(RhythmParameter<T> rp) Get the RhythmParameter value.int
void
Methods inherited from interface java.awt.datatransfer.Transferable
getTransferData, getTransferDataFlavors, isDataFlavorSupported
-
Field Details
-
PROP_RP_VALUE
Fired when a rhythm parameter value has changed.Occurs when value was replaced by another value (for immutable values), or value state has changed (for RpMutableValue instances).
oldValue=rhythm parameter, newValue=value.
- See Also:
-
PROP_RP_MUTABLE_VALUE
Fired when a mutable value has changed (in addition to the PROP_RP_VALUE change event).Occurs when the value state of a RpMutableValue instance has changed.
oldValue=rhythm parameter, newValue=value.
- See Also:
-
PROP_START_BAR_INDEX
- See Also:
-
PROP_NB_BARS
- See Also:
-
PROP_NAME
- See Also:
-
DATA_FLAVOR
-
-
Method Details
-
getStartBarIndex
int getStartBarIndex() -
getNbBars
int getNbBars()The size of the song part in bars (same as the parentSection size).- Returns:
-
getBarRange
Convenience method.- Returns:
- The range [getStartBarIndex(); getStartBarIndex()+getNbBars()-1]
-
getName
String getName()By default set to the parentSection's name- Returns:
-
getParentSection
CLI_Section getParentSection()An optional CLI_Section associated to this SongPart.- Returns:
-
getRPValue
Get the RhythmParameter value.- Type Parameters:
T
-- Parameters:
rp
-- Returns:
- the java.lang.Object
-
getRhythm
Rhythm getRhythm() -
getContainer
SongStructure getContainer()- Returns:
- The SongStructure this object belong to. Set by SongStructure when the SongPart is added.
-
getClientProperties
StringProperties getClientProperties() -
clone
Create a new SongPart with same name based on this object.Parameters of the new SongPart can be adjusted.
If using a different rhythm, try to adapt the value of compatible RhythmParameters.- Parameters:
r
- The new Rhythm to be used. If null Rhythm is unchanged.startBarIndex
- The startBarIndex of the new SongPartnbBars
- The nbBars of the new SongPartparentSection
- The parentSection of the new SongPart. TimeSignature must match the specified rhythm. Can be null.- Returns:
- A new SongPart.
-
addPropertyChangeListener
-
removePropertyChangeListener
-