resolve method
Resolves streams available on the network found since the last call to resolve. It will return all streams that are currently available, limited by maxStreams. It is your responsibility to ensure that the returned streams are destroyed when no longer needed.
Implementation
@override
Future<List<LSLStreamInfo>> resolve({double waitTime = 0.0}) async {
if (_resolver == null) {
throw LSLException('Resolver not created');
}
// pause for specified wait time
// this is to allow the resolver to gather streams
if (waitTime > 0) {
await Future.delayed(Duration(milliseconds: (waitTime * 1000).toInt()));
}
final int streamCount = lsl_resolver_results(
_resolver!,
_streamInfoBuffer!,
maxStreams,
);
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;
}