From 91928fb804f0ee77042dd09b5d9ede4abbb44e68 Mon Sep 17 00:00:00 2001 From: redtide Date: Sun, 21 May 2023 15:00:51 +0200 Subject: [PATCH] Temporary fixes for demos, see #1148 --- demos/CMakeLists.txt | 39 +++++++++++++++++++++++++++++---------- demos/FileWavetable.cpp | 4 ++-- demos/PlotLFO.cpp | 1 + 3 files changed, 32 insertions(+), 12 deletions(-) diff --git a/demos/CMakeLists.txt b/demos/CMakeLists.txt index 22e8b3199..8b7d672d7 100644 --- a/demos/CMakeLists.txt +++ b/demos/CMakeLists.txt @@ -26,11 +26,22 @@ if(TARGET Qt5::Widgets) set_target_properties(sfizz_demo_stretch_tuning PROPERTIES AUTOUIC ON) endif() -add_executable(eq_apply EQ.cpp) -target_link_libraries(eq_apply PRIVATE sfizz::internal sfizz::sndfile sfizz::cxxopts sfizz::filesystem) - -add_executable(filter_apply Filter.cpp) -target_link_libraries(filter_apply PRIVATE sfizz::internal sfizz::sndfile sfizz::cxxopts sfizz::filesystem) +if(SFIZZ_USE_SNDFILE) + add_executable(eq_apply EQ.cpp) + target_link_libraries(eq_apply PRIVATE + sfizz::cxxopts + sfizz::filesystem + sfizz::internal + sfizz::sndfile + ) + add_executable(filter_apply Filter.cpp) + target_link_libraries(filter_apply PRIVATE + sfizz::cxxopts + sfizz::filesystem + sfizz::internal + sfizz::sndfile + ) +endif() add_executable(sfizz_plot_curve PlotCurve.cpp) target_link_libraries(sfizz_plot_curve PRIVATE sfizz::internal) @@ -38,11 +49,19 @@ target_link_libraries(sfizz_plot_curve PRIVATE sfizz::internal) add_executable(sfizz_plot_wavetables PlotWavetables.cpp) target_link_libraries(sfizz_plot_wavetables PRIVATE sfizz::internal) -add_executable(sfizz_plot_lfo PlotLFO.cpp) -target_link_libraries(sfizz_plot_lfo PRIVATE sfizz::internal sfizz::sndfile sfizz::cxxopts) - -add_executable(sfizz_file_instrument FileInstrument.cpp) -target_link_libraries(sfizz_file_instrument PRIVATE sfizz::internal sfizz::sndfile) +if(SFIZZ_USE_SNDFILE) + add_executable(sfizz_plot_lfo PlotLFO.cpp) + target_link_libraries(sfizz_plot_lfo PRIVATE + sfizz::cxxopts + sfizz::internal + sfizz::sndfile + ) + add_executable(sfizz_file_instrument FileInstrument.cpp) + target_link_libraries(sfizz_file_instrument PRIVATE + sfizz::internal + sfizz::sndfile + ) +endif() add_executable(sfizz_file_wavetable FileWavetable.cpp) target_link_libraries(sfizz_file_wavetable PRIVATE sfizz::internal) diff --git a/demos/FileWavetable.cpp b/demos/FileWavetable.cpp index 9e1fa5972..e81a5582b 100644 --- a/demos/FileWavetable.cpp +++ b/demos/FileWavetable.cpp @@ -36,8 +36,8 @@ int main(int argc, char *argv[]) sfz::WavetableInfo wt {}; - sfz::FileMetadataReader reader; - if (!reader.open(path)) { + sfz::FileMetadataReader reader(path); + if (!reader.open()) { fprintf(stderr, "Cannot open file\n"); return 1; } diff --git a/demos/PlotLFO.cpp b/demos/PlotLFO.cpp index 17ff452b8..86bc288f4 100644 --- a/demos/PlotLFO.cpp +++ b/demos/PlotLFO.cpp @@ -92,6 +92,7 @@ int main(int argc, char* argv[]) sfzPath = argv[1]; } + // FIXME: OptionException was replaced by some cxxopts::exceptions::??? catch (cxxopts::OptionException& ex) { std::cerr << ex.what() << "\n"; return 1;