public class FrameNumberFilter extends AbstractSignalProcessor<AudioBuffer,AudioBuffer>
Allows to ignore AudioBuffer
s, if their first frame number as returned by
AudioBuffer.getFrameNumber()
does not fall into a specified
range. Note, that the max frame number is exclusive.
If the end of the buffer is higher than max frames, it is still let through, if the beginning is lower.
lastOut, signalProcessorSupport
Constructor and Description |
---|
FrameNumberFilter(int minFrameNumber,
int maxFrameNumber)
Creates a 'gatekeeper' for buffers with certain frame numbers.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object o) |
int |
getMaxFrameNumber() |
int |
getMinFrameNumber() |
int |
hashCode() |
void |
process(AudioBuffer buffer)
Asks this processor to work on the provided data and pipe the
output to the connected processors' own
SignalProcessor.process(Object) method.Implementing methods must not modify or hold on to the provided data. |
protected AudioBuffer |
processNext(AudioBuffer buffer)
Processes the given input and returns some output.
|
AudioBuffer |
read()
Provide the next chunk of output data.
|
void |
setMaxFrameNumber(int maxFrameNumber) |
void |
setMinFrameNumber(int minFrameNumber) |
String |
toString() |
connectTo, connectTo, connectTo, disconnectFrom, flush, getConnectedProcessors, getConnectedSource, getId, getOutput, reset, setId
public FrameNumberFilter(int minFrameNumber, int maxFrameNumber)
minFrameNumber
- each buffer's first frame number has to be at least as big as thismaxFrameNumber
- if a buffer's first frame number is equal or greater, the whole buffer will be ignoredpublic int getMinFrameNumber()
public void setMinFrameNumber(int minFrameNumber)
public int getMaxFrameNumber()
public void setMaxFrameNumber(int maxFrameNumber)
protected AudioBuffer processNext(AudioBuffer buffer) throws IOException
AbstractSignalProcessor
processNext
in class AbstractSignalProcessor<AudioBuffer,AudioBuffer>
buffer
- input guaranteed not to be null
.IOException
- if an IO error occurspublic AudioBuffer read() throws IOException
SignalSource
SignalSource
data, typically an SignalPullProcessor
.read
in interface SignalSource<AudioBuffer>
read
in class AbstractSignalProcessor<AudioBuffer,AudioBuffer>
AudioBuffer
, null
if no more data is availableIOException
- if something goes wrongpublic void process(AudioBuffer buffer) throws IOException
SignalProcessor
SignalProcessor.process(Object)
method.Object.clone()
method.
It is the responsibility of implementing classes to call the SignalProcessor.process(Object)
method of any connected processors. To manage connected processors classes may want
to use a SignalProcessorSupport
instance.process
in interface SignalProcessor<AudioBuffer,AudioBuffer>
process
in class AbstractSignalProcessor<AudioBuffer,AudioBuffer>
buffer
- data to processIOException
- if a processing error occursSignalProcessor.getConnectedProcessors()
Copyright © 2011–2020 tagtraum industries incorporated. All rights reserved.