80 template <
typename... Args>
87 void openTabBox(
const char* label)
override { t.openTabBox(label); }
88 void openHorizontalBox(
const char* label)
override { t.openHorizontalBox(label); }
89 void openVerticalBox(
const char* label)
override { t.openVerticalBox(label); }
90 void closeBox()
override { t.closeBox(); }
91 void declare(FAUSTFLOAT* zone,
const char* key,
const char* val)
override
93 t.declare(zone, key, val);
96 addSoundfile(
const char* label,
const char* filename, Soundfile** sf_zone)
override
98 t.addSoundfile(label, filename, sf_zone);
100 void addButton(
const char* label, FAUSTFLOAT* zone)
override
102 t.addButton(label, zone);
104 void addCheckButton(
const char* label, FAUSTFLOAT* zone)
override
106 t.addCheckButton(label, zone);
108 void addVerticalSlider(
109 const char* label, FAUSTFLOAT* zone, FAUSTFLOAT init, FAUSTFLOAT min,
110 FAUSTFLOAT max, FAUSTFLOAT step)
override
112 t.addVerticalSlider(label, zone, init, min, max, step);
114 void addHorizontalSlider(
115 const char* label, FAUSTFLOAT* zone, FAUSTFLOAT init, FAUSTFLOAT min,
116 FAUSTFLOAT max, FAUSTFLOAT step)
override
118 t.addHorizontalSlider(label, zone, init, min, max, step);
121 const char* label, FAUSTFLOAT* zone, FAUSTFLOAT init, FAUSTFLOAT min,
122 FAUSTFLOAT max, FAUSTFLOAT step)
override
124 t.addNumEntry(label, zone, init, min, max, step);
126 void addHorizontalBargraph(
127 const char* label, FAUSTFLOAT* zone, FAUSTFLOAT min, FAUSTFLOAT max)
override
129 t.addHorizontalBargraph(label, zone, min, max);
131 void addVerticalBargraph(
132 const char* label, FAUSTFLOAT* zone, FAUSTFLOAT min, FAUSTFLOAT max)
override
134 t.addVerticalBargraph(label, zone, min, max);
187 static constexpr bool is_unique =
true;
193 ossia::small_vector<std::pair<ossia::value_port*, FAUSTFLOAT*>, 8> controls;
196 m_inlets.push_back(
new ossia::audio_inlet);
197 m_outlets.push_back(
new ossia::audio_outlet);
199 dsp.buildUserInterface(&ex);
202 void run(
const ossia::token_request& tk, ossia::exec_state_facade)
noexcept override
204 ossia::nodes::faust_exec(*
this, dsp, tk);
207 std::string label()
const noexcept override {
return "Faust"; }
209 void all_notes_off()
noexcept override { }
212 static Q_DECL_RELAXED_CONSTEXPR score::Component::Key static_key() noexcept
217 score::Component::Key key() const noexcept final
override {
return static_key(); }
219 bool key_match(score::Component::Key other)
const noexcept final override
221 return static_key() == other || Execution::ProcessComponent::base_key_match(other);
225 :
Execution::ProcessComponent_T<Fx<DSP>, ossia::node_process>{
226 proc, ctx,
"FaustComponent", parent}
228 auto node = ossia::make_node<exec_node>(*ctx.execState);
230 this->m_ossia_process = std::make_shared<ossia::node_process>(node);
231 node->dsp.instanceInit(ctx.execState->sampleRate);
233 for(std::size_t i = 1; i < proc.inlets().size(); i++)
236 *node->controls[i - 1].second = ossia::convert<double>(inlet->value());
237 auto inl = this->node->inputs()[i];
239 inlet, &Process::ControlInlet::valueChanged,
this,
240 [
this, inl](
const ossia::value& v) {
241 this->system().executionQueue.enqueue([inl, val = v]()
mutable {
242 inl->data.template target<ossia::value_port>()->write_value(std::move(val), 0);
Definition ExecutionContext.hpp:76