com.groovemanager.sampled.fx
Class AbstractAnalyzeEffect

java.lang.Object
  extended by com.groovemanager.sampled.fx.AbstractEffect
      extended by com.groovemanager.sampled.fx.AbstractAnalyzeEffect
All Implemented Interfaces:
Effect
Direct Known Subclasses:
Normalizer

public abstract class AbstractAnalyzeEffect
extends AbstractEffect

Abstract superclass to be used for implementations of Effects that need an analyzation of the audio data before they can process it.

Author:
Manu Robledo

Field Summary
private  boolean analyzing
          Indicates whether this Effect is currently analyzing or not
 
Fields inherited from class com.groovemanager.sampled.fx.AbstractEffect
sampleRate
 
Constructor Summary
AbstractAnalyzeEffect(java.lang.String name)
          Construct a new Effect with the given name
 
Method Summary
abstract  void analyze(java.nio.FloatBuffer[] in)
          Analyze a buffer of audio data
 boolean isAnalyzing()
          Indicates whether this Effect is currently expecting calls to analyze() or not.
 boolean needsAnalysis()
          Ask this Effect, if it needs to analyze the whole audio data before being able to process it
 void startAnalysis(float sampleRate)
          If this Effects needs to analyze the whole audio data before processing, an analyzation will be done before the processing.
 void stopAnalysis()
          Indicate that the analyzation process has been finished and no more calls to analyze() are to be expected before the next call to startAnalysis().
 
Methods inherited from class com.groovemanager.sampled.fx.AbstractEffect
close, getControl, getControls, getName, isControlSupported, isOpen, isUndoable, open, process, undoEffect
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

analyzing

private boolean analyzing
Indicates whether this Effect is currently analyzing or not

Constructor Detail

AbstractAnalyzeEffect

public AbstractAnalyzeEffect(java.lang.String name)
Construct a new Effect with the given name

Parameters:
name - The effect name
Method Detail

analyze

public abstract void analyze(java.nio.FloatBuffer[] in)
Description copied from interface: Effect
Analyze a buffer of audio data

Specified by:
analyze in interface Effect
Overrides:
analyze in class AbstractEffect
Parameters:
in - Array of two FloatBuffers containing the audio data to be analyzed for the left (index [0]) and the right (index [1]) channel.
See Also:
AbstractEffect.analyze(java.nio.FloatBuffer[])

isAnalyzing

public boolean isAnalyzing()
Description copied from interface: Effect
Indicates whether this Effect is currently expecting calls to analyze() or not.

Specified by:
isAnalyzing in interface Effect
Overrides:
isAnalyzing in class AbstractEffect
Returns:
true, if this Effect is currently in analyzing state, false otherwise
See Also:
AbstractEffect.isAnalyzing()

needsAnalysis

public boolean needsAnalysis()
Description copied from interface: Effect
Ask this Effect, if it needs to analyze the whole audio data before being able to process it

Specified by:
needsAnalysis in interface Effect
Overrides:
needsAnalysis in class AbstractEffect
Returns:
true, if anayzation is needed by this Effect, false otherwise
See Also:
AbstractEffect.needsAnalysis()

startAnalysis

public void startAnalysis(float sampleRate)
Description copied from interface: Effect
If this Effects needs to analyze the whole audio data before processing, an analyzation will be done before the processing. This method will be called to indicate that analyzation starts and will usually be followed by a number of calls to analyze() and an optional final call to stopAnalysis(). After finishing analyzation open() to start processing. so an analyzing Effect is not necessarily open.

Specified by:
startAnalysis in interface Effect
Overrides:
startAnalysis in class AbstractEffect
Parameters:
sampleRate - The sample rate of the audio data to be analyzed
See Also:
Effect.startAnalysis(float)

stopAnalysis

public void stopAnalysis()
Description copied from interface: Effect
Indicate that the analyzation process has been finished and no more calls to analyze() are to be expected before the next call to startAnalysis(). This method is optional.

Specified by:
stopAnalysis in interface Effect
Overrides:
stopAnalysis in class AbstractEffect
See Also:
AbstractEffect.stopAnalysis()