Skip to content

Commit 048aaa2

Browse files
authored
Merge branch 'master' into unity-examples
2 parents d93c348 + bb0f510 commit 048aaa2

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

LSL.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -495,7 +495,7 @@ protected override void DestroyLSLObject(IntPtr obj)
495495
* Wait until some consumer shows up (without wasting resources).
496496
* @return True if the wait was successful, false if the timeout expired.
497497
*/
498-
public bool wait_for_consumers(double timeout = LSL.FOREVER) { return dll.lsl_wait_for_consumers(obj) > 0; }
498+
public bool wait_for_consumers(double timeout = LSL.FOREVER) { return dll.lsl_wait_for_consumers(obj, timeout) > 0; }
499499

500500
/**
501501
* Retrieve the stream info provided by this outlet.
@@ -1023,7 +1023,7 @@ class dll
10231023
public static extern int lsl_have_consumers(IntPtr obj);
10241024

10251025
[DllImport(libname, CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Ansi, ExactSpelling = true)]
1026-
public static extern int lsl_wait_for_consumers(IntPtr obj);
1026+
public static extern int lsl_wait_for_consumers(IntPtr obj, double timeout);
10271027

10281028
[DllImport(libname, CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Ansi, ExactSpelling = true)]
10291029
public static extern IntPtr lsl_get_info(IntPtr obj);

README-Unity.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,22 +27,24 @@ using System.Collections;
2727
using System.Collections.Generic;
2828
using UnityEngine;
2929
using LSL;
30-
using static LSL.LSL;
3130

3231
public class LSLInput : MonoBehaviour
3332
{
3433
public string StreamType = "EEG";
3534
public float scaleInput = 0.1f;
35+
3636
StreamInfo[] streamInfos;
3737
StreamInlet streamInlet;
38+
3839
float[] sample;
3940
private int channelCount = 0;
4041

4142
void Update()
4243
{
4344
if (streamInlet == null)
4445
{
45-
streamInfos = resolve_stream("type", StreamType, 1, 0.0);
46+
47+
streamInfos = LSL.resolve_stream("type", StreamType, 1, 0.0);
4648
if (streamInfos.Length > 0)
4749
{
4850
streamInlet = new StreamInlet(streamInfos[0]);
@@ -91,6 +93,7 @@ public class LSLOutput : MonoBehaviour
9193
private StreamOutlet outlet;
9294
private float[] currentSample;
9395

96+
9497
public string StreamName = "Unity.ExampleStream";
9598
public string StreamType = "Unity.StreamType";
9699
public string StreamId = "MyStreamID-Unity1234";
@@ -107,6 +110,7 @@ public class LSLOutput : MonoBehaviour
107110
currentSample = new float[3];
108111
}
109112

113+
110114
// Update is called once per frame
111115
void FixedUpdate()
112116
{

0 commit comments

Comments
 (0)