-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #12 from labstreaminglayer/restructure
Restructure the wrapper
- Loading branch information
Showing
19 changed files
with
1,065 additions
and
1,050 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<Project> | ||
<Import Project="$([MSBuild]::GetPathOfFileAbove('Directory.Build.props', '$(MSBuildThisFileDirectory)../'))" /> | ||
<PropertyGroup> | ||
<LangVersion>8.0</LangVersion> | ||
</PropertyGroup> | ||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,11 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
<ItemGroup> | ||
<ProjectReference Include="..\..\liblsl.csproj" /> | ||
</ItemGroup> | ||
<PropertyGroup> | ||
<Product>HandleMetaData</Product> | ||
<OutputType>Exe</OutputType> | ||
<TargetFramework>netcoreapp2.0</TargetFramework> | ||
<TargetFramework>net5.0</TargetFramework> | ||
<Version>1.14</Version> | ||
<LangVersion>8.0</LangVersion> | ||
<OutputType>Exe</OutputType> | ||
</PropertyGroup> | ||
<ItemGroup> | ||
<ProjectReference Include="..\..\liblsl.csproj" /> | ||
</ItemGroup> | ||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
<!-- All-in-one example project. | ||
It contains a launcher for all examples in the subdirectories that | ||
compiles to a single .exe, prints some information about the wrapper and | ||
passes all arguments through to the example specified as first command line | ||
argument. --> | ||
<PropertyGroup> | ||
<TargetFramework>netcoreapp5.0</TargetFramework> | ||
<Product>Labstreaminglayer C# examples</Product> | ||
<Version>1.14</Version> | ||
<LangVersion>8.0</LangVersion> | ||
<OutputType>Exe</OutputType> | ||
<StartupObject>LSLExamples.EntryPoint</StartupObject> | ||
</PropertyGroup> | ||
<ItemGroup> | ||
<ProjectReference Include="..\liblsl.csproj" /> | ||
</ItemGroup> | ||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
using System; | ||
using System.Linq; | ||
using System.Reflection; | ||
|
||
namespace LSLExamples | ||
{ | ||
static class EntryPoint | ||
{ | ||
public static void Main(string[] args) { | ||
var examples = Assembly.GetExecutingAssembly().GetTypes() | ||
.Where(t => t.Namespace =="LSLExamples").ToDictionary(e=>e.Name, e=>e); | ||
|
||
var WrapperVersion = Assembly.GetAssembly(typeof(LSL.LSL)).GetName().Version.ToString(); | ||
Console.Out.Write("Wrapper version: "); | ||
Console.Out.WriteLine(WrapperVersion); | ||
Console.Out.Write("liblsl version: "); | ||
Console.Out.WriteLine(LSL.LSL.library_version()); | ||
if (args.Length < 1 || !examples.ContainsKey(args[0])) { | ||
Console.Out.WriteLine("\nNot enough arguments. Valid examples:"); | ||
foreach(var name in examples.Keys) Console.Out.WriteLine(name); | ||
return; | ||
} | ||
var method = examples[args[0]].GetMethod("Main", BindingFlags.Public|BindingFlags.Static); | ||
Console.Out.WriteLine(method); | ||
method.Invoke(null, new object[]{ args}); | ||
} | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,28 @@ | ||
using System; | ||
using System.Threading; | ||
using LSL; | ||
|
||
namespace ConsoleApplication1 | ||
namespace LSLExamples | ||
{ | ||
class Program | ||
static class ReceiveData | ||
{ | ||
static void Main(string[] args) | ||
public static void Main(string[] args) | ||
{ | ||
// wait until an EEG stream shows up | ||
liblsl.StreamInfo[] results = liblsl.resolve_stream("type", "EEG"); | ||
StreamInfo[] results = LSL.LSL.resolve_stream("type", "EEG"); | ||
|
||
// open an inlet and print some interesting info about the stream (meta-data, etc.) | ||
liblsl.StreamInlet inlet = new liblsl.StreamInlet(results[0]); | ||
using StreamInlet inlet = new StreamInlet(results[0]); | ||
results.DisposeArray(); | ||
System.Console.Write(inlet.info().as_xml()); | ||
|
||
// read samples | ||
float[] sample = new float[8]; | ||
while (true) | ||
while (!System.Console.KeyAvailable) | ||
{ | ||
inlet.pull_sample(sample); | ||
foreach (float f in sample) | ||
System.Console.Write("\t{0}",f); | ||
System.Console.Write("\t{0}", f); | ||
System.Console.WriteLine(); | ||
} | ||
|
||
System.Console.ReadKey(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,12 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
<ItemGroup> | ||
<ProjectReference Include="..\..\liblsl.csproj" /> | ||
</ItemGroup> | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
<PropertyGroup> | ||
<Product>ReceiveData</Product> | ||
<OutputType>Exe</OutputType> | ||
<TargetFramework>netcoreapp2.0</TargetFramework> | ||
<TargetFramework>net5.0</TargetFramework> | ||
<Product>Labstreaminglayer C# examples</Product> | ||
<Version>1.14</Version> | ||
<LangVersion>8.0</LangVersion> | ||
<OutputType>Exe</OutputType> | ||
</PropertyGroup> | ||
<ItemGroup> | ||
<ProjectReference Include="..\..\liblsl.csproj" /> | ||
</ItemGroup> | ||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,12 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
<ItemGroup> | ||
<ProjectReference Include="..\..\liblsl.csproj" /> | ||
</ItemGroup> | ||
<PropertyGroup> | ||
<Product>ReceiveDataInChunks</Product> | ||
<OutputType>Exe</OutputType> | ||
<TargetFramework>netcoreapp2.0</TargetFramework> | ||
<TargetFramework>net5.0</TargetFramework> | ||
<Product>Labstreaminglayer C# examples</Product> | ||
<Version>1.14</Version> | ||
<LangVersion>8.0</LangVersion> | ||
<OutputType>Exe</OutputType> | ||
</PropertyGroup> | ||
<ItemGroup> | ||
<ProjectReference Include="..\..\liblsl.csproj" /> | ||
</ItemGroup> | ||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,12 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
<ItemGroup> | ||
<ProjectReference Include="..\..\liblsl.csproj" /> | ||
</ItemGroup> | ||
<PropertyGroup> | ||
<Product>ReceiveStringMarkers</Product> | ||
<OutputType>Exe</OutputType> | ||
<TargetFramework>netcoreapp2.0</TargetFramework> | ||
<TargetFramework>net5.0</TargetFramework> | ||
<Product>Labstreaminglayer C# examples</Product> | ||
<Version>1.14</Version> | ||
<LangVersion>8.0</LangVersion> | ||
<OutputType>Exe</OutputType> | ||
</PropertyGroup> | ||
<ItemGroup> | ||
<ProjectReference Include="..\..\liblsl.csproj" /> | ||
</ItemGroup> | ||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,12 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
<ItemGroup> | ||
<ProjectReference Include="..\..\liblsl.csproj" /> | ||
</ItemGroup> | ||
<PropertyGroup> | ||
<Product>SendData</Product> | ||
<OutputType>Exe</OutputType> | ||
<TargetFramework>netcoreapp2.0</TargetFramework> | ||
<TargetFramework>net5.0</TargetFramework> | ||
<Product>Labstreaminglayer C# examples</Product> | ||
<Version>1.14</Version> | ||
<LangVersion>8.0</LangVersion> | ||
<OutputType>Exe</OutputType> | ||
</PropertyGroup> | ||
<ItemGroup> | ||
<ProjectReference Include="..\..\liblsl.csproj" /> | ||
</ItemGroup> | ||
</Project> |
Oops, something went wrong.