com.groovemanager.sampled.waveform
Class ConcatWaveForm

java.lang.Object
  extended by com.groovemanager.sampled.waveform.AbstractWaveForm
      extended by com.groovemanager.sampled.waveform.ConcatWaveForm
All Implemented Interfaces:
WaveForm

public class ConcatWaveForm
extends AbstractWaveForm

This WaveForm implementation can be used to concatenate a given number of WaveForms into a new one. The WaveForms must all have the same number of channels.

Author:
Manu Robledo

Field Summary
protected  WaveForm[] sources
          The source WaveForms to concatenate
 
Fields inherited from class com.groovemanager.sampled.waveform.AbstractWaveForm
channels, displayWidth, intervallSize, nullWave, position, realLength
 
Constructor Summary
ConcatWaveForm(WaveForm[] sources)
          Construct a new ConcatWaveForm out of the given WaveForms
 
Method Summary
 byte getMax(int channel)
          Get the maximum value at the current read position in the given channel
 byte getMin(int channel)
          Get the minimum value at the current read position in the given channel
 
Methods inherited from class com.groovemanager.sampled.waveform.AbstractWaveForm
canProvide, getAdditionalToString, getChannels, getData, getDisplayableLength, getIntervallSize, getPosition, getRealLength, getRealPosition, getZoomFactor, next, rewind, setPosition, setRealPosition, subWaveForm, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

sources

protected WaveForm[] sources
The source WaveForms to concatenate

Constructor Detail

ConcatWaveForm

public ConcatWaveForm(WaveForm[] sources)
Construct a new ConcatWaveForm out of the given WaveForms

Parameters:
sources - The WaveForms to concatenate. Must all have the same number of channels
Throws:
java.lang.IllegalArgumentException - If no WaveForms are supplied or if not all of the given WaveForms have the same number of channels
Method Detail

getMax

public byte getMax(int channel)
Description copied from interface: WaveForm
Get the maximum value at the current read position in the given channel

Parameters:
channel - the zero-based index of the channel
Returns:
the maximum value at this position as byte

getMin

public byte getMin(int channel)
Description copied from interface: WaveForm
Get the minimum value at the current read position in the given channel

Parameters:
channel - the zero-based index of the channel
Returns:
the minimum value at this position as byte