35 std::optional<std::pair<double, double>>
range;
55 , raw_value(raw_value)
57 , device_id(device_id)
129 double process_sample(
double input = 0.0)
override;
136 std::vector<double> process_batch(
unsigned int num_samples)
override;
162 bool has_new_input();
180 [[nodiscard]] std::optional<Core::InputValue> get_last_input()
const;
183 [[nodiscard]] std::vector<Core::InputValue> get_input_history()
const;
191 m_config.smoothing = mode;
192 m_config.smoothing_factor = factor;
219 void on_value_change(
const NodeHook& callback,
double epsilon = 0.0001);
226 void on_threshold_rising(
double threshold,
const NodeHook& callback);
233 void on_threshold_falling(
double threshold,
const NodeHook& callback);
241 void on_range_enter(
double min,
double max,
const NodeHook& callback);
249 void on_range_exit(
double min,
double max,
const NodeHook& callback);
257 void on_button_press(
const NodeHook& callback);
265 void on_button_release(
const NodeHook& callback);
273 void while_in_range(
double min,
double max,
const NodeHook& callback);
289 void update_context(
double value)
override;
297 void notify_tick(
double value)
override;
303 std::atomic<double> m_target_value { 0.0 };
304 std::atomic<double> m_current_value { 0.0 };
305 std::atomic<bool> m_has_new_input {
false };
306 double m_previous_value {};
307 bool m_was_in_range {};
309 std::atomic<uint32_t> m_last_device_id { 0 };
315 [[nodiscard]]
double apply_smoothing(
double target,
double current)
const;
317 void add_input_callback(
320 std::optional<double> threshold = {},
321 std::optional<std::pair<double, double>> range = {},
322 std::optional<NodeCondition> condition = {});
Policy-driven unified circular buffer implementation.
uint32_t device_id
Source device ID.
double raw_value
Unsmoothed input value.
InputContext(double value, double raw_value, Core::InputType source, uint32_t device_id)
Core::InputType source_type
Backend that produced this input.
Context for InputNode callbacks - provides input event access.
Base context class for node callbacks.
Base interface for all computational processing nodes.
InputType
Input backend type enumeration.
std::function< void(NodeContext &)> NodeHook
Callback function type for node processing events.