81 const std::string&
type,
92, m_uid(QUuid::createUuid().toString(QUuid::WithoutBraces).toStdString())
93, m_hostname(QHostInfo::localHostName().toStdString())
117 return m_channel_count;
124 return m_nominal_srate;
131 return m_channel_format;
189 std::ostringstream oss;
193 <<
"|" << m_channel_count
194 <<
"|" << m_nominal_srate
197 <<
"|" << m_source_id
198 <<
"|" << m_data_port
199 <<
"|" <<
static_cast<int>(m_channel_format);
208 std::istringstream iss(data);
210 std::vector<std::string> tokens;
212 while (std::getline(iss, token,
'|')) {
213 tokens.push_back(token);
217 if (tokens.size() < 10 || tokens[0] !=
"MNELSL1") {
222 info.m_name = tokens[1];
223 info.m_type = tokens[2];
224 info.m_channel_count = std::stoi(tokens[3]);
225 info.m_nominal_srate = std::stod(tokens[4]);
226 info.m_uid = tokens[5];
227 info.m_hostname = tokens[6];
228 info.m_source_id = tokens[7];
229 info.m_data_port = std::stoi(tokens[8]);
230 info.m_channel_format =
static_cast<channel_format_t>(std::stoi(tokens[9]));
Contains the declaration of the stream_info class.
Lab Streaming Layer (LSL) integration for real-time data exchange.
std::string to_string() const
Serialize stream_info into a string for network transport.
std::string type() const
Content type of the stream.
std::string hostname() const
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).
int channel_count() const
Number of channels.
double nominal_srate() const
Nominal sampling rate in Hz. 0.0 means irregular.
void set_data_port(int port)
Set the TCP data port (used internally during discovery / outlet creation).
std::string name() const
Name of the stream.
std::string data_host() const
Host address of the outlet (IP, set from UDP sender address during discovery).
std::string uid() const
A unique identifier for this particular stream instance (auto-generated).
std::string source_id() const
Unique source identifier.
channel_format_t channel_format() const
Data format of a channel.
static stream_info from_string(const std::string &data)
Deserialize a stream_info from a network transport string.
int data_port() const
TCP data port of the outlet.