lsl library

The liblsl.dart Library for LSL (Lab Streaming Layer) functionality.

Classes

LSL
Interface to the LSL library.
LSLApiConfig
LSL API Configuration class for Dart FFI wrapper of liblsl Represents the configuration options available in liblsl's configuration file. For more details, refer to the official LSL documentation: https://labstreaminglayer.readthedocs.io/info/lslapicfg.html Specifically, if you would like to use LSL over wireless networks, the documentation recommends using the following configuration: https://labstreaminglayer.readthedocs.io/info/lslapicfg.html#tuning timeProbeMaxRTT = 0.100 timeProbeInterval = 0.010 timeProbeCount = 10 timeUpdateInterval = 0.25 multicastMinRTT = 0.100 multicastMaxRTT = 30
LSLChunk<T>
A chunk of samples pulled from an inlet, in list-of-samples form.
LSLChunkPointer
Zero-copy result of LSLInlet.pullChunkPointerSync.
LSLChunkTyped
A chunk of samples in flat typed-data form.
LSLContentType
LSL content types used to identify the type of data being streamed.
LSLDescription
Provides access to a stream's metadata description element.
LSLInlet<T>
A unified LSL inlet that supports both isolated and direct execution modes.
LSLMapper
LSLMapper type mapping.
LSLOutlet
A unified LSL outlet that supports both isolated and direct execution modes.
LSLPullChunk<T extends NativeType, D>
The base class for chunk pull operations, one subclass per channel format.
LSLPullSample<T extends NativeType, D>
The base class for all LSL pull sample types.
LSLPushChunk<T extends NativeType>
The base class for chunk push operations, one subclass per channel format.
LSLPushSample<T extends NativeType>
The base class for all LSL push sample types.
LSLReusableBuffer<T extends NativeType>
A Reusable buffer for LSL samples to avoid memory allocation overhead.
LSLReusableBufferDouble
LSLReusableBufferFloat
LSLReusableBufferInt8
LSLSample<T>
A representation of a sample.
LSLSamplePointer<T extends NativeType>
LSLStreamInfo
Representation of the lsl_streaminfo_struct_ from the LSL C API.
LSLStreamInfoWithMetadata
Stream info with full metadata and description access.
LSLStreamResolver
The standard resolver for LSL streams.
LSLStreamResolverContinuous
Representation of the lsl_continuous_resolver_ from the LSL C API.
LSLStreamResolverContinuousByPredicate
LSLStreamResolverContinuousByProperty
LSLTimeCorrection
An extended time-correction estimate from lsl_time_correction_ex.
LSLXml
Base class for interacting with LibLSL XML elements.
LSLXmlNode
An XML node in LibLSL's metadata structure.

Enums

ConfigSection
Enum for config sections
IPv6Mode
IPv6 mode options
LSLChannelFormat
The stream info channel formats.
LSLProcessingOptions
Automatic post-processing an inlet applies to incoming time stamps.
LSLStreamProperty
Represents a property of an LSL stream that can be used for filtering. This enum is used in LSLStreamResolver to filter streams by their properties.
LSLTransportOptions
This enum has flags that are used for inlets and outlets
ResolveScope
Multicast resolve scope options

Extensions

FirstWhereOrNullExtension on Iterable<E>
Helper extension to add firstWhereOrNull functionality
LSLProcessingOptionsFlags on Set<LSLProcessingOptions>
Combines a set of LSLProcessingOptions into the bitwise-OR'd int that lsl_set_postprocessing expects.
LSLStreamResolverByPredicate on LSLStreamResolver
A filtered stream resolver that resolves streams by a predicate expression.
LSLStreamResolverByProp on LSLStreamResolver
A filtered stream resolver that resolves streams by properties. It is a subclass of LSLStreamResolver and allows you to filter streams by properties such as stream name, type, etc.
LSLTransportOptionsFlags on Set<LSLTransportOptions>
Combines a set of LSLTransportOptions into the bitwise-OR'd int that the lsl_create_outlet_ex / lsl_create_inlet_ex functions expect.
StreamInfoList on List<LSLStreamInfo>

Constants

LSL_FOREVER → const double
LSL_IRREGULAR_RATE → const double

Functions

lslError(String what, int code) → LSLException
Builds an LSLException for a nonzero liblsl error code, naming the code and appending liblsl's own message for it when one is available.
runPreciseInterval<T>(Duration interval, T callback(T state), {required Completer<void> completer, dynamic state, Duration startBusyAt = const Duration(milliseconds: 1), Stopwatch? sw}) → void
Run a callback at precise intervals.
runPreciseIntervalAsync<T>(Duration interval, FutureOr<T> callback(T state), {required Completer<void> completer, dynamic state, Duration startBusyAt = const Duration(milliseconds: 1), Stopwatch? sw}) → Future<void>
Run a callback at precise intervals asynchronously. This is a less precise version of runPreciseInterval that uses Future.delayed instead of sleep to reduce the impact on the main thread. The tradeoff is that the callback may be called slightly later than the specified interval.

Exceptions / Errors

LSLException
LSLException base exception class
LSLTimeout
LSLTimeout exception class