jcaas.midi
Class TimeSignature

java.lang.Object
  extended by jcaas.midi.StaffProperty
      extended by jcaas.midi.TimeSignature

public class TimeSignature
extends StaffProperty

TimeSignature represents the Time Signature of a staff. It extends from StaffProperty since it may be returned by Song getters and setters.

Version:
last updated: 4/17/05
Author:
Conrad Hutcheson

Constructor Summary
TimeSignature()
          Default constructor.
TimeSignature(int beats, int unit)
          Constructor, sets the time signature to beats/unit
 
Method Summary
 int getBeatsPerMeasure()
          Return the number of beats per measure.
 java.lang.String getName()
          Returns the name for this type of Staff Property
 int getUnitBeat()
          Return the size of the unit beat.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TimeSignature

public TimeSignature()
Default constructor. Sets the time signature to 4/4.


TimeSignature

public TimeSignature(int beats,
                     int unit)
Constructor, sets the time signature to beats/unit

Parameters:
beats - the int number of beats per measure.
unit - the int representing the type of note which counts as one beat. 1 is whole note, 2 half note, 4 quarter note, 8 eight note, etc.
Method Detail

getBeatsPerMeasure

public int getBeatsPerMeasure()
Return the number of beats per measure.

Returns:
the int number of beats per measure.

getUnitBeat

public int getUnitBeat()
Return the size of the unit beat.

Returns:
the in size of the unit beat. 1 = whole note, 2 = half note, 4 = quarter note, 8 = eigth note, etc.

getName

public java.lang.String getName()
Description copied from class: StaffProperty
Returns the name for this type of Staff Property

Specified by:
getName in class StaffProperty
Returns:
a string name