47 if (
auto gen = std::dynamic_pointer_cast<Generator>(node)) {
48 gen->set_amplitude(
value);
51 "Cannot multiply non-generator node by a scalar. "
52 "Use set_[params] methods or create a BinaryOpNode.");
#define MF_ERROR(comp, ctx,...)
double amplitude
Current amplitude of the generator.
double phase
Current phase of the generator.
float frequency
Current frequency of the generator.
Specialized context for generator node callbacks.
GeneratorContext m_context
void notify_tick(double value) override
Notifies all registered callbacks with the current context.
virtual void set_frequency(float frequency)
Sets the generator's frequency.
virtual double get_amplitude() const
Gets the current base amplitude.
GeneratorContextGpu m_context_gpu
virtual void set_amplitude(double amplitude)
Sets the generator's amplitude.
float m_frequency
Base frequency of the generator.
NodeContext & get_last_context() override
Gets the last created context object.
double m_amplitude
Base amplitude of the generator.
void on_tick_if(const NodeCondition &condition, const TypedHook< GeneratorContext > &callback)
Registers a conditional typed callback receiving GeneratorContext directly.
virtual void update_context(double value) override
Updates the context object for callbacks.
void on_tick(const TypedHook< GeneratorContext > &callback)
Registers a typed callback receiving GeneratorContext directly.
double m_phase
Current phase of the generator.
double value
Current sample value.
Base context class for node callbacks.
std::vector< NodeHook > m_callbacks
Collection of standard callback functions.
bool is_gpu_compatible() const
Checks if the node supports GPU processing.
std::vector< std::pair< NodeHook, NodeCondition > > m_conditional_callbacks
Collection of conditional callback functions with their predicates.
bool m_gpu_compatible
Flag indicating if the node supports GPU processing This flag is set by derived classes to indicate w...
@ NodeProcessing
Node graph processing (Nodes::NodeGraphManager)
@ API
MayaFlux/API Wrapper and convenience functions.
void operator*(const std::shared_ptr< Node > &node, double value)
Sets the generator's amplitude.
std::function< void(ContextT &)> TypedHook
Callback function type for node processing events, parameterised on context type.
std::function< bool(NodeContext &)> NodeCondition
Predicate function type for conditional callbacks.