Class Sound

Class Sound

java.lang.Object
   |
   +----Sound

class Sound
extends Object
implements Runnable, ImageObserver
Sound implements the thread, which is playing the sound and updating the takt (time) numbers. It also calls every time step java.applet.Applet.repaint().
See Also:
Dance

Variable Index

 o numMaxH
Maximal size().height of the takt numbers.
 o numMaxW
Maximal size().width of the takt numbers.

Constructor Index

 o Sound(URL, Dance)
Creates the sound object.

Method Index

 o GetNumImg()
Get the number image suitable to the Counter value and the number of beats for one takt of the current dance.
 o KillSound()
Delete the sound thread.
 o SetCounter(int)
Set the takt/time counter to c.
 o SoundAlive()
Test if the sound thread is still alive.
 o StartSound()
Start the sound thread.
 o StopSound()
Stop the Sound thread.
 o getLastNumImg()
Returns the last drawn image.
 o imageUpdate(Image, int, int, int, int, int)
Manages infos about the number-images.
 o run()
Main function of the sound thread.
 o setLastNumImg(Image)
Set last painted number.

Variables

 o numMaxW
  public int numMaxW
Maximal size().width of the takt numbers.
 o numMaxH
  public int numMaxH
Maximal size().height of the takt numbers.

Constructors

 o Sound
  public Sound(URL audioURL,
               Dance app)
Creates the sound object. If Dance.useAudio() is set, it preloads the audio data defined by the URL.
Parameters:
audioURL - pointer to the audio data
app - pointer to the main applet.

Methods

 o StartSound
  public synchronized void StartSound()
Start the sound thread.
 o KillSound
  public synchronized void KillSound()
Delete the sound thread.
 o StopSound
  public void StopSound()
Stop the Sound thread.
 o SoundAlive
  public boolean SoundAlive()
Test if the sound thread is still alive.
 o run
  public void run()
Main function of the sound thread. Sleeps one timestep, update the takt counter and does a repaint. Runs until StopSound() or KillSound() is called.
 o SetCounter
  public void SetCounter(int c)
Set the takt/time counter to c. Needed for the single step mode.
 o GetNumImg
  public Image GetNumImg()
Get the number image suitable to the Counter value and the number of beats for one takt of the current dance.
 o setLastNumImg
  public void setLastNumImg(Image img)
Set last painted number.
See Also:
drawNum
 o getLastNumImg
  public Image getLastNumImg()
Returns the last drawn image.
See Also:
drawNum
 o imageUpdate
  public boolean imageUpdate(Image img,
                             int infoflags,
                             int x,
                             int y,
                             int width,
                             int height)
Manages infos about the number-images.
See Also:
imageUpdate