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