org.jscience.media.audio.dsp.sources
Class Oscillator

java.lang.Object
  extended by org.jscience.media.audio.dsp.AbstractAudio
      extended by org.jscience.media.audio.dsp.sources.Oscillator
All Implemented Interfaces:
Named
Direct Known Subclasses:
StereoOscillator

public class Oscillator
extends AbstractAudio

DOCUMENT ME!


Field Summary
protected  double amplitudeAdj
          DOCUMENT ME!
protected  int frequency
          DOCUMENT ME!
protected  NegotiationListener negComplete
          DOCUMENT ME!
static int NOISE
          DOCUMENT ME!
static int NOTYPE
          DOCUMENT ME!
protected  int numberOfChannels
          DOCUMENT ME!
protected  int pos
          DOCUMENT ME!
protected  int sampleRate
          DOCUMENT ME!
static int SINEWAVE
          DOCUMENT ME!
static int SQUAREWAVE
          DOCUMENT ME!
static int TRIANGLEWAVE
          DOCUMENT ME!
protected  int type
          DOCUMENT ME!
protected  short[] waveTable
          DOCUMENT ME!
 
Fields inherited from class org.jscience.media.audio.dsp.AbstractAudio
ALLTYPES, MONITOR, next, previous, PROCESSOR, SAMPLEBUFFERSIZE, SINK, SOURCE
 
Constructor Summary
Oscillator(int type, int frequency, int sampleRate, int numberOfChannels, NegotiationListener negComplete)
          Creates a new Oscillator object.
Oscillator(NegotiationListener negComplete)
          Creates a new Oscillator object.
 
Method Summary
protected  void buildWaveTable()
          DOCUMENT ME!
 double getAmplitudeAdj()
          DOCUMENT ME!
 int getFrequency()
          DOCUMENT ME!
 int getNumberOfChannels()
          DOCUMENT ME!
 int getOscType()
          DOCUMENT ME!
 int getSampleRate()
          DOCUMENT ME!
 int getSamples(short[] buffer, int length)
          DOCUMENT ME!
 void minMaxChannels(int min, int max, int preferred)
          DOCUMENT ME!
 void minMaxSamplingRate(int min, int max, int preferred)
          DOCUMENT ME!
 void setAmplitudeAdj(double amplitudeAdj)
          DOCUMENT ME!
 void setFrequency(int frequency)
          DOCUMENT ME!
 void setNumberOfChannels(int numberOfChannels)
          DOCUMENT ME!
 void setOscType(int type)
          DOCUMENT ME!
 void setSampleRate(int sampleRate)
          DOCUMENT ME!
 
Methods inherited from class org.jscience.media.audio.dsp.AbstractAudio
doReset, equals, getByPass, getName, getSamplingRate, hexo, hexo, hexo, hexo, negotiateNumberOfChannels, negotiateSamplingRate, o, propagateReset, reset, setByPass, setChannelsRecursive, setSamplingRate, setSamplingRateRecursive, toString, typeString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

NOTYPE

public static final int NOTYPE
DOCUMENT ME!

See Also:
Constant Field Values

NOISE

public static final int NOISE
DOCUMENT ME!

See Also:
Constant Field Values

SINEWAVE

public static final int SINEWAVE
DOCUMENT ME!

See Also:
Constant Field Values

TRIANGLEWAVE

public static final int TRIANGLEWAVE
DOCUMENT ME!

See Also:
Constant Field Values

SQUAREWAVE

public static final int SQUAREWAVE
DOCUMENT ME!

See Also:
Constant Field Values

type

protected int type
DOCUMENT ME!


frequency

protected int frequency
DOCUMENT ME!


sampleRate

protected int sampleRate
DOCUMENT ME!


numberOfChannels

protected int numberOfChannels
DOCUMENT ME!


negComplete

protected NegotiationListener negComplete
DOCUMENT ME!


pos

protected int pos
DOCUMENT ME!


waveTable

protected short[] waveTable
DOCUMENT ME!


amplitudeAdj

protected double amplitudeAdj
DOCUMENT ME!

Constructor Detail

Oscillator

public Oscillator(int type,
                  int frequency,
                  int sampleRate,
                  int numberOfChannels,
                  NegotiationListener negComplete)
Creates a new Oscillator object.

Parameters:
type - DOCUMENT ME!
frequency - DOCUMENT ME!
sampleRate - DOCUMENT ME!
numberOfChannels - DOCUMENT ME!
negComplete - DOCUMENT ME!

Oscillator

public Oscillator(NegotiationListener negComplete)
Creates a new Oscillator object.

Parameters:
negComplete - DOCUMENT ME!
Method Detail

getOscType

public int getOscType()
DOCUMENT ME!

Returns:
DOCUMENT ME!

setOscType

public void setOscType(int type)
DOCUMENT ME!

Parameters:
type - DOCUMENT ME!

getFrequency

public int getFrequency()
DOCUMENT ME!

Returns:
DOCUMENT ME!

setFrequency

public void setFrequency(int frequency)
DOCUMENT ME!

Parameters:
frequency - DOCUMENT ME!

getSampleRate

public int getSampleRate()
DOCUMENT ME!

Returns:
DOCUMENT ME!

setSampleRate

public void setSampleRate(int sampleRate)
DOCUMENT ME!

Parameters:
sampleRate - DOCUMENT ME!

getNumberOfChannels

public int getNumberOfChannels()
DOCUMENT ME!

Overrides:
getNumberOfChannels in class AbstractAudio
Returns:
DOCUMENT ME!

setNumberOfChannels

public void setNumberOfChannels(int numberOfChannels)
DOCUMENT ME!

Overrides:
setNumberOfChannels in class AbstractAudio
Parameters:
numberOfChannels - DOCUMENT ME!

getAmplitudeAdj

public double getAmplitudeAdj()
DOCUMENT ME!

Returns:
DOCUMENT ME!

setAmplitudeAdj

public void setAmplitudeAdj(double amplitudeAdj)
DOCUMENT ME!

Parameters:
amplitudeAdj - DOCUMENT ME!

buildWaveTable

protected void buildWaveTable()
DOCUMENT ME!


getSamples

public int getSamples(short[] buffer,
                      int length)
DOCUMENT ME!

Specified by:
getSamples in class AbstractAudio
Parameters:
buffer - DOCUMENT ME!
length - DOCUMENT ME!
Returns:
DOCUMENT ME!

minMaxSamplingRate

public void minMaxSamplingRate(int min,
                               int max,
                               int preferred)
DOCUMENT ME!

Overrides:
minMaxSamplingRate in class AbstractAudio
Parameters:
min - DOCUMENT ME!
max - DOCUMENT ME!
preferred - DOCUMENT ME!

minMaxChannels

public void minMaxChannels(int min,
                           int max,
                           int preferred)
DOCUMENT ME!

Overrides:
minMaxChannels in class AbstractAudio
Parameters:
min - DOCUMENT ME!
max - DOCUMENT ME!
preferred - DOCUMENT ME!