77 const std::string&
type,
88, m_uid(QUuid::createUuid().toString(QUuid::WithoutBraces).toStdString())
89, m_hostname(QHostInfo::localHostName().toStdString())
113 return m_channel_count;
120 return m_nominal_srate;
127 return m_channel_format;
185 std::ostringstream oss;
189 <<
"|" << m_channel_count
190 <<
"|" << m_nominal_srate
193 <<
"|" << m_source_id
194 <<
"|" << m_data_port
195 <<
"|" <<
static_cast<int>(m_channel_format);
204 std::istringstream iss(data);
206 std::vector<std::string> tokens;
208 while (std::getline(iss, token,
'|')) {
209 tokens.push_back(token);
213 if (tokens.size() < 10 || tokens[0] !=
"MNELSL1") {
218 info.m_name = tokens[1];
219 info.m_type = tokens[2];
220 info.m_channel_count = std::stoi(tokens[3]);
221 info.m_nominal_srate = std::stod(tokens[4]);
222 info.m_uid = tokens[5];
223 info.m_hostname = tokens[6];
224 info.m_source_id = tokens[7];
225 info.m_data_port = std::stoi(tokens[8]);
226 info.m_channel_format =
static_cast<ChannelFormat>(std::stoi(tokens[9]));
Declares stream_info, the LSL metadata descriptor that identifies and routes a stream on the network.
Lab Streaming Layer (LSL) integration for real-time data exchange.
int channel_count() const noexcept
Number of channels.
int data_port() const noexcept
TCP data port of the outlet.
double nominal_srate() const noexcept
Nominal sampling rate in Hz. 0.0 means irregular.
std::string to_string() const
Serialize stream_info into a string for network transport.
std::string hostname() const noexcept
Hostname of the machine from which the stream originates.
void set_data_host(const std::string &host)
Set the data host (used internally during discovery).
std::string source_id() const noexcept
Unique source identifier.
void set_data_port(int port)
Set the TCP data port (used internally during discovery / outlet creation).
ChannelFormat channel_format() const noexcept
Data format of a channel.
std::string uid() const noexcept
A unique identifier for this particular stream instance (auto-generated).
std::string name() const noexcept
Name of the stream.
std::string type() const noexcept
Content type of the stream.
static stream_info from_string(const std::string &data)
Deserialize a stream_info from a network transport string.
std::string data_host() const noexcept
Host address of the outlet (IP, set from UDP sender address during discovery).