11using System ;
22using LSL ;
33
4- namespace ConsoleApplication1
4+ namespace LSLExamples
55{
6- class Program
6+ static class HandleMetaData
77 {
8- static void Main ( string [ ] args )
8+ public static void Main ( string [ ] args )
99 {
1010 {
11- using liblsl . StreamInfo inf_ = new liblsl . StreamInfo ( "Test" , "EEG" , 8 , 100 , liblsl . channel_format_t . cf_double64 , "test1234" ) ;
11+ using StreamInfo inf_ = new StreamInfo ( "Test" , "EEG" , 8 , 100 , channel_format_t . cf_double64 , "test1234" ) ;
1212 Console . Out . WriteLine ( "Test" ) ;
1313 }
1414 // create a new StreamInfo and declare some meta-data (in accordance with XDF format)
15- using liblsl . StreamInfo info = new liblsl . StreamInfo ( "MetaTester" , "EEG" , 8 , 100 , liblsl . channel_format_t . cf_float32 , "myuid323457" ) ;
16- liblsl . XMLElement chns = info . desc ( ) . append_child ( "channels" ) ;
15+ using StreamInfo info = new StreamInfo ( "MetaTester" , "EEG" , 8 , 100 , channel_format_t . cf_float32 , "myuid323457" ) ;
16+ XMLElement chns = info . desc ( ) . append_child ( "channels" ) ;
1717 String [ ] labels = { "C3" , "C4" , "Cz" , "FPz" , "POz" , "CPz" , "O1" , "O2" } ;
1818 for ( int k = 0 ; k < labels . Length ; k ++ )
1919 chns . append_child ( "channel" )
@@ -27,23 +27,23 @@ static void Main(string[] args)
2727 . append_child_value ( "labelscheme" , "10-20" ) ;
2828
2929 // create outlet for the stream
30- liblsl . StreamOutlet outlet = new liblsl . StreamOutlet ( info ) ;
30+ StreamOutlet outlet = new StreamOutlet ( info ) ;
3131
3232 // === the following could run on another computer ===
3333
3434 // resolve the stream and open an inlet
35- liblsl . StreamInfo [ ] results = liblsl . resolve_stream ( "name" , "MetaTester" ) ;
36- using liblsl . StreamInlet inlet = new liblsl . StreamInlet ( results [ 0 ] ) ;
35+ StreamInfo [ ] results = LSL . LSL . resolve_stream ( "name" , "MetaTester" ) ;
36+ using StreamInlet inlet = new StreamInlet ( results [ 0 ] ) ;
3737 results . DisposeArray ( ) ;
3838
3939 // get the full stream info (including custom meta-data) and dissect it
40- using liblsl . StreamInfo inf = inlet . info ( ) ;
40+ using StreamInfo inf = inlet . info ( ) ;
4141 Console . WriteLine ( "The stream's XML meta-data is: " ) ;
4242 Console . WriteLine ( inf . as_xml ( ) ) ;
4343 Console . WriteLine ( "The manufacturer is: " + inf . desc ( ) . child_value ( "manufacturer" ) ) ;
4444 Console . WriteLine ( "The cap circumference is: " + inf . desc ( ) . child ( "cap" ) . child_value ( "size" ) ) ;
4545 Console . WriteLine ( "The channel labels are as follows:" ) ;
46- liblsl . XMLElement ch = inf . desc ( ) . child ( "channels" ) . child ( "channel" ) ;
46+ XMLElement ch = inf . desc ( ) . child ( "channels" ) . child ( "channel" ) ;
4747 for ( int k = 0 ; k < info . channel_count ( ) ; k ++ )
4848 {
4949 Console . WriteLine ( " " + ch . child_value ( "label" ) ) ;
0 commit comments