MayaFlux 1.0.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches

◆ add_input_callback()

HookId MayaFlux::Nodes::Input::InputNode::add_input_callback ( const TypedHook< InputContext > &  callback,
InputEventType  event_type,
std::optional< double >  threshold = {},
std::optional< std::pair< double, double > >  range = {},
std::optional< NodeCondition >  condition = {} 
)
private

Definition at line 189 of file InputNode.cpp.

195{
196 const auto tag = static_cast<uint8_t>(event_type);
197
198 if (condition) {
199 return m_input_callbacks.add_conditional(adapt_hook(callback), std::move(*condition), callback.target_type(), tag);
200 }
201
202 std::array<double, 2> params {};
203 if (range) {
204 params = { range->first, range->second };
205 } else if (threshold) {
206 params[0] = *threshold;
207 }
208 return m_input_callbacks.add(adapt_hook(callback), callback.target_type(), tag, params);
209}
PickCallback callback
Definition Picker.cpp:22
float threshold
HookId add(NodeHook hook, const std::type_info &key, uint8_t tag=0, std::array< double, 2 > params={})
Appends a hook with no duplicate check and returns its id.
HookId add_conditional(NodeHook hook, NodeCondition condition, const std::type_info &key, uint8_t tag=0)
Appends a hook that fires only while condition holds.
std::vector< double > range(std::span< const double > data, size_t n_windows, uint32_t hop_size, uint32_t window_size)
Value range (max - min) per window.
Definition Analysis.cpp:452
NodeHook adapt_hook(const TypedHook< ContextT > &hook)
Wraps a context-typed hook into a NodeHook.

References MayaFlux::Nodes::adapt_hook(), MayaFlux::Nodes::HookList::add(), MayaFlux::Nodes::HookList::add_conditional(), callback, m_input_callbacks, and threshold.

Referenced by on_button_press(), on_button_release(), on_range_enter(), on_range_exit(), on_threshold_falling(), on_threshold_rising(), and on_value_change().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: