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

◆ process_input()

void MayaFlux::Nodes::Input::InputNode::process_input ( const Core::InputValue value)
virtual

Process an input value from a backend.

Parameters
valueThe input value

Called by InputManager when input arrives. This is the main entry point.

Thread-safe. Called from InputManager's processing thread.

Definition at line 40 of file InputNode.cpp.

41{
42 double extracted = extract_value(value);
43
44 double current = m_current_value.load();
45 double smoothed = apply_smoothing(extracted, current);
46
47 m_target_value.store(extracted);
48 m_current_value.store(smoothed);
49 m_last_output = smoothed;
50 m_has_new_input.store(true);
51
52 m_last_device_id.store(value.device_id);
53 m_last_source_type = value.source_type;
54
55 (void)m_input_history.push(value);
56
57 notify_tick(smoothed);
58}
std::atomic< double > m_target_value
Memory::LockFreeQueue< Core::InputValue, 64 > m_input_history
std::atomic< uint32_t > m_last_device_id
void notify_tick(double value) override
Notify callbacks (minimal for InputNode)
virtual double extract_value(const Core::InputValue &value)
Extract a scalar value from an InputValue.
Definition InputNode.cpp:78
double apply_smoothing(double target, double current) const
std::atomic< bool > m_has_new_input
std::atomic< double > m_current_value
double m_last_output
The most recent sample value generated by this oscillator.
Definition Node.hpp:377

References apply_smoothing(), MayaFlux::Core::InputValue::device_id, extract_value(), m_current_value, m_has_new_input, m_input_history, m_last_device_id, MayaFlux::Nodes::Node::m_last_output, m_last_source_type, m_target_value, notify_tick(), and MayaFlux::Core::InputValue::source_type.

+ Here is the call graph for this function: