stream_info
Namespace: LSLLIB · Library: LSL Library
#include <lsl/lsl_stream_info.h>
class LSLLIB::stream_info
Value-type descriptor of a single LSL stream: semantic metadata plus transport endpoint, API-compatible with liblsl's stream_info.
stream_info info("ex_lsl_eeg", "EEG", 3, 250.0, ChannelFormat::Float32, "ex_lsl"); // name, type, channels, Hz
stream_outlet outlet(info); // starts serving immediately
Public Methods
stream_info()
Default constructor.
Creates an empty / invalid stream_info.
stream_info(name, type, channel_count, nominal_srate, channel_format, source_id)
Construct a new stream_info object.
Parameters:
-
name : const std::string & Name of the stream (e.g. "EEG" or "MoCap").
-
type : const std::string & Content type of the stream (e.g. "EEG", "Markers").
-
channel_count : int Number of channels in the stream.
-
nominal_srate : double The nominal sampling rate (Hz). Use 0.0 for irregular streams.
-
channel_format : ChannelFormat Data format of a channel (default: cf_float32).
-
source_id : const std::string & A unique identifier for the device or source that generates the stream.
stream_info(other)
Copy constructor.
Parameters:
- other : const stream_info &
stream_infoto copy.
operator=(other)
Copy assignment operator.
Parameters:
- other : const stream_info &
stream_infoto copy.
Returns:
- stream_info & — Reference to this object.
Example
- Full source:
src/examples/ex_lsl/main.cpp - Build target:
ex_lsl(runs under CTest)
Used in examples
ex_lsl
LSL library: publish a stream, discover it and receive its samples over loopback.
stream_info info("ex_lsl_eeg", "EEG", 3, 250.0, ChannelFormat::Float32, "ex_lsl"); // name, type, channels, Hz
stream_outlet outlet(info); // starts serving immediately
ok &= expect(outlet.info().name() == "ex_lsl_eeg" && outlet.info().channel_count() == 3 && outlet.info().nominal_srate() == 250.0 && outlet.info().data_port() > 0 && !outlet.info().uid().empty(),
QString("stream_info: 3 channels at 250 Hz, served on port %1").arg(outlet.info().data_port()));
Authors of this file
- Christoph Dinh <christoph.dinh@mne-cpp.org>