auditory.described
Class AbstractContent

java.lang.Object
  extended by auditory.described.AbstractContent
All Implemented Interfaces:
Content
Direct Known Subclasses:
Chord, Note

public abstract class AbstractContent
extends java.lang.Object
implements Content

A partial encapsulation of a piece of described auditory content

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

Field Summary
protected  boolean audible
           
protected  boolean dotted
           
protected  boolean playing
           
protected  int type
           
 
Constructor Summary
AbstractContent()
          Default Constructor
AbstractContent(int type, boolean dotted)
          Explicit Value Constructor
 
Method Summary
 int getType()
          Get the type of this AbstractContent [i.e., 1 for whole notes, 2 for half notes, etc...] (required by MidiSound)
 boolean isDotted()
          Is this AbstractContent dotted? (required by MidiSound)
 void render(javax.sound.midi.MidiChannel channel)
          Render this AbstractContent on the given MidiChannel (required by MidiSound)
 void setAudible(boolean audible)
          Set whether this AbstractContent is audible or note
protected  void setDotted(boolean dotted)
          Set whether this AbstractContent is dotted
protected  void setType(int type)
          Set the type of this AbstractContent
protected abstract  void startPlaying(javax.sound.midi.MidiChannel channel)
          Start playing this AbstractContent on the given MidiChannel
protected abstract  void stopPlaying(javax.sound.midi.MidiChannel channel)
          Start playing this AbstractContent on the given MidiChannel
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

audible

protected boolean audible

dotted

protected boolean dotted

playing

protected boolean playing

type

protected int type
Constructor Detail

AbstractContent

public AbstractContent()
Default Constructor


AbstractContent

public AbstractContent(int type,
                       boolean dotted)
Explicit Value Constructor

Parameters:
type - 1 for whole notes, 2 for half notes, etc...
dotted - Whether the note is dotted
Method Detail

getType

public int getType()
Get the type of this AbstractContent [i.e., 1 for whole notes, 2 for half notes, etc...] (required by MidiSound)

Specified by:
getType in interface Content
Returns:
The type

isDotted

public boolean isDotted()
Is this AbstractContent dotted? (required by MidiSound)

Specified by:
isDotted in interface Content
Returns:
true if dotted; false otherwise

render

public void render(javax.sound.midi.MidiChannel channel)
Render this AbstractContent on the given MidiChannel (required by MidiSound)

Specified by:
render in interface Content
Parameters:
channel - The MIDI channel to use

setAudible

public void setAudible(boolean audible)
Set whether this AbstractContent is audible or note

Specified by:
setAudible in interface Content
Parameters:
audible - true to make it audible; false otherwise

setDotted

protected void setDotted(boolean dotted)
Set whether this AbstractContent is dotted

Parameters:
dotted - Whether the note is dotted

setType

protected void setType(int type)
Set the type of this AbstractContent

Parameters:
type - 1 for whole notes, 2 for half notes, etc...

startPlaying

protected abstract void startPlaying(javax.sound.midi.MidiChannel channel)
Start playing this AbstractContent on the given MidiChannel

Parameters:
channel - The MIDI channel to use

stopPlaying

protected abstract void stopPlaying(javax.sound.midi.MidiChannel channel)
Start playing this AbstractContent on the given MidiChannel

Parameters:
channel - The MIDI channel to use


Design and Implementation of Multimedia Software, Jones and Bartlett Publishers