|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
API that includes utilities for manipulating songs.
This API is thread-safe and may be called from any thread.
| Method Summary | |
void |
compactLine(SongLine line,
UndoableEditListener undoListener)
Compact a line-- aggregates any consecutive comment strings or text strings, ensures inserts empty text between adjacent chords in the same chord set, and ensures that the line starts and ends with strings. |
void |
compactSong(Song song,
UndoableEditListener undoListener)
Compact a song-- performs compactLine on all lines in the song. |
void |
copySong(Song source,
Song destination)
Make one song a copy of another. |
BinaryField |
forceGetBinaryField(FieldContainer fieldContainer,
String fieldName,
String defaultType,
byte[] defaultValue,
UndoableEditListener undoListener)
Ensure that a field exists and is a binary field. |
BinaryListField |
forceGetBinaryListField(FieldContainer fieldContainer,
String fieldName,
UndoableEditListener undoListener)
Ensure that a field exists and is a binary list. |
StringField |
forceGetStringField(FieldContainer fieldContainer,
String fieldName,
String defaultStr,
UndoableEditListener undoListener)
Ensure that a field exists and is a string. |
StringListField |
forceGetStringListField(FieldContainer fieldContainer,
String fieldName,
UndoableEditListener undoListener)
Ensure that a field exists and is a string list. |
String |
getFieldValueAsString(FieldContainer fieldContainer,
String fieldName)
Get a field value as a string. |
String[] |
getFieldValueAsStringArray(FieldContainer fieldContainer,
String fieldName)
Get a field value as a string array. |
String |
getFirstLineAsString(Song song,
boolean useVariation,
Variation variation)
Get the first line of the song as a string. |
int |
getMemberPosition(SongLineMember member,
ChordSet set)
Get the index of a line member within its line |
String |
getMultiLineString(StringList stringList)
Get the StringList value as a string with newline delimiters. |
String |
getSongTextAsString(Song song,
boolean useVariation,
Variation variation)
Get the entire song text as a string. |
ChordAnnotation |
moveChordAnnotation(ChordAnnotation chord,
TextString destinationMember,
int destinationPos,
ChordSet destinationSet,
UndoableEditListener undoListener)
Move a chord marking |
boolean |
prepareSongForEditing(Song song)
Normalize a song for editing. |
void |
removeLineRange(SongLine line,
TextString startMember,
int startPos,
TextString endMember,
int endPos,
UndoableEditListener undoListener)
Remove the given range from a line |
void |
setMultiLineString(StringList stringList,
String value,
UndoableEditListener undoListener)
Parses the given string into lines and sets the string list value. |
SongBlock |
splitBlock(SongBlock block,
SongLine line,
UndoableEditListener undoListener)
Split a block in half. |
SongLine |
splitLine(TextString member,
int pos,
UndoableEditListener undoListener)
Split a line in half. |
void |
transpose(SongBlock block,
ChordSet chordSet,
Interval interval,
UndoableEditListener undoListener)
Transpose chords in the given song block. |
void |
transpose(Song song,
ChordSet chordSet,
Interval interval,
UndoableEditListener undoListener)
Transpose chords in the given song. |
void |
transpose(SongLine line,
ChordSet chordSet,
Interval interval,
UndoableEditListener undoListener)
Transpose chords in the given song line. |
| Method Detail |
public void copySong(Song source,
Song destination)
source - source songdestination - destination songpublic boolean prepareSongForEditing(Song song)
song - Song to prepare
public void compactLine(SongLine line,
UndoableEditListener undoListener)
line - SongLine to compactundoListener - listener to notify if an undoable edit is generated,
or null to suppress generation of undoable edits
NullPointerException - line was null
public void compactSong(Song song,
UndoableEditListener undoListener)
song - Song to compactundoListener - listener to notify if an undoable edit is generated,
or null to suppress generation of undoable edits
NullPointerException - line was null
public StringField forceGetStringField(FieldContainer fieldContainer,
String fieldName,
String defaultStr,
UndoableEditListener undoListener)
fieldContainer - FieldContainer to queryfieldName - field namedefaultStr - default valueundoListener - listener to notify if an undoable edit is generated,
or null to suppress generation of undoable edits
NullPointerException - something was null
public StringListField forceGetStringListField(FieldContainer fieldContainer,
String fieldName,
UndoableEditListener undoListener)
fieldContainer - FieldContainer to queryfieldName - field nameundoListener - listener to notify if an undoable edit is generated,
or null to suppress generation of undoable edits
NullPointerException - something was null
public BinaryField forceGetBinaryField(FieldContainer fieldContainer,
String fieldName,
String defaultType,
byte[] defaultValue,
UndoableEditListener undoListener)
fieldContainer - FieldContainer to queryfieldName - field namedefaultType - default data typedefaultValue - default valueundoListener - listener to notify if an undoable edit is generated,
or null to suppress generation of undoable edits
NullPointerException - something was null
public BinaryListField forceGetBinaryListField(FieldContainer fieldContainer,
String fieldName,
UndoableEditListener undoListener)
fieldContainer - FieldContainer to queryfieldName - field nameundoListener - listener to notify if an undoable edit is generated,
or null to suppress generation of undoable edits
NullPointerException - something was null
public String getFieldValueAsString(FieldContainer fieldContainer,
String fieldName)
fieldContainer - FieldContainer to queryfieldName - field name
NullPointerException - something was null
public String[] getFieldValueAsStringArray(FieldContainer fieldContainer,
String fieldName)
fieldContainer - FieldContainer to queryfieldName - field name
NullPointerException - something was nullpublic String getMultiLineString(StringList stringList)
stringList - StringList to query
NullPointerException - something was null
public void setMultiLineString(StringList stringList,
String value,
UndoableEditListener undoListener)
stringList - StringList to modifyvalue - field value as a string with newlinesundoListener - listener to notify if an undoable edit is generated,
or null to suppress generation of undoable edits
NullPointerException - something was null
public String getSongTextAsString(Song song,
boolean useVariation,
Variation variation)
song - song to queryuseVariation - true to query a specific variation, specified by the variation
parameter, or false to query the entire text (which may not correspond to any
actual variation)variation - variation to get, or null for the default variation. Ignored if
useVariation is false
NullPointerException - something was null
public String getFirstLineAsString(Song song,
boolean useVariation,
Variation variation)
song - song to queryuseVariation - true to query a specific variation, specified by the variation
parameter, or false to query the entire text (which may not correspond to any
actual variation)variation - variation to get, or null for the default variation. Ignored if
useVariation is false
NullPointerException - something was null
public void removeLineRange(SongLine line,
TextString startMember,
int startPos,
TextString endMember,
int endPos,
UndoableEditListener undoListener)
line - line to editstartMember - Start of the range to remove. Null for the beginning of the linestartPos - position within startMemberendMember - End of the range to remove. Null for the end of the lineendPos - position within endMemberundoListener - listener for undo records, or null to not generate edits
public ChordAnnotation moveChordAnnotation(ChordAnnotation chord,
TextString destinationMember,
int destinationPos,
ChordSet destinationSet,
UndoableEditListener undoListener)
chord - Chord to move. If null, inserts an empty chord.destinationMember - Text member containing the chord destinationdestinationPos - position within destinationMemberdestinationSet - ChordSet to move chord to. If null, uses chord's set.undoListener - listener for undo records, or null to not generate edits
public int getMemberPosition(SongLineMember member,
ChordSet set)
member - member to queryset - ChordSet to limit to, or null for entire line
public SongLine splitLine(TextString member,
int pos,
UndoableEditListener undoListener)
member - member containing the split positionpos - position within memberundoListener - listener to notify if an undoable edit is generated,
or null to suppress generation of undoable edits
NullPointerException - member was null
public SongBlock splitBlock(SongBlock block,
SongLine line,
UndoableEditListener undoListener)
block - block to split.line - last line in the first half. The split position will be after this line.
Pass null to "split" at the beginning of the block.undoListener - listener to notify if an undoable edit is generated,
or null to suppress generation of undoable edits
NullPointerException - member was null
public void transpose(SongLine line,
ChordSet chordSet,
Interval interval,
UndoableEditListener undoListener)
line - line to transposechordSet - chord set to transposeinterval - interval to transposeundoListener - listener to notify if an undoable edit is generated,
or null to suppress generation of undoable edits
NullPointerException - something was null
public void transpose(SongBlock block,
ChordSet chordSet,
Interval interval,
UndoableEditListener undoListener)
block - block to transposechordSet - chord set to transposeinterval - interval to transposeundoListener - listener to notify if an undoable edit is generated,
or null to suppress generation of undoable edits
NullPointerException - something was null
public void transpose(Song song,
ChordSet chordSet,
Interval interval,
UndoableEditListener undoListener)
song - song to transposechordSet - chord set to transposeinterval - interval to transposeundoListener - listener to notify if an undoable edit is generated,
or null to suppress generation of undoable edits
NullPointerException - something was null
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||