Skip to content

Commit 060ef56

Browse files
committed
faust: add new virtual method added in 2.83
1 parent 4e31c50 commit 060ef56

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

src/ossia/dataflow/nodes/faust/faust_utils.hpp

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
#include <libremidi/message.hpp>
88
#include <libremidi/ump_events.hpp>
99

10+
#include <iostream>
11+
1012
#include <faust/dsp/poly-llvm-dsp.h>
1113

1214
namespace ossia::nodes
@@ -617,6 +619,20 @@ struct custom_dsp_poly_factory : public dsp_factory
617619

618620
virtual ~custom_dsp_poly_factory() = default;
619621

622+
virtual std::string getJSON()
623+
{
624+
// Needed because API was not updated on the exact
625+
// commit where this was introduced, so there's multiple
626+
// 2.83.10 commits which don't have this method, and multiple
627+
// which do, thus version check is not enough
628+
return [](auto ptr) -> std::string {
629+
if constexpr(requires { ptr->getJSON(); })
630+
return ptr->getJSON();
631+
else
632+
return {};
633+
}(fProcessFactory);
634+
}
635+
620636
virtual std::string getName() { return fProcessFactory->getName(); }
621637
virtual std::string getSHAKey() { return fProcessFactory->getSHAKey(); }
622638
virtual std::string getDSPCode() { return fProcessFactory->getDSPCode(); }

0 commit comments

Comments
 (0)