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

◆ create_context()

std::unique_ptr< NodeContext > MayaFlux::Nodes::Generator::Generator::create_context ( double  value)
overridevirtual

Creates a context object for callbacks.

Parameters
valueThe current generated sample
Returns
A unique pointer to a GeneratorContext object

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 return std::make_unique<GeneratorContextGpu>(
23 value,
26 m_phase,
28 }
29 return std::make_unique<GeneratorContext>(value, m_frequency, m_amplitude, m_phase);
30}
float m_frequency
Base frequency of the generator.
double m_amplitude
Base amplitude of the generator.
double m_phase
Current phase of the generator.
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:387
std::span< const float > get_gpu_data_buffer() const
Provides access to the GPU data buffer.
Definition Node.cpp:78

References MayaFlux::Nodes::Node::get_gpu_data_buffer(), m_amplitude, m_frequency, MayaFlux::Nodes::Node::m_gpu_compatible, and m_phase.

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

+ Here is the call graph for this function:
+ Here is the caller graph for this function: