Use the importer in the JACK client
This commit is contained in:
parent
23a1ab268d
commit
f9cc84b5f0
2 changed files with 13 additions and 2 deletions
|
|
@ -1,6 +1,6 @@
|
||||||
if(SFIZZ_JACK)
|
if(SFIZZ_JACK)
|
||||||
add_executable(sfizz_jack MidiHelpers.h jack_client.cpp)
|
add_executable(sfizz_jack MidiHelpers.h jack_client.cpp)
|
||||||
target_link_libraries(sfizz_jack PRIVATE sfizz::sfizz sfizz::jack sfizz::spin_mutex absl::flags_parse)
|
target_link_libraries(sfizz_jack PRIVATE sfizz::import sfizz::sfizz sfizz::jack sfizz::spin_mutex absl::flags_parse)
|
||||||
sfizz_enable_lto_if_needed(sfizz_jack)
|
sfizz_enable_lto_if_needed(sfizz_jack)
|
||||||
install(TARGETS sfizz_jack DESTINATION ${CMAKE_INSTALL_BINDIR}
|
install(TARGETS sfizz_jack DESTINATION ${CMAKE_INSTALL_BINDIR}
|
||||||
COMPONENT "jack" OPTIONAL)
|
COMPONENT "jack" OPTIONAL)
|
||||||
|
|
|
||||||
|
|
@ -22,6 +22,7 @@
|
||||||
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
#include "sfizz.hpp"
|
#include "sfizz.hpp"
|
||||||
|
#include "sfizz/import/sfizz_import.h"
|
||||||
#include "MidiHelpers.h"
|
#include "MidiHelpers.h"
|
||||||
#include <absl/flags/parse.h>
|
#include <absl/flags/parse.h>
|
||||||
#include <absl/flags/flag.h>
|
#include <absl/flags/flag.h>
|
||||||
|
|
@ -188,7 +189,13 @@ int main(int argc, char** argv)
|
||||||
sfz::Sfizz synth;
|
sfz::Sfizz synth;
|
||||||
synth.setOversamplingFactor(factor);
|
synth.setOversamplingFactor(factor);
|
||||||
synth.setPreloadSize(preload_size);
|
synth.setPreloadSize(preload_size);
|
||||||
synth.loadSfzFile(filesToParse[0]);
|
|
||||||
|
const char *importFormat = nullptr;
|
||||||
|
if (!sfizz_load_or_import_file(synth.handle(), filesToParse[0], &importFormat)) {
|
||||||
|
std::cout << "Could not load the instrument file: " << filesToParse[0] << '\n';
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
std::cout << "==========" << '\n';
|
std::cout << "==========" << '\n';
|
||||||
std::cout << "Total:" << '\n';
|
std::cout << "Total:" << '\n';
|
||||||
std::cout << "\tMasters: " << synth.getNumMasters() << '\n';
|
std::cout << "\tMasters: " << synth.getNumMasters() << '\n';
|
||||||
|
|
@ -211,6 +218,10 @@ int main(int argc, char** argv)
|
||||||
for (auto& opcode : synth.getUnknownOpcodes())
|
for (auto& opcode : synth.getUnknownOpcodes())
|
||||||
std::cout << opcode << ',';
|
std::cout << opcode << ',';
|
||||||
std::cout << '\n';
|
std::cout << '\n';
|
||||||
|
if (importFormat) {
|
||||||
|
std::cout << "==========" << '\n';
|
||||||
|
std::cout << "Import format: " << importFormat << '\n';
|
||||||
|
}
|
||||||
// std::cout << std::flush;
|
// std::cout << std::flush;
|
||||||
|
|
||||||
jack_status_t status;
|
jack_status_t status;
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue