Class SoundExplorer

java.lang.Object
  extended by SoundExplorer
All Implemented Interfaces:
ActionListener, MouseListener, MouseMotionListener, EventListener, LineListener

public class SoundExplorer
extends Object
implements MouseMotionListener, ActionListener, MouseListener, LineListener

This class allows you to explore a Sound. You can see the line drawing of the sound samples and play all or part of a sound. You can zoom in to see all the samples in the sound or zoom out to see the entire sound. You can click on the sound wave to see the value at that index. Copyright Georgia Institute of Technology 2004

Author:
Keith McDermottt, gte047w@cc.gatech.edu, Barb Ericson ericson@cc.gatech.edu

Constructor Summary
SoundExplorer(SimpleSound sound, boolean inStereo)
          Constructor that takes a sound and a boolean flag
 
Method Summary
 void actionPerformed(ActionEvent e)
          Method to handle an action event
 void checkScroll()
          Method to check that the current position is in the viewing area and if not scroll to center the current position if possible
 void mouseClicked(MouseEvent e)
          Handle a mouse click event
 void mouseDragged(MouseEvent e)
          Method to handle a mouse dragged event
 void mouseEntered(MouseEvent e)
          Method to handle a mouse entered event
 void mouseExited(MouseEvent e)
          Method to handle a mouse exited event
 void mouseMoved(MouseEvent e)
          Method to handle a mouse move event
 void mousePressed(MouseEvent e)
          Method to handle a mouse press
 void mouseReleased(MouseEvent e)
          Method to handle a mouse release
 void setBase(int base)
          Method to set the base for the index.
 void setTitle(String s)
          Method to set the title on the main window
 void update(LineEvent e)
          Method to handle the line event update
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SoundExplorer

public SoundExplorer(SimpleSound sound,
                     boolean inStereo)
Constructor that takes a sound and a boolean flag

Parameters:
sound - the sound to view
inStereo - true if you want to show it in stereo
Method Detail

setTitle

public void setTitle(String s)
Method to set the title on the main window

Parameters:
s - the string to use as the title

mouseClicked

public void mouseClicked(MouseEvent e)
Handle a mouse click event

Specified by:
mouseClicked in interface MouseListener
Parameters:
e - the mouse event

mousePressed

public void mousePressed(MouseEvent e)
Method to handle a mouse press

Specified by:
mousePressed in interface MouseListener
Parameters:
e - the mouse event

mouseReleased

public void mouseReleased(MouseEvent e)
Method to handle a mouse release

Specified by:
mouseReleased in interface MouseListener
Parameters:
e - the mouse event

mouseEntered

public void mouseEntered(MouseEvent e)
Method to handle a mouse entered event

Specified by:
mouseEntered in interface MouseListener
Parameters:
e - the mouse event

mouseExited

public void mouseExited(MouseEvent e)
Method to handle a mouse exited event

Specified by:
mouseExited in interface MouseListener
Parameters:
e - the mouse event

mouseDragged

public void mouseDragged(MouseEvent e)
Method to handle a mouse dragged event

Specified by:
mouseDragged in interface MouseMotionListener
Parameters:
e - the mouse event

mouseMoved

public void mouseMoved(MouseEvent e)
Method to handle a mouse move event

Specified by:
mouseMoved in interface MouseMotionListener
Parameters:
e - the mouse event

update

public void update(LineEvent e)
Method to handle the line event update

Specified by:
update in interface LineListener
Parameters:
e - the line event

actionPerformed

public void actionPerformed(ActionEvent e)
Method to handle an action event

Specified by:
actionPerformed in interface ActionListener
Parameters:
e - the action event

checkScroll

public void checkScroll()
Method to check that the current position is in the viewing area and if not scroll to center the current position if possible


setBase

public void setBase(int base)
Method to set the base for the index. The default is a base of 0.

Parameters:
base - the new base to use (for example use setBase(1)) to use base 1 instead of 0