|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.groovemanager.spi.asio.ASIODataLine
public class ASIODataLine
This class implements SourceDataLine as well as TargetDataLine because input and output processing is similar in ASIO. All lines provided by the ASIOMixer will be instances of this class.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface javax.sound.sampled.DataLine |
|---|
DataLine.Info |
| Field Summary | |
|---|---|
(package private) ByteBuffer[][] |
asioBuffers
The real asioBuffers. |
(package private) int |
channels
Number of channels associated with this line right now |
private Control[] |
controls
the Controls for this line |
private int |
desiredBufferSize
The buffersize in bytes specified to open(AudioFormat, int) |
private byte[] |
emptyArray
an empty array for flushing |
private boolean |
flushed
indicates whether flus() has been called lately on this line |
private AudioFormat |
format
The format of this line when its running |
private int |
frameSize
frameSize of the current format |
private ASIOLineInfo |
info
THE ASIOLineInfo object corresponding to this line |
private ArrayList<LineListener> |
listeners
List of the registered LineListeners |
private ASIOMixer |
mixer
The ASIOMixer instance which created this line |
private boolean |
open
Indicates if this line is open |
private long |
openSeq
Sequence number used when opening this line. |
(package private) DoubleHalfRingBuffer[] |
ringBuffers
A RingBuffer for each channel wrapped around the two buffer halfs |
private int |
sampleSize
sample size of the current format |
private boolean |
started
indicates whether this line has been started or not |
| Constructor Summary | |
|---|---|
ASIODataLine(ASIOMixer mixer,
ASIOLineInfo info)
|
|
| Method Summary | |
|---|---|
void |
addLineListener(LineListener listener)
|
int |
available()
|
void |
close()
|
(package private) void |
closed()
called from the Mixer to indicate that this line has been closed |
void |
drain()
|
void |
finalize()
|
void |
flush()
|
int |
getBufferSize()
|
(package private) int |
getChannel()
Get the channel index of the first channel that belongs to this line |
Control |
getControl(Control.Type control)
Will return a Clock Source Control for Selection of the Clock Source |
Control[] |
getControls()
Will return a Clock Source Control for Selection of the Clock Source |
AudioFormat |
getFormat()
|
int |
getFramePosition()
|
float |
getLevel()
ASIO doesn't support this. |
ASIOLineInfo |
getLineInfo()
|
long |
getLongFramePosition()
|
long |
getMicrosecondPosition()
|
(package private) ASIOMixer |
getMixer()
Get the ASIOMixer to which this Line belongs |
boolean |
isActive()
|
boolean |
isControlSupported(Control.Type control)
Only a Clock Source Control for Selection of the Clock Source is supported |
boolean |
isInput()
Tells if this Line is used as In- or Output |
boolean |
isOpen()
|
boolean |
isRunning()
|
private void |
notifyListeners(LineEvent e)
Notify the line listeners |
void |
open()
If no arguments are specified to open(), the preferred buffer
size will be used and the Format will be Mono with the preferred Sample Rate |
void |
open(AudioFormat format)
|
void |
open(AudioFormat format,
int buffersize)
|
(package private) void |
opened(long seq,
ByteBuffer[][] buffers)
called from the Mixer to indicate that this line has been opened |
int |
read(byte[] b,
int off,
int len)
|
void |
removeLineListener(LineListener listener)
|
void |
start()
|
(package private) void |
started()
called from the Mixer to indicate that this line has been started |
void |
stop()
|
(package private) void |
stopped()
called from the Mixer to indicate that this line has been stopped |
int |
write(byte[] b,
int off,
int len)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
DoubleHalfRingBuffer[] ringBuffers
ByteBuffer[][] asioBuffers
private ArrayList<LineListener> listeners
private ASIOMixer mixer
private ASIOLineInfo info
private int desiredBufferSize
private boolean open
private AudioFormat format
int channels
private long openSeq
private int frameSize
private int sampleSize
private boolean started
private boolean flushed
private Control[] controls
private byte[] emptyArray
| Constructor Detail |
|---|
ASIODataLine(ASIOMixer mixer,
ASIOLineInfo info)
| Method Detail |
|---|
ASIOMixer getMixer()
public void drain()
drain in interface DataLinepublic void flush()
flush in interface DataLinepublic void start()
start in interface DataLinepublic void stop()
stop in interface DataLinepublic boolean isRunning()
isRunning in interface DataLinepublic boolean isActive()
isActive in interface DataLinepublic AudioFormat getFormat()
getFormat in interface DataLinepublic int getBufferSize()
getBufferSize in interface DataLinepublic int available()
available in interface DataLinepublic int getFramePosition()
getFramePosition in interface DataLinepublic long getMicrosecondPosition()
getMicrosecondPosition in interface DataLinepublic float getLevel()
AudioSystem.NOT_SPECIFIED will be returned.
getLevel in interface DataLineDataLine.getLevel()public ASIOLineInfo getLineInfo()
getLineInfo in interface Line
public void open()
throws LineUnavailableException
open(), the preferred buffer
size will be used and the Format will be Mono with the preferred Sample Rate
open in interface LineLineUnavailableExceptionLine.open()public void close()
close in interface Linepublic boolean isOpen()
isOpen in interface Linepublic Control[] getControls()
getControls in interface LineLine.getControls()public boolean isControlSupported(Control.Type control)
isControlSupported in interface LineLine.isControlSupported(javax.sound.sampled.Control.Type)public Control getControl(Control.Type control)
getControl in interface LineLine.getControl(javax.sound.sampled.Control.Type)public void addLineListener(LineListener listener)
addLineListener in interface Linepublic void removeLineListener(LineListener listener)
removeLineListener in interface Line
public void open(AudioFormat format,
int buffersize)
throws LineUnavailableException
open in interface SourceDataLineopen in interface TargetDataLineLineUnavailableException
public void open(AudioFormat format)
throws LineUnavailableException
open in interface SourceDataLineopen in interface TargetDataLineLineUnavailableException
public int read(byte[] b,
int off,
int len)
read in interface TargetDataLine
public int write(byte[] b,
int off,
int len)
write in interface SourceDataLineint getChannel()
public boolean isInput()
void opened(long seq,
ByteBuffer[][] buffers)
seq - The sequence number that should be used for closingbuffers - The asioBuffersvoid started()
private void notifyListeners(LineEvent e)
e - The LineEventvoid stopped()
void closed()
public void finalize()
finalize in class Objectpublic long getLongFramePosition()
getLongFramePosition in interface DataLine
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||