auditory.described
Class Part

java.lang.Object
  extended by auditory.described.Part
All Implemented Interfaces:
MetronomeListener

public class Part
extends java.lang.Object
implements MetronomeListener

A Part (i.e., a sequence of Content objects) in a Score Note: This class is not thread safe. Hence, Part objects should be modified as required before they are rendered.

See Also:
"The Design and Implementation of Multimedia Software © 2011"

Constructor Summary
Part()
          Default Constructor
 
Method Summary
 void add(Content c)
          Add a Content to this Part
 void handleTick(int millis)
          Handle a Metronome tick (required by MetronomeListener)
 void render(javax.sound.midi.MidiChannel channel)
          Render the current note in this Part
 void setTempo(int millisPerMeasure)
          Set the tempo for this Part
 void setTimeSignature(int numerator, int denominator)
          Set the time signature for this Part
 void upbeat(Metronome metronome)
          Alert this Part to the fact that is should make itself ready to be played
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Part

public Part()
Default Constructor

Method Detail

add

public void add(Content c)
Add a Content to this Part

Parameters:
c - The Content to add

handleTick

public void handleTick(int millis)
Handle a Metronome tick (required by MetronomeListener)

Specified by:
handleTick in interface MetronomeListener
Parameters:
millis - The number of milliseconds since the start

render

public void render(javax.sound.midi.MidiChannel channel)
Render the current note in this Part

Parameters:
channel - The MidiChannel to use

setTempo

public void setTempo(int millisPerMeasure)
Set the tempo for this Part

Parameters:
millisPerMeasure - The tempo (in milliseconds per measure)

setTimeSignature

public void setTimeSignature(int numerator,
                             int denominator)
Set the time signature for this Part

Parameters:
numerator - The numerator of the time signature
denominator - The denominator of the time signature

upbeat

public void upbeat(Metronome metronome)
Alert this Part to the fact that is should make itself ready to be played

Parameters:
metronome - The Metronome it will listen to


Design and Implementation of Multimedia Software, Jones and Bartlett Publishers