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);
25 id = score::gfx::invalid_node_index;
27 for(
int i = 0, n = std::ssize(controls); i < n; i++)
29 auto& ctl = controls[i];
30 ctl->port->write_value(ctl->value, 0);
33 auto n = std::make_unique<score::gfx::ISFNode>(isf, vert, frag);
38 msg.token.date = m_last_flicks;
39 msg.token.parent_duration = ossia::time_value{};
40 msg.input.resize(this->m_inlets.size());
42 for(ossia::inlet* inlet : this->m_inlets)
44 switch(inlet->which())
46 case ossia::value_port::which: {
47 auto& p = inlet->cast<ossia::value_port>();
48 if(!p.get_data().empty())
50 msg.input[inlet_i] = std::move(p.get_data().back().value);
59 n->process(std::move(msg));
61 id = exec_context->ui->register_node(std::move(n));
68 auto n = std::make_unique<score::gfx::ISFNode>(isf, compute);
70 id = exec_context->ui->register_node(std::move(n));
73 void set_script(
const isf::descriptor& isf,
const QString& compute)
75 exec_context->ui->unregister_node(
id);
76 id = score::gfx::invalid_node_index;
78 for(
int i = 0, n = std::ssize(controls); i < n; i++)
80 auto& ctl = controls[i];
81 ctl->port->write_value(ctl->value, 0);
84 auto n = std::make_unique<score::gfx::ISFNode>(isf, compute);
89 msg.token.date = m_last_flicks;
90 msg.token.parent_duration = ossia::time_value{};
91 msg.input.resize(this->m_inlets.size());
93 for(ossia::inlet* inlet : this->m_inlets)
95 switch(inlet->which())
97 case ossia::value_port::which: {
98 auto& p = inlet->cast<ossia::value_port>();
99 if(!p.get_data().empty())
101 msg.input[inlet_i] = std::move(p.get_data().back().value);
102 p.get_data().clear();
110 n->process(std::move(msg));
112 id = exec_context->ui->register_node(std::move(n));
115 ~filter_node() { exec_context->ui->unregister_node(
id); }
117 std::string label()
const noexcept override {
return "Gfx::filter_node"; }