Class liblsl.StreamOutlet
A stream outlet.
Outlets are used to make streaming data (and the meta-data) available on the lab network.
Namespace: LSL4Unity
Assembly: cs.temp.dll.dll
Syntax
public class StreamOutlet
Constructors
StreamOutlet(liblsl.StreamInfo, Int32, Int32)
Initializes a new instance of liblsl.StreamOutlet. This makes the stream discoverable.
Declaration
public StreamOutlet(liblsl.StreamInfo info, int chunkSize = 0, int maxBuffered = 360)
Parameters
Type | Name | Description |
---|---|---|
liblsl.StreamInfo | info | The stream information to use for creating this stream. Stays constant over the lifetime of the outlet. |
Int32 | chunkSize | Optionally the desired chunk granularity (in samples) for transmission. If unspecified, each push operation yields one chunk. Inlets can override this setting. |
Int32 | maxBuffered | Optionally the maximum amount of data to buffer (in seconds if there is a nominal sampling rate, otherwise x100 in samples). The default is 6 minutes of data. |
Methods
Finalize()
Finalizes an instance of the liblsl.StreamOutlet.
The stream will no longer be discoverable after destruction and all paired inlets will stop delivering data.
Declaration
protected void Finalize()
HaveConsumers()
Check whether consumers are currently registered.
While it does not hurt, there is technically no reason to push samples if there is no consumer.
Declaration
public bool HaveConsumers()
Returns
Type | Description |
---|---|
Boolean |
|
Info()
Retrieve the stream info provided by this outlet.
This is what was used to create the stream (and also has the Additional Network Information fields assigned).
Declaration
public liblsl.StreamInfo Info()
Returns
Type | Description |
---|---|
liblsl.StreamInfo |
PushChunk(Char[,], Double, Boolean)
Push a chunk of samples into the outlet. Single time provided.
Declaration
public void PushChunk(char[, ] data, double time = 0, bool pushthrough = true)
Parameters
Type | Name | Description |
---|---|---|
Char[,] | data | A rectangular array of values for multiple samples. |
Double | time | Optionally the capture time of the sample, in agreement with LocalClock(); if omitted, the current time is used. |
Boolean | pushthrough | Optionally whether to push the sample through to the receivers instead of buffering it with subsequent samples. Note that the chunkSize, if specified at outlet construction, takes precedence over the pushthrough flag. |
PushChunk(Char[,], Double[], Boolean)
Push a chunk of multiplexed samples into the outlet. One time per sample is provided.
Declaration
public void PushChunk(char[, ] data, double[] times, bool pushthrough = true)
Parameters
Type | Name | Description |
---|---|---|
Char[,] | data | A rectangular array of values for multiple samples. |
Double[] | times | |
Boolean | pushthrough |
PushChunk(Double[,], Double, Boolean)
Push a chunk of samples into the outlet. Single time provided.
Declaration
public void PushChunk(double[, ] data, double time = 0, bool pushthrough = true)
Parameters
Type | Name | Description |
---|---|---|
Double[,] | data | A rectangular array of values for multiple samples. |
Double | time | Optionally the capture time of the sample, in agreement with LocalClock(); if omitted, the current time is used. |
Boolean | pushthrough | Optionally whether to push the sample through to the receivers instead of buffering it with subsequent samples. Note that the chunkSize, if specified at outlet construction, takes precedence over the pushthrough flag. |
PushChunk(Double[,], Double[], Boolean)
Push a chunk of multiplexed samples into the outlet. One time per sample is provided.
Declaration
public void PushChunk(double[, ] data, double[] times, bool pushthrough = true)
Parameters
Type | Name | Description |
---|---|---|
Double[,] | data | A rectangular array of values for multiple samples. |
Double[] | times | |
Boolean | pushthrough |
PushChunk(Int16[,], Double, Boolean)
Push a chunk of samples into the outlet. Single time provided.
Declaration
public void PushChunk(short[, ] data, double time = 0, bool pushthrough = true)
Parameters
Type | Name | Description |
---|---|---|
Int16[,] | data | A rectangular array of values for multiple samples. |
Double | time | Optionally the capture time of the sample, in agreement with LocalClock(); if omitted, the current time is used. |
Boolean | pushthrough | Optionally whether to push the sample through to the receivers instead of buffering it with subsequent samples. Note that the chunkSize, if specified at outlet construction, takes precedence over the pushthrough flag. |
PushChunk(Int16[,], Double[], Boolean)
Push a chunk of multiplexed samples into the outlet. One time per sample is provided.
Declaration
public void PushChunk(short[, ] data, double[] times, bool pushthrough = true)
Parameters
Type | Name | Description |
---|---|---|
Int16[,] | data | A rectangular array of values for multiple samples. |
Double[] | times | |
Boolean | pushthrough |
PushChunk(Int32[,], Double, Boolean)
Push a chunk of samples into the outlet. Single time provided.
Declaration
public void PushChunk(int[, ] data, double time = 0, bool pushthrough = true)
Parameters
Type | Name | Description |
---|---|---|
Int32[,] | data | A rectangular array of values for multiple samples. |
Double | time | Optionally the capture time of the sample, in agreement with LocalClock(); if omitted, the current time is used. |
Boolean | pushthrough | Optionally whether to push the sample through to the receivers instead of buffering it with subsequent samples. Note that the chunkSize, if specified at outlet construction, takes precedence over the pushthrough flag. |
PushChunk(Int32[,], Double[], Boolean)
Push a chunk of multiplexed samples into the outlet. One time per sample is provided.
Declaration
public void PushChunk(int[, ] data, double[] times, bool pushthrough = true)
Parameters
Type | Name | Description |
---|---|---|
Int32[,] | data | A rectangular array of values for multiple samples. |
Double[] | times | |
Boolean | pushthrough |
PushChunk(Single[,], Double, Boolean)
Push a chunk of samples into the outlet. Single time provided.
Declaration
public void PushChunk(float[, ] data, double time = 0, bool pushthrough = true)
Parameters
Type | Name | Description |
---|---|---|
Single[,] | data | A rectangular array of values for multiple samples. |
Double | time | Optionally the capture time of the sample, in agreement with LocalClock(); if omitted, the current time is used. |
Boolean | pushthrough | Optionally whether to push the sample through to the receivers instead of buffering it with subsequent samples. Note that the chunkSize, if specified at outlet construction, takes precedence over the pushthrough flag. |
PushChunk(Single[,], Double[], Boolean)
Push a chunk of multiplexed samples into the outlet. One time per sample is provided.
Declaration
public void PushChunk(float[, ] data, double[] times, bool pushthrough = true)
Parameters
Type | Name | Description |
---|---|---|
Single[,] | data | A rectangular array of values for multiple samples. |
Double[] | times | |
Boolean | pushthrough |
PushChunk(String[,], Double, Boolean)
Push a chunk of samples into the outlet. Single time provided.
Declaration
public void PushChunk(string[, ] data, double time = 0, bool pushthrough = true)
Parameters
Type | Name | Description |
---|---|---|
String[,] | data | A rectangular array of values for multiple samples. |
Double | time | Optionally the capture time of the sample, in agreement with LocalClock(); if omitted, the current time is used. |
Boolean | pushthrough | Optionally whether to push the sample through to the receivers instead of buffering it with subsequent samples. Note that the chunkSize, if specified at outlet construction, takes precedence over the pushthrough flag. |
PushChunk(String[,], Double[], Boolean)
Push a chunk of multiplexed samples into the outlet. One time per sample is provided.
Declaration
public void PushChunk(string[, ] data, double[] times, bool pushthrough = true)
Parameters
Type | Name | Description |
---|---|---|
String[,] | data | A rectangular array of values for multiple samples. |
Double[] | times | |
Boolean | pushthrough |
PushSample(Char[], Double, Boolean)
Push an array of values as a sample into the outlet.
Declaration
public void PushSample(char[] data, double time = 0, bool pushthrough = true)
Parameters
Type | Name | Description |
---|---|---|
Char[] | data | An array of values to push (one for each channel). |
Double | time | Optionally the capture time of the sample, in agreement with LocalClock(); if omitted, the current time is used. |
Boolean | pushthrough | Optionally whether to push the sample through to the receivers instead of buffering it with subsequent samples. Note that the chunk_size, if specified at outlet construction, takes precedence over the pushthrough flag. |
PushSample(Double[], Double, Boolean)
Push an array of values as a sample into the outlet.
Declaration
public void PushSample(double[] data, double time = 0, bool pushthrough = true)
Parameters
Type | Name | Description |
---|---|---|
Double[] | data | An array of values to push (one for each channel). |
Double | time | Optionally the capture time of the sample, in agreement with LocalClock(); if omitted, the current time is used. |
Boolean | pushthrough | Optionally whether to push the sample through to the receivers instead of buffering it with subsequent samples. Note that the chunk_size, if specified at outlet construction, takes precedence over the pushthrough flag. |
PushSample(Int16[], Double, Boolean)
Push an array of values as a sample into the outlet.
Declaration
public void PushSample(short[] data, double time = 0, bool pushthrough = true)
Parameters
Type | Name | Description |
---|---|---|
Int16[] | data | An array of values to push (one for each channel). |
Double | time | Optionally the capture time of the sample, in agreement with LocalClock(); if omitted, the current time is used. |
Boolean | pushthrough | Optionally whether to push the sample through to the receivers instead of buffering it with subsequent samples. Note that the chunk_size, if specified at outlet construction, takes precedence over the pushthrough flag. |
PushSample(Int32[], Double, Boolean)
Push an array of values as a sample into the outlet.
Declaration
public void PushSample(int[] data, double time = 0, bool pushthrough = true)
Parameters
Type | Name | Description |
---|---|---|
Int32[] | data | An array of values to push (one for each channel). |
Double | time | Optionally the capture time of the sample, in agreement with LocalClock(); if omitted, the current time is used. |
Boolean | pushthrough | Optionally whether to push the sample through to the receivers instead of buffering it with subsequent samples. Note that the chunk_size, if specified at outlet construction, takes precedence over the pushthrough flag. |
PushSample(Single[], Double, Boolean)
Push an array of values as a sample into the outlet.
Declaration
public void PushSample(float[] data, double time = 0, bool pushthrough = true)
Parameters
Type | Name | Description |
---|---|---|
Single[] | data | An array of values to push (one for each channel). |
Double | time | Optionally the capture time of the sample, in agreement with LocalClock(); if omitted, the current time is used. |
Boolean | pushthrough | Optionally whether to push the sample through to the receivers instead of buffering it with subsequent samples. Note that the chunk_size, if specified at outlet construction, takes precedence over the pushthrough flag. |
PushSample(String[], Double, Boolean)
Push an array of values as a sample into the outlet.
Declaration
public void PushSample(string[] data, double time = 0, bool pushthrough = true)
Parameters
Type | Name | Description |
---|---|---|
String[] | data | An array of values to push (one for each channel). |
Double | time | Optionally the capture time of the sample, in agreement with LocalClock(); if omitted, the current time is used. |
Boolean | pushthrough | Optionally whether to push the sample through to the receivers instead of buffering it with subsequent samples. Note that the chunk_size, if specified at outlet construction, takes precedence over the pushthrough flag. |
WaitForConsumers(Double)
Wait until some consumer shows up (without wasting resources).
Declaration
public bool WaitForConsumers(double timeout)
Parameters
Type | Name | Description |
---|---|---|
Double | timeout | The timeout. |
Returns
Type | Description |
---|---|
Boolean | True if the wait was successful, false if the timeout expired. |