public static class LSL.StreamInlet
extends java.lang.Object
Constructor and Description |
---|
LSL.StreamInlet(LSL.StreamInfo info) |
LSL.StreamInlet(LSL.StreamInfo info,
int max_buflen) |
LSL.StreamInlet(LSL.StreamInfo info,
int max_buflen,
int max_chunklen) |
LSL.StreamInlet(LSL.StreamInfo info,
int max_buflen,
int max_chunklen,
boolean recover)
Construct a new stream inlet from a resolved stream info.
|
Modifier and Type | Method and Description |
---|---|
void |
close_stream()
Drop the current data stream.
|
void |
close()
Disconnect and close the inlet.
|
LSL.StreamInfo |
info() |
LSL.StreamInfo |
info(double timeout)
Retrieve the complete information of the given stream, including the extended description.
|
void |
open_stream() |
void |
open_stream(double timeout)
Subscribe to the data stream.
|
int |
pull_chunk(byte[] data_buffer,
double[] timestamp_buffer) |
int |
pull_chunk(byte[] data_buffer,
double[] timestamp_buffer,
double timeout) |
int |
pull_chunk(double[] data_buffer,
double[] timestamp_buffer) |
int |
pull_chunk(double[] data_buffer,
double[] timestamp_buffer,
double timeout) |
int |
pull_chunk(float[] data_buffer,
double[] timestamp_buffer) |
int |
pull_chunk(float[] data_buffer,
double[] timestamp_buffer,
double timeout)
Pull a chunk of data from the inlet.
|
int |
pull_chunk(int[] data_buffer,
double[] timestamp_buffer) |
int |
pull_chunk(int[] data_buffer,
double[] timestamp_buffer,
double timeout) |
int |
pull_chunk(short[] data_buffer,
double[] timestamp_buffer) |
int |
pull_chunk(short[] data_buffer,
double[] timestamp_buffer,
double timeout) |
int |
pull_chunk(java.lang.String[] data_buffer,
double[] timestamp_buffer) |
int |
pull_chunk(java.lang.String[] data_buffer,
double[] timestamp_buffer,
double timeout) |
double |
pull_sample(byte[] sample) |
double |
pull_sample(byte[] sample,
double timeout) |
double |
pull_sample(double[] sample) |
double |
pull_sample(double[] sample,
double timeout) |
double |
pull_sample(float[] sample) |
double |
pull_sample(float[] sample,
double timeout)
Pull a sample from the inlet and read it into an array of values.
|
double |
pull_sample(int[] sample) |
double |
pull_sample(int[] sample,
double timeout) |
double |
pull_sample(short[] sample) |
double |
pull_sample(short[] sample,
double timeout) |
double |
pull_sample(java.lang.String[] sample) |
double |
pull_sample(java.lang.String[] sample,
double timeout) |
int |
samples_available()
Query whether samples are currently available for immediate pickup.
|
double |
time_correction() |
double |
time_correction(double timeout)
Retrieve an estimated time correction offset for the given stream.
|
boolean |
was_clock_reset()
Query whether the clock was potentially reset since the last call to was_clock_reset().
|
public LSL.StreamInlet(LSL.StreamInfo info, int max_buflen, int max_chunklen, boolean recover)
info
- A resolved stream info object (as coming from one of the resolver functions).
Note: the stream_inlet may also be constructed with a fully-specified stream_info,
if the desired channel format and count is already known up-front, but this is
strongly discouraged and should only ever be done if there is no time to resolve the
stream up-front (e.g., due to limitations in the client program).max_buflen
- Optionally the maximum amount of data to buffer (in seconds if there is a nominal
sampling rate, otherwise x100 in samples). Recording applications want to use a fairly
large buffer size here, while real-time applications would only buffer as much as
they need to perform their next calculation.max_chunklen
- Optionally the maximum size, in samples, at which chunks are transmitted
(the default corresponds to the chunk sizes used by the sender).
Recording applications can use a generous size here (leaving it to the network how
to pack things), while real-time applications may want a finer (perhaps 1-sample) granularity.
If left unspecified (=0), the sender determines the chunk granularity.recover
- Try to silently recover lost streams that are recoverable (=those that that have a source_id set).
In all other cases (recover is false or the stream is not recoverable) functions may throw a
LostException if the stream's source is lost (e.g., due to an app or computer crash).public LSL.StreamInlet(LSL.StreamInfo info, int max_buflen, int max_chunklen)
public LSL.StreamInlet(LSL.StreamInfo info, int max_buflen)
public LSL.StreamInlet(LSL.StreamInfo info)
public void close()
public LSL.StreamInfo info(double timeout) throws java.lang.Exception
timeout
- Timeout of the operation (default: no timeout).LSL.TimeoutException
- (if the timeout expires), or LostException (if the stream source has been lost).java.lang.Exception
public LSL.StreamInfo info() throws java.lang.Exception
java.lang.Exception
public void open_stream(double timeout) throws java.lang.Exception
timeout
- Optional timeout of the operation (default: no timeout).LSL.TimeoutException
- (if the timeout expires), or LostException (if the stream source has been lost).java.lang.Exception
public void open_stream() throws java.lang.Exception
java.lang.Exception
public void close_stream()
public double time_correction(double timeout) throws java.lang.Exception
LSL.TimeoutException
- (if the timeout expires), or LostException (if the stream source has been lost).java.lang.Exception
public double time_correction() throws java.lang.Exception
java.lang.Exception
public double pull_sample(float[] sample, double timeout) throws java.lang.Exception
sample
- An array to hold the resulting values.timeout
- The timeout for this operation, if any.LSL.LostException
- (if the stream source has been lost).java.lang.Exception
public double pull_sample(float[] sample) throws java.lang.Exception
java.lang.Exception
public double pull_sample(double[] sample, double timeout) throws java.lang.Exception
java.lang.Exception
public double pull_sample(double[] sample) throws java.lang.Exception
java.lang.Exception
public double pull_sample(int[] sample, double timeout) throws java.lang.Exception
java.lang.Exception
public double pull_sample(int[] sample) throws java.lang.Exception
java.lang.Exception
public double pull_sample(short[] sample, double timeout) throws java.lang.Exception
java.lang.Exception
public double pull_sample(short[] sample) throws java.lang.Exception
java.lang.Exception
public double pull_sample(byte[] sample, double timeout) throws java.lang.Exception
java.lang.Exception
public double pull_sample(byte[] sample) throws java.lang.Exception
java.lang.Exception
public double pull_sample(java.lang.String[] sample, double timeout) throws java.lang.Exception
java.lang.Exception
public double pull_sample(java.lang.String[] sample) throws java.lang.Exception
java.lang.Exception
public int pull_chunk(float[] data_buffer, double[] timestamp_buffer, double timeout) throws java.lang.Exception
data_buffer
- A pre-allocated buffer where the channel data shall be stored.timestamp_buffer
- A pre-allocated buffer where time stamps shall be stored.timeout
- Optionally the timeout for this operation, if any. When the timeout expires, the function
may return before the entire buffer is filled. The default value of 0.0 will retrieve only
data available for immediate pickup.LSL.LostException
- (if the stream source has been lost).java.lang.Exception
public int pull_chunk(float[] data_buffer, double[] timestamp_buffer) throws java.lang.Exception
java.lang.Exception
public int pull_chunk(double[] data_buffer, double[] timestamp_buffer, double timeout) throws java.lang.Exception
java.lang.Exception
public int pull_chunk(double[] data_buffer, double[] timestamp_buffer) throws java.lang.Exception
java.lang.Exception
public int pull_chunk(short[] data_buffer, double[] timestamp_buffer, double timeout) throws java.lang.Exception
java.lang.Exception
public int pull_chunk(short[] data_buffer, double[] timestamp_buffer) throws java.lang.Exception
java.lang.Exception
public int pull_chunk(byte[] data_buffer, double[] timestamp_buffer, double timeout) throws java.lang.Exception
java.lang.Exception
public int pull_chunk(byte[] data_buffer, double[] timestamp_buffer) throws java.lang.Exception
java.lang.Exception
public int pull_chunk(int[] data_buffer, double[] timestamp_buffer, double timeout) throws java.lang.Exception
java.lang.Exception
public int pull_chunk(int[] data_buffer, double[] timestamp_buffer) throws java.lang.Exception
java.lang.Exception
public int pull_chunk(java.lang.String[] data_buffer, double[] timestamp_buffer, double timeout) throws java.lang.Exception
java.lang.Exception
public int pull_chunk(java.lang.String[] data_buffer, double[] timestamp_buffer) throws java.lang.Exception
java.lang.Exception
public int samples_available()
public boolean was_clock_reset()