ads.audio
Class AudioTrack

java.lang.Object
  |
  +--ads.AbstractTrack
        |
        +--ads.audio.AudioTrack
All Implemented Interfaces:
java.awt.event.ActionListener, ControlContext, java.util.EventListener

public class AudioTrack
extends AbstractTrack
implements java.awt.event.ActionListener, ControlContext

This is the class that handles the capture, playback, and waveform display of audio data. A vector of these objects is created in MainFrame class; one for each audio track.


Nested Class Summary
 class AudioTrack.Capture
          Reads data from the input channel and writes to the output stream
 class AudioTrack.Playback
          Write data to the OutputChannel.
 class AudioTrack.SamplingGraph
          Render a WaveForm.
 
Field Summary
 AudioTrack.Capture capture
           
 AudioTrack.Playback playback
           
 AudioTrack.SamplingGraph samplingGraph
           
 
Constructor Summary
AudioTrack()
           
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent e)
           
 void close()
           
 void createAudioInputStream(java.io.File file, boolean updateComponents)
           
 void load()
           
 void open()
           
 void saveToFile(java.lang.String name, javax.sound.sampled.AudioFileFormat.Type fileType)
           
 void setGain(int gain)
          Sets the gain for this track.
 
Methods inherited from class ads.AbstractTrack
getDeviceName, getFileName, getInputDeviceNumber, getLength, getName, getOutputDeviceNumber, getPosition, getTrackNumber, isAudioBoolean, isLoopBoolean, isMidiBoolean, isMute, isPlay, isRecord, isSolo, setAudioBoolean, setDeviceName, setFileName, setInputDeviceNumber, setLength, setLoopBoolean, setMidiBoolean, setMute, setName, setOutputDeviceNumber, setPlay, setPosition, setRecord, setSolo, setTrackNumber
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

capture

public AudioTrack.Capture capture

playback

public AudioTrack.Playback playback

samplingGraph

public AudioTrack.SamplingGraph samplingGraph
Constructor Detail

AudioTrack

public AudioTrack()
Method Detail

open

public void open()
Specified by:
open in interface ControlContext

close

public void close()
Specified by:
close in interface ControlContext

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent e)
Specified by:
actionPerformed in interface java.awt.event.ActionListener

load

public void load()

createAudioInputStream

public void createAudioInputStream(java.io.File file,
                                   boolean updateComponents)

saveToFile

public void saveToFile(java.lang.String name,
                       javax.sound.sampled.AudioFileFormat.Type fileType)

setGain

public void setGain(int gain)
Description copied from class: AbstractTrack
Sets the gain for this track. This is called by the setVol(int val)method of the selected Channel object of the Mixer object.

Overrides:
setGain in class AbstractTrack