File tree Expand file tree Collapse file tree 1 file changed +11
-9
lines changed
Expand file tree Collapse file tree 1 file changed +11
-9
lines changed Original file line number Diff line number Diff line change @@ -77,21 +77,23 @@ public virtual void AStreamIsFound(StreamInfo stream_info)
7777 single_sample = new TData [ nChannels ] ;
7878
7979 XMLElement channels = inlet . info ( ) . desc ( ) . child ( "channels" ) ;
80+ XMLElement chan ;
8081 if ( ! channels . empty ( ) )
82+ chan = channels . first_child ( ) ;
83+ else
84+ chan = channels ;
85+
86+ ChannelNames . Clear ( ) ;
87+ for ( int chan_ix = 0 ; chan_ix < nChannels ; chan_ix ++ )
8188 {
82-
83- XMLElement chan = channels . first_child ( ) ;
84- while ( ! chan . empty ( ) )
89+ if ( ! chan . empty ( ) )
8590 {
86- // Read chan
8791 ChannelNames . Add ( chan . child_value ( "label" ) ) ;
8892 chan = chan . next_sibling ( ) ;
8993 }
90- }
91- // Pad with empty strings to make ChannelNames length == nChannels.
92- for ( int chan_ix = ChannelNames . Count ; chan_ix < nChannels ; chan_ix ++ )
93- {
94- ChannelNames . Add ( "Chan" + chan_ix ) ;
94+ else
95+ // Pad with empty strings to make ChannelNames length == nChannels.
96+ ChannelNames . Add ( "Chan" + chan_ix ) ;
9597 }
9698
9799 OnStreamAvailable ( ) ;
You can’t perform that action at this time.
0 commit comments