2 #include <Process/Process.hpp>
4 #include <Crousti/ProcessModel.hpp>
6 #include <avnd/binding/ossia/node.hpp>
10 template <
typename Node>
13 using ExecNode = safe_node<Node>;
16 typename ExecNode::control_input_values_type& arr;
19 template <avnd::dynamic_ports_port Field, std::
size_t N, std::
size_t NField>
20 void operator()(Field& field, avnd::predicate_index<N>, avnd::field_index<NField>)
22 for(
auto p : element.avnd_input_idx_to_model_ports(NField))
24 if(
auto inlet = qobject_cast<Process::ControlInlet*>(p))
33 template <
typename Field, std::
size_t N, std::
size_t NField>
34 void operator()(Field& field, avnd::predicate_index<N>, avnd::field_index<NField>)
36 auto p = element.avnd_input_idx_to_model_ports(NField)[0];
37 if(
auto inlet = qobject_cast<Process::ControlInlet*>(p))
40 inlet->setExecutionValue(oscr::to_ossia_value(field, get<N>(arr)));
45 template <
typename Node>
48 using ExecNode = safe_node<Node>;
50 typename ExecNode::control_output_values_type& arr;
53 template <
typename Field, std::
size_t N, std::
size_t NField>
54 void operator()(Field& field, avnd::predicate_index<N>, avnd::field_index<NField>)
57 auto ports = element.avnd_output_idx_to_model_ports(NField);
58 SCORE_ASSERT(!ports.empty());
59 auto outlet = safe_cast<Process::ControlOutlet*>(ports[0]);
60 outlet->setValue(oscr::to_ossia_value(field, get<N>(arr)));
63 template <avnd::dynamic_ports_port Field, std::
size_t N, std::
size_t NField>
64 void operator()(Field& field, avnd::predicate_index<N>, avnd::field_index<NField>)
74 template <
typename Node>
77 using ExecNode = safe_node<Node>;
79 std::weak_ptr<ExecNode> weak_node;
82 void handle_controls(ExecNode& node)
const noexcept
84 using namespace ossia::safe_nodes;
88 typename ExecNode::control_input_values_type arr;
90 while(node.control.ins_queue.try_dequeue(arr))
96 for(
auto state : node.impl.full_state())
98 avnd::control_input_introspection<Node>::for_all_n2(
104 void handle_control_outs(ExecNode& node)
const noexcept
106 using namespace ossia::safe_nodes;
109 typename ExecNode::control_output_values_type arr;
111 while(node.control.outs_queue.try_dequeue(arr))
118 avnd::control_output_introspection<Node>::for_all_n2(
119 avnd::get_outputs<Node>(node.impl),
124 void operator()()
const noexcept
126 if(
auto node = weak_node.lock())
128 static constexpr
const auto control_count
129 = avnd::control_input_introspection<Node>::size;
130 static constexpr
const auto control_out_count
131 = avnd::control_output_introspection<Node>::size;
132 if constexpr(control_count > 0)
133 handle_controls(*node);
135 if constexpr(control_out_count > 0)
136 handle_control_outs(*node);
Definition: score-plugin-avnd/Crousti/ProcessModel.hpp:77
Definition: Factories.hpp:19
Definition: ExecutorUpdateControlValueInUi.hpp:12
Definition: ExecutorUpdateControlValueInUi.hpp:47
Definition: ExecutorUpdateControlValueInUi.hpp:76