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 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

      public boolean isLevelAffected​(Staff staff, int level)
    • getCancellingKeySignature

      public static KeySignature getCancellingKeySignature​(KeySignature keySigToCancel)
    • keyNameToKeySignature

      public static KeySignature keyNameToKeySignature​(java.lang.String keyName)
    • equals

      public boolean equals​(java.lang.Object obj)
      Overrides:
      equals in class java.lang.Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class java.lang.Object
    • isCancelling

      public boolean isCancelling()
      Returns:
      Returns the isCancelling.
    • setCancelling

      public void setCancelling​(boolean isCancelling)
      Parameters:
      isCancelling - The isCancelling to set.