tapeutils
Interface WaveProcessor

All Known Implementing Classes:
ZX81WaveProcessor

public interface WaveProcessor

This class provides the representation of a sample sound.

Author:
hldswrth

Method Summary
 int checkGroupGap(int lastEnd, int nextStart)
          Check the gap between the given groups.
 int getActualMaxGroupGap()
          Get the actual maximum group gap.
 int getActualMaxOneLength()
          Get the actual maximum one length.
 int getActualMaxZeroLength()
          Get the actual maximum zero length.
 int getActualMinGroupGap()
          Get the actual minimum group gap.
 int getActualMinOneLength()
          Get the actual minimum one length.
 int getActualMinZeroLength()
          Get the actual minimum zero length.
 void initialize()
          Initialize this object ready for processing a sample.
 int processWave(int waveStart, int waveEnd, int amplitude, int minLength, int maxLength, int currentPos)
          Process a wave.
 void setWaveIdentifier(WaveIdentifier identifier)
          Set the object to be used to identify waves.
 

Method Detail

setWaveIdentifier

public void setWaveIdentifier(WaveIdentifier identifier)
Set the object to be used to identify waves.

Parameters:
identifier - The wave identifier.

initialize

public void initialize()
Initialize this object ready for processing a sample.


processWave

public int processWave(int waveStart,
                       int waveEnd,
                       int amplitude,
                       int minLength,
                       int maxLength,
                       int currentPos)
Process a wave.

Parameters:
waveStart - The start of the wave.
waveEnd - The end of the wave.
amplitude - The amplitude of the wave.
minLength - The minimum allowed wavelength.
maxLength - The maximum allowed wavelength.
currentPos - The current sample position.
Returns:
The position in the sample at which processing should continue.

checkGroupGap

public int checkGroupGap(int lastEnd,
                         int nextStart)
Check the gap between the given groups.

Parameters:
lastEnd - The last group end.
nextStart - The next group start.
Returns:
The suggested gap, or 0 if its OK.

getActualMinGroupGap

public int getActualMinGroupGap()
Get the actual minimum group gap.

Returns:
The actual minimum group gap.

getActualMaxGroupGap

public int getActualMaxGroupGap()
Get the actual maximum group gap.

Returns:
The actual maximum group gap.

getActualMinZeroLength

public int getActualMinZeroLength()
Get the actual minimum zero length.

Returns:
The actual minimum zero length.

getActualMaxZeroLength

public int getActualMaxZeroLength()
Get the actual maximum zero length.

Returns:
The actual maximum zero length.

getActualMinOneLength

public int getActualMinOneLength()
Get the actual minimum one length.

Returns:
The actual minimum one length.

getActualMaxOneLength

public int getActualMaxOneLength()
Get the actual maximum one length.

Returns:
The actual maximum one length.