Skip to content

Commit 91928fb

Browse files
committed
Temporary fixes for demos, see sfztools#1148
1 parent 56b0f4d commit 91928fb

File tree

3 files changed

+32
-12
lines changed

3 files changed

+32
-12
lines changed

demos/CMakeLists.txt

+29-10
Original file line numberDiff line numberDiff line change
@@ -26,23 +26,42 @@ if(TARGET Qt5::Widgets)
2626
set_target_properties(sfizz_demo_stretch_tuning PROPERTIES AUTOUIC ON)
2727
endif()
2828

29-
add_executable(eq_apply EQ.cpp)
30-
target_link_libraries(eq_apply PRIVATE sfizz::internal sfizz::sndfile sfizz::cxxopts sfizz::filesystem)
31-
32-
add_executable(filter_apply Filter.cpp)
33-
target_link_libraries(filter_apply PRIVATE sfizz::internal sfizz::sndfile sfizz::cxxopts sfizz::filesystem)
29+
if(SFIZZ_USE_SNDFILE)
30+
add_executable(eq_apply EQ.cpp)
31+
target_link_libraries(eq_apply PRIVATE
32+
sfizz::cxxopts
33+
sfizz::filesystem
34+
sfizz::internal
35+
sfizz::sndfile
36+
)
37+
add_executable(filter_apply Filter.cpp)
38+
target_link_libraries(filter_apply PRIVATE
39+
sfizz::cxxopts
40+
sfizz::filesystem
41+
sfizz::internal
42+
sfizz::sndfile
43+
)
44+
endif()
3445

3546
add_executable(sfizz_plot_curve PlotCurve.cpp)
3647
target_link_libraries(sfizz_plot_curve PRIVATE sfizz::internal)
3748

3849
add_executable(sfizz_plot_wavetables PlotWavetables.cpp)
3950
target_link_libraries(sfizz_plot_wavetables PRIVATE sfizz::internal)
4051

41-
add_executable(sfizz_plot_lfo PlotLFO.cpp)
42-
target_link_libraries(sfizz_plot_lfo PRIVATE sfizz::internal sfizz::sndfile sfizz::cxxopts)
43-
44-
add_executable(sfizz_file_instrument FileInstrument.cpp)
45-
target_link_libraries(sfizz_file_instrument PRIVATE sfizz::internal sfizz::sndfile)
52+
if(SFIZZ_USE_SNDFILE)
53+
add_executable(sfizz_plot_lfo PlotLFO.cpp)
54+
target_link_libraries(sfizz_plot_lfo PRIVATE
55+
sfizz::cxxopts
56+
sfizz::internal
57+
sfizz::sndfile
58+
)
59+
add_executable(sfizz_file_instrument FileInstrument.cpp)
60+
target_link_libraries(sfizz_file_instrument PRIVATE
61+
sfizz::internal
62+
sfizz::sndfile
63+
)
64+
endif()
4665

4766
add_executable(sfizz_file_wavetable FileWavetable.cpp)
4867
target_link_libraries(sfizz_file_wavetable PRIVATE sfizz::internal)

demos/FileWavetable.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ int main(int argc, char *argv[])
3636

3737
sfz::WavetableInfo wt {};
3838

39-
sfz::FileMetadataReader reader;
40-
if (!reader.open(path)) {
39+
sfz::FileMetadataReader reader(path);
40+
if (!reader.open()) {
4141
fprintf(stderr, "Cannot open file\n");
4242
return 1;
4343
}

demos/PlotLFO.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ int main(int argc, char* argv[])
9292

9393
sfzPath = argv[1];
9494
}
95+
// FIXME: OptionException was replaced by some cxxopts::exceptions::???
9596
catch (cxxopts::OptionException& ex) {
9697
std::cerr << ex.what() << "\n";
9798
return 1;

0 commit comments

Comments
 (0)