Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add simple xdf loader executable #26

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
16 changes: 16 additions & 0 deletions test.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#include "xdf.h"
#include <iostream>

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";
}
}