diff --git a/CMakeLists.txt b/CMakeLists.txt index 102a1f1..01336bb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -24,6 +24,8 @@ set(SOURCES ) add_library(xdf ${SOURCES}) +add_executable(loadtest test.cpp) +target_link_libraries(loadtest PRIVATE xdf) target_compile_features(xdf PUBLIC cxx_std_11) set_target_properties(xdf PROPERTIES OUTPUT_NAME xdf PUBLIC_HEADER xdf.h) diff --git a/test.cpp b/test.cpp new file mode 100644 index 0000000..e275444 --- /dev/null +++ b/test.cpp @@ -0,0 +1,16 @@ +#include "xdf.h" +#include + +int main(int argc, char** argv) { + if(argc < 2) { + std::cerr << "Usage: " << argv[0] << " filename\n"; + return 1; + } + Xdf XDFdata; + XDFdata.load_xdf(argv[1]); + for(const auto& stream: XDFdata.streams) { + std::cout << "Stream: " << stream.info.name + << ' ' << stream.info.channel_count << " channels " + << stream.info.sample_count << " samples\n"; + } +}