Skip to content

Commit 191652f

Browse files
authored
Merge branch 'master' into ubuntu-22.04
2 parents 5badf11 + e6c8b6c commit 191652f

14 files changed

+61
-23
lines changed

.github/workflows/cppcmake.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ jobs:
3535
- {name: "ubuntu-20.04", os: "ubuntu-20.04", cmake_extra: "-DLSL_BUNDLED_PUGIXML=OFF"}
3636
- {name: "ubuntu-18.04", os: "ubuntu-latest", docker: "ubuntu:18.04" }
3737
- {name: "ubuntu-22.04", os: "ubuntu-latest", docker: "ubuntu:22.04" }
38-
- {name: "windows-x64", os: "windows-latest", cmake_extra: "-T v140,host=x86"}
39-
- {name: "windows-32", os: "windows-latest", cmake_extra: "-T v140,host=x86 -A Win32"}
38+
- {name: "windows-x64", os: "windows-2019", cmake_extra: "-T v140,host=x86"}
39+
- {name: "windows-32", os: "windows-2019", cmake_extra: "-T v140,host=x86 -A Win32"}
4040
- {name: "macOS-latest", os: "macOS-latest"}
4141

4242
# runs all steps in the container configured in config.docker or as subprocesses when empty

.github/workflows/mingw_static.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ on:
1313
jobs:
1414
build:
1515
name: MinGW batteries-included
16-
runs-on: windows-latest
16+
runs-on: windows-2019
1717

1818
defaults:
1919
run:

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
/build*/
2+
/install/
3+
/package/
24
/CMakeLists.txt.user
35
/CMakeLists.json
46
/CMakeSettings.json

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
cmake_minimum_required (VERSION 3.12)
22
project (liblsl
3-
VERSION 1.15.2
3+
VERSION 1.16.0
44
LANGUAGES C CXX
55
DESCRIPTION "Labstreaminglayer C/C++ library"
66
HOMEPAGE_URL "https://github.com/sccn/liblsl"

README.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,15 @@ The most up-to-date instructions are in the
2020
Precompiled packages are uploaded
2121

2222
- to the [Release page](https://github.com/sccn/liblsl/releases)
23-
- the [Anaconda cloud](https://anaconda.org/conda-force/liblsl), install with `conda install -c conda-forge liblsl`
23+
- the [Anaconda cloud](https://anaconda.org/conda-forge/liblsl), install with `conda install -c conda-forge liblsl`
2424

25-
To compile the library yourself from source please follow the [online documentation](https://labstreaminglayer.readthedocs.io/dev/lib_dev.html).
25+
liblsl is also available via the following package managers:
26+
27+
- [vcpkg](https://vcpkg.io)
28+
- [Conan](https://conan.io/center/liblsl)
29+
30+
To compile the library yourself from source,
31+
please follow the [online documentation](https://labstreaminglayer.readthedocs.io/dev/lib_dev.html).
2632

2733
For single board computers running linux, you can also try
2834
`standalone_compilation_linux.sh`.

examples/ReceiveDataInChunks.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ int main(int argc, char **argv) {
2222
bool flush = argc > 3;
2323
// resolve the stream of interest & make an inlet
2424
lsl::stream_info inlet_info = lsl::resolve_stream("name", name).at(0);
25-
lsl::stream_inlet inlet(inlet_info, max_buffered);
25+
lsl::stream_inlet inlet(inlet_info, (int32_t)max_buffered);
2626

2727
// Use set_postprocessing to get the timestamps in a common base clock.
2828
// Do not use if this application will record timestamps to disk -- it is better to

examples/SendData.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ int main(int argc, char *argv[]) {
7171
// Create random data for the first 8 channels.
7272
for (int c = 0; c < 8; c++) sample[c] = (float)((rand() % 1500) / 500.0 - 1.5);
7373
// For the remaining channels, fill them with a sample counter (wraps at 1M).
74-
std::fill(sample.begin() + 8, sample.end(), t % 1000000);
74+
std::fill(sample.begin() + 8, sample.end(), (float)(t % 1000000));
7575

7676
// Wait until the next expected sample time.
7777
next_sample_time += std::chrono::microseconds(sample_dur_us);

examples/SendDataInChunks.cpp

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,14 @@ struct fake_device {
2525
*/
2626
std::size_t n_channels;
2727
double srate;
28-
int64_t pattern_samples;
29-
int64_t head;
28+
std::size_t pattern_samples;
29+
std::size_t head;
3030
std::vector<int16_t> pattern;
3131
std::chrono::steady_clock::time_point last_time;
3232

3333
fake_device(const int16_t n_channels, const float srate)
3434
: n_channels(n_channels), srate(srate), head(0) {
35-
pattern_samples = (int64_t)(srate - 0.5) + 1; // truncate OK.
35+
pattern_samples = (std::size_t)(srate - 0.5) + 1; // truncate OK.
3636

3737
// Pre-allocate entire test pattern. The data _could_ be generated on the fly
3838
// for a much smaller memory hit, but we also use this example application
@@ -47,8 +47,9 @@ struct fake_device {
4747
// sin(2*pi*f*t), where f cycles from 1 Hz to Nyquist: srate / 2
4848
double f = (chan_ix + 1) % (int)(srate / 2);
4949
pattern.emplace_back(
50-
offset_0 + chan_ix * offset_step +
51-
magnitude * static_cast<int16_t>(sin(2 * M_PI * f * sample_ix / srate)));
50+
static_cast<int16_t>(
51+
offset_0 + chan_ix * offset_step +
52+
magnitude * sin(2 * M_PI * f * sample_ix / srate)));
5253
}
5354
}
5455
last_time = std::chrono::steady_clock::now();
@@ -70,8 +71,8 @@ struct fake_device {
7071
auto now = std::chrono::steady_clock::now();
7172
auto elapsed_nano =
7273
std::chrono::duration_cast<std::chrono::nanoseconds>(now - last_time).count();
73-
int64_t elapsed_samples = std::size_t(elapsed_nano * srate * 1e-9); // truncate OK.
74-
elapsed_samples = std::min(elapsed_samples, (int64_t)(buffer.size() / n_channels));
74+
std::size_t elapsed_samples = std::size_t(elapsed_nano * srate * 1e-9); // truncate OK.
75+
elapsed_samples = std::min(elapsed_samples, (std::size_t)(buffer.size() / n_channels));
7576
if (nodata) {
7677
// The fastest but no patterns.
7778
// memset(&buffer[0], 23, buffer.size() * sizeof buffer[0]);
@@ -116,7 +117,7 @@ int main(int argc, char **argv) {
116117
chn.append_child_value("unit", "microvolts");
117118
chn.append_child_value("type", type);
118119
}
119-
int32_t buf_samples = max_buffered * samplingrate;
120+
int32_t buf_samples = (int32_t)(max_buffered * samplingrate);
120121
lsl::stream_outlet outlet(info, chunk_samples, buf_samples);
121122
info = outlet.info(); // Refresh info with whatever the outlet captured.
122123
std::cout << "Stream UID: " << info.uid() << std::endl;

examples/SendDataMinimal.cpp

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
#include <chrono>
2+
#include <thread>
3+
#include <lsl_cpp.h>
4+
5+
/**
6+
* This is a minimal example of how a multi-channel data stream can be sent to LSL.
7+
* Here, the stream is named SimpleStream, has content-type EEG, 8 channels, and 200 Hz.
8+
* The transmitted samples contain random numbers.
9+
*/
10+
11+
const int nchannels = 8;
12+
13+
int main(int argc, char *argv[]) {
14+
// make a new stream_info and open an outlet with it
15+
lsl::stream_info info("SimpleStream", "EEG", nchannels, 200.0);
16+
lsl::stream_outlet outlet(info);
17+
18+
// send data forever
19+
float sample[nchannels];
20+
while (true) {
21+
// generate random data
22+
for (int c = 0; c < nchannels; c++) sample[c] = (float)((rand() % 1500) / 500.0 - 1.5);
23+
// send it
24+
outlet.push_sample(sample);
25+
// maintain our desired sampling rate (approximately; real software might do something else)
26+
std::this_thread::sleep_for(std::chrono::milliseconds(5));
27+
}
28+
29+
return 0;
30+
}

examples/SendDataSimple.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ int main(int argc, char *argv[]) {
2222
float sample[nchannels];
2323
while (outlet.have_consumers()) {
2424
// generate random data
25-
for (int c = 0; c < nchannels; c++) sample[c] = (rand() % 1500) / 500.0 - 1.5;
25+
for (int c = 0; c < nchannels; c++) sample[c] = (float)((rand() % 1500) / 500.0 - 1.5);
2626
// send it
2727
outlet.push_sample(sample);
2828
std::this_thread::sleep_for(std::chrono::milliseconds(5));

0 commit comments

Comments
 (0)