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

◆ notify_tick()

template<size_t N = 0>
void MayaFlux::Nodes::CompositeOpNode< N >::notify_tick ( double  value)
inlineoverrideprotectedvirtual

Notifies all registered callbacks with the current context.

Parameters
valueThe current sample value

This method is called by the node implementation when a new output value is produced. It creates a context object using create_context(), then calls all registered callbacks with that context.

For unconditional callbacks (registered with on_tick()), the callback is always called. For conditional callbacks (registered with on_tick_if()), the callback is called only if its condition returns true.

Node implementations should call this method at appropriate points in their processing flow to trigger callbacks.

Implements MayaFlux::Nodes::Node.

Definition at line 506 of file NodeCombine.hpp.

507 {
508 update_context(value);
509 auto& ctx = get_last_context();
510
511 for (const auto& callback : m_callbacks) {
512 callback(ctx);
513 }
514
515 for (const auto& [callback, condition] : m_conditional_callbacks) {
516 if (condition(ctx)) {
517 callback(ctx);
518 }
519 }
520 }
void update_context(double) override
Updates the context object with the current node state.
NodeContext & get_last_context() override
Retrieves the last created context object.
std::vector< NodeHook > m_callbacks
Collection of standard callback functions.
Definition Node.hpp:406
std::vector< std::pair< NodeHook, NodeCondition > > m_conditional_callbacks
Collection of conditional callback functions with their predicates.
Definition Node.hpp:416