Skip to content

Commit a98c2ec

Browse files
committed
Normalize all the line endings
1 parent 506509d commit a98c2ec

9 files changed

Lines changed: 1437 additions & 1437 deletions

LSL.cs

Lines changed: 1207 additions & 1207 deletions
Large diffs are not rendered by default.

examples/HandleMetaData.cs

Lines changed: 49 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,49 @@
1-
using System;
2-
using System.Threading;
3-
using LSL;
4-
5-
namespace ConsoleApplication1
6-
{
7-
class Program
8-
{
9-
static void Main(string[] args)
10-
{
11-
// create a new StreamInfo and declare some meta-data (in accordance with XDF format)
12-
liblsl.StreamInfo info = new liblsl.StreamInfo("MetaTester","EEG",8,100,liblsl.channel_format_t.cf_float32,"myuid323457");
13-
liblsl.XMLElement chns = info.desc().append_child("channels");
14-
String[] labels = {"C3","C4","Cz","FPz","POz","CPz","O1","O2"};
15-
for (int k=0;k<labels.Length;k++)
16-
chns.append_child("channel")
17-
.append_child_value("label", labels[k])
18-
.append_child_value("unit", "microvolts")
19-
.append_child_value("type","EEG");
20-
info.desc().append_child_value("manufacturer","SCCN");
21-
info.desc().append_child("cap")
22-
.append_child_value("name","EasyCap")
23-
.append_child_value("size","54")
24-
.append_child_value("labelscheme","10-20");
25-
26-
// create outlet for the stream
27-
liblsl.StreamOutlet outlet = new liblsl.StreamOutlet(info);
28-
29-
// === the following could run on another computer ===
30-
31-
// resolve the stream and open an inlet
32-
liblsl.StreamInfo[] results = liblsl.resolve_stream("name","MetaTester");
33-
liblsl.StreamInlet inlet = new liblsl.StreamInlet(results[0]);
34-
// get the full stream info (including custom meta-data) and dissect it
35-
liblsl.StreamInfo inf = inlet.info();
36-
Console.WriteLine("The stream's XML meta-data is: ");
37-
Console.WriteLine(inf.as_xml());
38-
Console.WriteLine("The manufacturer is: " + inf.desc().child_value("manufacturer"));
39-
Console.WriteLine("The cap circumference is: " + inf.desc().child("cap").child_value("size"));
40-
Console.WriteLine("The channel labels are as follows:");
41-
liblsl.XMLElement ch = inf.desc().child("channels").child("channel");
42-
for (int k=0;k<info.channel_count();k++) {
43-
Console.WriteLine(" " + ch.child_value("label"));
44-
ch = ch.next_sibling();
45-
}
46-
Console.ReadKey();
47-
}
48-
}
49-
}
1+
using System;
2+
using System.Threading;
3+
using LSL;
4+
5+
namespace ConsoleApplication1
6+
{
7+
class Program
8+
{
9+
static void Main(string[] args)
10+
{
11+
// create a new StreamInfo and declare some meta-data (in accordance with XDF format)
12+
liblsl.StreamInfo info = new liblsl.StreamInfo("MetaTester","EEG",8,100,liblsl.channel_format_t.cf_float32,"myuid323457");
13+
liblsl.XMLElement chns = info.desc().append_child("channels");
14+
String[] labels = {"C3","C4","Cz","FPz","POz","CPz","O1","O2"};
15+
for (int k=0;k<labels.Length;k++)
16+
chns.append_child("channel")
17+
.append_child_value("label", labels[k])
18+
.append_child_value("unit", "microvolts")
19+
.append_child_value("type","EEG");
20+
info.desc().append_child_value("manufacturer","SCCN");
21+
info.desc().append_child("cap")
22+
.append_child_value("name","EasyCap")
23+
.append_child_value("size","54")
24+
.append_child_value("labelscheme","10-20");
25+
26+
// create outlet for the stream
27+
liblsl.StreamOutlet outlet = new liblsl.StreamOutlet(info);
28+
29+
// === the following could run on another computer ===
30+
31+
// resolve the stream and open an inlet
32+
liblsl.StreamInfo[] results = liblsl.resolve_stream("name","MetaTester");
33+
liblsl.StreamInlet inlet = new liblsl.StreamInlet(results[0]);
34+
// get the full stream info (including custom meta-data) and dissect it
35+
liblsl.StreamInfo inf = inlet.info();
36+
Console.WriteLine("The stream's XML meta-data is: ");
37+
Console.WriteLine(inf.as_xml());
38+
Console.WriteLine("The manufacturer is: " + inf.desc().child_value("manufacturer"));
39+
Console.WriteLine("The cap circumference is: " + inf.desc().child("cap").child_value("size"));
40+
Console.WriteLine("The channel labels are as follows:");
41+
liblsl.XMLElement ch = inf.desc().child("channels").child("channel");
42+
for (int k=0;k<info.channel_count();k++) {
43+
Console.WriteLine(" " + ch.child_value("label"));
44+
ch = ch.next_sibling();
45+
}
46+
Console.ReadKey();
47+
}
48+
}
49+
}

examples/ReceiveData.cs

Lines changed: 31 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,31 @@
1-
using System;
2-
using System.Threading;
3-
using LSL;
4-
5-
namespace ConsoleApplication1
6-
{
7-
class Program
8-
{
9-
static void Main(string[] args)
10-
{
11-
// wait until an EEG stream shows up
12-
liblsl.StreamInfo[] results = liblsl.resolve_stream("type", "EEG");
13-
14-
// open an inlet and print some interesting info about the stream (meta-data, etc.)
15-
liblsl.StreamInlet inlet = new liblsl.StreamInlet(results[0]);
16-
System.Console.Write(inlet.info().as_xml());
17-
18-
// read samples
19-
float[] sample = new float[8];
20-
while (true)
21-
{
22-
inlet.pull_sample(sample);
23-
foreach (float f in sample)
24-
System.Console.Write("\t{0}",f);
25-
System.Console.WriteLine();
26-
}
27-
28-
System.Console.ReadKey();
29-
}
30-
}
31-
}
1+
using System;
2+
using System.Threading;
3+
using LSL;
4+
5+
namespace ConsoleApplication1
6+
{
7+
class Program
8+
{
9+
static void Main(string[] args)
10+
{
11+
// wait until an EEG stream shows up
12+
liblsl.StreamInfo[] results = liblsl.resolve_stream("type", "EEG");
13+
14+
// open an inlet and print some interesting info about the stream (meta-data, etc.)
15+
liblsl.StreamInlet inlet = new liblsl.StreamInlet(results[0]);
16+
System.Console.Write(inlet.info().as_xml());
17+
18+
// read samples
19+
float[] sample = new float[8];
20+
while (true)
21+
{
22+
inlet.pull_sample(sample);
23+
foreach (float f in sample)
24+
System.Console.Write("\t{0}",f);
25+
System.Console.WriteLine();
26+
}
27+
28+
System.Console.ReadKey();
29+
}
30+
}
31+
}

examples/ReceiveDataInChunks.cs

Lines changed: 33 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,33 @@
1-
using System;
2-
using System.Threading;
3-
using LSL;
4-
5-
namespace ConsoleApplication1
6-
{
7-
class Program
8-
{
9-
static void Main(string[] args)
10-
{
11-
// wait until an EEG stream shows up
12-
liblsl.StreamInfo[] results = liblsl.resolve_stream("type", "EEG");
13-
14-
// open an inlet and print meta-data
15-
liblsl.StreamInlet inlet = new liblsl.StreamInlet(results[0]);
16-
System.Console.Write(inlet.info().as_xml());
17-
18-
// read samples
19-
float[,] buffer = new float[512, 8];
20-
double[] timestamps = new double[512];
21-
while (true)
22-
{
23-
int num = inlet.pull_chunk(buffer,timestamps);
24-
for (int s = 0; s < num; s++)
25-
{
26-
for (int c = 0; c < 8; c++)
27-
Console.Write("\t{0}", buffer[s, c]);
28-
Console.WriteLine();
29-
}
30-
}
31-
}
32-
}
33-
}
1+
using System;
2+
using System.Threading;
3+
using LSL;
4+
5+
namespace ConsoleApplication1
6+
{
7+
class Program
8+
{
9+
static void Main(string[] args)
10+
{
11+
// wait until an EEG stream shows up
12+
liblsl.StreamInfo[] results = liblsl.resolve_stream("type", "EEG");
13+
14+
// open an inlet and print meta-data
15+
liblsl.StreamInlet inlet = new liblsl.StreamInlet(results[0]);
16+
System.Console.Write(inlet.info().as_xml());
17+
18+
// read samples
19+
float[,] buffer = new float[512, 8];
20+
double[] timestamps = new double[512];
21+
while (true)
22+
{
23+
int num = inlet.pull_chunk(buffer,timestamps);
24+
for (int s = 0; s < num; s++)
25+
{
26+
for (int c = 0; c < 8; c++)
27+
Console.Write("\t{0}", buffer[s, c]);
28+
Console.WriteLine();
29+
}
30+
}
31+
}
32+
}
33+
}

examples/ReceiveStringMarkers.cs

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,27 @@
1-
using System;
2-
using System.Threading;
3-
using LSL;
4-
5-
namespace ConsoleApplication1
6-
{
7-
class Program
8-
{
9-
static void Main(string[] args)
10-
{
11-
// wait until an EEG stream shows up
12-
liblsl.StreamInfo[] results = liblsl.resolve_stream("type", "Markers");
13-
14-
// open an inlet and print meta-data
15-
liblsl.StreamInlet inlet = new liblsl.StreamInlet(results[0]);
16-
System.Console.Write(inlet.info().as_xml());
17-
18-
// read samples
19-
string[] sample = new string[1];
20-
while (true)
21-
{
22-
inlet.pull_sample(sample);
23-
System.Console.WriteLine(sample[0]);
24-
}
25-
}
26-
}
27-
}
1+
using System;
2+
using System.Threading;
3+
using LSL;
4+
5+
namespace ConsoleApplication1
6+
{
7+
class Program
8+
{
9+
static void Main(string[] args)
10+
{
11+
// wait until an EEG stream shows up
12+
liblsl.StreamInfo[] results = liblsl.resolve_stream("type", "Markers");
13+
14+
// open an inlet and print meta-data
15+
liblsl.StreamInlet inlet = new liblsl.StreamInlet(results[0]);
16+
System.Console.Write(inlet.info().as_xml());
17+
18+
// read samples
19+
string[] sample = new string[1];
20+
while (true)
21+
{
22+
inlet.pull_sample(sample);
23+
System.Console.WriteLine(sample[0]);
24+
}
25+
}
26+
}
27+
}

examples/SendData.cs

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,29 @@
1-
using System;
2-
using System.Threading;
3-
using LSL;
4-
5-
namespace ConsoleApplication1
6-
{
7-
class Program
8-
{
9-
static void Main(string[] args)
10-
{
11-
Random rnd = new Random();
12-
13-
// create stream info and outlet
14-
liblsl.StreamInfo info = new liblsl.StreamInfo("BioSemi", "EEG", 8, 100, liblsl.channel_format_t.cf_float32, "sddsfsdf");
15-
liblsl.StreamOutlet outlet = new liblsl.StreamOutlet(info);
16-
float[] data = new float[8];
17-
while (true)
18-
{
19-
// generate random data and send it
20-
for (int k = 0; k < data.Length; k++)
21-
data[k] = rnd.Next(-100, 100);
22-
outlet.push_sample(data);
23-
System.Threading.Thread.Sleep(10);
24-
}
25-
26-
System.Console.ReadKey();
27-
}
28-
}
29-
}
1+
using System;
2+
using System.Threading;
3+
using LSL;
4+
5+
namespace ConsoleApplication1
6+
{
7+
class Program
8+
{
9+
static void Main(string[] args)
10+
{
11+
Random rnd = new Random();
12+
13+
// create stream info and outlet
14+
liblsl.StreamInfo info = new liblsl.StreamInfo("BioSemi", "EEG", 8, 100, liblsl.channel_format_t.cf_float32, "sddsfsdf");
15+
liblsl.StreamOutlet outlet = new liblsl.StreamOutlet(info);
16+
float[] data = new float[8];
17+
while (true)
18+
{
19+
// generate random data and send it
20+
for (int k = 0; k < data.Length; k++)
21+
data[k] = rnd.Next(-100, 100);
22+
outlet.push_sample(data);
23+
System.Threading.Thread.Sleep(10);
24+
}
25+
26+
System.Console.ReadKey();
27+
}
28+
}
29+
}

examples/SendDataInChunks.cs

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,28 @@
1-
using System;
2-
using System.Threading;
3-
using LSL;
4-
5-
namespace ConsoleApplication1
6-
{
7-
class Program
8-
{
9-
static void Main(string[] args)
10-
{
11-
Random rnd = new Random();
12-
// create stream info and outlet
13-
liblsl.StreamInfo info = new liblsl.StreamInfo("BioSemi", "EEG", 8, 100, liblsl.channel_format_t.cf_float32, "sddsfsdf");
14-
liblsl.StreamOutlet outlet = new liblsl.StreamOutlet(info);
15-
16-
// send data in chunks of 10 samples and 8 channels
17-
float[,] data = new float[10, 8];
18-
while (true)
19-
{
20-
for (int s = 0; s < 10; s++)
21-
for (int c = 0; c < 8; c++)
22-
data[s, c] = rnd.Next(-100, 100);
23-
outlet.push_chunk(data);
24-
System.Threading.Thread.Sleep(100);
25-
}
26-
}
27-
}
28-
}
1+
using System;
2+
using System.Threading;
3+
using LSL;
4+
5+
namespace ConsoleApplication1
6+
{
7+
class Program
8+
{
9+
static void Main(string[] args)
10+
{
11+
Random rnd = new Random();
12+
// create stream info and outlet
13+
liblsl.StreamInfo info = new liblsl.StreamInfo("BioSemi", "EEG", 8, 100, liblsl.channel_format_t.cf_float32, "sddsfsdf");
14+
liblsl.StreamOutlet outlet = new liblsl.StreamOutlet(info);
15+
16+
// send data in chunks of 10 samples and 8 channels
17+
float[,] data = new float[10, 8];
18+
while (true)
19+
{
20+
for (int s = 0; s < 10; s++)
21+
for (int c = 0; c < 8; c++)
22+
data[s, c] = rnd.Next(-100, 100);
23+
outlet.push_chunk(data);
24+
System.Threading.Thread.Sleep(100);
25+
}
26+
}
27+
}
28+
}

0 commit comments

Comments
 (0)