Interface CLI_ChordSymbol
- All Superinterfaces:
ChordLeadSheetItem<ExtChordSymbol>,Comparable<ChordLeadSheetItem<?>>,Transferable
- All Known Implementing Classes:
CLI_ChordSymbol.ComparableCsItem
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic classA dummy CLI_ChordSymbol class which can be used only for position comparison when using the NavigableSet/SortedSet-based methods of ChordLeadSheet or ChordSequence.static enumNested classes/interfaces inherited from interface org.jjazz.chordleadsheet.api.item.ChordLeadSheetItem
ChordLeadSheetItem.DefaultComparableItem -
Field Summary
FieldsFields inherited from interface org.jjazz.chordleadsheet.api.item.ChordLeadSheetItem
LOGGER, PROP_CONTAINER, PROP_ITEM_DATA, PROP_ITEM_POSITION -
Method Summary
Static MethodsModifier and TypeMethodDescriptionstatic CLI_ChordSymbolcreateItemFrom(int bar) Create an item at the beginning of the specified bar for comparison purposes.static CLI_ChordSymbolcreateItemFrom(Position pos, boolean inclusive) Create an item right before the specified position for comparison purposes.static CLI_ChordSymbolcreateItemTo(int bar) Create an item at the end of the specified bar for comparison purposes.static CLI_ChordSymbolcreateItemTo(Position pos, boolean inclusive) Create an item right after the specified position for comparison purposes.static StringtoBarString(TimeSignature ts, List<? extends CLI_ChordSymbol> items) Build a string representing the bar chord symbols.
This string can be used as input for toCLI_ChordSymbols().static CLI_ChordSymboltoCLI_ChordSymbol(String str, Position defaultPos, ChordLeadSheet cls) Return a new CLI_ChordSymbol built from a string.static List<CLI_ChordSymbol> toCLI_ChordSymbolsNoPosition(String str, TimeSignature ts, ChordLeadSheet cls, int barIndex, boolean swing) Analyze a string describing a bar like "C Fm7" and return the list of CLI_ChordSymbols.static StringtoString(CLI_ChordSymbol cli, CLI_ChordSymbol.PositionDisplay pDisplay) Return a CLI_ChordSymbol as a string.static StringtoStringNoPosition(List<? extends CLI_ChordSymbol> items) A String like "C7 Am7 D"Methods inherited from interface org.jjazz.chordleadsheet.api.item.ChordLeadSheetItem
addPropertyChangeListener, compareTo, getClientProperties, getContainer, getCopy, getData, getPosition, getPositionOrder, isBarSingleItem, removePropertyChangeListenerMethods inherited from interface java.awt.datatransfer.Transferable
getTransferData, getTransferDataFlavors, isDataFlavorSupported
-
Field Details
-
POSITION_ORDER
static final int POSITION_ORDER- See Also:
-
DATA_FLAVOR
-
-
Method Details
-
toCLI_ChordSymbol
static CLI_ChordSymbol toCLI_ChordSymbol(String str, Position defaultPos, ChordLeadSheet cls) throws ParseException Return a new CLI_ChordSymbol built from a string.Recognized strings:
"C7" => C7 at pos=defaultPos
"C7$lydian_b7" => same with lydian_b7 scale
"C7[2]" => C7 at pos=defaultPos.getBar()/beat 2
"Cm7[1:2]" => Cm7 at pos=bar 1/beat 2
"Cm7[1:2]$phrygian" => same with phrygian scaleNOTES:
- bar and beat in string position string [bar:beat] must be 1-based.
- scale name case does not matter. Scale must be compatible with the chord symbol, otherwise it is ignored.
- Parameters:
str- As produced by toString(CLI_ChordSymbol).defaultPos- Used when position data is missing in str.cls- The container for this CLI_ChordSymbol. Can be null.- Returns:
- Throws:
ParseException- See Also:
-
toCLI_ChordSymbolsNoPosition
static List<CLI_ChordSymbol> toCLI_ChordSymbolsNoPosition(String str, TimeSignature ts, ChordLeadSheet cls, int barIndex, boolean swing) throws ParseException Analyze a string describing a bar like "C Fm7" and return the list of CLI_ChordSymbols.If 1 chord, beat=0.
If 2 chords, second chord is at the "half" of the bar.
If 3 chords, second chord is at the "half" of the bar and last one on last beat
If more chords place them at regular intervals.- Parameters:
str-ts- Can be null if cls is non-null. If specified and cls is non-null, must be consistent with cls and time signature at barIndex.cls- Can be null if ts is non-null.barIndex- Must be consistent with cls (if cls is specified)swing- If true for example for 3/4 time signature place half-beat chord symbols at 1.666 (5/3) instead of 1.5- Returns:
- Throws:
ParseException- When thrown, GetErrorOffset() represents the faulty chord symbol index.- See Also:
-
toBarString
Build a string representing the bar chord symbols.
This string can be used as input for toCLI_ChordSymbols().- Parameters:
ts- The TimeSignature of the bar.items- The chord symbols in the bar.- Returns:
-
toStringNoPosition
A String like "C7 Am7 D"- Parameters:
items-- Returns:
-
toString
Return a CLI_ChordSymbol as a string.Returned String can be used as an input for toCLI_ChordSymbol().
- Parameters:
cli-pDisplay- Define how position is represented.- Returns:
- See Also:
-
createItemTo
Create an item right after the specified position for comparison purposes.For the Comparable interface, any item whose position is before (or equal if inclusive is true) to pos will be considered BEFORE the returned item.
- Parameters:
pos-inclusive-- Returns:
-
createItemTo
Create an item at the end of the specified bar for comparison purposes.For the Comparable interface, any normal item in the bar will be considered BEFORE the returned item.
- Parameters:
bar-- Returns:
-
createItemFrom
Create an item right before the specified position for comparison purposes.For the Comparable interface, any item whose position is after (or equal if inclusive is true) to pos will be considered AFTER the returned item.
- Parameters:
pos-inclusive-- Returns:
-
createItemFrom
Create an item at the beginning of the specified bar for comparison purposes.For the Comparable interface, any normal item in the bar will be considered AFTER the returned item.
- Parameters:
bar-- Returns:
-