MayaFlux 0.1.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches
Generator.cpp
Go to the documentation of this file.
1#include "Generator.hpp"
2
4
13
18
19std::unique_ptr<NodeContext> Generator::create_context(double value)
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}
31
32} // namespace MayaFlux::Nodes::Generator
virtual bool should_mock_process() const
Checks if the generator should mock process.
Definition Generator.cpp:14
virtual std::unique_ptr< NodeContext > create_context(double value) override
Creates a context object for callbacks.
Definition Generator.cpp:19
float m_frequency
Base frequency of the generator.
double m_amplitude
Base amplitude of the generator.
virtual void enable_mock_process(bool mock_process)
Allows RootNode to process the Generator without using the processed sample.
Definition Generator.cpp:5
double m_phase
Current phase of the generator.
std::atomic< Utils::NodeState > m_state
Atomic state flag tracking the node's processing status.
Definition Node.hpp:463
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
void atomic_add_flag(std::atomic< Utils::NodeState > &state, Utils::NodeState flag)
Atomically adds a flag to a node state.
Definition NodeUtils.cpp:96
void atomic_remove_flag(std::atomic< Utils::NodeState > &state, Utils::NodeState flag)
Atomically removes a flag from a node state.
@ MOCK_PROCESS
Node should be processed but output ignored.
Definition Utils.hpp:33