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

◆ update_context()

void MayaFlux::Nodes::Generator::Generator::update_context ( double  value)
overridevirtual

Updates the context object for callbacks.

Parameters
valueThe current generated sample

This method creates a specialized context object containing the current sample value and all oscillator parameters, providing callbacks with rich information about the oscillator's state.

Implements MayaFlux::Nodes::Node.

Reimplemented in MayaFlux::Nodes::Generator::Logic, MayaFlux::Nodes::Generator::Polynomial, and MayaFlux::Nodes::Generator::Stochastics::Random.

Definition at line 19 of file Generator.cpp.

20{
21 if (m_gpu_compatible) {
22 m_context_gpu.value = value;
26 } else {
27 m_context.value = value;
31 }
32}
double amplitude
Current amplitude of the generator.
Definition Generator.hpp:57
double phase
Current phase of the generator.
Definition Generator.hpp:62
float frequency
Current frequency of the generator.
Definition Generator.hpp:52
float m_frequency
Base frequency of the generator.
double m_amplitude
Base amplitude of the generator.
double m_phase
Current phase of the generator.
double value
Current sample value.
Definition Node.hpp:40
bool m_gpu_compatible
Flag indicating if the node supports GPU processing This flag is set by derived classes to indicate w...
Definition Node.hpp:383

References MayaFlux::Nodes::Generator::GeneratorContext::amplitude, MayaFlux::Nodes::Generator::GeneratorContext::frequency, m_amplitude, m_context, m_context_gpu, m_frequency, MayaFlux::Nodes::Node::m_gpu_compatible, m_phase, MayaFlux::Nodes::Generator::GeneratorContext::phase, and MayaFlux::Nodes::NodeContext::value.

Referenced by MayaFlux::Nodes::Generator::Impulse::notify_tick(), MayaFlux::Nodes::Generator::Phasor::notify_tick(), and MayaFlux::Nodes::Generator::Sine::notify_tick().

+ Here is the caller graph for this function: