@@ -750,8 +750,7 @@ class stream_outlet {
750750 }
751751
752752 /* * Push a chunk of multiplexed samples into the outlet. Single timestamp provided.
753- * IMPORTANT: Note that the provided buffer size is measured in channel values (e.g., floats)
754- * rather than in samples.
753+ * @warning The provided buffer size is measured in channel values (e.g., floats), not samples.
755754 * @param buffer A buffer of channel values holding the data for zero or more successive samples
756755 * to send.
757756 * @param buffer_elements The number of channel values (of type T) in the buffer. Must be a
@@ -760,8 +759,8 @@ class stream_outlet {
760759 * local_clock(); if omitted, the current time is used. The time stamps of other samples are
761760 * automatically derived based on the sampling rate of the stream.
762761 * @param pushthrough Whether to push the chunk through to the receivers instead of buffering it
763- * with subsequent samples. Note that the chunk_size, if specified at outlet construction, takes
764- * precedence over the pushthrough flag.
762+ * with subsequent samples. Note that the stream_outlet() constructur parameter @p chunk_size,
763+ * if specified at outlet construction, takes precedence over the pushthrough flag.
765764 */
766765 void push_chunk_multiplexed (const float *buffer, std::size_t buffer_elements,
767766 double timestamp = 0.0 , bool pushthrough = true ) {
@@ -802,7 +801,7 @@ class stream_outlet {
802801 }
803802
804803 /* * Push a chunk of multiplexed samples into the outlet. One timestamp per sample is provided.
805- * IMPORTANT: Note that the provided buffer size is measured in channel values (e.g., floats)
804+ * @warning Note that the provided buffer size is measured in channel values (e.g., floats)
806805 * rather than in samples.
807806 * @param data_buffer A buffer of channel values holding the data for zero or more successive
808807 * samples to send.
@@ -932,8 +931,8 @@ class stream_outlet {
932931 * (see Network Connectivity in the LSL wiki).
933932 * This is the default mechanism used by the browsing programs and the recording program.
934933 * @param wait_time The waiting time for the operation, in seconds, to search for streams.
935- * Warning: If this is too short (<0.5s) only a subset (or none) of the
936- * outlets that are present on the network may be returned.
934+ * If this is too short (<0.5s) only a subset (or none) of the outlets that are present on the
935+ * network may be returned.
937936 * @return A vector of stream info objects (excluding their desc field), any of which can
938937 * subsequently be used to open an inlet. The full info can be retrieve from the inlet.
939938 */
@@ -996,34 +995,27 @@ inline std::vector<stream_info> resolve_stream(
996995 */
997996class stream_inlet {
998997public:
999- /* * Construct a new stream inlet from a resolved stream info.
1000- * @param info A resolved stream info object (as coming from one of the resolver functions).
1001- * Note: the stream_inlet may also be constructed with a fully-specified stream_info,
1002- * if the desired channel format and count is already known up-front, but this
1003- is
1004- * strongly discouraged and should only ever be done if there is no time to
1005- resolve the
1006- * stream up-front (e.g., due to limitations in the client program).
1007- * @param max_buflen Optionally the maximum amount of data to buffer (in seconds if there is a
1008- nominal
1009- * sampling rate, otherwise x100 in samples). Recording applications want to
1010- use a fairly
1011- * large buffer size here, while real-time applications would only buffer as
1012- much as
1013- * they need to perform their next calculation.
1014- * @param max_chunklen Optionally the maximum size, in samples, at which chunks are transmitted
1015- * (the default corresponds to the chunk sizes used by the sender).
1016- * Recording applications can use a generous size here (leaving it to the
1017- network how
1018- * to pack things), while real-time applications may want a finer (perhaps
1019- 1-sample) granularity. If left unspecified (=0), the sender determines the chunk granularity.
1020- * @param recover Try to silently recover lost streams that are recoverable (=those that that
1021- have a source_id set).
1022- * In all other cases (recover is false or the stream is not recoverable)
1023- functions may throw a
1024- * lost_error if the stream's source is lost (e.g., due to an app or computer
1025- crash).
1026- */
998+ /* *
999+ * Construct a new stream inlet from a resolved stream info.
1000+ * @param info A resolved stream info object (as coming from one of the resolver functions).
1001+ * Note: The stream_inlet may also be constructed with a fully-specified stream_info, if the
1002+ * desired channel format and count is already known up-front, but this is strongly discouraged
1003+ * and should only ever be done if there is no time to resolve the stream up-front (e.g., due
1004+ * to limitations in the client program).
1005+ * @param max_buflen Optionally the maximum amount of data to buffer (in seconds if there is a
1006+ * nominal sampling rate, otherwise x100 in samples). Recording applications want to use a
1007+ * fairly large buffer size here, while real-time applications would only buffer as much as
1008+ * they need to perform their next calculation.
1009+ * @param max_chunklen Optionally the maximum size, in samples, at which chunks are transmitted
1010+ * (the default corresponds to the chunk sizes used by the sender).
1011+ * Recording applications can use a generous size here (leaving it to the network how to pack
1012+ * things), while real-time applications may want a finer (perhaps 1-sample) granularity.
1013+ * If left unspecified (=0), the sender determines the chunk granularity.
1014+ * @param recover Try to silently recover lost streams that are recoverable (=those that that
1015+ * have a source_id set).
1016+ * In all other cases (recover is false or the stream is not recoverable) functions may throw a
1017+ * lsl::lost_error if the stream's source is lost (e.g., due to an app or computer crash).
1018+ */
10271019 stream_inlet (const stream_info &info, int32_t max_buflen = 360 , int32_t max_chunklen = 0 ,
10281020 bool recover = true )
10291021 : channel_count(info.channel_count()),
@@ -1066,7 +1058,7 @@ class stream_inlet {
10661058 /* * Subscribe to the data stream.
10671059 * All samples pushed in at the other end from this moment onwards will be queued and
10681060 * eventually be delivered in response to pull_sample() or pull_chunk() calls.
1069- * Pulling a sample without some preceding open_stream is permitted (the stream will then be
1061+ * Pulling a sample without some preceding open_stream() is permitted (the stream will then be
10701062 * opened implicitly).
10711063 * @param timeout Optional timeout of the operation (default: no timeout).
10721064 * @throws timeout_error (if the timeout expires), or lost_error (if the stream source has been
@@ -1090,19 +1082,18 @@ class stream_inlet {
10901082
10911083 /* * Retrieve an estimated time correction offset for the given stream.
10921084 *
1093- * The first call to this function takes several milliseconds until a reliable first
1094- * estimate is obtained. Subsequent calls are instantaneous (and rely on periodic background
1095- * updates). On a well-behaved network, the precision of these estimates should be below 1
1096- * ms (empirically it is within +/-0.2 ms).
1085+ * The first call to this function takes several milliseconds until a reliable first estimate
1086+ * is obtained. Subsequent calls are instantaneous (and rely on periodic background updates).
1087+ * On a well-behaved network, the precision of these estimates should be below 1 ms
1088+ * (empirically it is within +/-0.2 ms).
1089+ *
10971090 * To get a measure of whether the network is well-behaved, use the extended version
1098- * time_correction(double*,double*,double)
1099- * and check uncertainty (which maps to round-trip-time).
1091+ * time_correction(double*,double*,double) and check uncertainty (i.e. the round-trip-time).
11001092 *
11011093 * 0.2 ms is typical of wired networks. 2 ms is typical of wireless networks.
11021094 * The number can be much higher on poor networks.
11031095 *
1104- * @param timeout Timeout to acquire the first time-correction estimate (default: no
1105- * timeout).
1096+ * @param timeout Timeout to acquire the first time-correction estimate (default: no timeout).
11061097 * @return The time correction estimate. This is the number that needs to be added to a time
11071098 * stamp that was remotely generated via lsl_local_clock() to map it into the local clock
11081099 * domain of this machine.
@@ -1135,8 +1126,8 @@ class stream_inlet {
11351126 * stamps, which can then be manually synchronized using .time_correction(), and then
11361127 * smoothed/dejittered if desired.<br>
11371128 * This function allows automating these two and possibly more operations.<br>
1138- * Warning: when you enable this, you will no longer receive or be able to recover the
1139- * original time stamps.
1129+ * @warning When you enable this, you will no longer receive or be able to recover the original
1130+ * time stamps.
11401131 * @param flags An integer that is the result of bitwise OR'ing one or more options from
11411132 * processing_options_t together (e.g., `post_clocksync|post_dejitter`); the default is to
11421133 * enable all options.
@@ -1376,8 +1367,7 @@ class stream_inlet {
13761367 *
13771368 * This is a high-performance function that performs no memory allocations
13781369 * (useful for very high data rates or on low-powered devices).
1379- * IMPORTANT: Note that the provided data buffer size is measured in channel values (e.g.,
1380- * floats) rather than in samples.
1370+ * @warning The provided buffer size is measured in channel values (e.g., floats), not samples.
13811371 * @param data_buffer A pointer to a buffer of data values where the results shall be stored.
13821372 * @param timestamp_buffer A pointer to a buffer of timestamp values where time stamps shall be
13831373 * stored. If this is NULL, no time stamps will be returned.
@@ -1575,6 +1565,9 @@ class stream_inlet {
15751565 */
15761566 std::size_t samples_available () { return lsl_samples_available (obj); }
15771567
1568+ // / Drop all queued not-yet pulled samples, return the nr of dropped samples
1569+ uint32_t flush () noexcept { return lsl_inlet_flush (obj); }
1570+
15781571 /* *
15791572 * Query whether the clock was potentially reset since the last call to was_clock_reset().
15801573 *
0 commit comments