v2.0.0
Loading...
Searching...
No Matches
lsl_stream_inlet.cpp File Reference

Implements the QTcpSocket-backed receive path that turns a remote LSL outlet into a stream of multichannel float chunks. More...

#include "lsl_stream_inlet.h"
#include <QTcpSocket>
#include <QByteArray>
#include <QDebug>
#include <cstring>
#include <stdexcept>
Include dependency graph for lsl_stream_inlet.cpp:

Go to the source code of this file.

Classes

class  LSLLIB::StreamInletPrivate

Detailed Description

Implements the QTcpSocket-backed receive path that turns a remote LSL outlet into a stream of multichannel float chunks.

SPDX-License-Identifier: BSD-3-Clause Copyright (c) 2026 MNE-CPP Authors

Author
Christoph Dinh chris.nosp@m.toph.nosp@m..dinh.nosp@m.@mne.nosp@m.-cpp..nosp@m.org
Since
2.0.0
Date
March 2026

The PIMPL class StreamInletPrivate owns the QTcpSocket and is responsible for opening the connection to the host/port pair stored in the LSLLIB::stream_info, draining pending bytes on every samples_available probe, and reassembling them into fixed-width multichannel samples sized by channel_count * sizeof(float). Partial samples observed at the end of a readAll buffer are kept in a residual byte buffer and prepended to the next read so that no sample is ever split across calls.

The public LSLLIB::stream_inlet methods are thin forwarding shims that delegate to the PIMPL, which lets the public header stay free of Qt network symbols and keeps the std::unique_ptr destructor pinned to this translation unit where the complete type is visible.

Definition in file lsl_stream_inlet.cpp.