11using System ;
2- using System . Threading ;
32using LSL ;
43
54namespace ConsoleApplication1
@@ -8,11 +7,15 @@ class Program
87 {
98 static void Main ( string [ ] args )
109 {
10+ {
11+ using liblsl . StreamInfo inf_ = new liblsl . StreamInfo ( "Test" , "EEG" , 8 , 100 , liblsl . channel_format_t . cf_double64 , "test1234" ) ;
12+ Console . Out . WriteLine ( "Test" ) ;
13+ }
1114 // 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" ) ;
15+ using liblsl . StreamInfo info = new liblsl . StreamInfo ( "MetaTester" , "EEG" , 8 , 100 , liblsl . channel_format_t . cf_float32 , "myuid323457" ) ;
1316 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 ++ )
17+ String [ ] labels = { "C3" , "C4" , "Cz" , "FPz" , "POz" , "CPz" , "O1" , "O2" } ;
18+ for ( int k = 0 ; k < labels . Length ; k ++ )
1619 chns . append_child ( "channel" )
1720 . append_child_value ( "label" , labels [ k ] )
1821 . append_child_value ( "unit" , "microvolts" )
@@ -29,10 +32,12 @@ static void Main(string[] args)
2932 // === the following could run on another computer ===
3033
3134 // 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 ] ) ;
35+ liblsl . StreamInfo [ ] results = liblsl . resolve_stream ( "name" , "MetaTester" ) ;
36+ using liblsl . StreamInlet inlet = new liblsl . StreamInlet ( results [ 0 ] ) ;
37+ foreach ( liblsl . StreamInfo si in results ) si . Dispose ( ) ;
38+
3439 // get the full stream info (including custom meta-data) and dissect it
35- liblsl . StreamInfo inf = inlet . info ( ) ;
40+ using liblsl . StreamInfo inf = inlet . info ( ) ;
3641 Console . WriteLine ( "The stream's XML meta-data is: " ) ;
3742 Console . WriteLine ( inf . as_xml ( ) ) ;
3843 Console . WriteLine ( "The manufacturer is: " + inf . desc ( ) . child_value ( "manufacturer" ) ) ;
0 commit comments