|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.groovemanager.sampled.fx.FXUnit
This implementation of Mixer is a questionable effort to think of an effect unit as a Mixer. An FXUnit can handle the processing of audio data with an Effect instance. A SourceDataLine for analysis and a SourceDataLine for processing as well as a TargetDataLine for the resulting audio data are provided by this Mixer and the effect´s Controls can also be accessed through the FXUnit.
| Nested Class Summary | |
|---|---|
(package private) class |
FXUnit.FXAnalysisLine
A FXAnalysisLine is used for streaming audio data for analysis into the FXUnit |
(package private) class |
FXUnit.FXSourceDataLine
A FXSourceDataLine is used for streaming audio data into the FXUnit |
(package private) class |
FXUnit.FXTargetDataLine
A FXTargetDataLine is used for reading processed audio data out of the FXUnit |
(package private) class |
FXUnit.Info
Subclass of Mixer.Info to be able to create a new instance |
| Field Summary | |
|---|---|
private FXUnit.FXAnalysisLine |
analysisLine
The SourceDataLine for sending the audio data to be analyzed |
private RingBuffer |
buffer
The RingBuffer into which the FXSourceLine writes its data and from which the FXTargetLine reads its data |
private javax.sound.sampled.AudioFormat |
currentFormat
The current used AudioFormat |
private static int |
DEFAULT_BUFFER_SIZE
The default buffer size for effect processing |
static javax.sound.sampled.AudioFormat |
DEFAULT_FORMAT
A Float encoded 2 channel AudioFormat with NOT_SPECIFIED sample rate for use with DataLine.Info.getFormats() |
private Effect |
effect
The Effect represented by this FXUnit |
static javax.sound.sampled.AudioFormat |
FORMAT
A Float encoded 2 channel AudioFormat with NOT_SPECIFIED sample rate for use with DataLine.Info.getFormats() |
private java.nio.FloatBuffer[] |
inBuffers
Array of two FloatBuffers used for processing |
private java.util.ArrayList |
lineListeners
List of LineListeners |
private boolean |
lineOpen
Indicates whether the FXSourceLine and/or the FXTargetLine are open or not |
private FXUnit.Info |
mixerInfo
The Mixer.Info object for this FXUnit |
private java.nio.FloatBuffer[] |
outBuffers
Array of two FloatBuffers used for processing |
private FXUnit.FXSourceDataLine |
sourceLine
The SourceDataLine for sending the audio data to be processed |
private FXUnit.FXTargetDataLine |
targetLine
The TargetDataLine for receiving the processed audio data |
| Constructor Summary | |
|---|---|
FXUnit(Effect effect)
Create a new FXUnit for the given Effect |
|
| Method Summary | |
|---|---|
void |
addLineListener(javax.sound.sampled.LineListener listener)
|
void |
close()
|
private void |
createBuffers(int bufferSize)
Create the RingBuffer and the needed temporary Buffers for the specified buffer size in bytes |
protected javax.sound.sampled.AudioFormat |
createFormat(float sampleRate)
Create an AudioFormat object with the given sample rate |
protected FXUnit.Info |
createInfo()
Create the Mixer.Info object for this Unit |
javax.sound.sampled.SourceDataLine |
getAnalysisLine()
Get the SourceDataLine that is used for analysis input |
javax.sound.sampled.Control |
getControl(javax.sound.sampled.Control.Type type)
|
javax.sound.sampled.Control[] |
getControls()
|
javax.sound.sampled.SourceDataLine |
getEffectSourceLine()
Get the SourceDataLine used for effect input |
javax.sound.sampled.TargetDataLine |
getEffectTargetLine()
Get the TargetDataLine from which the Effect´s result can be read |
javax.sound.sampled.Line |
getLine(javax.sound.sampled.Line.Info info)
|
javax.sound.sampled.Line.Info |
getLineInfo()
|
int |
getMaxLines(javax.sound.sampled.Line.Info info)
|
javax.sound.sampled.Mixer.Info |
getMixerInfo()
|
javax.sound.sampled.Line.Info[] |
getSourceLineInfo()
|
javax.sound.sampled.Line.Info[] |
getSourceLineInfo(javax.sound.sampled.Line.Info info)
|
javax.sound.sampled.Line[] |
getSourceLines()
|
javax.sound.sampled.Line.Info[] |
getTargetLineInfo()
|
javax.sound.sampled.Line.Info[] |
getTargetLineInfo(javax.sound.sampled.Line.Info info)
|
javax.sound.sampled.Line[] |
getTargetLines()
|
boolean |
isControlSupported(javax.sound.sampled.Control.Type type)
|
boolean |
isLineSupported(javax.sound.sampled.Line.Info info)
|
boolean |
isOpen()
|
boolean |
isSynchronizationSupported(javax.sound.sampled.Line[] lines,
boolean maintainSync)
|
private void |
notifyListeners(javax.sound.sampled.LineEvent.Type type)
Notify all registered LineListeners about a LineEvent |
void |
open()
|
void |
removeLineListener(javax.sound.sampled.LineListener listener)
|
void |
synchronize(javax.sound.sampled.Line[] lines,
boolean maintainSync)
|
void |
unsynchronize(javax.sound.sampled.Line[] lines)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private final FXUnit.FXAnalysisLine analysisLine
private RingBuffer buffer
private javax.sound.sampled.AudioFormat currentFormat
private static final int DEFAULT_BUFFER_SIZE
public static final javax.sound.sampled.AudioFormat DEFAULT_FORMAT
private final Effect effect
public static final javax.sound.sampled.AudioFormat FORMAT
private java.nio.FloatBuffer[] inBuffers
private java.util.ArrayList lineListeners
private boolean lineOpen
private final FXUnit.Info mixerInfo
private java.nio.FloatBuffer[] outBuffers
private final FXUnit.FXSourceDataLine sourceLine
private final FXUnit.FXTargetDataLine targetLine
| Constructor Detail |
|---|
public FXUnit(Effect effect)
effect - The Effect to wrap with an FXUnit| Method Detail |
|---|
public void addLineListener(javax.sound.sampled.LineListener listener)
addLineListener in interface javax.sound.sampled.LineLine.addLineListener(javax.sound.sampled.LineListener)public void close()
close in interface javax.sound.sampled.LineLine.close()private void createBuffers(int bufferSize)
bufferSize - The buffer size in bytesprotected javax.sound.sampled.AudioFormat createFormat(float sampleRate)
sampleRate -
protected FXUnit.Info createInfo()
public javax.sound.sampled.SourceDataLine getAnalysisLine()
public javax.sound.sampled.Control getControl(javax.sound.sampled.Control.Type type)
getControl in interface javax.sound.sampled.LineLine.getControl(javax.sound.sampled.Control.Type)public javax.sound.sampled.Control[] getControls()
getControls in interface javax.sound.sampled.LineLine.getControls()public javax.sound.sampled.SourceDataLine getEffectSourceLine()
public javax.sound.sampled.TargetDataLine getEffectTargetLine()
public javax.sound.sampled.Line getLine(javax.sound.sampled.Line.Info info)
throws javax.sound.sampled.LineUnavailableException
getLine in interface javax.sound.sampled.Mixerjavax.sound.sampled.LineUnavailableExceptionMixer.getLine(javax.sound.sampled.Line.Info)public javax.sound.sampled.Line.Info getLineInfo()
getLineInfo in interface javax.sound.sampled.LineLine.getLineInfo()public int getMaxLines(javax.sound.sampled.Line.Info info)
getMaxLines in interface javax.sound.sampled.MixerMixer.getMaxLines(javax.sound.sampled.Line.Info)public javax.sound.sampled.Mixer.Info getMixerInfo()
getMixerInfo in interface javax.sound.sampled.MixerMixer.getMixerInfo()public javax.sound.sampled.Line.Info[] getSourceLineInfo()
getSourceLineInfo in interface javax.sound.sampled.MixerMixer.getSourceLineInfo()public javax.sound.sampled.Line.Info[] getSourceLineInfo(javax.sound.sampled.Line.Info info)
getSourceLineInfo in interface javax.sound.sampled.MixerMixer.getSourceLineInfo(javax.sound.sampled.Line.Info)public javax.sound.sampled.Line[] getSourceLines()
getSourceLines in interface javax.sound.sampled.MixerMixer.getSourceLines()public javax.sound.sampled.Line.Info[] getTargetLineInfo()
getTargetLineInfo in interface javax.sound.sampled.MixerMixer.getTargetLineInfo()public javax.sound.sampled.Line.Info[] getTargetLineInfo(javax.sound.sampled.Line.Info info)
getTargetLineInfo in interface javax.sound.sampled.MixerMixer.getTargetLineInfo(javax.sound.sampled.Line.Info)public javax.sound.sampled.Line[] getTargetLines()
getTargetLines in interface javax.sound.sampled.MixerMixer.getTargetLines()public boolean isControlSupported(javax.sound.sampled.Control.Type type)
isControlSupported in interface javax.sound.sampled.LineLine.isControlSupported(javax.sound.sampled.Control.Type)public boolean isLineSupported(javax.sound.sampled.Line.Info info)
isLineSupported in interface javax.sound.sampled.MixerMixer.isLineSupported(javax.sound.sampled.Line.Info)public boolean isOpen()
isOpen in interface javax.sound.sampled.LineLine.isOpen()
public boolean isSynchronizationSupported(javax.sound.sampled.Line[] lines,
boolean maintainSync)
isSynchronizationSupported in interface javax.sound.sampled.MixerMixer.isSynchronizationSupported(javax.sound.sampled.Line[], boolean)private void notifyListeners(javax.sound.sampled.LineEvent.Type type)
type - The type of the LineEvent
public void open()
throws javax.sound.sampled.LineUnavailableException
open in interface javax.sound.sampled.Linejavax.sound.sampled.LineUnavailableExceptionLine.open()public void removeLineListener(javax.sound.sampled.LineListener listener)
removeLineListener in interface javax.sound.sampled.LineLine.removeLineListener(javax.sound.sampled.LineListener)
public void synchronize(javax.sound.sampled.Line[] lines,
boolean maintainSync)
synchronize in interface javax.sound.sampled.MixerMixer.synchronize(javax.sound.sampled.Line[], boolean)public void unsynchronize(javax.sound.sampled.Line[] lines)
unsynchronize in interface javax.sound.sampled.MixerMixer.unsynchronize(javax.sound.sampled.Line[])
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||