Vhi.LSLWrapper
VHI_godot¶
Vhi¶
LSLWrapper Class¶
Wrapper for SharpLSL that avoids static initialization hang in Godot. Uses reflection to dynamically load and call LSL methods.
Inheritance System.Object → LSLWrapper
Methods¶
LSLWrapper.CreateStreamInfo(string, string, int, double, string, string) Method¶
Create a StreamInfo object
public static object CreateStreamInfo(string name, string type, int channelCount, double nominalSrate, string channelFormat, string sourceId);
Returns¶
LSLWrapper.CreateStreamInlet(object, int, int, bool) Method¶
Create a StreamInlet from a StreamInfo
public static object CreateStreamInlet(object streamInfo, int maxChunkLength=0, int maxBufferLength=360, bool recover=true);
Returns¶
LSLWrapper.CreateStreamOutlet(object, int, int) Method¶
Create a StreamOutlet from a StreamInfo
Returns¶
LSLWrapper.Dispose(object) Method¶
Dispose an LSL object (StreamInlet or StreamOutlet)
LSLWrapper.GetStreamInfoChannelCount(object) Method¶
Get StreamInfo channel count
Returns¶
LSLWrapper.GetStreamInfoName(object) Method¶
Get StreamInfo name
Returns¶
LSLWrapper.Initialize() Method¶
Initialize LSL types via reflection. Call this once before using LSL.
LSLWrapper.PullSample(object, float[], double) Method¶
Pull a sample from a StreamInlet (non-blocking)
Returns¶
Remarks¶
Returns 0.0 on failure, which ends the caller's drain loop for this frame. Failures are rate-limited rather than silenced: an inlet whose producer has gone keeps failing until the staleness clock re-resolves it, and printing each one buries everything else.
LSLWrapper.PushSample(object, float[]) Method¶
Push a sample to a StreamOutlet
LSLWrapper.ResolveAll(double) Method¶
Every LSL stream visible on the network right now.
Returns¶
Remarks¶
One network resolve, whatever the caller is after. This used to filter by name here, which read as "resolve one stream" and was not — liblsl resolved everything either way, so a caller wanting several streams paid a full resolve per name. That matters now that VHI subscribes to one stream per DOF: concurrent liblsl resolves kernel- panicked a machine here, so the caller matches names against one answer instead.
LSLWrapper.SetChannelLabels(object, string[]) Method¶
Set channel labels in StreamInfo description XML
LSLWrapper.SetStreamMetadata(object, string, string) Method¶
Add initial state/schema to StreamInfo metadata