resolve method
Resolves streams available on the network.
The waitTime
parameter determines how long to wait for streams to
resolve.
It is your responsibility to ensure that the returned streams are
destroyed when no longer needed.
Implementation
Future<List<LSLStreamInfo>> resolve({double waitTime = 5.0}) async {
if (!created) {
throw LSLException('Resolver not created');
}
final streamCount = lsl_resolve_all(
_streamInfoBuffer!,
maxStreams,
waitTime,
);
if (streamCount < 0) {
throw LSLException('Error resolving streams: $streamCount');
}
final streams = <LSLStreamInfo>[];
for (var i = 0; i < streamCount; i++) {
final streamInfo = LSLStreamInfo.fromStreamInfo(_streamInfoBuffer![i]);
streams.add(streamInfo);
}
return streams;
}