13 const isf::descriptor& isf,
const QString& vert,
const QString& frag,
17 auto n = std::make_unique<score::gfx::ISFNode>(isf, vert, frag);
19 id = exec_context->ui->register_node(std::move(n));
22 void set_script(
const isf::descriptor& isf,
const QString& vert,
const QString& frag)
24 exec_context->ui->unregister_node(
id);
26 for(
int i = 0, n = std::ssize(controls); i < n; i++)
28 auto& ctl = controls[i];
29 ctl->port->write_value(ctl->value, 0);
32 auto n = std::make_unique<score::gfx::ISFNode>(isf, vert, frag);
37 msg.token.date = m_last_flicks;
38 msg.token.parent_duration = ossia::time_value{};
39 msg.input.resize(this->m_inlets.size());
41 for(ossia::inlet* inlet : this->m_inlets)
43 switch(inlet->which())
45 case ossia::value_port::which: {
46 auto& p = inlet->cast<ossia::value_port>();
47 if(!p.get_data().empty())
49 msg.input[inlet_i] = std::move(p.get_data().back().value);
58 n->process(std::move(msg));
60 id = exec_context->ui->register_node(std::move(n));
67 auto n = std::make_unique<score::gfx::ISFNode>(isf, compute);
69 id = exec_context->ui->register_node(std::move(n));
72 void set_script(
const isf::descriptor& isf,
const QString& compute)
74 exec_context->ui->unregister_node(
id);
76 for(
int i = 0, n = std::ssize(controls); i < n; i++)
78 auto& ctl = controls[i];
79 ctl->port->write_value(ctl->value, 0);
82 auto n = std::make_unique<score::gfx::ISFNode>(isf, compute);
87 msg.token.date = m_last_flicks;
88 msg.token.parent_duration = ossia::time_value{};
89 msg.input.resize(this->m_inlets.size());
91 for(ossia::inlet* inlet : this->m_inlets)
93 switch(inlet->which())
95 case ossia::value_port::which: {
96 auto& p = inlet->cast<ossia::value_port>();
97 if(!p.get_data().empty())
99 msg.input[inlet_i] = std::move(p.get_data().back().value);
100 p.get_data().clear();
108 n->process(std::move(msg));
110 id = exec_context->ui->register_node(std::move(n));
113 ~filter_node() { exec_context->ui->unregister_node(
id); }
115 std::string label()
const noexcept override {
return "Gfx::filter_node"; }