com.virtuosotechnologies.asaph.model
Interface ChordSet

All Superinterfaces:
FieldContainer, SongMember

public interface ChordSet
extends SongMember, FieldContainer

A set of chords for a song. Most songs will only have one ChordSet, but some may have multiple, especially if there are alternate tunes.


Field Summary
static String KEYSIGNATURETYPE_FIELD
          Name of key signature type field.
static String NAME_FIELD
          Name of chord set name field.
 
Method Summary
 ChordSetKey addAlternateKey(Note note, UndoableEditListener undoListener)
          Add a new alternate key to the chord set.
 int getAlternateKeyCount()
          Get the number of alternate keys
 Locale getLocale()
          Get the locale for this ChordSet.
 ChordSetKey getNativeKey()
          Get the ChordSetKey representing the native key signature.
 ChordSetKey getNextAlternateKey(ChordSetKey reference)
          Get the next alternate key following reference.
 ChordSetKey getPreviousAlternateKey(ChordSetKey reference)
          Get the previous alternate key preceding reference.
 String getSerializableID()
          Get a string ID that can be used to serialize references to this ChordSet.
 void removeAlternateKey(ChordSetKey alternateKey, UndoableEditListener undoListener)
          Remove the given alternate key from the chord set.
 
Methods inherited from interface com.virtuosotechnologies.asaph.model.SongMember
getSong, isDefunct
 
Methods inherited from interface com.virtuosotechnologies.asaph.model.FieldContainer
addBinaryField, addBinaryListField, addStringField, addStringListField, getFieldCount, getNamedField, getNextField, getNthField, getPreviousField, removeField
 

Field Detail

NAME_FIELD

public static final String NAME_FIELD
Name of chord set name field. Value is a StringField.

See Also:
Constant Field Values

KEYSIGNATURETYPE_FIELD

public static final String KEYSIGNATURETYPE_FIELD
Name of key signature type field. Value is a StringField.

See Also:
Constant Field Values
Method Detail

getLocale

public Locale getLocale()
Get the locale for this ChordSet.

Returns:
the Locale

getNativeKey

public ChordSetKey getNativeKey()
Get the ChordSetKey representing the native key signature.

Returns:
native key signature

getAlternateKeyCount

public int getAlternateKeyCount()
Get the number of alternate keys

Returns:
number of alternate keys

getNextAlternateKey

public ChordSetKey getNextAlternateKey(ChordSetKey reference)
Get the next alternate key following reference. If reference is null, returns the first alternate key. If reference is the last alternate key, returns null;

Parameters:
reference - reference ChordSetKey
Returns:
next alternate key
Throws:
IllegalArgumentException - reference is not a member

getPreviousAlternateKey

public ChordSetKey getPreviousAlternateKey(ChordSetKey reference)
Get the previous alternate key preceding reference. If reference is null, returns the last alternate key. If reference is the first alternate key, returns null;

Parameters:
reference - reference ChordSetKey
Returns:
previous alternate key
Throws:
IllegalArgumentException - reference is not a member

getSerializableID

public String getSerializableID()
Get a string ID that can be used to serialize references to this ChordSet. The ID is guaranteed to be unique among ChordSets within the owning Song, and will remain the same for the same ChordSet across different executions of the tool. However, two ChordSets from different Songs may have the same string ID, and the same string ID may be shared between SongBlocks, Variations and ChordSets within the same Song.

Returns:
a unique serializable String ID for this ChordSet

addAlternateKey

public ChordSetKey addAlternateKey(Note note,
                                   UndoableEditListener undoListener)
Add a new alternate key to the chord set.

Parameters:
note - key note
undoListener - listener to notify if an undoable edit is generated, or null to suppress generation of undoable edits
Returns:
added alternate key
Throws:
NullPointerException - note was null

removeAlternateKey

public void removeAlternateKey(ChordSetKey alternateKey,
                               UndoableEditListener undoListener)
Remove the given alternate key from the chord set.

Parameters:
alternateKey - ChordSetKey to remove
undoListener - listener to notify if an undoable edit is generated, or null to suppress generation of undoable edits
Throws:
IllegalArgumentException - alternateKey is not present
NullPointerException - alternateKey was null