File tree 1 file changed +16
-7
lines changed
src/plugins/score-plugin-avnd/Crousti
1 file changed +16
-7
lines changed Original file line number Diff line number Diff line change @@ -66,13 +66,6 @@ struct CustomFloatControlBase : public Process::ControlInlet
66
66
67
67
auto getMin () const noexcept { return domain ().get ().template convert_min <float >(); }
68
68
auto getMax () const noexcept { return domain ().get ().template convert_max <float >(); }
69
-
70
- void setupExecution (ossia::inlet& inl) const noexcept override
71
- {
72
- auto & port = **safe_cast<ossia::value_inlet*>(&inl);
73
- port.type = ossia::val_type::FLOAT;
74
- port.domain = domain ().get ();
75
- }
76
69
};
77
70
78
71
template <typename Node, typename FieldIndex>
@@ -92,6 +85,22 @@ struct CustomFloatControl : public CustomFloatControlBase
92
85
}
93
86
94
87
~CustomFloatControl () = default ;
88
+
89
+ void setupExecution (ossia::inlet& inl) const noexcept override
90
+ {
91
+ auto & port = **safe_cast<ossia::value_inlet*>(&inl);
92
+ port.type = ossia::val_type::FLOAT;
93
+ using inlet_type = avnd::input_introspection<Node>;
94
+ using port_type = inlet_type::template field_type<FieldIndex{}>;
95
+ if constexpr (avnd::has_range<port_type>)
96
+ {
97
+ static constexpr auto range = avnd::get_range<port_type>();
98
+ ossia::domain_base<float > dom;
99
+ dom.min = range.min ;
100
+ dom.max = range.max ;
101
+ port.domain = dom;
102
+ }
103
+ }
95
104
};
96
105
97
106
}
You can’t perform that action at this time.
0 commit comments