org.tritonus.saol.engine
Class Bus

java.lang.Object
  extended by org.tritonus.saol.engine.Bus
All Implemented Interfaces:
Output
Direct Known Subclasses:
AudioOutputStreamOutput

public class Bus
extends java.lang.Object
implements Output

Bus in the SA engine. This interface abstracts the way calculated samples are output from the engine. The engine only calls this interface, while implementations of this interface write the samples to a file, a line, a network socket or whatever else.


Constructor Summary
Bus(int nWidth)
           
 
Method Summary
 void clear()
          Initiate the cumulation of a sample value.
 float[] getValues()
           
 int getWidth()
          Gives the width of this bus.
 void output(float fSample)
          Add the sample value of one instrument.
 void output(float[] afSamples)
          Add sample values of one instrument.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Bus

public Bus(int nWidth)
Method Detail

getWidth

public int getWidth()
Gives the width of this bus.

Specified by:
getWidth in interface Output

clear

public void clear()
Initiate the cumulation of a sample value. Sets the values of all samples to 0.0. This method must be called in an a-cycle before any instrument's a-cycle code is executed.

Specified by:
clear in interface Output

output

public void output(float fSample)
Add the sample value of one instrument. This method can be called by instrument's a-cycle code to output the sample value the instrument has calculated for this a-cycle. The current hacky version allows only for mono samples.

Specified by:
output in interface Output

output

public void output(float[] afSamples)
Add sample values of one instrument. This method can be called by instrument's a-cycle code to output the sample value the instrument has calculated for this a-cycle. The current hacky version allows only for mono samples.

Specified by:
output in interface Output

getValues

public float[] getValues()