createSample method
Implementation
@protected
LSLSample<D> createSample(
Pointer<T> buffer,
lsl_inlet inlet,
int channels,
double timeout,
) {
final Pointer<Int32> ec = allocate<Int32>();
final double timestamp = _pullFn(inlet, buffer, channels, timeout, ec);
final int errorCode = ec.value;
if (LSLObj.error(errorCode)) {
return LSLSample<D>(IList(), timestamp, errorCode);
}
ec.free();
if (timestamp > 0) {
final IList<D> result = bufferToList(buffer, channels);
buffer.free();
return LSLSample<D>(result, timestamp, errorCode);
}
buffer.free();
return LSLSample<D>(IList(), timestamp, errorCode);
}