LSLInlet<T> constructor

LSLInlet<T>(
  1. LSLStreamInfo _streamInfo, {
  2. int maxBuffer = 360,
  3. int chunkSize = 0,
  4. bool recover = true,
  5. double createTimeout = LSL_FOREVER,
  6. Set<LSLTransportOptions> transportOptions = const {},
  7. bool useIsolates = true,
})

Creates a new LSLInlet instance. Parameters:

  • streamInfo: The stream information to create the inlet for.
  • maxBuffer: Maximum buffer size in seconds (default: 360).
  • chunkSize: Maximum chunk length in seconds (default: 0).
  • recover: Whether to recover from lost samples (default: true).
  • createTimeout: Seconds lsl_open_stream may block while opening the data connection (default: LSL_FOREVER, i.e. ~370 days). Used in both modes — direct mode passes it to lsl_open_stream in _createDirect. In direct mode the call is a synchronous FFI call on the calling thread, so leaving this at the default lets an unreachable peer block that thread indefinitely; callers sharing a thread or isolate between several inlets should set a bounded value.
  • useIsolates: Whether to use isolates for thread safety (default: true) This is recommended for most use cases to ensure thread safety, if you choose to use direct mode (useIsolates: false), you most likely will want to still run this in an isolate to avoid blocking the main isolate.

Implementation

LSLInlet(
  this._streamInfo, {
  this.maxBuffer = 360,
  this.chunkSize = 0,
  this.recover = true,
  this.createTimeout = LSL_FOREVER,
  this.transportOptions = const {},
  bool useIsolates = true,
}) : _useIsolates = useIsolates;