Package com.softsynth.jmsl.score
Class KeySignature
java.lang.Object
com.softsynth.jmsl.score.KeySignature
public class KeySignature
extends java.lang.Object
- Author:
- Nick Didkovsky, (c) 2004 All rights reserved, Email: nick@didkovsky.com
-
Field Summary
Fields Modifier and Type Field Description static int
FLAT_KEY
static java.lang.String[]
KEYSIG_FLAT_NAMES
static java.lang.String[]
KEYSIG_SHARP_NAMES
static int
SHARP_KEY
-
Constructor Summary
Constructors Constructor Description KeySignature()
-
Method Summary
Modifier and Type Method Description boolean
equals(java.lang.Object obj)
static KeySignature
getCancellingKeySignature(KeySignature keySigToCancel)
int
getKeySignatureType()
int
getNumAccidentals()
int
getPitch(int accNum)
int
hashCode()
boolean
isCancelling()
boolean
isLevelAffected(Staff staff, int level)
static KeySignature
keyNameToKeySignature(java.lang.String keyName)
void
setCancelling(boolean isCancelling)
void
setKeySignatureType(int sharpOrFlat)
Set key signature type to SHARP_KEY or FLAT_KEYvoid
setNumAccidentals(int numAcc)
Set number of sharps or flats in this key signature (0 for C maj)Methods inherited from class java.lang.Object
getClass, notify, notifyAll, toString, wait, wait, wait
-
Field Details
-
KEYSIG_SHARP_NAMES
public static final java.lang.String[] KEYSIG_SHARP_NAMES -
KEYSIG_FLAT_NAMES
public static final java.lang.String[] KEYSIG_FLAT_NAMES -
SHARP_KEY
public static final int SHARP_KEY- See Also:
- Constant Field Values
-
FLAT_KEY
public static final int FLAT_KEY- See Also:
- Constant Field Values
-
-
Constructor Details
-
KeySignature
public KeySignature()
-
-
Method Details
-
setKeySignatureType
public void setKeySignatureType(int sharpOrFlat)Set key signature type to SHARP_KEY or FLAT_KEY -
getKeySignatureType
public int getKeySignatureType() -
setNumAccidentals
public void setNumAccidentals(int numAcc)Set number of sharps or flats in this key signature (0 for C maj) -
getNumAccidentals
public int getNumAccidentals()- Returns:
- number of sharps or flats in this key signature (0 if C major)
-
getPitch
public int getPitch(int accNum)- Returns:
- pitch in sharp/flat array for this key sig. Checks if flat or sharp.
-
isLevelAffected
-
getCancellingKeySignature
-
keyNameToKeySignature
-
equals
public boolean equals(java.lang.Object obj)- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()- Overrides:
hashCode
in classjava.lang.Object
-
isCancelling
public boolean isCancelling()- Returns:
- Returns the isCancelling.
-
setCancelling
public void setCancelling(boolean isCancelling)- Parameters:
isCancelling
- The isCancelling to set.
-